atrium_api/com/atproto/identity/
resolve_identity.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `com.atproto.identity.resolveIdentity` namespace.
3pub const NSID: &str = "com.atproto.identity.resolveIdentity";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct ParametersData {
7    ///Handle or DID to resolve.
8    pub identifier: crate::types::string::AtIdentifier,
9}
10pub type Parameters = crate::types::Object<ParametersData>;
11pub type Output = crate::com::atproto::identity::defs::IdentityInfo;
12#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
13#[serde(tag = "error", content = "message")]
14pub enum Error {
15    ///The resolution process confirmed that the handle does not resolve to any DID.
16    HandleNotFound(Option<String>),
17    ///The DID resolution process confirmed that there is no current DID.
18    DidNotFound(Option<String>),
19    ///The DID previously existed, but has been deactivated.
20    DidDeactivated(Option<String>),
21}
22impl std::fmt::Display for Error {
23    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
24        match self {
25            Error::HandleNotFound(msg) => {
26                write!(_f, "HandleNotFound")?;
27                if let Some(msg) = msg {
28                    write!(_f, ": {msg}")?;
29                }
30            }
31            Error::DidNotFound(msg) => {
32                write!(_f, "DidNotFound")?;
33                if let Some(msg) = msg {
34                    write!(_f, ": {msg}")?;
35                }
36            }
37            Error::DidDeactivated(msg) => {
38                write!(_f, "DidDeactivated")?;
39                if let Some(msg) = msg {
40                    write!(_f, ": {msg}")?;
41                }
42            }
43        }
44        Ok(())
45    }
46}