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