1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `com.atproto.server.createAccount` namespace.
pub const NSID: &str = "com.atproto.server.createAccount";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
    ///Pre-existing atproto DID, being imported to a new account.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub did: Option<crate::types::string::Did>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    ///Requested handle for the account.
    pub handle: crate::types::string::Handle,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub invite_code: Option<String>,
    ///Initial account password. May need to meet instance-specific password strength requirements.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub password: Option<String>,
    ///A signed DID PLC operation to be submitted as part of importing an existing account to this instance. NOTE: this optional field may be updated when full account migration is implemented.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub plc_op: Option<crate::types::Unknown>,
    ///DID PLC rotation key (aka, recovery key) to be included in PLC creation operation.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recovery_key: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub verification_code: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub verification_phone: Option<String>,
}
pub type Input = crate::types::Object<InputData>;
///Account login session returned on successful account creation.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
    pub access_jwt: String,
    ///The DID of the new account.
    pub did: crate::types::string::Did,
    ///Complete DID document.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub did_doc: Option<crate::types::Unknown>,
    pub handle: crate::types::string::Handle,
    pub refresh_jwt: 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 {
    InvalidHandle(Option<String>),
    InvalidPassword(Option<String>),
    InvalidInviteCode(Option<String>),
    HandleNotAvailable(Option<String>),
    UnsupportedDomain(Option<String>),
    UnresolvableDid(Option<String>),
    IncompatibleDidDoc(Option<String>),
}
impl std::fmt::Display for Error {
    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::InvalidHandle(msg) => {
                write!(_f, "InvalidHandle")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::InvalidPassword(msg) => {
                write!(_f, "InvalidPassword")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::InvalidInviteCode(msg) => {
                write!(_f, "InvalidInviteCode")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::HandleNotAvailable(msg) => {
                write!(_f, "HandleNotAvailable")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::UnsupportedDomain(msg) => {
                write!(_f, "UnsupportedDomain")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::UnresolvableDid(msg) => {
                write!(_f, "UnresolvableDid")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::IncompatibleDidDoc(msg) => {
                write!(_f, "IncompatibleDidDoc")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
        }
        Ok(())
    }
}