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 ServerGetSessionOutput {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub active: Option<bool>,
    pub did: crate::syntax::Did,
    pub did_doc: serde_json::Value,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub email_auth_factor: Option<bool>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub email_confirmed: Option<bool>,
    pub handle: crate::syntax::Handle,
    /// If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// Extra fields not defined in the schema.
    #[serde(flatten)]
    pub extra: std::collections::HashMap<String, serde_json::Value>,
}

/// ServerGetSession — Get information about the current auth session. Requires auth.
pub async fn server_get_session(
    client: &crate::xrpc::Client,
) -> Result<ServerGetSessionOutput, crate::xrpc::Error> {
    client.query("com.atproto.server.getSession", &()).await
}