fn _default_limit() -> std::option::Option<i64> {
Some(100i64)
}
fn _default_sort() -> std::option::Option<jacquard_common::CowStr<'static>> {
Some(jacquard_common::CowStr::from("recent"))
}
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct GetInviteCodes<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub cursor: std::option::Option<jacquard_common::CowStr<'a>>,
#[serde(default = "_default_limit")]
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub limit: std::option::Option<i64>,
#[serde(default = "_default_sort")]
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub sort: std::option::Option<jacquard_common::CowStr<'a>>,
}
pub mod get_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 GetInviteCodesBuilder<'a, S: get_invite_codes_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<i64>,
::core::option::Option<jacquard_common::CowStr<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> GetInviteCodes<'a> {
pub fn new() -> GetInviteCodesBuilder<'a, get_invite_codes_state::Empty> {
GetInviteCodesBuilder::new()
}
}
impl<'a> GetInviteCodesBuilder<'a, get_invite_codes_state::Empty> {
pub fn new() -> Self {
GetInviteCodesBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: get_invite_codes_state::State> GetInviteCodesBuilder<'a, S> {
pub fn cursor(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_cursor(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
self.__unsafe_private_named.0 = value;
self
}
}
impl<'a, S: get_invite_codes_state::State> GetInviteCodesBuilder<'a, S> {
pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_limit(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S: get_invite_codes_state::State> GetInviteCodesBuilder<'a, S> {
pub fn sort(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_sort(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
self.__unsafe_private_named.2 = value;
self
}
}
impl<'a, S> GetInviteCodesBuilder<'a, S>
where
S: get_invite_codes_state::State,
{
pub fn build(self) -> GetInviteCodes<'a> {
GetInviteCodes {
cursor: self.__unsafe_private_named.0,
limit: self.__unsafe_private_named.1,
sort: self.__unsafe_private_named.2,
}
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct GetInviteCodesOutput<'a> {
#[serde(borrow)]
pub codes: Vec<crate::com_atproto::server::InviteCode<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub cursor: std::option::Option<jacquard_common::CowStr<'a>>,
}
pub struct GetInviteCodesResponse;
impl jacquard_common::xrpc::XrpcResp for GetInviteCodesResponse {
const NSID: &'static str = "com.atproto.admin.getInviteCodes";
const ENCODING: &'static str = "application/json";
type Output<'de> = GetInviteCodesOutput<'de>;
type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}
impl<'a> jacquard_common::xrpc::XrpcRequest for GetInviteCodes<'a> {
const NSID: &'static str = "com.atproto.admin.getInviteCodes";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = GetInviteCodesResponse;
}
pub struct GetInviteCodesRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetInviteCodesRequest {
const PATH: &'static str = "/xrpc/com.atproto.admin.getInviteCodes";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<'de> = GetInviteCodes<'de>;
type Response = GetInviteCodesResponse;
}