//! apt-ostree client module
//! 
//! This module contains the client implementation for apt-ostree,
//! providing DBus communication with the daemon.

pub mod dbus;
pub mod transaction;

pub use dbus::ClientDBus;
pub use transaction::TransactionClient;

/// Client configuration
#[derive(Debug, Clone)]
pub struct ClientConfig {
    pub dbus_name: String,
    pub dbus_path: String,
    pub dbus_interface: String,
    pub timeout: std::time::Duration,
}

impl Default for ClientConfig {
    fn default() -> Self {
        Self {
            dbus_name: "org.projectatomic.aptostree1".to_string(),
            dbus_path: "/org/projectatomic/aptostree1".to_string(),
            dbus_interface: "org.projectatomic.aptostree1".to_string(),
            timeout: std::time::Duration::from_secs(300), // 5 minutes
        }
    }
}

/// Client error types
#[derive(Debug, thiserror::Error)]
pub enum ClientError {
    #[error("DBus error: {0}")]
    DBus(#[from] zbus::Error),
    
    #[error("Connection error: {0}")]
    Connection(String),
    
    #[error("Timeout error: {0}")]
    Timeout(String),
    
    #[error("Authentication error: {0}")]
    Authentication(String),
}

pub type ClientResult<T> = Result<T, ClientError>;
