use zbus::proxy;
use crate::error;
#[proxy(
interface = "org.freedesktop.UDisks2.MDRaid",
default_service = "org.freedesktop.UDisks2",
default_path = "/org/freedesktop/UDisks2/MDRaid"
)]
pub trait MDRaid {
fn add_device(
&self,
device: &zbus::zvariant::ObjectPath<'_>,
options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
) -> error::Result<()>;
fn delete(
&self,
options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
) -> error::Result<()>;
fn remove_device(
&self,
device: &zbus::zvariant::ObjectPath<'_>,
options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
) -> error::Result<()>;
fn request_sync_action(
&self,
sync_action: &str,
options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
) -> error::Result<()>;
fn set_bitmap_location(
&self,
value: &[u8],
options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
) -> error::Result<()>;
fn start(
&self,
options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
) -> error::Result<()>;
fn stop(
&self,
options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
) -> error::Result<()>;
#[zbus(property)]
#[allow(clippy::type_complexity)]
fn active_devices(
&self,
) -> error::Result<
Vec<(
zbus::zvariant::OwnedObjectPath,
i32,
Vec<String>,
u64,
std::collections::HashMap<String, zbus::zvariant::OwnedValue>,
)>,
>;
#[zbus(property)]
fn bitmap_location(&self) -> error::Result<Vec<u8>>;
#[zbus(property)]
fn child_configuration(
&self,
) -> error::Result<
Vec<(
String,
std::collections::HashMap<String, zbus::zvariant::OwnedValue>,
)>,
>;
#[zbus(property)]
fn chunk_size(&self) -> error::Result<u64>;
#[zbus(property)]
fn degraded(&self) -> error::Result<u32>;
#[zbus(property)]
fn level(&self) -> error::Result<String>;
#[zbus(property)]
fn name(&self) -> error::Result<String>;
#[zbus(property)]
fn num_devices(&self) -> error::Result<u32>;
#[zbus(property)]
fn running(&self) -> error::Result<bool>;
#[zbus(property)]
fn size(&self) -> error::Result<u64>;
#[zbus(property)]
fn sync_action(&self) -> error::Result<String>;
#[zbus(property)]
fn sync_completed(&self) -> error::Result<f64>;
#[zbus(property)]
fn sync_rate(&self) -> error::Result<u64>;
#[zbus(property)]
fn sync_remaining_time(&self) -> error::Result<u64>;
#[zbus(property, name = "UUID")]
fn uuid(&self) -> error::Result<String>;
}