jacquard_api/com_atproto/temp/
fetch_labels.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: com.atproto.temp.fetchLabels
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[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    ///(default: 50, min: 1, max: 250)
20    #[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    /// State trait tracking which required fields have been set
35    pub trait State: sealed::Sealed {}
36    /// Empty state - all required fields are unset
37    pub struct Empty(());
38    impl sealed::Sealed for Empty {}
39    impl State for Empty {}
40    /// Marker types for field names
41    #[allow(non_camel_case_types)]
42    pub mod members {}
43}
44
45/// Builder for constructing an instance of this type
46pub 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    /// Create a new builder for this type
53    pub fn new() -> FetchLabelsBuilder<fetch_labels_state::Empty> {
54        FetchLabelsBuilder::new()
55    }
56}
57
58impl FetchLabelsBuilder<fetch_labels_state::Empty> {
59    /// Create a new builder with all fields unset
60    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    /// Set the `limit` field (optional)
70    pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self {
71        self.__unsafe_private_named.0 = value.into();
72        self
73    }
74    /// Set the `limit` field to an Option value (optional)
75    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    /// Set the `since` field (optional)
83    pub fn since(mut self, value: impl Into<Option<i64>>) -> Self {
84        self.__unsafe_private_named.1 = value.into();
85        self
86    }
87    /// Set the `since` field to an Option value (optional)
88    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    /// Build the final struct
99    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
123/// Response type for
124///com.atproto.temp.fetchLabels
125pub 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
139/// Endpoint type for
140///com.atproto.temp.fetchLabels
141pub 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}