jacquard_api/com_atproto/temp/
fetch_labels.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 FetchLabels {
19 #[serde(skip_serializing_if = "std::option::Option::is_none")]
21 pub limit: std::option::Option<i64>,
22 #[serde(skip_serializing_if = "std::option::Option::is_none")]
23 pub since: std::option::Option<i64>,
24}
25
26pub mod fetch_labels_state {
27
28 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
29 #[allow(unused)]
30 use ::core::marker::PhantomData;
31 mod sealed {
32 pub trait Sealed {}
33 }
34 pub trait State: sealed::Sealed {}
36 pub struct Empty(());
38 impl sealed::Sealed for Empty {}
39 impl State for Empty {}
40 #[allow(non_camel_case_types)]
42 pub mod members {}
43}
44
45pub struct FetchLabelsBuilder<S: fetch_labels_state::State> {
47 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
48 __unsafe_private_named: (::core::option::Option<i64>, ::core::option::Option<i64>),
49}
50
51impl FetchLabels {
52 pub fn new() -> FetchLabelsBuilder<fetch_labels_state::Empty> {
54 FetchLabelsBuilder::new()
55 }
56}
57
58impl FetchLabelsBuilder<fetch_labels_state::Empty> {
59 pub fn new() -> Self {
61 FetchLabelsBuilder {
62 _phantom_state: ::core::marker::PhantomData,
63 __unsafe_private_named: (None, None),
64 }
65 }
66}
67
68impl<S: fetch_labels_state::State> FetchLabelsBuilder<S> {
69 pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self {
71 self.__unsafe_private_named.0 = value.into();
72 self
73 }
74 pub fn maybe_limit(mut self, value: Option<i64>) -> Self {
76 self.__unsafe_private_named.0 = value;
77 self
78 }
79}
80
81impl<S: fetch_labels_state::State> FetchLabelsBuilder<S> {
82 pub fn since(mut self, value: impl Into<Option<i64>>) -> Self {
84 self.__unsafe_private_named.1 = value.into();
85 self
86 }
87 pub fn maybe_since(mut self, value: Option<i64>) -> Self {
89 self.__unsafe_private_named.1 = value;
90 self
91 }
92}
93
94impl<S> FetchLabelsBuilder<S>
95where
96 S: fetch_labels_state::State,
97{
98 pub fn build(self) -> FetchLabels {
100 FetchLabels {
101 limit: self.__unsafe_private_named.0,
102 since: self.__unsafe_private_named.1,
103 }
104 }
105}
106
107#[jacquard_derive::lexicon]
108#[derive(
109 serde::Serialize,
110 serde::Deserialize,
111 Debug,
112 Clone,
113 PartialEq,
114 Eq,
115 jacquard_derive::IntoStatic
116)]
117#[serde(rename_all = "camelCase")]
118pub struct FetchLabelsOutput<'a> {
119 #[serde(borrow)]
120 pub labels: Vec<crate::com_atproto::label::Label<'a>>,
121}
122
123pub struct FetchLabelsResponse;
126impl jacquard_common::xrpc::XrpcResp for FetchLabelsResponse {
127 const NSID: &'static str = "com.atproto.temp.fetchLabels";
128 const ENCODING: &'static str = "application/json";
129 type Output<'de> = FetchLabelsOutput<'de>;
130 type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
131}
132
133impl jacquard_common::xrpc::XrpcRequest for FetchLabels {
134 const NSID: &'static str = "com.atproto.temp.fetchLabels";
135 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
136 type Response = FetchLabelsResponse;
137}
138
139pub struct FetchLabelsRequest;
142impl jacquard_common::xrpc::XrpcEndpoint for FetchLabelsRequest {
143 const PATH: &'static str = "/xrpc/com.atproto.temp.fetchLabels";
144 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
145 type Request<'de> = FetchLabels;
146 type Response = FetchLabelsResponse;
147}