fn _default_create_available() -> std::option::Option<bool> {
Some(true)
}
fn _default_include_used() -> std::option::Option<bool> {
Some(true)
}
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct GetAccountInviteCodes {
#[serde(default = "_default_create_available")]
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub create_available: std::option::Option<bool>,
#[serde(default = "_default_include_used")]
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub include_used: std::option::Option<bool>,
}
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 {}
}
pub trait State: sealed::Sealed {}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {}
#[allow(non_camel_case_types)]
pub mod members {}
}
pub struct GetAccountInviteCodesBuilder<S: get_account_invite_codes_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (::core::option::Option<bool>, ::core::option::Option<bool>),
}
impl GetAccountInviteCodes {
pub fn new() -> GetAccountInviteCodesBuilder<get_account_invite_codes_state::Empty> {
GetAccountInviteCodesBuilder::new()
}
}
impl GetAccountInviteCodesBuilder<get_account_invite_codes_state::Empty> {
pub fn new() -> Self {
GetAccountInviteCodesBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
}
}
}
impl<S: get_account_invite_codes_state::State> GetAccountInviteCodesBuilder<S> {
pub fn create_available(mut self, value: impl Into<Option<bool>>) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_create_available(mut self, value: Option<bool>) -> Self {
self.__unsafe_private_named.0 = value;
self
}
}
impl<S: get_account_invite_codes_state::State> GetAccountInviteCodesBuilder<S> {
pub fn include_used(mut self, value: impl Into<Option<bool>>) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_include_used(mut self, value: Option<bool>) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<S> GetAccountInviteCodesBuilder<S>
where
S: get_account_invite_codes_state::State,
{
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<crate::com_atproto::server::InviteCode<'a>>,
}
#[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<jacquard_common::CowStr<'a>>),
}
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),
}
}
}
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;
}
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;
}