shrike 0.1.1

AT Protocol library for Rust
Documentation
// Code generated by lexgen. DO NOT EDIT.

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ServerCreateAccountInput {
    /// Pre-existing atproto DID, being imported to a new account.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub did: Option<crate::syntax::Did>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    /// Requested handle for the account.
    pub handle: crate::syntax::Handle,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub invite_code: Option<String>,
    /// Initial account password. May need to meet instance-specific password strength requirements.
    #[serde(default, 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.
    pub plc_op: serde_json::Value,
    /// DID PLC rotation key (aka, recovery key) to be included in PLC creation operation.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub recovery_key: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub verification_code: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub verification_phone: Option<String>,
    /// Extra fields not defined in the schema.
    #[serde(flatten)]
    pub extra: std::collections::HashMap<String, serde_json::Value>,
}

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ServerCreateAccountOutput {
    pub access_jwt: String,
    /// The DID of the new account.
    pub did: crate::syntax::Did,
    /// Complete DID document.
    pub did_doc: serde_json::Value,
    pub handle: crate::syntax::Handle,
    pub refresh_jwt: String,
    /// Extra fields not defined in the schema.
    #[serde(flatten)]
    pub extra: std::collections::HashMap<String, serde_json::Value>,
}

/// ServerCreateAccount — Create an account. Implemented by PDS.
pub async fn server_create_account(
    client: &crate::xrpc::Client,
    input: &ServerCreateAccountInput,
) -> Result<ServerCreateAccountOutput, crate::xrpc::Error> {
    client
        .procedure("com.atproto.server.createAccount", input)
        .await
}