// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: com.atproto.identity.refreshIdentity // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, bon::Builder )] #[serde(rename_all = "camelCase")] #[builder(start_fn = new)] pub struct RefreshIdentity<'a> { #[serde(borrow)] pub identifier: jacquard_common::types::ident::AtIdentifier<'a>, #[serde(flatten)] #[serde(borrow)] #[builder(default)] pub extra_data: ::std::collections::BTreeMap< ::jacquard_common::smol_str::SmolStr, ::jacquard_common::types::value::Data<'a>, >, } impl jacquard_common::IntoStatic for RefreshIdentity<'_> { type Output = RefreshIdentity<'static>; fn into_static(self) -> Self::Output { RefreshIdentity { identifier: self.identifier.into_static(), extra_data: self.extra_data.into_static(), } } } #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct RefreshIdentityOutput<'a> { #[serde(flatten)] #[serde(borrow)] pub value: crate::com_atproto::identity::IdentityInfo<'a>, } impl jacquard_common::IntoStatic for RefreshIdentityOutput<'_> { type Output = RefreshIdentityOutput<'static>; fn into_static(self) -> Self::Output { RefreshIdentityOutput { 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 RefreshIdentityError<'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 RefreshIdentityError<'_> { 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 RefreshIdentityError<'_> { type Output = RefreshIdentityError<'static>; fn into_static(self) -> Self::Output { match self { RefreshIdentityError::HandleNotFound(v) => { RefreshIdentityError::HandleNotFound(v.into_static()) } RefreshIdentityError::DidNotFound(v) => { RefreshIdentityError::DidNotFound(v.into_static()) } RefreshIdentityError::DidDeactivated(v) => { RefreshIdentityError::DidDeactivated(v.into_static()) } RefreshIdentityError::Unknown(v) => { RefreshIdentityError::Unknown(v.into_static()) } } } } impl jacquard_common::types::xrpc::XrpcRequest for RefreshIdentity<'_> { const NSID: &'static str = "com.atproto.identity.refreshIdentity"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( "application/json", ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = RefreshIdentityOutput<'de>; type Err<'de> = RefreshIdentityError<'de>; }