jacquard_api/com_atproto/admin/
get_invite_codes.rs1#[derive(
9 serde::Serialize,
10 serde::Deserialize,
11 Debug,
12 Clone,
13 PartialEq,
14 Eq,
15 jacquard_derive::IntoStatic
16)]
17#[serde(rename_all = "camelCase")]
18pub struct GetInviteCodes<'a> {
19 #[serde(skip_serializing_if = "std::option::Option::is_none")]
20 #[serde(borrow)]
21 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>,
22 #[serde(skip_serializing_if = "std::option::Option::is_none")]
24 pub limit: std::option::Option<i64>,
25 #[serde(skip_serializing_if = "std::option::Option::is_none")]
27 #[serde(borrow)]
28 pub sort: std::option::Option<jacquard_common::CowStr<'a>>,
29}
30
31pub mod get_invite_codes_state {
32
33 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
34 #[allow(unused)]
35 use ::core::marker::PhantomData;
36 mod sealed {
37 pub trait Sealed {}
38 }
39 pub trait State: sealed::Sealed {}
41 pub struct Empty(());
43 impl sealed::Sealed for Empty {}
44 impl State for Empty {}
45 #[allow(non_camel_case_types)]
47 pub mod members {}
48}
49
50pub struct GetInviteCodesBuilder<'a, S: get_invite_codes_state::State> {
52 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
53 __unsafe_private_named: (
54 ::core::option::Option<jacquard_common::CowStr<'a>>,
55 ::core::option::Option<i64>,
56 ::core::option::Option<jacquard_common::CowStr<'a>>,
57 ),
58 _phantom: ::core::marker::PhantomData<&'a ()>,
59}
60
61impl<'a> GetInviteCodes<'a> {
62 pub fn new() -> GetInviteCodesBuilder<'a, get_invite_codes_state::Empty> {
64 GetInviteCodesBuilder::new()
65 }
66}
67
68impl<'a> GetInviteCodesBuilder<'a, get_invite_codes_state::Empty> {
69 pub fn new() -> Self {
71 GetInviteCodesBuilder {
72 _phantom_state: ::core::marker::PhantomData,
73 __unsafe_private_named: (None, None, None),
74 _phantom: ::core::marker::PhantomData,
75 }
76 }
77}
78
79impl<'a, S: get_invite_codes_state::State> GetInviteCodesBuilder<'a, S> {
80 pub fn cursor(
82 mut self,
83 value: impl Into<Option<jacquard_common::CowStr<'a>>>,
84 ) -> Self {
85 self.__unsafe_private_named.0 = value.into();
86 self
87 }
88 pub fn maybe_cursor(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
90 self.__unsafe_private_named.0 = value;
91 self
92 }
93}
94
95impl<'a, S: get_invite_codes_state::State> GetInviteCodesBuilder<'a, S> {
96 pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self {
98 self.__unsafe_private_named.1 = value.into();
99 self
100 }
101 pub fn maybe_limit(mut self, value: Option<i64>) -> Self {
103 self.__unsafe_private_named.1 = value;
104 self
105 }
106}
107
108impl<'a, S: get_invite_codes_state::State> GetInviteCodesBuilder<'a, S> {
109 pub fn sort(
111 mut self,
112 value: impl Into<Option<jacquard_common::CowStr<'a>>>,
113 ) -> Self {
114 self.__unsafe_private_named.2 = value.into();
115 self
116 }
117 pub fn maybe_sort(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
119 self.__unsafe_private_named.2 = value;
120 self
121 }
122}
123
124impl<'a, S> GetInviteCodesBuilder<'a, S>
125where
126 S: get_invite_codes_state::State,
127{
128 pub fn build(self) -> GetInviteCodes<'a> {
130 GetInviteCodes {
131 cursor: self.__unsafe_private_named.0,
132 limit: self.__unsafe_private_named.1,
133 sort: self.__unsafe_private_named.2,
134 }
135 }
136}
137
138#[jacquard_derive::lexicon]
139#[derive(
140 serde::Serialize,
141 serde::Deserialize,
142 Debug,
143 Clone,
144 PartialEq,
145 Eq,
146 jacquard_derive::IntoStatic
147)]
148#[serde(rename_all = "camelCase")]
149pub struct GetInviteCodesOutput<'a> {
150 #[serde(borrow)]
151 pub codes: Vec<crate::com_atproto::server::InviteCode<'a>>,
152 #[serde(skip_serializing_if = "std::option::Option::is_none")]
153 #[serde(borrow)]
154 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>,
155}
156
157pub struct GetInviteCodesResponse;
160impl jacquard_common::xrpc::XrpcResp for GetInviteCodesResponse {
161 const NSID: &'static str = "com.atproto.admin.getInviteCodes";
162 const ENCODING: &'static str = "application/json";
163 type Output<'de> = GetInviteCodesOutput<'de>;
164 type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
165}
166
167impl<'a> jacquard_common::xrpc::XrpcRequest for GetInviteCodes<'a> {
168 const NSID: &'static str = "com.atproto.admin.getInviteCodes";
169 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
170 type Response = GetInviteCodesResponse;
171}
172
173pub struct GetInviteCodesRequest;
176impl jacquard_common::xrpc::XrpcEndpoint for GetInviteCodesRequest {
177 const PATH: &'static str = "/xrpc/com.atproto.admin.getInviteCodes";
178 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
179 type Request<'de> = GetInviteCodes<'de>;
180 type Response = GetInviteCodesResponse;
181}