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 `app.bsky.contact.verifyPhone` namespace.
pub const NSID: &str = "app.bsky.contact.verifyPhone";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
    ///The code received via SMS as a result of the call to `app.bsky.contact.startPhoneVerification`.
    pub code: String,
    ///The phone number to verify. Should be the same as the one passed to `app.bsky.contact.startPhoneVerification`.
    pub phone: String,
}
pub type Input = crate::types::Object<InputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
    ///JWT to be used in a call to `app.bsky.contact.importContacts`. It is only valid for a single call.
    pub token: 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 {
    RateLimitExceeded(Option<String>),
    InvalidDid(Option<String>),
    InvalidPhone(Option<String>),
    InvalidCode(Option<String>),
    InternalError(Option<String>),
}
impl std::fmt::Display for Error {
    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::RateLimitExceeded(msg) => {
                write!(_f, "RateLimitExceeded")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::InvalidDid(msg) => {
                write!(_f, "InvalidDid")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::InvalidPhone(msg) => {
                write!(_f, "InvalidPhone")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::InvalidCode(msg) => {
                write!(_f, "InvalidCode")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::InternalError(msg) => {
                write!(_f, "InternalError")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
        }
        Ok(())
    }
}