// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: com.atproto.server.defs // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. pub mod activate_account; pub mod check_account_status; pub mod confirm_email; pub mod create_account; pub mod create_app_password; pub mod create_invite_code; pub mod create_invite_codes; pub mod create_session; pub mod deactivate_account; pub mod delete_account; pub mod delete_session; pub mod describe_server; pub mod get_account_invite_codes; pub mod get_service_auth; pub mod get_session; pub mod list_app_passwords; pub mod refresh_session; pub mod request_account_delete; pub mod request_email_confirmation; pub mod request_email_update; pub mod request_password_reset; pub mod reserve_signing_key; pub mod reset_password; pub mod revoke_app_password; pub mod update_email; #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct InviteCode<'a> { pub available: i64, #[serde(borrow)] pub code: jacquard_common::CowStr<'a>, pub created_at: jacquard_common::types::string::Datetime, #[serde(borrow)] pub created_by: jacquard_common::CowStr<'a>, pub disabled: bool, #[serde(borrow)] pub for_account: jacquard_common::CowStr<'a>, #[serde(borrow)] pub uses: Vec>, } pub mod invite_code_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 Code; type ForAccount; type CreatedBy; type CreatedAt; type Uses; type Available; type Disabled; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Code = Unset; type ForAccount = Unset; type CreatedBy = Unset; type CreatedAt = Unset; type Uses = Unset; type Available = Unset; type Disabled = Unset; } ///State transition - sets the `code` field to Set pub struct SetCode(PhantomData S>); impl sealed::Sealed for SetCode {} impl State for SetCode { type Code = Set; type ForAccount = S::ForAccount; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; type Uses = S::Uses; type Available = S::Available; type Disabled = S::Disabled; } ///State transition - sets the `for_account` field to Set pub struct SetForAccount(PhantomData S>); impl sealed::Sealed for SetForAccount {} impl State for SetForAccount { type Code = S::Code; type ForAccount = Set; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; type Uses = S::Uses; type Available = S::Available; type Disabled = S::Disabled; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { type Code = S::Code; type ForAccount = S::ForAccount; type CreatedBy = Set; type CreatedAt = S::CreatedAt; type Uses = S::Uses; type Available = S::Available; type Disabled = S::Disabled; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type Code = S::Code; type ForAccount = S::ForAccount; type CreatedBy = S::CreatedBy; type CreatedAt = Set; type Uses = S::Uses; type Available = S::Available; type Disabled = S::Disabled; } ///State transition - sets the `uses` field to Set pub struct SetUses(PhantomData S>); impl sealed::Sealed for SetUses {} impl State for SetUses { type Code = S::Code; type ForAccount = S::ForAccount; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; type Uses = Set; type Available = S::Available; type Disabled = S::Disabled; } ///State transition - sets the `available` field to Set pub struct SetAvailable(PhantomData S>); impl sealed::Sealed for SetAvailable {} impl State for SetAvailable { type Code = S::Code; type ForAccount = S::ForAccount; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; type Uses = S::Uses; type Available = Set; type Disabled = S::Disabled; } ///State transition - sets the `disabled` field to Set pub struct SetDisabled(PhantomData S>); impl sealed::Sealed for SetDisabled {} impl State for SetDisabled { type Code = S::Code; type ForAccount = S::ForAccount; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; type Uses = S::Uses; type Available = S::Available; type Disabled = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `code` field pub struct code(()); ///Marker type for the `for_account` field pub struct for_account(()); ///Marker type for the `created_by` field pub struct created_by(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `uses` field pub struct uses(()); ///Marker type for the `available` field pub struct available(()); ///Marker type for the `disabled` field pub struct disabled(()); } } /// Builder for constructing an instance of this type pub struct InviteCodeBuilder<'a, S: invite_code_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option, ::core::option::Option>, ::core::option::Option, ::core::option::Option>, ::core::option::Option, ::core::option::Option>, ::core::option::Option>>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> InviteCode<'a> { /// Create a new builder for this type pub fn new() -> InviteCodeBuilder<'a, invite_code_state::Empty> { InviteCodeBuilder::new() } } impl<'a> InviteCodeBuilder<'a, invite_code_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { InviteCodeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None, None, None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> InviteCodeBuilder<'a, S> where S: invite_code_state::State, S::Available: invite_code_state::IsUnset, { /// Set the `available` field (required) pub fn available( mut self, value: impl Into, ) -> InviteCodeBuilder<'a, invite_code_state::SetAvailable> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); InviteCodeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> InviteCodeBuilder<'a, S> where S: invite_code_state::State, S::Code: invite_code_state::IsUnset, { /// Set the `code` field (required) pub fn code( mut self, value: impl Into>, ) -> InviteCodeBuilder<'a, invite_code_state::SetCode> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); InviteCodeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> InviteCodeBuilder<'a, S> where S: invite_code_state::State, S::CreatedAt: invite_code_state::IsUnset, { /// Set the `createdAt` field (required) pub fn created_at( mut self, value: impl Into, ) -> InviteCodeBuilder<'a, invite_code_state::SetCreatedAt> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); InviteCodeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> InviteCodeBuilder<'a, S> where S: invite_code_state::State, S::CreatedBy: invite_code_state::IsUnset, { /// Set the `createdBy` field (required) pub fn created_by( mut self, value: impl Into>, ) -> InviteCodeBuilder<'a, invite_code_state::SetCreatedBy> { self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); InviteCodeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> InviteCodeBuilder<'a, S> where S: invite_code_state::State, S::Disabled: invite_code_state::IsUnset, { /// Set the `disabled` field (required) pub fn disabled( mut self, value: impl Into, ) -> InviteCodeBuilder<'a, invite_code_state::SetDisabled> { self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); InviteCodeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> InviteCodeBuilder<'a, S> where S: invite_code_state::State, S::ForAccount: invite_code_state::IsUnset, { /// Set the `forAccount` field (required) pub fn for_account( mut self, value: impl Into>, ) -> InviteCodeBuilder<'a, invite_code_state::SetForAccount> { self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); InviteCodeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> InviteCodeBuilder<'a, S> where S: invite_code_state::State, S::Uses: invite_code_state::IsUnset, { /// Set the `uses` field (required) pub fn uses( mut self, value: impl Into>>, ) -> InviteCodeBuilder<'a, invite_code_state::SetUses> { self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); InviteCodeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> InviteCodeBuilder<'a, S> where S: invite_code_state::State, S::Code: invite_code_state::IsSet, S::ForAccount: invite_code_state::IsSet, S::CreatedBy: invite_code_state::IsSet, S::CreatedAt: invite_code_state::IsSet, S::Uses: invite_code_state::IsSet, S::Available: invite_code_state::IsSet, S::Disabled: invite_code_state::IsSet, { /// Build the final struct pub fn build(self) -> InviteCode<'a> { InviteCode { available: self.__unsafe_private_named.0.unwrap(), code: self.__unsafe_private_named.1.unwrap(), created_at: self.__unsafe_private_named.2.unwrap(), created_by: self.__unsafe_private_named.3.unwrap(), disabled: self.__unsafe_private_named.4.unwrap(), for_account: self.__unsafe_private_named.5.unwrap(), uses: self.__unsafe_private_named.6.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>, >, ) -> InviteCode<'a> { InviteCode { available: self.__unsafe_private_named.0.unwrap(), code: self.__unsafe_private_named.1.unwrap(), created_at: self.__unsafe_private_named.2.unwrap(), created_by: self.__unsafe_private_named.3.unwrap(), disabled: self.__unsafe_private_named.4.unwrap(), for_account: self.__unsafe_private_named.5.unwrap(), uses: self.__unsafe_private_named.6.unwrap(), extra_data: Some(extra_data), } } } fn lexicon_doc_com_atproto_server_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< 'static, > { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("com.atproto.server.defs"), revision: None, description: None, defs: { let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("inviteCode"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("code"), ::jacquard_common::smol_str::SmolStr::new_static("available"), ::jacquard_common::smol_str::SmolStr::new_static("disabled"), ::jacquard_common::smol_str::SmolStr::new_static("forAccount"), ::jacquard_common::smol_str::SmolStr::new_static("createdBy"), ::jacquard_common::smol_str::SmolStr::new_static("createdAt"), ::jacquard_common::smol_str::SmolStr::new_static("uses") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "available", ), ::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("code"), ::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( "createdAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), 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( "createdBy", ), ::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("disabled"), ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { description: None, default: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "forAccount", ), ::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("uses"), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: None, items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#inviteCodeUse", ), }), min_length: None, max_length: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("inviteCodeUse"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("usedBy"), ::jacquard_common::smol_str::SmolStr::new_static("usedAt") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("usedAt"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), 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("usedBy"), ::jacquard_lexicon::lexicon::LexObjectProperty::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, }), ); map }, }), ); map }, } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for InviteCode<'a> { fn nsid() -> &'static str { "com.atproto.server.defs" } fn def_name() -> &'static str { "inviteCode" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_atproto_server_defs() } 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 InviteCodeUse<'a> { pub used_at: jacquard_common::types::string::Datetime, #[serde(borrow)] pub used_by: jacquard_common::types::string::Did<'a>, } pub mod invite_code_use_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 UsedBy; type UsedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type UsedBy = Unset; type UsedAt = Unset; } ///State transition - sets the `used_by` field to Set pub struct SetUsedBy(PhantomData S>); impl sealed::Sealed for SetUsedBy {} impl State for SetUsedBy { type UsedBy = Set; type UsedAt = S::UsedAt; } ///State transition - sets the `used_at` field to Set pub struct SetUsedAt(PhantomData S>); impl sealed::Sealed for SetUsedAt {} impl State for SetUsedAt { type UsedBy = S::UsedBy; type UsedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `used_by` field pub struct used_by(()); ///Marker type for the `used_at` field pub struct used_at(()); } } /// Builder for constructing an instance of this type pub struct InviteCodeUseBuilder<'a, S: invite_code_use_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> InviteCodeUse<'a> { /// Create a new builder for this type pub fn new() -> InviteCodeUseBuilder<'a, invite_code_use_state::Empty> { InviteCodeUseBuilder::new() } } impl<'a> InviteCodeUseBuilder<'a, invite_code_use_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { InviteCodeUseBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> InviteCodeUseBuilder<'a, S> where S: invite_code_use_state::State, S::UsedAt: invite_code_use_state::IsUnset, { /// Set the `usedAt` field (required) pub fn used_at( mut self, value: impl Into, ) -> InviteCodeUseBuilder<'a, invite_code_use_state::SetUsedAt> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); InviteCodeUseBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> InviteCodeUseBuilder<'a, S> where S: invite_code_use_state::State, S::UsedBy: invite_code_use_state::IsUnset, { /// Set the `usedBy` field (required) pub fn used_by( mut self, value: impl Into>, ) -> InviteCodeUseBuilder<'a, invite_code_use_state::SetUsedBy> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); InviteCodeUseBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> InviteCodeUseBuilder<'a, S> where S: invite_code_use_state::State, S::UsedBy: invite_code_use_state::IsSet, S::UsedAt: invite_code_use_state::IsSet, { /// Build the final struct pub fn build(self) -> InviteCodeUse<'a> { InviteCodeUse { used_at: self.__unsafe_private_named.0.unwrap(), used_by: 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>, >, ) -> InviteCodeUse<'a> { InviteCodeUse { used_at: self.__unsafe_private_named.0.unwrap(), used_by: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for InviteCodeUse<'a> { fn nsid() -> &'static str { "com.atproto.server.defs" } fn def_name() -> &'static str { "inviteCodeUse" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_atproto_server_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } }