atproto blogging
at main 157 lines 4.8 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.bsky.graph.muteThread 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8#[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 /// State trait tracking which required fields have been set 33 pub trait State: sealed::Sealed { 34 type Root; 35 } 36 /// Empty state - all required fields are unset 37 pub struct Empty(()); 38 impl sealed::Sealed for Empty {} 39 impl State for Empty { 40 type Root = Unset; 41 } 42 ///State transition - sets the `root` field to Set 43 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 /// Marker types for field names 49 #[allow(non_camel_case_types)] 50 pub mod members { 51 ///Marker type for the `root` field 52 pub struct root(()); 53 } 54} 55 56/// Builder for constructing an instance of this type 57pub 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 /// Create a new builder for this type 67 pub fn new() -> MuteThreadBuilder<'a, mute_thread_state::Empty> { 68 MuteThreadBuilder::new() 69 } 70} 71 72impl<'a> MuteThreadBuilder<'a, mute_thread_state::Empty> { 73 /// Create a new builder with all fields unset 74 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 /// Set the `root` field (required) 89 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 /// Build the final struct 108 pub fn build(self) -> MuteThread<'a> { 109 MuteThread { 110 root: self.__unsafe_private_named.0.unwrap(), 111 extra_data: Default::default(), 112 } 113 } 114 /// Build the final struct with custom extra_data 115 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 129/// Response type for 130///app.bsky.graph.muteThread 131pub 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 147/// Endpoint type for 148///app.bsky.graph.muteThread 149pub 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}