// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: com.atproto.identity.resolveIdentity // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, bon::Builder )] #[builder(start_fn = new)] #[serde(rename_all = "camelCase")] pub struct ResolveIdentity<'a> { #[serde(borrow)] pub identifier: jacquard_common::types::ident::AtIdentifier<'a>, } impl jacquard_common::IntoStatic for ResolveIdentity<'_> { type Output = ResolveIdentity<'static>; fn into_static(self) -> Self::Output { ResolveIdentity { identifier: self.identifier.into_static(), } } } #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ResolveIdentityOutput<'a> { #[serde(flatten)] #[serde(borrow)] pub value: crate::com_atproto::identity::IdentityInfo<'a>, } impl jacquard_common::IntoStatic for ResolveIdentityOutput<'_> { type Output = ResolveIdentityOutput<'static>; fn into_static(self) -> Self::Output { ResolveIdentityOutput { value: self.value.into_static(), extra_data: self.extra_data.into_static(), } } } #[jacquard_derive::open_union] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, thiserror::Error, miette::Diagnostic )] #[serde(tag = "error", content = "message")] #[serde(bound(deserialize = "'de: 'a"))] pub enum ResolveIdentityError<'a> { ///The resolution process confirmed that the handle does not resolve to any DID. #[serde(rename = "HandleNotFound")] HandleNotFound(std::option::Option), ///The DID resolution process confirmed that there is no current DID. #[serde(rename = "DidNotFound")] DidNotFound(std::option::Option), ///The DID previously existed, but has been deactivated. #[serde(rename = "DidDeactivated")] DidDeactivated(std::option::Option), } impl std::fmt::Display for ResolveIdentityError<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::HandleNotFound(msg) => { write!(f, "HandleNotFound")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::DidNotFound(msg) => { write!(f, "DidNotFound")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::DidDeactivated(msg) => { write!(f, "DidDeactivated")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), } } } impl jacquard_common::IntoStatic for ResolveIdentityError<'_> { type Output = ResolveIdentityError<'static>; fn into_static(self) -> Self::Output { match self { ResolveIdentityError::HandleNotFound(v) => { ResolveIdentityError::HandleNotFound(v.into_static()) } ResolveIdentityError::DidNotFound(v) => { ResolveIdentityError::DidNotFound(v.into_static()) } ResolveIdentityError::DidDeactivated(v) => { ResolveIdentityError::DidDeactivated(v.into_static()) } ResolveIdentityError::Unknown(v) => { ResolveIdentityError::Unknown(v.into_static()) } } } } impl jacquard_common::types::xrpc::XrpcRequest for ResolveIdentity<'_> { const NSID: &'static str = "com.atproto.identity.resolveIdentity"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = ResolveIdentityOutput<'de>; type Err<'de> = ResolveIdentityError<'de>; }