zbus_systemd 0.26000.0

A pure-Rust library to interact with systemd DBus services
Documentation
// This file is autogenerated, do not manually edit.

use crate::zbus::proxy;

/// Proxy object for `org.freedesktop.sysupdate1.Manager`.
#[proxy(
    interface = "org.freedesktop.sysupdate1.Manager",
    gen_blocking = false,
    default_service = "org.freedesktop.sysupdate1",
    default_path = "/org/freedesktop/sysupdate1"
)]
pub trait Manager {
    /// [📖](https://www.freedesktop.org/software/systemd/man/systemd.directives.html#ListTargets()) Call interface method `ListTargets`.
    #[zbus(name = "ListTargets")]
    fn list_targets(
        &self,
    ) -> crate::zbus::Result<Vec<(String, String, crate::zvariant::OwnedObjectPath)>>;

    /// [📖](https://www.freedesktop.org/software/systemd/man/systemd.directives.html#ListJobs()) Call interface method `ListJobs`.
    #[zbus(name = "ListJobs")]
    fn list_jobs(
        &self,
    ) -> crate::zbus::Result<Vec<(u64, String, u32, crate::zvariant::OwnedObjectPath)>>;

    /// [📖](https://www.freedesktop.org/software/systemd/man/systemd.directives.html#ListAppStream()) Call interface method `ListAppStream`.
    #[zbus(name = "ListAppStream")]
    fn list_app_stream(&self) -> crate::zbus::Result<Vec<String>>;

    /// Receive `JobRemoved` signal.
    #[zbus(signal, name = "JobRemoved")]
    fn job_removed(
        &self,
        id: u64,
        path: crate::zvariant::OwnedObjectPath,
        status: i32,
    ) -> crate::zbus::Result<()>;
}

/// Proxy object for `org.freedesktop.sysupdate1.Target`.
#[proxy(
    interface = "org.freedesktop.sysupdate1.Target",
    gen_blocking = false,
    default_service = "org.freedesktop.sysupdate1",
    assume_defaults = false
)]
pub trait Target {
    /// [📖](https://www.freedesktop.org/software/systemd/man/systemd.directives.html#List()) Call interface method `List`.
    #[zbus(name = "List")]
    fn list(&self, flags: u64) -> crate::zbus::Result<Vec<String>>;

    /// [📖](https://www.freedesktop.org/software/systemd/man/systemd.directives.html#Describe()) Call interface method `Describe`.
    #[zbus(name = "Describe")]
    fn describe(&self, version: String, flags: u64) -> crate::zbus::Result<String>;

    /// [📖](https://www.freedesktop.org/software/systemd/man/systemd.directives.html#CheckNew()) Call interface method `CheckNew`.
    #[zbus(name = "CheckNew")]
    fn check_new(&self) -> crate::zbus::Result<String>;

    /// [📖](https://www.freedesktop.org/software/systemd/man/systemd.directives.html#Acquire()) Call interface method `Acquire`.
    #[zbus(name = "Acquire")]
    fn acquire(
        &self,
        new_version: String,
        flags: u64,
    ) -> crate::zbus::Result<(String, u64, crate::zvariant::OwnedObjectPath)>;

    /// [📖](https://www.freedesktop.org/software/systemd/man/systemd.directives.html#Install()) Call interface method `Install`.
    #[zbus(name = "Install")]
    fn install(
        &self,
        new_version: String,
        flags: u64,
    ) -> crate::zbus::Result<(String, u64, crate::zvariant::OwnedObjectPath)>;

    /// [📖](https://www.freedesktop.org/software/systemd/man/systemd.directives.html#Vacuum()) Call interface method `Vacuum`.
    #[zbus(name = "Vacuum")]
    fn vacuum(&self) -> crate::zbus::Result<(u32, u32)>;

    /// [📖](https://www.freedesktop.org/software/systemd/man/systemd.directives.html#GetAppStream()) Call interface method `GetAppStream`.
    #[zbus(name = "GetAppStream")]
    fn get_app_stream(&self) -> crate::zbus::Result<Vec<String>>;

    /// [📖](https://www.freedesktop.org/software/systemd/man/systemd.directives.html#GetVersion()) Call interface method `GetVersion`.
    #[zbus(name = "GetVersion")]
    fn get_version(&self) -> crate::zbus::Result<String>;

    /// [📖](https://www.freedesktop.org/software/systemd/man/systemd.directives.html#ListFeatures()) Call interface method `ListFeatures`.
    #[zbus(name = "ListFeatures")]
    fn list_features(&self, flags: u64) -> crate::zbus::Result<Vec<String>>;

    /// [📖](https://www.freedesktop.org/software/systemd/man/systemd.directives.html#DescribeFeature()) Call interface method `DescribeFeature`.
    #[zbus(name = "DescribeFeature")]
    fn describe_feature(&self, feature: String, flags: u64) -> crate::zbus::Result<String>;

    /// [📖](https://www.freedesktop.org/software/systemd/man/systemd.directives.html#SetFeatureEnabled()) Call interface method `SetFeatureEnabled`.
    #[zbus(name = "SetFeatureEnabled")]
    fn set_feature_enabled(
        &self,
        feature: String,
        enabled: i32,
        flags: u64,
    ) -> crate::zbus::Result<()>;

    /// Get property `Class`.
    #[zbus(property(emits_changed_signal = "const"), name = "Class")]
    fn class(&self) -> crate::zbus::Result<String>;

    /// Get property `Name`.
    #[zbus(property(emits_changed_signal = "const"), name = "Name")]
    fn name(&self) -> crate::zbus::Result<String>;

    /// Get property `Path`.
    #[zbus(property(emits_changed_signal = "const"), name = "Path")]
    fn path(&self) -> crate::zbus::Result<String>;
}

/// Proxy object for `org.freedesktop.sysupdate1.Job`.
#[proxy(
    interface = "org.freedesktop.sysupdate1.Job",
    gen_blocking = false,
    default_service = "org.freedesktop.sysupdate1",
    assume_defaults = false
)]
pub trait Job {
    /// [📖](https://www.freedesktop.org/software/systemd/man/systemd.directives.html#Cancel()) Call interface method `Cancel`.
    #[zbus(name = "Cancel")]
    fn cancel(&self) -> crate::zbus::Result<()>;

    /// Get property `Id`.
    #[zbus(property(emits_changed_signal = "const"), name = "Id")]
    fn id(&self) -> crate::zbus::Result<u64>;

    /// Get property `Type`.
    #[zbus(property(emits_changed_signal = "const"), name = "Type")]
    fn type_property(&self) -> crate::zbus::Result<String>;

    /// Get property `Offline`.
    #[zbus(property(emits_changed_signal = "const"), name = "Offline")]
    fn offline(&self) -> crate::zbus::Result<bool>;

    /// Get property `Progress`.
    #[zbus(property(emits_changed_signal = "true"), name = "Progress")]
    fn progress(&self) -> crate::zbus::Result<u32>;
}