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 `app.bsky.unspecced.initAgeAssurance` namespace.
pub const NSID: &str = "app.bsky.unspecced.initAgeAssurance";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
    ///An ISO 3166-1 alpha-2 code of the user's location.
    pub country_code: String,
    ///The user's email address to receive assurance instructions.
    pub email: String,
    ///The user's preferred language for communication during the assurance process.
    pub language: String,
}
pub type Input = crate::types::Object<InputData>;
pub type Output = crate::app::bsky::unspecced::defs::AgeAssuranceState;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
    InvalidEmail(Option<String>),
    DidTooLong(Option<String>),
    InvalidInitiation(Option<String>),
}
impl std::fmt::Display for Error {
    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::InvalidEmail(msg) => {
                write!(_f, "InvalidEmail")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::DidTooLong(msg) => {
                write!(_f, "DidTooLong")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::InvalidInitiation(msg) => {
                write!(_f, "InvalidInitiation")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
        }
        Ok(())
    }
}