// @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, jacquard_derive::IntoStatic )] #[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>, >, } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct RefreshIdentityOutput<'a> { #[serde(flatten)] #[serde(borrow)] pub value: crate::com_atproto::identity::IdentityInfo<'a>, } #[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()) } } } } ///Response type for ///com.atproto.identity.refreshIdentity pub struct RefreshIdentityResponse; impl jacquard_common::xrpc::XrpcResp for RefreshIdentityResponse { const NSID: &'static str = "com.atproto.identity.refreshIdentity"; const ENCODING: &'static str = "application/json"; type Output<'de> = RefreshIdentityOutput<'de>; type Err<'de> = RefreshIdentityError<'de>; } impl<'de> jacquard_common::xrpc::XrpcRequest<'de> for RefreshIdentity<'de> { const NSID: &'static str = "com.atproto.identity.refreshIdentity"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( "application/json", ); type Response = RefreshIdentityResponse; } ///Endpoint type for ///com.atproto.identity.refreshIdentity pub struct RefreshIdentityRequest; impl jacquard_common::xrpc::XrpcEndpoint for RefreshIdentityRequest { const PATH: &'static str = "/xrpc/com.atproto.identity.refreshIdentity"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( "application/json", ); type Request<'de> = RefreshIdentity<'de>; type Response = RefreshIdentityResponse; }