// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: com.atproto.server.getAccountInviteCodes // // 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 GetAccountInviteCodes { ///(default: true) #[serde(skip_serializing_if = "std::option::Option::is_none")] pub create_available: std::option::Option, ///(default: true) #[serde(skip_serializing_if = "std::option::Option::is_none")] pub include_used: std::option::Option, } impl jacquard_common::IntoStatic for GetAccountInviteCodes { type Output = GetAccountInviteCodes; fn into_static(self) -> Self::Output { self } } #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetAccountInviteCodesOutput<'a> { #[serde(borrow)] pub codes: Vec>, } impl jacquard_common::IntoStatic for GetAccountInviteCodesOutput<'_> { type Output = GetAccountInviteCodesOutput<'static>; fn into_static(self) -> Self::Output { GetAccountInviteCodesOutput { codes: self.codes.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 GetAccountInviteCodesError<'a> { #[serde(rename = "DuplicateCreate")] DuplicateCreate(std::option::Option), } impl std::fmt::Display for GetAccountInviteCodesError<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::DuplicateCreate(msg) => { write!(f, "DuplicateCreate")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), } } } impl jacquard_common::IntoStatic for GetAccountInviteCodesError<'_> { type Output = GetAccountInviteCodesError<'static>; fn into_static(self) -> Self::Output { match self { GetAccountInviteCodesError::DuplicateCreate(v) => { GetAccountInviteCodesError::DuplicateCreate(v.into_static()) } GetAccountInviteCodesError::Unknown(v) => { GetAccountInviteCodesError::Unknown(v.into_static()) } } } } impl jacquard_common::types::xrpc::XrpcRequest for GetAccountInviteCodes { const NSID: &'static str = "com.atproto.server.getAccountInviteCodes"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetAccountInviteCodesOutput<'de>; type Err<'de> = GetAccountInviteCodesError<'de>; }