// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: com.atproto.admin.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.admin` Lexicon namespace/module. pub mod delete_account; pub mod disable_account_invites; pub mod disable_invite_codes; pub mod enable_account_invites; pub mod get_account_info; pub mod get_account_infos; pub mod get_invite_codes; pub mod get_subject_status; pub mod search_accounts; pub mod send_email; pub mod update_account_email; pub mod update_account_handle; pub mod update_account_password; pub mod update_account_signing_key; pub mod update_subject_status; #[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, Handle, AtUri, Cid, 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::InviteCode; use crate::com_atproto::admin; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct AccountView { #[serde(skip_serializing_if = "Option::is_none")] pub deactivated_at: Option, pub did: Did, #[serde(skip_serializing_if = "Option::is_none")] pub email: Option, #[serde(skip_serializing_if = "Option::is_none")] pub email_confirmed_at: Option, pub handle: Handle, pub indexed_at: Datetime, #[serde(skip_serializing_if = "Option::is_none")] pub invite_note: Option, #[serde(skip_serializing_if = "Option::is_none")] pub invited_by: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub invites: Option>>, #[serde(skip_serializing_if = "Option::is_none")] pub invites_disabled: Option, #[serde(skip_serializing_if = "Option::is_none")] pub related_records: Option>>, #[serde(skip_serializing_if = "Option::is_none")] pub threat_signatures: Option>>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct RepoBlobRef { pub cid: Cid, pub did: Did, #[serde(skip_serializing_if = "Option::is_none")] pub record_uri: Option>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct RepoRef { pub did: Did, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct StatusAttr { pub applied: bool, #[serde(skip_serializing_if = "Option::is_none")] pub r#ref: Option, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct ThreatSignature { pub property: S, pub value: S, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } impl LexiconSchema for AccountView { fn nsid() -> &'static str { "com.atproto.admin.defs" } fn def_name() -> &'static str { "accountView" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_com_atproto_admin_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for RepoBlobRef { fn nsid() -> &'static str { "com.atproto.admin.defs" } fn def_name() -> &'static str { "repoBlobRef" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_com_atproto_admin_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for RepoRef { fn nsid() -> &'static str { "com.atproto.admin.defs" } fn def_name() -> &'static str { "repoRef" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_com_atproto_admin_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for StatusAttr { fn nsid() -> &'static str { "com.atproto.admin.defs" } fn def_name() -> &'static str { "statusAttr" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_com_atproto_admin_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for ThreatSignature { fn nsid() -> &'static str { "com.atproto.admin.defs" } fn def_name() -> &'static str { "threatSignature" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_com_atproto_admin_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } pub mod account_view_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 Did; type Handle; type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; type Handle = Unset; type IndexedAt = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Did = Set; type Handle = St::Handle; type IndexedAt = St::IndexedAt; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData St>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { type Did = St::Did; type Handle = Set; type IndexedAt = St::IndexedAt; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Did = St::Did; type Handle = St::Handle; type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `did` field pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); } } /// Builder for constructing an instance of this type. pub struct AccountViewBuilder { _state: PhantomData St>, _fields: ( Option, Option>, Option, Option, Option>, Option, Option, Option>, Option>>, Option, Option>>, Option>>, ), _type: PhantomData S>, } impl AccountView { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> AccountViewBuilder { AccountViewBuilder::new() } } impl AccountView { /// Create a new builder for this type pub fn builder() -> AccountViewBuilder { AccountViewBuilder::builder() } } impl AccountViewBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { AccountViewBuilder { _state: PhantomData, _fields: ( None, None, None, None, None, None, None, None, None, None, None, None, ), _type: PhantomData, } } } impl AccountViewBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { AccountViewBuilder { _state: PhantomData, _fields: ( None, None, None, None, None, None, None, None, None, None, None, None, ), _type: PhantomData, } } } impl AccountViewBuilder { /// Set the `deactivatedAt` field (optional) pub fn deactivated_at(mut self, value: impl Into>) -> Self { self._fields.0 = value.into(); self } /// Set the `deactivatedAt` field to an Option value (optional) pub fn maybe_deactivated_at(mut self, value: Option) -> Self { self._fields.0 = value; self } } impl AccountViewBuilder where St: account_view_state::State, St::Did: account_view_state::IsUnset, { /// Set the `did` field (required) pub fn did( mut self, value: impl Into>, ) -> AccountViewBuilder, S> { self._fields.1 = Option::Some(value.into()); AccountViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl AccountViewBuilder { /// Set the `email` field (optional) pub fn email(mut self, value: impl Into>) -> Self { self._fields.2 = value.into(); self } /// Set the `email` field to an Option value (optional) pub fn maybe_email(mut self, value: Option) -> Self { self._fields.2 = value; self } } impl AccountViewBuilder { /// Set the `emailConfirmedAt` field (optional) pub fn email_confirmed_at(mut self, value: impl Into>) -> Self { self._fields.3 = value.into(); self } /// Set the `emailConfirmedAt` field to an Option value (optional) pub fn maybe_email_confirmed_at(mut self, value: Option) -> Self { self._fields.3 = value; self } } impl AccountViewBuilder where St: account_view_state::State, St::Handle: account_view_state::IsUnset, { /// Set the `handle` field (required) pub fn handle( mut self, value: impl Into>, ) -> AccountViewBuilder, S> { self._fields.4 = Option::Some(value.into()); AccountViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl AccountViewBuilder where St: account_view_state::State, St::IndexedAt: account_view_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> AccountViewBuilder, S> { self._fields.5 = Option::Some(value.into()); AccountViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl AccountViewBuilder { /// Set the `inviteNote` field (optional) pub fn invite_note(mut self, value: impl Into>) -> Self { self._fields.6 = value.into(); self } /// Set the `inviteNote` field to an Option value (optional) pub fn maybe_invite_note(mut self, value: Option) -> Self { self._fields.6 = value; self } } impl AccountViewBuilder { /// Set the `invitedBy` field (optional) pub fn invited_by(mut self, value: impl Into>>) -> Self { self._fields.7 = value.into(); self } /// Set the `invitedBy` field to an Option value (optional) pub fn maybe_invited_by(mut self, value: Option>) -> Self { self._fields.7 = value; self } } impl AccountViewBuilder { /// Set the `invites` field (optional) pub fn invites(mut self, value: impl Into>>>) -> Self { self._fields.8 = value.into(); self } /// Set the `invites` field to an Option value (optional) pub fn maybe_invites(mut self, value: Option>>) -> Self { self._fields.8 = value; self } } impl AccountViewBuilder { /// Set the `invitesDisabled` field (optional) pub fn invites_disabled(mut self, value: impl Into>) -> Self { self._fields.9 = value.into(); self } /// Set the `invitesDisabled` field to an Option value (optional) pub fn maybe_invites_disabled(mut self, value: Option) -> Self { self._fields.9 = value; self } } impl AccountViewBuilder { /// Set the `relatedRecords` field (optional) pub fn related_records(mut self, value: impl Into>>>) -> Self { self._fields.10 = value.into(); self } /// Set the `relatedRecords` field to an Option value (optional) pub fn maybe_related_records(mut self, value: Option>>) -> Self { self._fields.10 = value; self } } impl AccountViewBuilder { /// Set the `threatSignatures` field (optional) pub fn threat_signatures( mut self, value: impl Into>>>, ) -> Self { self._fields.11 = value.into(); self } /// Set the `threatSignatures` field to an Option value (optional) pub fn maybe_threat_signatures( mut self, value: Option>>, ) -> Self { self._fields.11 = value; self } } impl AccountViewBuilder where St: account_view_state::State, St::Did: account_view_state::IsSet, St::Handle: account_view_state::IsSet, St::IndexedAt: account_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> AccountView { AccountView { deactivated_at: self._fields.0, did: self._fields.1.unwrap(), email: self._fields.2, email_confirmed_at: self._fields.3, handle: self._fields.4.unwrap(), indexed_at: self._fields.5.unwrap(), invite_note: self._fields.6, invited_by: self._fields.7, invites: self._fields.8, invites_disabled: self._fields.9, related_records: self._fields.10, threat_signatures: self._fields.11, extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: BTreeMap>, ) -> AccountView { AccountView { deactivated_at: self._fields.0, did: self._fields.1.unwrap(), email: self._fields.2, email_confirmed_at: self._fields.3, handle: self._fields.4.unwrap(), indexed_at: self._fields.5.unwrap(), invite_note: self._fields.6, invited_by: self._fields.7, invites: self._fields.8, invites_disabled: self._fields.9, related_records: self._fields.10, threat_signatures: self._fields.11, extra_data: Some(extra_data), } } } fn lexicon_doc_com_atproto_admin_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.admin.defs"), defs: { let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("accountView"), LexUserType::Object(LexObject { required: Some( vec![ SmolStr::new_static("did"), SmolStr::new_static("handle"), SmolStr::new_static("indexedAt") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("deactivatedAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("did"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Did), ..Default::default() }), ); map.insert( SmolStr::new_static("email"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("emailConfirmedAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("handle"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Handle), ..Default::default() }), ); map.insert( SmolStr::new_static("indexedAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("inviteNote"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("invitedBy"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static( "com.atproto.server.defs#inviteCode", ), ..Default::default() }), ); map.insert( SmolStr::new_static("invites"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static( "com.atproto.server.defs#inviteCode", ), ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("invitesDisabled"), LexObjectProperty::Boolean(LexBoolean { ..Default::default() }), ); map.insert( SmolStr::new_static("relatedRecords"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Unknown(LexUnknown { ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("threatSignatures"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#threatSignature"), ..Default::default() }), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("repoBlobRef"), LexUserType::Object(LexObject { required: Some( vec![SmolStr::new_static("did"), SmolStr::new_static("cid")], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("cid"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Cid), ..Default::default() }), ); map.insert( SmolStr::new_static("did"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Did), ..Default::default() }), ); map.insert( SmolStr::new_static("recordUri"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::AtUri), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("repoRef"), LexUserType::Object(LexObject { required: Some(vec![SmolStr::new_static("did")]), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("did"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Did), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("statusAttr"), LexUserType::Object(LexObject { required: Some(vec![SmolStr::new_static("applied")]), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("applied"), LexObjectProperty::Boolean(LexBoolean { ..Default::default() }), ); map.insert( SmolStr::new_static("ref"), LexObjectProperty::String(LexString { ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("threatSignature"), LexUserType::Object(LexObject { required: Some( vec![ SmolStr::new_static("property"), SmolStr::new_static("value") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("property"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("value"), LexObjectProperty::String(LexString { ..Default::default() }), ); map }, ..Default::default() }), ); map }, ..Default::default() } } pub mod repo_blob_ref_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 Cid; type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Cid = Unset; type Did = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData St>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Cid = Set; type Did = St::Did; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Cid = St::Cid; type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `did` field pub struct did(()); } } /// Builder for constructing an instance of this type. pub struct RepoBlobRefBuilder { _state: PhantomData St>, _fields: (Option>, Option>, Option>), _type: PhantomData S>, } impl RepoBlobRef { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> RepoBlobRefBuilder { RepoBlobRefBuilder::new() } } impl RepoBlobRef { /// Create a new builder for this type pub fn builder() -> RepoBlobRefBuilder { RepoBlobRefBuilder::builder() } } impl RepoBlobRefBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { RepoBlobRefBuilder { _state: PhantomData, _fields: (None, None, None), _type: PhantomData, } } } impl RepoBlobRefBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { RepoBlobRefBuilder { _state: PhantomData, _fields: (None, None, None), _type: PhantomData, } } } impl RepoBlobRefBuilder where St: repo_blob_ref_state::State, St::Cid: repo_blob_ref_state::IsUnset, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, ) -> RepoBlobRefBuilder, S> { self._fields.0 = Option::Some(value.into()); RepoBlobRefBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl RepoBlobRefBuilder where St: repo_blob_ref_state::State, St::Did: repo_blob_ref_state::IsUnset, { /// Set the `did` field (required) pub fn did( mut self, value: impl Into>, ) -> RepoBlobRefBuilder, S> { self._fields.1 = Option::Some(value.into()); RepoBlobRefBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl RepoBlobRefBuilder { /// Set the `recordUri` field (optional) pub fn record_uri(mut self, value: impl Into>>) -> Self { self._fields.2 = value.into(); self } /// Set the `recordUri` field to an Option value (optional) pub fn maybe_record_uri(mut self, value: Option>) -> Self { self._fields.2 = value; self } } impl RepoBlobRefBuilder where St: repo_blob_ref_state::State, St::Cid: repo_blob_ref_state::IsSet, St::Did: repo_blob_ref_state::IsSet, { /// Build the final struct. pub fn build(self) -> RepoBlobRef { RepoBlobRef { cid: self._fields.0.unwrap(), did: self._fields.1.unwrap(), record_uri: self._fields.2, extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: BTreeMap>, ) -> RepoBlobRef { RepoBlobRef { cid: self._fields.0.unwrap(), did: self._fields.1.unwrap(), record_uri: self._fields.2, extra_data: Some(extra_data), } } } pub mod repo_ref_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 Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `did` field pub struct did(()); } } /// Builder for constructing an instance of this type. pub struct RepoRefBuilder { _state: PhantomData St>, _fields: (Option>,), _type: PhantomData S>, } impl RepoRef { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> RepoRefBuilder { RepoRefBuilder::new() } } impl RepoRef { /// Create a new builder for this type pub fn builder() -> RepoRefBuilder { RepoRefBuilder::builder() } } impl RepoRefBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { RepoRefBuilder { _state: PhantomData, _fields: (None,), _type: PhantomData, } } } impl RepoRefBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { RepoRefBuilder { _state: PhantomData, _fields: (None,), _type: PhantomData, } } } impl RepoRefBuilder where St: repo_ref_state::State, St::Did: repo_ref_state::IsUnset, { /// Set the `did` field (required) pub fn did( mut self, value: impl Into>, ) -> RepoRefBuilder, S> { self._fields.0 = Option::Some(value.into()); RepoRefBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl RepoRefBuilder where St: repo_ref_state::State, St::Did: repo_ref_state::IsSet, { /// Build the final struct. pub fn build(self) -> RepoRef { RepoRef { did: self._fields.0.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data(self, extra_data: BTreeMap>) -> RepoRef { RepoRef { did: self._fields.0.unwrap(), extra_data: Some(extra_data), } } } pub mod status_attr_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 Applied; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Applied = Unset; } ///State transition - sets the `applied` field to Set pub struct SetApplied(PhantomData St>); impl sealed::Sealed for SetApplied {} impl State for SetApplied { type Applied = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `applied` field pub struct applied(()); } } /// Builder for constructing an instance of this type. pub struct StatusAttrBuilder { _state: PhantomData St>, _fields: (Option, Option), _type: PhantomData S>, } impl StatusAttr { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> StatusAttrBuilder { StatusAttrBuilder::new() } } impl StatusAttr { /// Create a new builder for this type pub fn builder() -> StatusAttrBuilder { StatusAttrBuilder::builder() } } impl StatusAttrBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { StatusAttrBuilder { _state: PhantomData, _fields: (None, None), _type: PhantomData, } } } impl StatusAttrBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { StatusAttrBuilder { _state: PhantomData, _fields: (None, None), _type: PhantomData, } } } impl StatusAttrBuilder where St: status_attr_state::State, St::Applied: status_attr_state::IsUnset, { /// Set the `applied` field (required) pub fn applied( mut self, value: impl Into, ) -> StatusAttrBuilder, S> { self._fields.0 = Option::Some(value.into()); StatusAttrBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl StatusAttrBuilder { /// Set the `ref` field (optional) pub fn r#ref(mut self, value: impl Into>) -> Self { self._fields.1 = value.into(); self } /// Set the `ref` field to an Option value (optional) pub fn maybe_ref(mut self, value: Option) -> Self { self._fields.1 = value; self } } impl StatusAttrBuilder where St: status_attr_state::State, St::Applied: status_attr_state::IsSet, { /// Build the final struct. pub fn build(self) -> StatusAttr { StatusAttr { applied: self._fields.0.unwrap(), r#ref: self._fields.1, extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: BTreeMap>, ) -> StatusAttr { StatusAttr { applied: self._fields.0.unwrap(), r#ref: self._fields.1, extra_data: Some(extra_data), } } }