atproto blogging
at main 191 lines 5.9 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.bsky.labeler.getServices 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8#[derive( 9 serde::Serialize, 10 serde::Deserialize, 11 Debug, 12 Clone, 13 PartialEq, 14 Eq, 15 jacquard_derive::IntoStatic 16)] 17#[serde(rename_all = "camelCase")] 18pub struct GetServices<'a> { 19 /// (default: false) 20 #[serde(skip_serializing_if = "std::option::Option::is_none")] 21 pub detailed: std::option::Option<bool>, 22 #[serde(borrow)] 23 pub dids: Vec<jacquard_common::types::string::Did<'a>>, 24} 25 26pub mod get_services_state { 27 28 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 29 #[allow(unused)] 30 use ::core::marker::PhantomData; 31 mod sealed { 32 pub trait Sealed {} 33 } 34 /// State trait tracking which required fields have been set 35 pub trait State: sealed::Sealed { 36 type Dids; 37 } 38 /// Empty state - all required fields are unset 39 pub struct Empty(()); 40 impl sealed::Sealed for Empty {} 41 impl State for Empty { 42 type Dids = Unset; 43 } 44 ///State transition - sets the `dids` field to Set 45 pub struct SetDids<S: State = Empty>(PhantomData<fn() -> S>); 46 impl<S: State> sealed::Sealed for SetDids<S> {} 47 impl<S: State> State for SetDids<S> { 48 type Dids = Set<members::dids>; 49 } 50 /// Marker types for field names 51 #[allow(non_camel_case_types)] 52 pub mod members { 53 ///Marker type for the `dids` field 54 pub struct dids(()); 55 } 56} 57 58/// Builder for constructing an instance of this type 59pub struct GetServicesBuilder<'a, S: get_services_state::State> { 60 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 61 __unsafe_private_named: ( 62 ::core::option::Option<bool>, 63 ::core::option::Option<Vec<jacquard_common::types::string::Did<'a>>>, 64 ), 65 _phantom: ::core::marker::PhantomData<&'a ()>, 66} 67 68impl<'a> GetServices<'a> { 69 /// Create a new builder for this type 70 pub fn new() -> GetServicesBuilder<'a, get_services_state::Empty> { 71 GetServicesBuilder::new() 72 } 73} 74 75impl<'a> GetServicesBuilder<'a, get_services_state::Empty> { 76 /// Create a new builder with all fields unset 77 pub fn new() -> Self { 78 GetServicesBuilder { 79 _phantom_state: ::core::marker::PhantomData, 80 __unsafe_private_named: (None, None), 81 _phantom: ::core::marker::PhantomData, 82 } 83 } 84} 85 86impl<'a, S: get_services_state::State> GetServicesBuilder<'a, S> { 87 /// Set the `detailed` field (optional) 88 pub fn detailed(mut self, value: impl Into<Option<bool>>) -> Self { 89 self.__unsafe_private_named.0 = value.into(); 90 self 91 } 92 /// Set the `detailed` field to an Option value (optional) 93 pub fn maybe_detailed(mut self, value: Option<bool>) -> Self { 94 self.__unsafe_private_named.0 = value; 95 self 96 } 97} 98 99impl<'a, S> GetServicesBuilder<'a, S> 100where 101 S: get_services_state::State, 102 S::Dids: get_services_state::IsUnset, 103{ 104 /// Set the `dids` field (required) 105 pub fn dids( 106 mut self, 107 value: impl Into<Vec<jacquard_common::types::string::Did<'a>>>, 108 ) -> GetServicesBuilder<'a, get_services_state::SetDids<S>> { 109 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 110 GetServicesBuilder { 111 _phantom_state: ::core::marker::PhantomData, 112 __unsafe_private_named: self.__unsafe_private_named, 113 _phantom: ::core::marker::PhantomData, 114 } 115 } 116} 117 118impl<'a, S> GetServicesBuilder<'a, S> 119where 120 S: get_services_state::State, 121 S::Dids: get_services_state::IsSet, 122{ 123 /// Build the final struct 124 pub fn build(self) -> GetServices<'a> { 125 GetServices { 126 detailed: self.__unsafe_private_named.0, 127 dids: self.__unsafe_private_named.1.unwrap(), 128 } 129 } 130} 131 132#[jacquard_derive::lexicon] 133#[derive( 134 serde::Serialize, 135 serde::Deserialize, 136 Debug, 137 Clone, 138 PartialEq, 139 Eq, 140 jacquard_derive::IntoStatic 141)] 142#[serde(rename_all = "camelCase")] 143pub struct GetServicesOutput<'a> { 144 #[serde(borrow)] 145 pub views: Vec<GetServicesOutputViewsItem<'a>>, 146} 147 148#[jacquard_derive::open_union] 149#[derive( 150 serde::Serialize, 151 serde::Deserialize, 152 Debug, 153 Clone, 154 PartialEq, 155 Eq, 156 jacquard_derive::IntoStatic 157)] 158#[serde(tag = "$type")] 159#[serde(bound(deserialize = "'de: 'a"))] 160pub enum GetServicesOutputViewsItem<'a> { 161 #[serde(rename = "app.bsky.labeler.defs#labelerView")] 162 LabelerView(Box<crate::app_bsky::labeler::LabelerView<'a>>), 163 #[serde(rename = "app.bsky.labeler.defs#labelerViewDetailed")] 164 LabelerViewDetailed(Box<crate::app_bsky::labeler::LabelerViewDetailed<'a>>), 165} 166 167/// Response type for 168///app.bsky.labeler.getServices 169pub struct GetServicesResponse; 170impl jacquard_common::xrpc::XrpcResp for GetServicesResponse { 171 const NSID: &'static str = "app.bsky.labeler.getServices"; 172 const ENCODING: &'static str = "application/json"; 173 type Output<'de> = GetServicesOutput<'de>; 174 type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 175} 176 177impl<'a> jacquard_common::xrpc::XrpcRequest for GetServices<'a> { 178 const NSID: &'static str = "app.bsky.labeler.getServices"; 179 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 180 type Response = GetServicesResponse; 181} 182 183/// Endpoint type for 184///app.bsky.labeler.getServices 185pub struct GetServicesRequest; 186impl jacquard_common::xrpc::XrpcEndpoint for GetServicesRequest { 187 const PATH: &'static str = "/xrpc/app.bsky.labeler.getServices"; 188 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 189 type Request<'de> = GetServices<'de>; 190 type Response = GetServicesResponse; 191}