// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: com.atproto.server.getServiceAuth // // 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, jacquard_derive::IntoStatic )] #[builder(start_fn = new)] #[serde(rename_all = "camelCase")] pub struct GetServiceAuth<'a> { #[serde(borrow)] pub aud: jacquard_common::types::string::Did<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub exp: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub lxm: std::option::Option>, } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct GetServiceAuthOutput<'a> { #[serde(borrow)] pub token: jacquard_common::CowStr<'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 GetServiceAuthError<'a> { ///Indicates that the requested expiration date is not a valid. May be in the past or may be reliant on the requested scopes. #[serde(rename = "BadExpiration")] BadExpiration(std::option::Option), } impl std::fmt::Display for GetServiceAuthError<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::BadExpiration(msg) => { write!(f, "BadExpiration")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), } } } impl jacquard_common::IntoStatic for GetServiceAuthError<'_> { type Output = GetServiceAuthError<'static>; fn into_static(self) -> Self::Output { match self { GetServiceAuthError::BadExpiration(v) => { GetServiceAuthError::BadExpiration(v.into_static()) } GetServiceAuthError::Unknown(v) => { GetServiceAuthError::Unknown(v.into_static()) } } } } ///Response type for ///com.atproto.server.getServiceAuth pub struct GetServiceAuthResponse; impl jacquard_common::xrpc::XrpcResp for GetServiceAuthResponse { const NSID: &'static str = "com.atproto.server.getServiceAuth"; const ENCODING: &'static str = "application/json"; type Output<'de> = GetServiceAuthOutput<'de>; type Err<'de> = GetServiceAuthError<'de>; } impl<'de> jacquard_common::xrpc::XrpcRequest<'de> for GetServiceAuth<'de> { const NSID: &'static str = "com.atproto.server.getServiceAuth"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; type Response = GetServiceAuthResponse; } ///Endpoint type for ///com.atproto.server.getServiceAuth pub struct GetServiceAuthRequest; impl jacquard_common::xrpc::XrpcEndpoint for GetServiceAuthRequest { const PATH: &'static str = "/xrpc/com.atproto.server.getServiceAuth"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; type Request<'de> = GetServiceAuth<'de>; type Response = GetServiceAuthResponse; }