// This code was autogenerated with `dbus-codegen-rust -s -d org.asuslinux.Daemon -p /org/asuslinux/Profile -m None -f org.asuslinux.Daemon -c blocking`, see https://github.com/diwic/dbus-rs
use dbus as dbus;
#[allow(unused_imports)]
use dbus::arg;
use dbus::blocking;

pub trait OrgAsuslinuxDaemon {
    fn set_profile(&self, profile: &str) -> Result<(), dbus::Error>;
    fn next_profile(&self) -> Result<(), dbus::Error>;
    fn active_profile_name(&self) -> Result<String, dbus::Error>;
    fn profile(&self) -> Result<String, dbus::Error>;
    fn profiles(&self) -> Result<String, dbus::Error>;
}

impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> OrgAsuslinuxDaemon for blocking::Proxy<'a, C> {

    fn set_profile(&self, profile: &str) -> Result<(), dbus::Error> {
        self.method_call("org.asuslinux.Daemon", "SetProfile", (profile, ))
    }

    fn next_profile(&self) -> Result<(), dbus::Error> {
        self.method_call("org.asuslinux.Daemon", "NextProfile", ())
    }

    fn active_profile_name(&self) -> Result<String, dbus::Error> {
        self.method_call("org.asuslinux.Daemon", "ActiveProfileName", ())
            .and_then(|r: (String, )| Ok(r.0, ))
    }

    fn profile(&self) -> Result<String, dbus::Error> {
        self.method_call("org.asuslinux.Daemon", "Profile", ())
            .and_then(|r: (String, )| Ok(r.0, ))
    }

    fn profiles(&self) -> Result<String, dbus::Error> {
        self.method_call("org.asuslinux.Daemon", "Profiles", ())
            .and_then(|r: (String, )| Ok(r.0, ))
    }
}

#[derive(Debug)]
pub struct OrgAsuslinuxDaemonNotifyProfile {
    pub profile: String,
}

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

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

impl dbus::message::SignalArgs for OrgAsuslinuxDaemonNotifyProfile {
    const NAME: &'static str = "NotifyProfile";
    const INTERFACE: &'static str = "org.asuslinux.Daemon";
}
