atproto blogging
1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: tools.ozone.moderation.searchRepos
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 SearchRepos<'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 ///(default: 50, min: 1, max: 100)
23 #[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")]
26 #[serde(borrow)]
27 pub q: std::option::Option<jacquard_common::CowStr<'a>>,
28 #[serde(skip_serializing_if = "std::option::Option::is_none")]
29 #[serde(borrow)]
30 pub term: std::option::Option<jacquard_common::CowStr<'a>>,
31}
32
33pub mod search_repos_state {
34
35 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
36 #[allow(unused)]
37 use ::core::marker::PhantomData;
38 mod sealed {
39 pub trait Sealed {}
40 }
41 /// State trait tracking which required fields have been set
42 pub trait State: sealed::Sealed {}
43 /// Empty state - all required fields are unset
44 pub struct Empty(());
45 impl sealed::Sealed for Empty {}
46 impl State for Empty {}
47 /// Marker types for field names
48 #[allow(non_camel_case_types)]
49 pub mod members {}
50}
51
52/// Builder for constructing an instance of this type
53pub struct SearchReposBuilder<'a, S: search_repos_state::State> {
54 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
55 __unsafe_private_named: (
56 ::core::option::Option<jacquard_common::CowStr<'a>>,
57 ::core::option::Option<i64>,
58 ::core::option::Option<jacquard_common::CowStr<'a>>,
59 ::core::option::Option<jacquard_common::CowStr<'a>>,
60 ),
61 _phantom: ::core::marker::PhantomData<&'a ()>,
62}
63
64impl<'a> SearchRepos<'a> {
65 /// Create a new builder for this type
66 pub fn new() -> SearchReposBuilder<'a, search_repos_state::Empty> {
67 SearchReposBuilder::new()
68 }
69}
70
71impl<'a> SearchReposBuilder<'a, search_repos_state::Empty> {
72 /// Create a new builder with all fields unset
73 pub fn new() -> Self {
74 SearchReposBuilder {
75 _phantom_state: ::core::marker::PhantomData,
76 __unsafe_private_named: (None, None, None, None),
77 _phantom: ::core::marker::PhantomData,
78 }
79 }
80}
81
82impl<'a, S: search_repos_state::State> SearchReposBuilder<'a, S> {
83 /// Set the `cursor` field (optional)
84 pub fn cursor(
85 mut self,
86 value: impl Into<Option<jacquard_common::CowStr<'a>>>,
87 ) -> Self {
88 self.__unsafe_private_named.0 = value.into();
89 self
90 }
91 /// Set the `cursor` field to an Option value (optional)
92 pub fn maybe_cursor(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
93 self.__unsafe_private_named.0 = value;
94 self
95 }
96}
97
98impl<'a, S: search_repos_state::State> SearchReposBuilder<'a, S> {
99 /// Set the `limit` field (optional)
100 pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self {
101 self.__unsafe_private_named.1 = value.into();
102 self
103 }
104 /// Set the `limit` field to an Option value (optional)
105 pub fn maybe_limit(mut self, value: Option<i64>) -> Self {
106 self.__unsafe_private_named.1 = value;
107 self
108 }
109}
110
111impl<'a, S: search_repos_state::State> SearchReposBuilder<'a, S> {
112 /// Set the `q` field (optional)
113 pub fn q(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self {
114 self.__unsafe_private_named.2 = value.into();
115 self
116 }
117 /// Set the `q` field to an Option value (optional)
118 pub fn maybe_q(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
119 self.__unsafe_private_named.2 = value;
120 self
121 }
122}
123
124impl<'a, S: search_repos_state::State> SearchReposBuilder<'a, S> {
125 /// Set the `term` field (optional)
126 pub fn term(
127 mut self,
128 value: impl Into<Option<jacquard_common::CowStr<'a>>>,
129 ) -> Self {
130 self.__unsafe_private_named.3 = value.into();
131 self
132 }
133 /// Set the `term` field to an Option value (optional)
134 pub fn maybe_term(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
135 self.__unsafe_private_named.3 = value;
136 self
137 }
138}
139
140impl<'a, S> SearchReposBuilder<'a, S>
141where
142 S: search_repos_state::State,
143{
144 /// Build the final struct
145 pub fn build(self) -> SearchRepos<'a> {
146 SearchRepos {
147 cursor: self.__unsafe_private_named.0,
148 limit: self.__unsafe_private_named.1,
149 q: self.__unsafe_private_named.2,
150 term: self.__unsafe_private_named.3,
151 }
152 }
153}
154
155#[jacquard_derive::lexicon]
156#[derive(
157 serde::Serialize,
158 serde::Deserialize,
159 Debug,
160 Clone,
161 PartialEq,
162 Eq,
163 jacquard_derive::IntoStatic
164)]
165#[serde(rename_all = "camelCase")]
166pub struct SearchReposOutput<'a> {
167 #[serde(skip_serializing_if = "std::option::Option::is_none")]
168 #[serde(borrow)]
169 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>,
170 #[serde(borrow)]
171 pub repos: Vec<crate::tools_ozone::moderation::RepoView<'a>>,
172}
173
174/// Response type for
175///tools.ozone.moderation.searchRepos
176pub struct SearchReposResponse;
177impl jacquard_common::xrpc::XrpcResp for SearchReposResponse {
178 const NSID: &'static str = "tools.ozone.moderation.searchRepos";
179 const ENCODING: &'static str = "application/json";
180 type Output<'de> = SearchReposOutput<'de>;
181 type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
182}
183
184impl<'a> jacquard_common::xrpc::XrpcRequest for SearchRepos<'a> {
185 const NSID: &'static str = "tools.ozone.moderation.searchRepos";
186 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
187 type Response = SearchReposResponse;
188}
189
190/// Endpoint type for
191///tools.ozone.moderation.searchRepos
192pub struct SearchReposRequest;
193impl jacquard_common::xrpc::XrpcEndpoint for SearchReposRequest {
194 const PATH: &'static str = "/xrpc/tools.ozone.moderation.searchRepos";
195 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
196 type Request<'de> = SearchRepos<'de>;
197 type Response = SearchReposResponse;
198}