atrium-api 0.26.0

API library for AT Protocol (Bluesky)
Documentation
// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `com.atproto.lexicon.resolveLexicon` namespace.
pub const NSID: &str = "com.atproto.lexicon.resolveLexicon";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ParametersData {
    ///The lexicon NSID to resolve.
    pub nsid: crate::types::string::Nsid,
}
pub type Parameters = crate::types::Object<ParametersData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
    ///The CID of the lexicon schema record.
    pub cid: crate::types::string::Cid,
    ///The resolved lexicon schema record.
    pub schema: crate::com::atproto::lexicon::schema::Record,
    ///The AT-URI of the lexicon schema record.
    pub uri: String,
}
pub type Output = crate::types::Object<OutputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
    ///No lexicon was resolved for the NSID.
    LexiconNotFound(Option<String>),
}
impl std::fmt::Display for Error {
    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::LexiconNotFound(msg) => {
                write!(_f, "LexiconNotFound")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
        }
        Ok(())
    }
}