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.muteActor 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 MuteActor<'a> { 20 #[serde(borrow)] 21 pub actor: jacquard_common::types::ident::AtIdentifier<'a>, 22} 23 24pub mod mute_actor_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 Actor; 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 Actor = Unset; 41 } 42 ///State transition - sets the `actor` field to Set 43 pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 44 impl<S: State> sealed::Sealed for SetActor<S> {} 45 impl<S: State> State for SetActor<S> { 46 type Actor = Set<members::actor>; 47 } 48 /// Marker types for field names 49 #[allow(non_camel_case_types)] 50 pub mod members { 51 ///Marker type for the `actor` field 52 pub struct actor(()); 53 } 54} 55 56/// Builder for constructing an instance of this type 57pub struct MuteActorBuilder<'a, S: mute_actor_state::State> { 58 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 59 __unsafe_private_named: ( 60 ::core::option::Option<jacquard_common::types::ident::AtIdentifier<'a>>, 61 ), 62 _phantom: ::core::marker::PhantomData<&'a ()>, 63} 64 65impl<'a> MuteActor<'a> { 66 /// Create a new builder for this type 67 pub fn new() -> MuteActorBuilder<'a, mute_actor_state::Empty> { 68 MuteActorBuilder::new() 69 } 70} 71 72impl<'a> MuteActorBuilder<'a, mute_actor_state::Empty> { 73 /// Create a new builder with all fields unset 74 pub fn new() -> Self { 75 MuteActorBuilder { 76 _phantom_state: ::core::marker::PhantomData, 77 __unsafe_private_named: (None,), 78 _phantom: ::core::marker::PhantomData, 79 } 80 } 81} 82 83impl<'a, S> MuteActorBuilder<'a, S> 84where 85 S: mute_actor_state::State, 86 S::Actor: mute_actor_state::IsUnset, 87{ 88 /// Set the `actor` field (required) 89 pub fn actor( 90 mut self, 91 value: impl Into<jacquard_common::types::ident::AtIdentifier<'a>>, 92 ) -> MuteActorBuilder<'a, mute_actor_state::SetActor<S>> { 93 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 94 MuteActorBuilder { 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> MuteActorBuilder<'a, S> 103where 104 S: mute_actor_state::State, 105 S::Actor: mute_actor_state::IsSet, 106{ 107 /// Build the final struct 108 pub fn build(self) -> MuteActor<'a> { 109 MuteActor { 110 actor: 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 ) -> MuteActor<'a> { 122 MuteActor { 123 actor: self.__unsafe_private_named.0.unwrap(), 124 extra_data: Some(extra_data), 125 } 126 } 127} 128 129/// Response type for 130///app.bsky.graph.muteActor 131pub struct MuteActorResponse; 132impl jacquard_common::xrpc::XrpcResp for MuteActorResponse { 133 const NSID: &'static str = "app.bsky.graph.muteActor"; 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 MuteActor<'a> { 140 const NSID: &'static str = "app.bsky.graph.muteActor"; 141 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 142 "application/json", 143 ); 144 type Response = MuteActorResponse; 145} 146 147/// Endpoint type for 148///app.bsky.graph.muteActor 149pub struct MuteActorRequest; 150impl jacquard_common::xrpc::XrpcEndpoint for MuteActorRequest { 151 const PATH: &'static str = "/xrpc/app.bsky.graph.muteActor"; 152 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 153 "application/json", 154 ); 155 type Request<'de> = MuteActor<'de>; 156 type Response = MuteActorResponse; 157}