atrium-api 0.25.8

API library for AT Protocol (Bluesky)
Documentation
// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `com.atproto.sync.getHostStatus` namespace.
pub const NSID: &str = "com.atproto.sync.getHostStatus";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ParametersData {
    ///Hostname of the host (eg, PDS or relay) being queried.
    pub hostname: String,
}
pub type Parameters = crate::types::Object<ParametersData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
    ///Number of accounts on the server which are associated with the upstream host. Note that the upstream may actually have more accounts.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub account_count: core::option::Option<i64>,
    pub hostname: String,
    ///Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor).
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub seq: core::option::Option<i64>,
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub status: core::option::Option<crate::com::atproto::sync::defs::HostStatus>,
}
pub type Output = crate::types::Object<OutputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
    HostNotFound(Option<String>),
}
impl std::fmt::Display for Error {
    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::HostNotFound(msg) => {
                write!(_f, "HostNotFound")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
        }
        Ok(())
    }
}