Something went wrong. Try again.
Something went wrong. Try again.
21 kB · 560 lines
Rust
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560// @generated by jacquard-lexicon. DO NOT EDIT.//// Lexicon: com.atproto.server.createInviteCodes//// This file was automatically generated from Lexicon schemas.// Any manual changes will be overwritten on the next regeneration.
#[jacquard_derive::lexicon]#[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic)]#[serde(rename_all = "camelCase")]pub struct AccountCodes<'a> { #[serde(borrow)] pub account: jacquard_common::CowStr<'a>, #[serde(borrow)] pub codes: Vec<jacquard_common::CowStr<'a>>,}
pub mod account_codes_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Codes; type Account; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Codes = Unset; type Account = Unset; } ///State transition - sets the `codes` field to Set pub struct SetCodes<S: State = Empty>(PhantomData<fn() -> S>); impl<S: State> sealed::Sealed for SetCodes<S> {} impl<S: State> State for SetCodes<S> { type Codes = Set<members::codes>; type Account = S::Account; } ///State transition - sets the `account` field to Set pub struct SetAccount<S: State = Empty>(PhantomData<fn() -> S>); impl<S: State> sealed::Sealed for SetAccount<S> {} impl<S: State> State for SetAccount<S> { type Codes = S::Codes; type Account = Set<members::account>; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `codes` field pub struct codes(()); ///Marker type for the `account` field pub struct account(()); }}
/// Builder for constructing an instance of this typepub struct AccountCodesBuilder<'a, S: account_codes_state::State> { _phantom_state: ::core::marker::PhantomData<fn() -> S>, __unsafe_private_named: ( ::core::option::Option<jacquard_common::CowStr<'a>>, ::core::option::Option<Vec<jacquard_common::CowStr<'a>>>, ), _phantom: ::core::marker::PhantomData<&'a ()>,}
impl<'a> AccountCodes<'a> { /// Create a new builder for this type pub fn new() -> AccountCodesBuilder<'a, account_codes_state::Empty> { AccountCodesBuilder::new() }}
impl<'a> AccountCodesBuilder<'a, account_codes_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { AccountCodesBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } }}
impl<'a, S> AccountCodesBuilder<'a, S>where S: account_codes_state::State, S::Account: account_codes_state::IsUnset,{ /// Set the `account` field (required) pub fn account( mut self, value: impl Into<jacquard_common::CowStr<'a>>, ) -> AccountCodesBuilder<'a, account_codes_state::SetAccount<S>> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); AccountCodesBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } }}
impl<'a, S> AccountCodesBuilder<'a, S>where S: account_codes_state::State, S::Codes: account_codes_state::IsUnset,{ /// Set the `codes` field (required) pub fn codes( mut self, value: impl Into<Vec<jacquard_common::CowStr<'a>>>, ) -> AccountCodesBuilder<'a, account_codes_state::SetCodes<S>> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); AccountCodesBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } }}
impl<'a, S> AccountCodesBuilder<'a, S>where S: account_codes_state::State, S::Codes: account_codes_state::IsSet, S::Account: account_codes_state::IsSet,{ /// Build the final struct pub fn build(self) -> AccountCodes<'a> { AccountCodes { account: self.__unsafe_private_named.0.unwrap(), codes: self.__unsafe_private_named.1.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> AccountCodes<'a> { AccountCodes { account: self.__unsafe_private_named.0.unwrap(), codes: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } }}
fn lexicon_doc_com_atproto_server_createInviteCodes() -> ::jacquard_lexicon::lexicon::LexiconDoc< 'static,> { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static( "com.atproto.server.createInviteCodes", ), revision: None, description: None, defs: { let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("accountCodes"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("account"), ::jacquard_common::smol_str::SmolStr::new_static("codes") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("account"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("codes"), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: None, items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), min_length: None, max_length: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("main"), ::jacquard_lexicon::lexicon::LexUserType::XrpcProcedure(::jacquard_lexicon::lexicon::LexXrpcProcedure { description: None, parameters: None, input: Some(::jacquard_lexicon::lexicon::LexXrpcBody { description: None, encoding: ::jacquard_common::CowStr::new_static( "application/json", ), schema: Some( ::jacquard_lexicon::lexicon::LexXrpcBodySchema::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("codeCount"), ::jacquard_common::smol_str::SmolStr::new_static("useCount") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "codeCount", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "forAccounts", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: None, items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Did, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "useCount", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map }, }), ), }), output: None, errors: None, }), ); map }, }}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AccountCodes<'a> { fn nsid() -> &'static str { "com.atproto.server.createInviteCodes" } fn def_name() -> &'static str { "accountCodes" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_atproto_server_createInviteCodes() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) }}
#[jacquard_derive::lexicon]#[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic)]#[serde(rename_all = "camelCase")]pub struct CreateInviteCodes<'a> { pub code_count: i64, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub for_accounts: std::option::Option<Vec<jacquard_common::types::string::Did<'a>>>, pub use_count: i64,}
pub mod create_invite_codes_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type UseCount; type CodeCount; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type UseCount = Unset; type CodeCount = Unset; } ///State transition - sets the `use_count` field to Set pub struct SetUseCount<S: State = Empty>(PhantomData<fn() -> S>); impl<S: State> sealed::Sealed for SetUseCount<S> {} impl<S: State> State for SetUseCount<S> { type UseCount = Set<members::use_count>; type CodeCount = S::CodeCount; } ///State transition - sets the `code_count` field to Set pub struct SetCodeCount<S: State = Empty>(PhantomData<fn() -> S>); impl<S: State> sealed::Sealed for SetCodeCount<S> {} impl<S: State> State for SetCodeCount<S> { type UseCount = S::UseCount; type CodeCount = Set<members::code_count>; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `use_count` field pub struct use_count(()); ///Marker type for the `code_count` field pub struct code_count(()); }}
/// Builder for constructing an instance of this typepub struct CreateInviteCodesBuilder<'a, S: create_invite_codes_state::State> { _phantom_state: ::core::marker::PhantomData<fn() -> S>, __unsafe_private_named: ( ::core::option::Option<i64>, ::core::option::Option<Vec<jacquard_common::types::string::Did<'a>>>, ::core::option::Option<i64>, ), _phantom: ::core::marker::PhantomData<&'a ()>,}
impl<'a> CreateInviteCodes<'a> { /// Create a new builder for this type pub fn new() -> CreateInviteCodesBuilder<'a, create_invite_codes_state::Empty> { CreateInviteCodesBuilder::new() }}
impl<'a> CreateInviteCodesBuilder<'a, create_invite_codes_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { CreateInviteCodesBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None), _phantom: ::core::marker::PhantomData, } }}
impl<'a, S> CreateInviteCodesBuilder<'a, S>where S: create_invite_codes_state::State, S::CodeCount: create_invite_codes_state::IsUnset,{ /// Set the `codeCount` field (required) pub fn code_count( mut self, value: impl Into<i64>, ) -> CreateInviteCodesBuilder<'a, create_invite_codes_state::SetCodeCount<S>> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); CreateInviteCodesBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } }}
impl<'a, S: create_invite_codes_state::State> CreateInviteCodesBuilder<'a, S> { /// Set the `forAccounts` field (optional) pub fn for_accounts( mut self, value: impl Into<Option<Vec<jacquard_common::types::string::Did<'a>>>>, ) -> Self { self.__unsafe_private_named.1 = value.into(); self } /// Set the `forAccounts` field to an Option value (optional) pub fn maybe_for_accounts( mut self, value: Option<Vec<jacquard_common::types::string::Did<'a>>>, ) -> Self { self.__unsafe_private_named.1 = value; self }}
impl<'a, S> CreateInviteCodesBuilder<'a, S>where S: create_invite_codes_state::State, S::UseCount: create_invite_codes_state::IsUnset,{ /// Set the `useCount` field (required) pub fn use_count( mut self, value: impl Into<i64>, ) -> CreateInviteCodesBuilder<'a, create_invite_codes_state::SetUseCount<S>> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); CreateInviteCodesBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } }}
impl<'a, S> CreateInviteCodesBuilder<'a, S>where S: create_invite_codes_state::State, S::UseCount: create_invite_codes_state::IsSet, S::CodeCount: create_invite_codes_state::IsSet,{ /// Build the final struct pub fn build(self) -> CreateInviteCodes<'a> { CreateInviteCodes { code_count: self.__unsafe_private_named.0.unwrap(), for_accounts: self.__unsafe_private_named.1, use_count: self.__unsafe_private_named.2.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> CreateInviteCodes<'a> { CreateInviteCodes { code_count: self.__unsafe_private_named.0.unwrap(), for_accounts: self.__unsafe_private_named.1, use_count: self.__unsafe_private_named.2.unwrap(), extra_data: Some(extra_data), } }}
#[jacquard_derive::lexicon]#[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic)]#[serde(rename_all = "camelCase")]pub struct CreateInviteCodesOutput<'a> { #[serde(borrow)] pub codes: Vec<crate::com_atproto::server::create_invite_codes::AccountCodes<'a>>,}
/// Response type for///com.atproto.server.createInviteCodespub struct CreateInviteCodesResponse;impl jacquard_common::xrpc::XrpcResp for CreateInviteCodesResponse { const NSID: &'static str = "com.atproto.server.createInviteCodes"; const ENCODING: &'static str = "application/json"; type Output<'de> = CreateInviteCodesOutput<'de>; type Err<'de> = jacquard_common::xrpc::GenericError<'de>;}
impl<'a> jacquard_common::xrpc::XrpcRequest for CreateInviteCodes<'a> { const NSID: &'static str = "com.atproto.server.createInviteCodes"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( "application/json", ); type Response = CreateInviteCodesResponse;}
/// Endpoint type for///com.atproto.server.createInviteCodespub struct CreateInviteCodesRequest;impl jacquard_common::xrpc::XrpcEndpoint for CreateInviteCodesRequest { const PATH: &'static str = "/xrpc/com.atproto.server.createInviteCodes"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( "application/json", ); type Request<'de> = CreateInviteCodes<'de>; type Response = CreateInviteCodesResponse;}