// This code was autogenerated with `dbus-codegen-rust -c blocking -m None`, see https://github.com/diwic/dbus-rs
// https://github.com/flatpak/xdg-desktop-portal/blob/main/data/org.freedesktop.portal.Request.xml
use dbus;
#[allow(unused_imports)]
use dbus::arg;
use dbus::blocking;

pub trait OrgFreedesktopPortalRequest {
  fn close(&self) -> Result<(), dbus::Error>;
}

impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target = T>> OrgFreedesktopPortalRequest
  for blocking::Proxy<'a, C>
{
  fn close(&self) -> Result<(), dbus::Error> {
      self.method_call("org.freedesktop.portal.Request", "Close", ())
  }
}

#[derive(Debug)]
pub struct OrgFreedesktopPortalRequestResponse {
  pub response: u32,
  pub results: arg::PropMap,
}

impl arg::AppendAll for OrgFreedesktopPortalRequestResponse {
  fn append(&self, i: &mut arg::IterAppend) {
      arg::RefArg::append(&self.response, i);
      arg::RefArg::append(&self.results, i);
  }
}

impl arg::ReadAll for OrgFreedesktopPortalRequestResponse {
  fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
      Ok(OrgFreedesktopPortalRequestResponse {
          response: i.read()?,
          results: i.read()?,
      })
  }
}

impl dbus::message::SignalArgs for OrgFreedesktopPortalRequestResponse {
  const NAME: &'static str = "Response";
  const INTERFACE: &'static str = "org.freedesktop.portal.Request";
}
