atproto blogging
1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: app.bsky.graph.getMutes
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 GetMutes<'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}
26
27pub mod get_mutes_state {
28
29 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
30 #[allow(unused)]
31 use ::core::marker::PhantomData;
32 mod sealed {
33 pub trait Sealed {}
34 }
35 /// State trait tracking which required fields have been set
36 pub trait State: sealed::Sealed {}
37 /// Empty state - all required fields are unset
38 pub struct Empty(());
39 impl sealed::Sealed for Empty {}
40 impl State for Empty {}
41 /// Marker types for field names
42 #[allow(non_camel_case_types)]
43 pub mod members {}
44}
45
46/// Builder for constructing an instance of this type
47pub struct GetMutesBuilder<'a, S: get_mutes_state::State> {
48 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
49 __unsafe_private_named: (
50 ::core::option::Option<jacquard_common::CowStr<'a>>,
51 ::core::option::Option<i64>,
52 ),
53 _phantom: ::core::marker::PhantomData<&'a ()>,
54}
55
56impl<'a> GetMutes<'a> {
57 /// Create a new builder for this type
58 pub fn new() -> GetMutesBuilder<'a, get_mutes_state::Empty> {
59 GetMutesBuilder::new()
60 }
61}
62
63impl<'a> GetMutesBuilder<'a, get_mutes_state::Empty> {
64 /// Create a new builder with all fields unset
65 pub fn new() -> Self {
66 GetMutesBuilder {
67 _phantom_state: ::core::marker::PhantomData,
68 __unsafe_private_named: (None, None),
69 _phantom: ::core::marker::PhantomData,
70 }
71 }
72}
73
74impl<'a, S: get_mutes_state::State> GetMutesBuilder<'a, S> {
75 /// Set the `cursor` field (optional)
76 pub fn cursor(
77 mut self,
78 value: impl Into<Option<jacquard_common::CowStr<'a>>>,
79 ) -> Self {
80 self.__unsafe_private_named.0 = value.into();
81 self
82 }
83 /// Set the `cursor` field to an Option value (optional)
84 pub fn maybe_cursor(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
85 self.__unsafe_private_named.0 = value;
86 self
87 }
88}
89
90impl<'a, S: get_mutes_state::State> GetMutesBuilder<'a, S> {
91 /// Set the `limit` field (optional)
92 pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self {
93 self.__unsafe_private_named.1 = value.into();
94 self
95 }
96 /// Set the `limit` field to an Option value (optional)
97 pub fn maybe_limit(mut self, value: Option<i64>) -> Self {
98 self.__unsafe_private_named.1 = value;
99 self
100 }
101}
102
103impl<'a, S> GetMutesBuilder<'a, S>
104where
105 S: get_mutes_state::State,
106{
107 /// Build the final struct
108 pub fn build(self) -> GetMutes<'a> {
109 GetMutes {
110 cursor: self.__unsafe_private_named.0,
111 limit: self.__unsafe_private_named.1,
112 }
113 }
114}
115
116#[jacquard_derive::lexicon]
117#[derive(
118 serde::Serialize,
119 serde::Deserialize,
120 Debug,
121 Clone,
122 PartialEq,
123 Eq,
124 jacquard_derive::IntoStatic
125)]
126#[serde(rename_all = "camelCase")]
127pub struct GetMutesOutput<'a> {
128 #[serde(skip_serializing_if = "std::option::Option::is_none")]
129 #[serde(borrow)]
130 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>,
131 #[serde(borrow)]
132 pub mutes: Vec<crate::app_bsky::actor::ProfileView<'a>>,
133}
134
135/// Response type for
136///app.bsky.graph.getMutes
137pub struct GetMutesResponse;
138impl jacquard_common::xrpc::XrpcResp for GetMutesResponse {
139 const NSID: &'static str = "app.bsky.graph.getMutes";
140 const ENCODING: &'static str = "application/json";
141 type Output<'de> = GetMutesOutput<'de>;
142 type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
143}
144
145impl<'a> jacquard_common::xrpc::XrpcRequest for GetMutes<'a> {
146 const NSID: &'static str = "app.bsky.graph.getMutes";
147 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
148 type Response = GetMutesResponse;
149}
150
151/// Endpoint type for
152///app.bsky.graph.getMutes
153pub struct GetMutesRequest;
154impl jacquard_common::xrpc::XrpcEndpoint for GetMutesRequest {
155 const PATH: &'static str = "/xrpc/app.bsky.graph.getMutes";
156 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
157 type Request<'de> = GetMutes<'de>;
158 type Response = GetMutesResponse;
159}