use std::collections::HashMap;
use zbus::proxy;
use zbus::zvariant::{OwnedObjectPath, OwnedValue};
pub type PropertyMap = HashMap<String, OwnedValue>;
pub type InterfaceMap = HashMap<String, PropertyMap>;
pub type ManagedObjectsMap = HashMap<OwnedObjectPath, InterfaceMap>;
#[proxy(
default_service = "org.gnome.OnlineAccounts",
default_path = "/org/gnome/OnlineAccounts",
interface = "org.freedesktop.DBus.ObjectManager"
)]
pub trait ObjectManager {
fn get_managed_objects(&self) -> zbus::Result<ManagedObjectsMap>;
}
#[proxy(
default_service = "org.gnome.OnlineAccounts",
interface = "org.gnome.OnlineAccounts.Account"
)]
pub trait Account {
#[zbus(property)]
fn id(&self) -> zbus::Result<String>;
#[zbus(property)]
fn identity(&self) -> zbus::Result<String>;
#[zbus(property)]
fn presentation_identity(&self) -> zbus::Result<String>;
#[zbus(property)]
fn provider_type(&self) -> zbus::Result<String>;
}
#[proxy(
default_service = "org.gnome.OnlineAccounts",
interface = "org.gnome.OnlineAccounts.Files"
)]
pub trait Files {
#[zbus(property)]
fn uri(&self) -> zbus::Result<String>;
}
#[proxy(
default_service = "org.gnome.OnlineAccounts",
interface = "org.gnome.OnlineAccounts.PasswordBased"
)]
pub trait PasswordBased {
fn get_password(&self, id: &str) -> zbus::Result<String>;
}