// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: com.atproto.server.refreshSession // // 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)] #[serde(rename_all = "camelCase")] pub struct RefreshSessionOutput<'a> { #[serde(borrow)] pub access_jwt: jacquard_common::CowStr<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub active: std::option::Option, #[serde(borrow)] pub did: jacquard_common::types::string::Did<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub did_doc: std::option::Option>, #[serde(borrow)] pub handle: jacquard_common::types::string::Handle<'a>, #[serde(borrow)] pub refresh_jwt: jacquard_common::CowStr<'a>, ///Hosting status of the account. If not specified, then assume 'active'. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub status: std::option::Option>, } impl jacquard_common::IntoStatic for RefreshSessionOutput<'_> { type Output = RefreshSessionOutput<'static>; fn into_static(self) -> Self::Output { RefreshSessionOutput { access_jwt: self.access_jwt.into_static(), active: self.active.into_static(), did: self.did.into_static(), did_doc: self.did_doc.into_static(), handle: self.handle.into_static(), refresh_jwt: self.refresh_jwt.into_static(), status: self.status.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 RefreshSessionError<'a> { #[serde(rename = "AccountTakedown")] AccountTakedown(std::option::Option), } impl std::fmt::Display for RefreshSessionError<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::AccountTakedown(msg) => { write!(f, "AccountTakedown")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), } } } impl jacquard_common::IntoStatic for RefreshSessionError<'_> { type Output = RefreshSessionError<'static>; fn into_static(self) -> Self::Output { match self { RefreshSessionError::AccountTakedown(v) => { RefreshSessionError::AccountTakedown(v.into_static()) } RefreshSessionError::Unknown(v) => { RefreshSessionError::Unknown(v.into_static()) } } } } /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct RefreshSession; impl jacquard_common::types::xrpc::XrpcRequest for RefreshSession { const NSID: &'static str = "com.atproto.server.refreshSession"; 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> = RefreshSessionOutput<'de>; type Err<'de> = RefreshSessionError<'de>; }