// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: com.atproto.identity.defs // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. pub mod get_recommended_did_credentials; pub mod refresh_identity; pub mod request_plc_operation_signature; pub mod resolve_did; pub mod resolve_handle; pub mod resolve_identity; pub mod sign_plc_operation; pub mod submit_plc_operation; pub mod update_handle; #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct IdentityInfo<'a> { #[serde(borrow)] pub did: jacquard_common::types::string::Did<'a>, /// The complete DID document for the identity. #[serde(borrow)] pub did_doc: jacquard_common::types::value::Data<'a>, /// The validated handle of the account; or 'handle.invalid' if the handle did not bi-directionally match the DID document. #[serde(borrow)] pub handle: jacquard_common::types::string::Handle<'a>, } pub mod identity_info_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 DidDoc; type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; type DidDoc = Unset; type Handle = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Did = Set; type DidDoc = S::DidDoc; type Handle = S::Handle; } ///State transition - sets the `did_doc` field to Set pub struct SetDidDoc(PhantomData S>); impl sealed::Sealed for SetDidDoc {} impl State for SetDidDoc { type Did = S::Did; type DidDoc = Set; type Handle = S::Handle; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { type Did = S::Did; type DidDoc = S::DidDoc; type Handle = 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 `did_doc` field pub struct did_doc(()); ///Marker type for the `handle` field pub struct handle(()); } } /// Builder for constructing an instance of this type pub struct IdentityInfoBuilder<'a, S: identity_info_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> IdentityInfo<'a> { /// Create a new builder for this type pub fn new() -> IdentityInfoBuilder<'a, identity_info_state::Empty> { IdentityInfoBuilder::new() } } impl<'a> IdentityInfoBuilder<'a, identity_info_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { IdentityInfoBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> IdentityInfoBuilder<'a, S> where S: identity_info_state::State, S::Did: identity_info_state::IsUnset, { /// Set the `did` field (required) pub fn did( mut self, value: impl Into>, ) -> IdentityInfoBuilder<'a, identity_info_state::SetDid> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); IdentityInfoBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> IdentityInfoBuilder<'a, S> where S: identity_info_state::State, S::DidDoc: identity_info_state::IsUnset, { /// Set the `didDoc` field (required) pub fn did_doc( mut self, value: impl Into>, ) -> IdentityInfoBuilder<'a, identity_info_state::SetDidDoc> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); IdentityInfoBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> IdentityInfoBuilder<'a, S> where S: identity_info_state::State, S::Handle: identity_info_state::IsUnset, { /// Set the `handle` field (required) pub fn handle( mut self, value: impl Into>, ) -> IdentityInfoBuilder<'a, identity_info_state::SetHandle> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); IdentityInfoBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> IdentityInfoBuilder<'a, S> where S: identity_info_state::State, S::Did: identity_info_state::IsSet, S::DidDoc: identity_info_state::IsSet, S::Handle: identity_info_state::IsSet, { /// Build the final struct pub fn build(self) -> IdentityInfo<'a> { IdentityInfo { did: self.__unsafe_private_named.0.unwrap(), did_doc: self.__unsafe_private_named.1.unwrap(), handle: 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>, >, ) -> IdentityInfo<'a> { IdentityInfo { did: self.__unsafe_private_named.0.unwrap(), did_doc: self.__unsafe_private_named.1.unwrap(), handle: self.__unsafe_private_named.2.unwrap(), extra_data: Some(extra_data), } } } fn lexicon_doc_com_atproto_identity_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< 'static, > { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("com.atproto.identity.defs"), revision: None, description: None, defs: { let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("identityInfo"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("did"), ::jacquard_common::smol_str::SmolStr::new_static("handle"), ::jacquard_common::smol_str::SmolStr::new_static("didDoc") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("did"), ::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.insert( ::jacquard_common::smol_str::SmolStr::new_static("didDoc"), ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { description: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("handle"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "The validated handle of the account; or 'handle.invalid' if the handle did not bi-directionally match the DID document.", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Handle, ), 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 IdentityInfo<'a> { fn nsid() -> &'static str { "com.atproto.identity.defs" } fn def_name() -> &'static str { "identityInfo" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_atproto_identity_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } }