Something went wrong. Try again.
atproto Thingiverse but good
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732// @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.
//! Generated bindings for the `com.atproto.server` Lexicon namespace/module.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;
#[allow(unused_imports)]use alloc::collections::BTreeMap;
#[allow(unused_imports)]use core::marker::PhantomData;use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;use jacquard_common::deps::smol_str::SmolStr;use jacquard_common::types::string::{Did, Datetime};use jacquard_common::types::value::Data;use jacquard_derive::IntoStatic;use jacquard_lexicon::lexicon::LexiconDoc;use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]use jacquard_lexicon::validation::{ConstraintError, ValidationPath};use serde::{Serialize, Deserialize};use crate::com_atproto::server;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]pub struct InviteCode<S: BosStr = DefaultStr> { pub available: i64, pub code: S, pub created_at: Datetime, pub created_by: S, pub disabled: bool, pub for_account: S, pub uses: Vec<server::InviteCodeUse<S>>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]pub struct InviteCodeUse<S: BosStr = DefaultStr> { pub used_at: Datetime, pub used_by: Did<S>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,}
impl<S: BosStr> LexiconSchema for InviteCode<S> { fn nsid() -> &'static str { "com.atproto.server.defs" } fn def_name() -> &'static str { "inviteCode" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_com_atproto_server_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) }}
impl<S: BosStr> LexiconSchema for InviteCodeUse<S> { fn nsid() -> &'static str { "com.atproto.server.defs" } fn def_name() -> &'static str { "inviteCodeUse" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_com_atproto_server_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) }}
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 Available; type Code; type CreatedAt; type CreatedBy; type Disabled; type ForAccount; type Uses; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Available = Unset; type Code = Unset; type CreatedAt = Unset; type CreatedBy = Unset; type Disabled = Unset; type ForAccount = Unset; type Uses = Unset; } ///State transition - sets the `available` field to Set pub struct SetAvailable<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetAvailable<St> {} impl<St: State> State for SetAvailable<St> { type Available = Set<members::available>; type Code = St::Code; type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; type Disabled = St::Disabled; type ForAccount = St::ForAccount; type Uses = St::Uses; } ///State transition - sets the `code` field to Set pub struct SetCode<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetCode<St> {} impl<St: State> State for SetCode<St> { type Available = St::Available; type Code = Set<members::code>; type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; type Disabled = St::Disabled; type ForAccount = St::ForAccount; type Uses = St::Uses; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetCreatedAt<St> {} impl<St: State> State for SetCreatedAt<St> { type Available = St::Available; type Code = St::Code; type CreatedAt = Set<members::created_at>; type CreatedBy = St::CreatedBy; type Disabled = St::Disabled; type ForAccount = St::ForAccount; type Uses = St::Uses; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetCreatedBy<St> {} impl<St: State> State for SetCreatedBy<St> { type Available = St::Available; type Code = St::Code; type CreatedAt = St::CreatedAt; type CreatedBy = Set<members::created_by>; type Disabled = St::Disabled; type ForAccount = St::ForAccount; type Uses = St::Uses; } ///State transition - sets the `disabled` field to Set pub struct SetDisabled<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetDisabled<St> {} impl<St: State> State for SetDisabled<St> { type Available = St::Available; type Code = St::Code; type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; type Disabled = Set<members::disabled>; type ForAccount = St::ForAccount; type Uses = St::Uses; } ///State transition - sets the `for_account` field to Set pub struct SetForAccount<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetForAccount<St> {} impl<St: State> State for SetForAccount<St> { type Available = St::Available; type Code = St::Code; type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; type Disabled = St::Disabled; type ForAccount = Set<members::for_account>; type Uses = St::Uses; } ///State transition - sets the `uses` field to Set pub struct SetUses<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetUses<St> {} impl<St: State> State for SetUses<St> { type Available = St::Available; type Code = St::Code; type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; type Disabled = St::Disabled; type ForAccount = St::ForAccount; type Uses = Set<members::uses>; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `available` field pub struct available(()); ///Marker type for the `code` field pub struct code(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `created_by` field pub struct created_by(()); ///Marker type for the `disabled` field pub struct disabled(()); ///Marker type for the `for_account` field pub struct for_account(()); ///Marker type for the `uses` field pub struct uses(()); }}
/// Builder for constructing an instance of this type.pub struct InviteCodeBuilder<St: invite_code_state::State, S: BosStr = DefaultStr> { _state: PhantomData<fn() -> St>, _fields: ( Option<i64>, Option<S>, Option<Datetime>, Option<S>, Option<bool>, Option<S>, Option<Vec<server::InviteCodeUse<S>>>, ), _type: PhantomData<fn() -> S>,}
impl InviteCode<DefaultStr> { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> InviteCodeBuilder<invite_code_state::Empty, DefaultStr> { InviteCodeBuilder::new() }}
impl<S: BosStr> InviteCode<S> { /// Create a new builder for this type pub fn builder() -> InviteCodeBuilder<invite_code_state::Empty, S> { InviteCodeBuilder::builder() }}
impl InviteCodeBuilder<invite_code_state::Empty, DefaultStr> { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { InviteCodeBuilder { _state: PhantomData, _fields: (None, None, None, None, None, None, None), _type: PhantomData, } }}
impl<S: BosStr> InviteCodeBuilder<invite_code_state::Empty, S> { /// Create a new builder with all fields unset pub fn builder() -> Self { InviteCodeBuilder { _state: PhantomData, _fields: (None, None, None, None, None, None, None), _type: PhantomData, } }}
impl<St, S: BosStr> InviteCodeBuilder<St, S>where St: invite_code_state::State, St::Available: invite_code_state::IsUnset,{ /// Set the `available` field (required) pub fn available( mut self, value: impl Into<i64>, ) -> InviteCodeBuilder<invite_code_state::SetAvailable<St>, S> { self._fields.0 = Option::Some(value.into()); InviteCodeBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> InviteCodeBuilder<St, S>where St: invite_code_state::State, St::Code: invite_code_state::IsUnset,{ /// Set the `code` field (required) pub fn code( mut self, value: impl Into<S>, ) -> InviteCodeBuilder<invite_code_state::SetCode<St>, S> { self._fields.1 = Option::Some(value.into()); InviteCodeBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> InviteCodeBuilder<St, S>where St: invite_code_state::State, St::CreatedAt: invite_code_state::IsUnset,{ /// Set the `createdAt` field (required) pub fn created_at( mut self, value: impl Into<Datetime>, ) -> InviteCodeBuilder<invite_code_state::SetCreatedAt<St>, S> { self._fields.2 = Option::Some(value.into()); InviteCodeBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> InviteCodeBuilder<St, S>where St: invite_code_state::State, St::CreatedBy: invite_code_state::IsUnset,{ /// Set the `createdBy` field (required) pub fn created_by( mut self, value: impl Into<S>, ) -> InviteCodeBuilder<invite_code_state::SetCreatedBy<St>, S> { self._fields.3 = Option::Some(value.into()); InviteCodeBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> InviteCodeBuilder<St, S>where St: invite_code_state::State, St::Disabled: invite_code_state::IsUnset,{ /// Set the `disabled` field (required) pub fn disabled( mut self, value: impl Into<bool>, ) -> InviteCodeBuilder<invite_code_state::SetDisabled<St>, S> { self._fields.4 = Option::Some(value.into()); InviteCodeBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> InviteCodeBuilder<St, S>where St: invite_code_state::State, St::ForAccount: invite_code_state::IsUnset,{ /// Set the `forAccount` field (required) pub fn for_account( mut self, value: impl Into<S>, ) -> InviteCodeBuilder<invite_code_state::SetForAccount<St>, S> { self._fields.5 = Option::Some(value.into()); InviteCodeBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> InviteCodeBuilder<St, S>where St: invite_code_state::State, St::Uses: invite_code_state::IsUnset,{ /// Set the `uses` field (required) pub fn uses( mut self, value: impl Into<Vec<server::InviteCodeUse<S>>>, ) -> InviteCodeBuilder<invite_code_state::SetUses<St>, S> { self._fields.6 = Option::Some(value.into()); InviteCodeBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> InviteCodeBuilder<St, S>where St: invite_code_state::State, St::Available: invite_code_state::IsSet, St::Code: invite_code_state::IsSet, St::CreatedAt: invite_code_state::IsSet, St::CreatedBy: invite_code_state::IsSet, St::Disabled: invite_code_state::IsSet, St::ForAccount: invite_code_state::IsSet, St::Uses: invite_code_state::IsSet,{ /// Build the final struct. pub fn build(self) -> InviteCode<S> { InviteCode { available: self._fields.0.unwrap(), code: self._fields.1.unwrap(), created_at: self._fields.2.unwrap(), created_by: self._fields.3.unwrap(), disabled: self._fields.4.unwrap(), for_account: self._fields.5.unwrap(), uses: self._fields.6.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: BTreeMap<SmolStr, Data<S>>, ) -> InviteCode<S> { InviteCode { available: self._fields.0.unwrap(), code: self._fields.1.unwrap(), created_at: self._fields.2.unwrap(), created_by: self._fields.3.unwrap(), disabled: self._fields.4.unwrap(), for_account: self._fields.5.unwrap(), uses: self._fields.6.unwrap(), extra_data: Some(extra_data), } }}
fn lexicon_doc_com_atproto_server_defs() -> LexiconDoc<'static> { #[allow(unused_imports)] use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType}; use jacquard_lexicon::lexicon::*; use alloc::collections::BTreeMap; LexiconDoc { lexicon: Lexicon::Lexicon1, id: CowStr::new_static("com.atproto.server.defs"), defs: { let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("inviteCode"), LexUserType::Object(LexObject { required: Some( vec![ SmolStr::new_static("code"), SmolStr::new_static("available"), SmolStr::new_static("disabled"), SmolStr::new_static("forAccount"), SmolStr::new_static("createdBy"), SmolStr::new_static("createdAt"), SmolStr::new_static("uses") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("available"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("code"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("createdAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("createdBy"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("disabled"), LexObjectProperty::Boolean(LexBoolean { ..Default::default() }), ); map.insert( SmolStr::new_static("forAccount"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("uses"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#inviteCodeUse"), ..Default::default() }), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("inviteCodeUse"), LexUserType::Object(LexObject { required: Some( vec![ SmolStr::new_static("usedBy"), SmolStr::new_static("usedAt") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("usedAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("usedBy"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Did), ..Default::default() }), ); map }, ..Default::default() }), ); map }, ..Default::default() }}
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 UsedAt; type UsedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type UsedAt = Unset; type UsedBy = Unset; } ///State transition - sets the `used_at` field to Set pub struct SetUsedAt<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetUsedAt<St> {} impl<St: State> State for SetUsedAt<St> { type UsedAt = Set<members::used_at>; type UsedBy = St::UsedBy; } ///State transition - sets the `used_by` field to Set pub struct SetUsedBy<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetUsedBy<St> {} impl<St: State> State for SetUsedBy<St> { type UsedAt = St::UsedAt; type UsedBy = Set<members::used_by>; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `used_at` field pub struct used_at(()); ///Marker type for the `used_by` field pub struct used_by(()); }}
/// Builder for constructing an instance of this type.pub struct InviteCodeUseBuilder< St: invite_code_use_state::State, S: BosStr = DefaultStr,> { _state: PhantomData<fn() -> St>, _fields: (Option<Datetime>, Option<Did<S>>), _type: PhantomData<fn() -> S>,}
impl InviteCodeUse<DefaultStr> { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> InviteCodeUseBuilder<invite_code_use_state::Empty, DefaultStr> { InviteCodeUseBuilder::new() }}
impl<S: BosStr> InviteCodeUse<S> { /// Create a new builder for this type pub fn builder() -> InviteCodeUseBuilder<invite_code_use_state::Empty, S> { InviteCodeUseBuilder::builder() }}
impl InviteCodeUseBuilder<invite_code_use_state::Empty, DefaultStr> { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { InviteCodeUseBuilder { _state: PhantomData, _fields: (None, None), _type: PhantomData, } }}
impl<S: BosStr> InviteCodeUseBuilder<invite_code_use_state::Empty, S> { /// Create a new builder with all fields unset pub fn builder() -> Self { InviteCodeUseBuilder { _state: PhantomData, _fields: (None, None), _type: PhantomData, } }}
impl<St, S: BosStr> InviteCodeUseBuilder<St, S>where St: invite_code_use_state::State, St::UsedAt: invite_code_use_state::IsUnset,{ /// Set the `usedAt` field (required) pub fn used_at( mut self, value: impl Into<Datetime>, ) -> InviteCodeUseBuilder<invite_code_use_state::SetUsedAt<St>, S> { self._fields.0 = Option::Some(value.into()); InviteCodeUseBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> InviteCodeUseBuilder<St, S>where St: invite_code_use_state::State, St::UsedBy: invite_code_use_state::IsUnset,{ /// Set the `usedBy` field (required) pub fn used_by( mut self, value: impl Into<Did<S>>, ) -> InviteCodeUseBuilder<invite_code_use_state::SetUsedBy<St>, S> { self._fields.1 = Option::Some(value.into()); InviteCodeUseBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> InviteCodeUseBuilder<St, S>where St: invite_code_use_state::State, St::UsedAt: invite_code_use_state::IsSet, St::UsedBy: invite_code_use_state::IsSet,{ /// Build the final struct. pub fn build(self) -> InviteCodeUse<S> { InviteCodeUse { used_at: self._fields.0.unwrap(), used_by: self._fields.1.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: BTreeMap<SmolStr, Data<S>>, ) -> InviteCodeUse<S> { InviteCodeUse { used_at: self._fields.0.unwrap(), used_by: self._fields.1.unwrap(), extra_data: Some(extra_data), } }}