jacquard_api/app_bsky/graph/
mute_thread.rs1#[jacquard_derive::lexicon]
9#[derive(
10 serde::Serialize,
11 serde::Deserialize,
12 Debug,
13 Clone,
14 PartialEq,
15 Eq,
16 jacquard_derive::IntoStatic
17)]
18#[serde(rename_all = "camelCase")]
19pub struct MuteThread<'a> {
20 #[serde(borrow)]
21 pub root: jacquard_common::types::string::AtUri<'a>,
22}
23
24pub mod mute_thread_state {
25
26 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
27 #[allow(unused)]
28 use ::core::marker::PhantomData;
29 mod sealed {
30 pub trait Sealed {}
31 }
32 pub trait State: sealed::Sealed {
34 type Root;
35 }
36 pub struct Empty(());
38 impl sealed::Sealed for Empty {}
39 impl State for Empty {
40 type Root = Unset;
41 }
42 pub struct SetRoot<S: State = Empty>(PhantomData<fn() -> S>);
44 impl<S: State> sealed::Sealed for SetRoot<S> {}
45 impl<S: State> State for SetRoot<S> {
46 type Root = Set<members::root>;
47 }
48 #[allow(non_camel_case_types)]
50 pub mod members {
51 pub struct root(());
53 }
54}
55
56pub struct MuteThreadBuilder<'a, S: mute_thread_state::State> {
58 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
59 __unsafe_private_named: (
60 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
61 ),
62 _phantom: ::core::marker::PhantomData<&'a ()>,
63}
64
65impl<'a> MuteThread<'a> {
66 pub fn new() -> MuteThreadBuilder<'a, mute_thread_state::Empty> {
68 MuteThreadBuilder::new()
69 }
70}
71
72impl<'a> MuteThreadBuilder<'a, mute_thread_state::Empty> {
73 pub fn new() -> Self {
75 MuteThreadBuilder {
76 _phantom_state: ::core::marker::PhantomData,
77 __unsafe_private_named: (None,),
78 _phantom: ::core::marker::PhantomData,
79 }
80 }
81}
82
83impl<'a, S> MuteThreadBuilder<'a, S>
84where
85 S: mute_thread_state::State,
86 S::Root: mute_thread_state::IsUnset,
87{
88 pub fn root(
90 mut self,
91 value: impl Into<jacquard_common::types::string::AtUri<'a>>,
92 ) -> MuteThreadBuilder<'a, mute_thread_state::SetRoot<S>> {
93 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
94 MuteThreadBuilder {
95 _phantom_state: ::core::marker::PhantomData,
96 __unsafe_private_named: self.__unsafe_private_named,
97 _phantom: ::core::marker::PhantomData,
98 }
99 }
100}
101
102impl<'a, S> MuteThreadBuilder<'a, S>
103where
104 S: mute_thread_state::State,
105 S::Root: mute_thread_state::IsSet,
106{
107 pub fn build(self) -> MuteThread<'a> {
109 MuteThread {
110 root: self.__unsafe_private_named.0.unwrap(),
111 extra_data: Default::default(),
112 }
113 }
114 pub fn build_with_data(
116 self,
117 extra_data: std::collections::BTreeMap<
118 jacquard_common::smol_str::SmolStr,
119 jacquard_common::types::value::Data<'a>,
120 >,
121 ) -> MuteThread<'a> {
122 MuteThread {
123 root: self.__unsafe_private_named.0.unwrap(),
124 extra_data: Some(extra_data),
125 }
126 }
127}
128
129pub struct MuteThreadResponse;
132impl jacquard_common::xrpc::XrpcResp for MuteThreadResponse {
133 const NSID: &'static str = "app.bsky.graph.muteThread";
134 const ENCODING: &'static str = "application/json";
135 type Output<'de> = ();
136 type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
137}
138
139impl<'a> jacquard_common::xrpc::XrpcRequest for MuteThread<'a> {
140 const NSID: &'static str = "app.bsky.graph.muteThread";
141 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
142 "application/json",
143 );
144 type Response = MuteThreadResponse;
145}
146
147pub struct MuteThreadRequest;
150impl jacquard_common::xrpc::XrpcEndpoint for MuteThreadRequest {
151 const PATH: &'static str = "/xrpc/app.bsky.graph.muteThread";
152 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
153 "application/json",
154 );
155 type Request<'de> = MuteThread<'de>;
156 type Response = MuteThreadResponse;
157}