Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550// @generated by jacquard-lexicon. DO NOT EDIT.//// Lexicon: chat.bsky.actor.defs//// This file was automatically generated from Lexicon schemas.// Any manual changes will be overwritten on the next regeneration.
pub mod declaration;pub mod delete_account;pub mod export_account_data;
#[jacquard_derive::lexicon]#[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic)]#[serde(rename_all = "camelCase")]pub struct ProfileViewBasic<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub associated: std::option::Option<crate::app_bsky::actor::ProfileAssociated<'a>>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub avatar: std::option::Option<jacquard_common::types::string::Uri<'a>>, /// Set to true when the actor cannot actively participate in conversations #[serde(skip_serializing_if = "std::option::Option::is_none")] pub chat_disabled: std::option::Option<bool>, #[serde(borrow)] pub did: jacquard_common::types::string::Did<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub display_name: std::option::Option<jacquard_common::CowStr<'a>>, #[serde(borrow)] pub handle: jacquard_common::types::string::Handle<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub labels: std::option::Option<Vec<crate::com_atproto::label::Label<'a>>>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub verification: std::option::Option<crate::app_bsky::actor::VerificationState<'a>>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub viewer: std::option::Option<crate::app_bsky::actor::ViewerState<'a>>,}
pub mod profile_view_basic_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 Handle; type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Handle = Unset; type Did = Unset; } ///State transition - sets the `handle` field to Set pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); impl<S: State> sealed::Sealed for SetHandle<S> {} impl<S: State> State for SetHandle<S> { type Handle = Set<members::handle>; type Did = S::Did; } ///State transition - sets the `did` field to Set pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); impl<S: State> sealed::Sealed for SetDid<S> {} impl<S: State> State for SetDid<S> { type Handle = S::Handle; type Did = Set<members::did>; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `handle` field pub struct handle(()); ///Marker type for the `did` field pub struct did(()); }}
/// Builder for constructing an instance of this typepub struct ProfileViewBasicBuilder<'a, S: profile_view_basic_state::State> { _phantom_state: ::core::marker::PhantomData<fn() -> S>, __unsafe_private_named: ( ::core::option::Option<crate::app_bsky::actor::ProfileAssociated<'a>>, ::core::option::Option<jacquard_common::types::string::Uri<'a>>, ::core::option::Option<bool>, ::core::option::Option<jacquard_common::types::string::Did<'a>>, ::core::option::Option<jacquard_common::CowStr<'a>>, ::core::option::Option<jacquard_common::types::string::Handle<'a>>, ::core::option::Option<Vec<crate::com_atproto::label::Label<'a>>>, ::core::option::Option<crate::app_bsky::actor::VerificationState<'a>>, ::core::option::Option<crate::app_bsky::actor::ViewerState<'a>>, ), _phantom: ::core::marker::PhantomData<&'a ()>,}
impl<'a> ProfileViewBasic<'a> { /// Create a new builder for this type pub fn new() -> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> { ProfileViewBasicBuilder::new() }}
impl<'a> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { ProfileViewBasicBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: ( None, None, None, None, None, None, None, None, None, ), _phantom: ::core::marker::PhantomData, } }}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { /// Set the `associated` field (optional) pub fn associated( mut self, value: impl Into<Option<crate::app_bsky::actor::ProfileAssociated<'a>>>, ) -> Self { self.__unsafe_private_named.0 = value.into(); self } /// Set the `associated` field to an Option value (optional) pub fn maybe_associated( mut self, value: Option<crate::app_bsky::actor::ProfileAssociated<'a>>, ) -> Self { self.__unsafe_private_named.0 = value; self }}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { /// Set the `avatar` field (optional) pub fn avatar( mut self, value: impl Into<Option<jacquard_common::types::string::Uri<'a>>>, ) -> Self { self.__unsafe_private_named.1 = value.into(); self } /// Set the `avatar` field to an Option value (optional) pub fn maybe_avatar( mut self, value: Option<jacquard_common::types::string::Uri<'a>>, ) -> Self { self.__unsafe_private_named.1 = value; self }}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { /// Set the `chatDisabled` field (optional) pub fn chat_disabled(mut self, value: impl Into<Option<bool>>) -> Self { self.__unsafe_private_named.2 = value.into(); self } /// Set the `chatDisabled` field to an Option value (optional) pub fn maybe_chat_disabled(mut self, value: Option<bool>) -> Self { self.__unsafe_private_named.2 = value; self }}
impl<'a, S> ProfileViewBasicBuilder<'a, S>where S: profile_view_basic_state::State, S::Did: profile_view_basic_state::IsUnset,{ /// Set the `did` field (required) pub fn did( mut self, value: impl Into<jacquard_common::types::string::Did<'a>>, ) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetDid<S>> { self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); ProfileViewBasicBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } }}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { /// Set the `displayName` field (optional) pub fn display_name( mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>, ) -> Self { self.__unsafe_private_named.4 = value.into(); self } /// Set the `displayName` field to an Option value (optional) pub fn maybe_display_name( mut self, value: Option<jacquard_common::CowStr<'a>>, ) -> Self { self.__unsafe_private_named.4 = value; self }}
impl<'a, S> ProfileViewBasicBuilder<'a, S>where S: profile_view_basic_state::State, S::Handle: profile_view_basic_state::IsUnset,{ /// Set the `handle` field (required) pub fn handle( mut self, value: impl Into<jacquard_common::types::string::Handle<'a>>, ) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetHandle<S>> { self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); ProfileViewBasicBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } }}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { /// Set the `labels` field (optional) pub fn labels( mut self, value: impl Into<Option<Vec<crate::com_atproto::label::Label<'a>>>>, ) -> Self { self.__unsafe_private_named.6 = value.into(); self } /// Set the `labels` field to an Option value (optional) pub fn maybe_labels( mut self, value: Option<Vec<crate::com_atproto::label::Label<'a>>>, ) -> Self { self.__unsafe_private_named.6 = value; self }}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { /// Set the `verification` field (optional) pub fn verification( mut self, value: impl Into<Option<crate::app_bsky::actor::VerificationState<'a>>>, ) -> Self { self.__unsafe_private_named.7 = value.into(); self } /// Set the `verification` field to an Option value (optional) pub fn maybe_verification( mut self, value: Option<crate::app_bsky::actor::VerificationState<'a>>, ) -> Self { self.__unsafe_private_named.7 = value; self }}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { /// Set the `viewer` field (optional) pub fn viewer( mut self, value: impl Into<Option<crate::app_bsky::actor::ViewerState<'a>>>, ) -> Self { self.__unsafe_private_named.8 = value.into(); self } /// Set the `viewer` field to an Option value (optional) pub fn maybe_viewer( mut self, value: Option<crate::app_bsky::actor::ViewerState<'a>>, ) -> Self { self.__unsafe_private_named.8 = value; self }}
impl<'a, S> ProfileViewBasicBuilder<'a, S>where S: profile_view_basic_state::State, S::Handle: profile_view_basic_state::IsSet, S::Did: profile_view_basic_state::IsSet,{ /// Build the final struct pub fn build(self) -> ProfileViewBasic<'a> { ProfileViewBasic { associated: self.__unsafe_private_named.0, avatar: self.__unsafe_private_named.1, chat_disabled: self.__unsafe_private_named.2, did: self.__unsafe_private_named.3.unwrap(), display_name: self.__unsafe_private_named.4, handle: self.__unsafe_private_named.5.unwrap(), labels: self.__unsafe_private_named.6, verification: self.__unsafe_private_named.7, viewer: self.__unsafe_private_named.8, 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>, >, ) -> ProfileViewBasic<'a> { ProfileViewBasic { associated: self.__unsafe_private_named.0, avatar: self.__unsafe_private_named.1, chat_disabled: self.__unsafe_private_named.2, did: self.__unsafe_private_named.3.unwrap(), display_name: self.__unsafe_private_named.4, handle: self.__unsafe_private_named.5.unwrap(), labels: self.__unsafe_private_named.6, verification: self.__unsafe_private_named.7, viewer: self.__unsafe_private_named.8, extra_data: Some(extra_data), } }}
fn lexicon_doc_chat_bsky_actor_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< 'static,> { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("chat.bsky.actor.defs"), revision: None, description: None, defs: { let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("profileViewBasic"), ::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") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "associated", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "app.bsky.actor.defs#profileAssociated", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("avatar"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Uri, ), 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( "chatDisabled", ), ::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("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( "displayName", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: Some(640usize), min_graphemes: None, max_graphemes: Some(64usize), r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("handle"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, 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.insert( ::jacquard_common::smol_str::SmolStr::new_static("labels"), ::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( "com.atproto.label.defs#label", ), }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "verification", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "app.bsky.actor.defs#verificationState", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("viewer"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "app.bsky.actor.defs#viewerState", ), }), ); map }, }), ); map }, }}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileViewBasic<'a> { fn nsid() -> &'static str { "chat.bsky.actor.defs" } fn def_name() -> &'static str { "profileViewBasic" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_chat_bsky_actor_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { if let Some(ref value) = self.display_name { #[allow(unused_comparisons)] if <str>::len(value.as_ref()) > 640usize { return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { path: ::jacquard_lexicon::validation::ValidationPath::from_field( "display_name", ), max: 640usize, actual: <str>::len(value.as_ref()), }); } } if let Some(ref value) = self.display_name { { let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( value.as_ref(), true, ) .count(); if count > 64usize { return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { path: ::jacquard_lexicon::validation::ValidationPath::from_field( "display_name", ), max: 64usize, actual: count, }); } } } Ok(()) }}