atproto blogging
1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: chat.bsky.convo.listConvos
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 ListConvos<'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 read_state: std::option::Option<jacquard_common::CowStr<'a>>,
28 #[serde(skip_serializing_if = "std::option::Option::is_none")]
29 #[serde(borrow)]
30 pub status: std::option::Option<jacquard_common::CowStr<'a>>,
31}
32
33pub mod list_convos_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 ListConvosBuilder<'a, S: list_convos_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> ListConvos<'a> {
65 /// Create a new builder for this type
66 pub fn new() -> ListConvosBuilder<'a, list_convos_state::Empty> {
67 ListConvosBuilder::new()
68 }
69}
70
71impl<'a> ListConvosBuilder<'a, list_convos_state::Empty> {
72 /// Create a new builder with all fields unset
73 pub fn new() -> Self {
74 ListConvosBuilder {
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: list_convos_state::State> ListConvosBuilder<'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: list_convos_state::State> ListConvosBuilder<'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: list_convos_state::State> ListConvosBuilder<'a, S> {
112 /// Set the `readState` field (optional)
113 pub fn read_state(
114 mut self,
115 value: impl Into<Option<jacquard_common::CowStr<'a>>>,
116 ) -> Self {
117 self.__unsafe_private_named.2 = value.into();
118 self
119 }
120 /// Set the `readState` field to an Option value (optional)
121 pub fn maybe_read_state(
122 mut self,
123 value: Option<jacquard_common::CowStr<'a>>,
124 ) -> Self {
125 self.__unsafe_private_named.2 = value;
126 self
127 }
128}
129
130impl<'a, S: list_convos_state::State> ListConvosBuilder<'a, S> {
131 /// Set the `status` field (optional)
132 pub fn status(
133 mut self,
134 value: impl Into<Option<jacquard_common::CowStr<'a>>>,
135 ) -> Self {
136 self.__unsafe_private_named.3 = value.into();
137 self
138 }
139 /// Set the `status` field to an Option value (optional)
140 pub fn maybe_status(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
141 self.__unsafe_private_named.3 = value;
142 self
143 }
144}
145
146impl<'a, S> ListConvosBuilder<'a, S>
147where
148 S: list_convos_state::State,
149{
150 /// Build the final struct
151 pub fn build(self) -> ListConvos<'a> {
152 ListConvos {
153 cursor: self.__unsafe_private_named.0,
154 limit: self.__unsafe_private_named.1,
155 read_state: self.__unsafe_private_named.2,
156 status: self.__unsafe_private_named.3,
157 }
158 }
159}
160
161#[jacquard_derive::lexicon]
162#[derive(
163 serde::Serialize,
164 serde::Deserialize,
165 Debug,
166 Clone,
167 PartialEq,
168 Eq,
169 jacquard_derive::IntoStatic
170)]
171#[serde(rename_all = "camelCase")]
172pub struct ListConvosOutput<'a> {
173 #[serde(borrow)]
174 pub convos: Vec<crate::chat_bsky::convo::ConvoView<'a>>,
175 #[serde(skip_serializing_if = "std::option::Option::is_none")]
176 #[serde(borrow)]
177 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>,
178}
179
180/// Response type for
181///chat.bsky.convo.listConvos
182pub struct ListConvosResponse;
183impl jacquard_common::xrpc::XrpcResp for ListConvosResponse {
184 const NSID: &'static str = "chat.bsky.convo.listConvos";
185 const ENCODING: &'static str = "application/json";
186 type Output<'de> = ListConvosOutput<'de>;
187 type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
188}
189
190impl<'a> jacquard_common::xrpc::XrpcRequest for ListConvos<'a> {
191 const NSID: &'static str = "chat.bsky.convo.listConvos";
192 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
193 type Response = ListConvosResponse;
194}
195
196/// Endpoint type for
197///chat.bsky.convo.listConvos
198pub struct ListConvosRequest;
199impl jacquard_common::xrpc::XrpcEndpoint for ListConvosRequest {
200 const PATH: &'static str = "/xrpc/chat.bsky.convo.listConvos";
201 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
202 type Request<'de> = ListConvos<'de>;
203 type Response = ListConvosResponse;
204}