atrium_api/com/atproto/server/
confirm_email.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `com.atproto.server.confirmEmail` namespace.
3pub const NSID: &str = "com.atproto.server.confirmEmail";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct InputData {
7    pub email: String,
8    pub token: String,
9}
10pub type Input = crate::types::Object<InputData>;
11#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
12#[serde(tag = "error", content = "message")]
13pub enum Error {
14    AccountNotFound(Option<String>),
15    ExpiredToken(Option<String>),
16    InvalidToken(Option<String>),
17    InvalidEmail(Option<String>),
18}
19impl std::fmt::Display for Error {
20    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
21        match self {
22            Error::AccountNotFound(msg) => {
23                write!(_f, "AccountNotFound")?;
24                if let Some(msg) = msg {
25                    write!(_f, ": {msg}")?;
26                }
27            }
28            Error::ExpiredToken(msg) => {
29                write!(_f, "ExpiredToken")?;
30                if let Some(msg) = msg {
31                    write!(_f, ": {msg}")?;
32                }
33            }
34            Error::InvalidToken(msg) => {
35                write!(_f, "InvalidToken")?;
36                if let Some(msg) = msg {
37                    write!(_f, ": {msg}")?;
38                }
39            }
40            Error::InvalidEmail(msg) => {
41                write!(_f, "InvalidEmail")?;
42                if let Some(msg) = msg {
43                    write!(_f, ": {msg}")?;
44                }
45            }
46        }
47        Ok(())
48    }
49}