atrium_api/com/atproto/sync/
get_host_status.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `com.atproto.sync.getHostStatus` namespace.
3pub const NSID: &str = "com.atproto.sync.getHostStatus";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct ParametersData {
7    ///Hostname of the host (eg, PDS or relay) being queried.
8    pub hostname: String,
9}
10pub type Parameters = crate::types::Object<ParametersData>;
11#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
12#[serde(rename_all = "camelCase")]
13pub struct OutputData {
14    ///Number of accounts on the server which are associated with the upstream host. Note that the upstream may actually have more accounts.
15    #[serde(skip_serializing_if = "core::option::Option::is_none")]
16    pub account_count: core::option::Option<i64>,
17    pub hostname: String,
18    ///Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor).
19    #[serde(skip_serializing_if = "core::option::Option::is_none")]
20    pub seq: core::option::Option<i64>,
21    #[serde(skip_serializing_if = "core::option::Option::is_none")]
22    pub status: core::option::Option<crate::com::atproto::sync::defs::HostStatus>,
23}
24pub type Output = crate::types::Object<OutputData>;
25#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
26#[serde(tag = "error", content = "message")]
27pub enum Error {
28    HostNotFound(Option<String>),
29}
30impl std::fmt::Display for Error {
31    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
32        match self {
33            Error::HostNotFound(msg) => {
34                write!(_f, "HostNotFound")?;
35                if let Some(msg) = msg {
36                    write!(_f, ": {msg}")?;
37                }
38            }
39        }
40        Ok(())
41    }
42}