// @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, jacquard_derive::IntoStatic )] #[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, } pub mod get_account_invite_codes_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed {} /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty {} /// Marker types for field names #[allow(non_camel_case_types)] pub mod members {} } /// Builder for constructing an instance of this type pub struct GetAccountInviteCodesBuilder { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: (::core::option::Option, ::core::option::Option), } impl GetAccountInviteCodes { /// Create a new builder for this type pub fn new() -> GetAccountInviteCodesBuilder { GetAccountInviteCodesBuilder::new() } } impl GetAccountInviteCodesBuilder { /// Create a new builder with all fields unset pub fn new() -> Self { GetAccountInviteCodesBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), } } } impl GetAccountInviteCodesBuilder { /// Set the `createAvailable` field (optional) pub fn create_available(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.0 = value.into(); self } /// Set the `createAvailable` field to an Option value (optional) pub fn maybe_create_available(mut self, value: Option) -> Self { self.__unsafe_private_named.0 = value; self } } impl GetAccountInviteCodesBuilder { /// Set the `includeUsed` field (optional) pub fn include_used(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.1 = value.into(); self } /// Set the `includeUsed` field to an Option value (optional) pub fn maybe_include_used(mut self, value: Option) -> Self { self.__unsafe_private_named.1 = value; self } } impl GetAccountInviteCodesBuilder where S: get_account_invite_codes_state::State, { /// Build the final struct pub fn build(self) -> GetAccountInviteCodes { GetAccountInviteCodes { create_available: self.__unsafe_private_named.0, include_used: self.__unsafe_private_named.1, } } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct GetAccountInviteCodesOutput<'a> { #[serde(borrow)] pub codes: Vec>, } #[jacquard_derive::open_union] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, thiserror::Error, miette::Diagnostic, jacquard_derive::IntoStatic )] #[serde(tag = "error", content = "message")] #[serde(bound(deserialize = "'de: 'a"))] pub enum GetAccountInviteCodesError<'a> { #[serde(rename = "DuplicateCreate")] DuplicateCreate(std::option::Option>), } impl core::fmt::Display for GetAccountInviteCodesError<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::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), } } } /// Response type for ///com.atproto.server.getAccountInviteCodes pub struct GetAccountInviteCodesResponse; impl jacquard_common::xrpc::XrpcResp for GetAccountInviteCodesResponse { const NSID: &'static str = "com.atproto.server.getAccountInviteCodes"; const ENCODING: &'static str = "application/json"; type Output<'de> = GetAccountInviteCodesOutput<'de>; type Err<'de> = GetAccountInviteCodesError<'de>; } impl jacquard_common::xrpc::XrpcRequest for GetAccountInviteCodes { const NSID: &'static str = "com.atproto.server.getAccountInviteCodes"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; type Response = GetAccountInviteCodesResponse; } /// Endpoint type for ///com.atproto.server.getAccountInviteCodes pub struct GetAccountInviteCodesRequest; impl jacquard_common::xrpc::XrpcEndpoint for GetAccountInviteCodesRequest { const PATH: &'static str = "/xrpc/com.atproto.server.getAccountInviteCodes"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; type Request<'de> = GetAccountInviteCodes; type Response = GetAccountInviteCodesResponse; }