// This code was autogenerated with `dbus-codegen-rust -s -d org.asuslinux.Daemon -f org.asuslinux.Daemon -c blocking -p /org/asuslinux/Led -m None`, 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_led_mode(&self, data: &str) -> Result<(), dbus::Error>;
    fn led_mode(&self) -> Result<String, dbus::Error>;
    fn led_modes(&self) -> Result<String, dbus::Error>;
}

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

    fn set_led_mode(&self, data: &str) -> Result<(), dbus::Error> {
        self.method_call("org.asuslinux.Daemon", "SetLedMode", (data, ))
    }

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

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

#[derive(Debug)]
pub struct OrgAsuslinuxDaemonNotifyLed {
    pub data: String,
}

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

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

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