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