Something went wrong. Try again.
atproto Thingiverse but good
Something went wrong. Try again.
41 kB · 1126 lines
Rust
at commit bb68bf8c
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126// @generated by jacquard-lexicon. DO NOT EDIT.//// Lexicon: space.polymodel.actor.defs//// This file was automatically generated from Lexicon schemas.// Any manual changes will be overwritten on the next regeneration.
//! Generated bindings for the `space.polymodel.actor` Lexicon namespace/module.pub mod bootstrap_profile;pub mod get_profile;pub mod get_session;pub mod profile;
#[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, AtUri, Cid, Datetime, UriValue};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::app_bsky::actor::ProfileViewDetailed;use crate::space_polymodel::library::ActorViewerState;use crate::space_polymodel::actor;/// A list authored by the profile actor, with enough metadata for profile tabs and links into space.polymodel.graph.getList.
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]pub struct ProfileListView<S: BosStr = DefaultStr> { pub cid: Cid<S>, pub created_at: Datetime, #[serde(skip_serializing_if = "Option::is_none")] pub description: Option<S>, pub item_count: i64, pub name: S, #[serde(skip_serializing_if = "Option::is_none")] pub purpose: Option<S>, pub uri: AtUri<S>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,}
/// Polymodel actor profile view (union variant). Hydrated from the space.polymodel.actor.profile record plus SQLite-derived stats and viewer relationship state. Returned when the actor authored a polymodel profile record; otherwise getProfile returns the app.bsky.actor.defs#profileViewDetailed variant.
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]pub struct ProfileView<S: BosStr = DefaultStr> { ///Resolved avatar URL (CDN). Null until the app view resolves the polymodel profile avatar blob. #[serde(skip_serializing_if = "Option::is_none")] pub avatar: Option<UriValue<S>>, #[serde(skip_serializing_if = "Option::is_none")] pub default_license: Option<S>, #[serde(skip_serializing_if = "Option::is_none")] pub description: Option<S>, pub did: Did<S>, #[serde(skip_serializing_if = "Option::is_none")] pub display_name: Option<S>, #[serde(skip_serializing_if = "Option::is_none")] pub follower_count: Option<i64>, #[serde(skip_serializing_if = "Option::is_none")] pub following_count: Option<i64>, pub handle: S, #[serde(skip_serializing_if = "Option::is_none")] pub indexed_at: Option<Datetime>, #[serde(skip_serializing_if = "Option::is_none")] pub links: Option<Vec<UriValue<S>>>, #[serde(skip_serializing_if = "Option::is_none")] pub lists: Option<Vec<actor::ProfileListView<S>>>, #[serde(skip_serializing_if = "Option::is_none")] pub printers: Option<Vec<S>>, #[serde(skip_serializing_if = "Option::is_none")] pub pronouns: Option<S>, ///The raw space.polymodel.actor.profile record. pub record: Data<S>, #[serde(skip_serializing_if = "Option::is_none")] pub thing_count: Option<i64>, #[serde(skip_serializing_if = "Option::is_none")] pub total_likes: Option<i64>, #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option<ActorViewerState<S>>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,}
///Discriminates a polymodel-native actor (space.polymodel.actor.defs#profileView, hydrated from the local profile record + stats) from a bluesky-only actor (app.bsky.actor.defs#profileViewDetailed, fetched from the public AppView). Clients render based on $type.
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]pub enum ProfileViewUnion<S: BosStr = DefaultStr> { #[serde(rename = "space.polymodel.actor.defs#profileView")] ProfileView(Box<actor::ProfileView<S>>), #[serde(rename = "app.bsky.actor.defs#profileViewDetailed")] ProfileViewDetailed(Box<ProfileViewDetailed<S>>),}
impl<S: BosStr> LexiconSchema for ProfileListView<S> { fn nsid() -> &'static str { "space.polymodel.actor.defs" } fn def_name() -> &'static str { "profileListView" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_actor_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) }}
impl<S: BosStr> LexiconSchema for ProfileView<S> { fn nsid() -> &'static str { "space.polymodel.actor.defs" } fn def_name() -> &'static str { "profileView" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_actor_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) }}
pub mod profile_list_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 Cid; type CreatedAt; type ItemCount; type Name; type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Cid = Unset; type CreatedAt = Unset; type ItemCount = Unset; type Name = Unset; type Uri = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetCid<St> {} impl<St: State> State for SetCid<St> { type Cid = Set<members::cid>; type CreatedAt = St::CreatedAt; type ItemCount = St::ItemCount; type Name = St::Name; type Uri = St::Uri; } ///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 Cid = St::Cid; type CreatedAt = Set<members::created_at>; type ItemCount = St::ItemCount; type Name = St::Name; type Uri = St::Uri; } ///State transition - sets the `item_count` field to Set pub struct SetItemCount<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetItemCount<St> {} impl<St: State> State for SetItemCount<St> { type Cid = St::Cid; type CreatedAt = St::CreatedAt; type ItemCount = Set<members::item_count>; type Name = St::Name; type Uri = St::Uri; } ///State transition - sets the `name` field to Set pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetName<St> {} impl<St: State> State for SetName<St> { type Cid = St::Cid; type CreatedAt = St::CreatedAt; type ItemCount = St::ItemCount; type Name = Set<members::name>; type Uri = St::Uri; } ///State transition - sets the `uri` field to Set pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetUri<St> {} impl<St: State> State for SetUri<St> { type Cid = St::Cid; type CreatedAt = St::CreatedAt; type ItemCount = St::ItemCount; type Name = St::Name; type Uri = Set<members::uri>; } /// 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 `created_at` field pub struct created_at(()); ///Marker type for the `item_count` field pub struct item_count(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `uri` field pub struct uri(()); }}
/// Builder for constructing an instance of this type.pub struct ProfileListViewBuilder< St: profile_list_view_state::State, S: BosStr = DefaultStr,> { _state: PhantomData<fn() -> St>, _fields: ( Option<Cid<S>>, Option<Datetime>, Option<S>, Option<i64>, Option<S>, Option<S>, Option<AtUri<S>>, ), _type: PhantomData<fn() -> S>,}
impl ProfileListView<DefaultStr> { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ProfileListViewBuilder<profile_list_view_state::Empty, DefaultStr> { ProfileListViewBuilder::new() }}
impl<S: BosStr> ProfileListView<S> { /// Create a new builder for this type pub fn builder() -> ProfileListViewBuilder<profile_list_view_state::Empty, S> { ProfileListViewBuilder::builder() }}
impl ProfileListViewBuilder<profile_list_view_state::Empty, DefaultStr> { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { ProfileListViewBuilder { _state: PhantomData, _fields: (None, None, None, None, None, None, None), _type: PhantomData, } }}
impl<S: BosStr> ProfileListViewBuilder<profile_list_view_state::Empty, S> { /// Create a new builder with all fields unset pub fn builder() -> Self { ProfileListViewBuilder { _state: PhantomData, _fields: (None, None, None, None, None, None, None), _type: PhantomData, } }}
impl<St, S: BosStr> ProfileListViewBuilder<St, S>where St: profile_list_view_state::State, St::Cid: profile_list_view_state::IsUnset,{ /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into<Cid<S>>, ) -> ProfileListViewBuilder<profile_list_view_state::SetCid<St>, S> { self._fields.0 = Option::Some(value.into()); ProfileListViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> ProfileListViewBuilder<St, S>where St: profile_list_view_state::State, St::CreatedAt: profile_list_view_state::IsUnset,{ /// Set the `createdAt` field (required) pub fn created_at( mut self, value: impl Into<Datetime>, ) -> ProfileListViewBuilder<profile_list_view_state::SetCreatedAt<St>, S> { self._fields.1 = Option::Some(value.into()); ProfileListViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St: profile_list_view_state::State, S: BosStr> ProfileListViewBuilder<St, S> { /// Set the `description` field (optional) pub fn description(mut self, value: impl Into<Option<S>>) -> Self { self._fields.2 = value.into(); self } /// Set the `description` field to an Option value (optional) pub fn maybe_description(mut self, value: Option<S>) -> Self { self._fields.2 = value; self }}
impl<St, S: BosStr> ProfileListViewBuilder<St, S>where St: profile_list_view_state::State, St::ItemCount: profile_list_view_state::IsUnset,{ /// Set the `itemCount` field (required) pub fn item_count( mut self, value: impl Into<i64>, ) -> ProfileListViewBuilder<profile_list_view_state::SetItemCount<St>, S> { self._fields.3 = Option::Some(value.into()); ProfileListViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> ProfileListViewBuilder<St, S>where St: profile_list_view_state::State, St::Name: profile_list_view_state::IsUnset,{ /// Set the `name` field (required) pub fn name( mut self, value: impl Into<S>, ) -> ProfileListViewBuilder<profile_list_view_state::SetName<St>, S> { self._fields.4 = Option::Some(value.into()); ProfileListViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St: profile_list_view_state::State, S: BosStr> ProfileListViewBuilder<St, S> { /// Set the `purpose` field (optional) pub fn purpose(mut self, value: impl Into<Option<S>>) -> Self { self._fields.5 = value.into(); self } /// Set the `purpose` field to an Option value (optional) pub fn maybe_purpose(mut self, value: Option<S>) -> Self { self._fields.5 = value; self }}
impl<St, S: BosStr> ProfileListViewBuilder<St, S>where St: profile_list_view_state::State, St::Uri: profile_list_view_state::IsUnset,{ /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into<AtUri<S>>, ) -> ProfileListViewBuilder<profile_list_view_state::SetUri<St>, S> { self._fields.6 = Option::Some(value.into()); ProfileListViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St, S: BosStr> ProfileListViewBuilder<St, S>where St: profile_list_view_state::State, St::Cid: profile_list_view_state::IsSet, St::CreatedAt: profile_list_view_state::IsSet, St::ItemCount: profile_list_view_state::IsSet, St::Name: profile_list_view_state::IsSet, St::Uri: profile_list_view_state::IsSet,{ /// Build the final struct. pub fn build(self) -> ProfileListView<S> { ProfileListView { cid: self._fields.0.unwrap(), created_at: self._fields.1.unwrap(), description: self._fields.2, item_count: self._fields.3.unwrap(), name: self._fields.4.unwrap(), purpose: self._fields.5, uri: 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>>, ) -> ProfileListView<S> { ProfileListView { cid: self._fields.0.unwrap(), created_at: self._fields.1.unwrap(), description: self._fields.2, item_count: self._fields.3.unwrap(), name: self._fields.4.unwrap(), purpose: self._fields.5, uri: self._fields.6.unwrap(), extra_data: Some(extra_data), } }}
fn lexicon_doc_space_polymodel_actor_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("space.polymodel.actor.defs"), defs: { let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("profileListView"), LexUserType::Object(LexObject { description: Some( CowStr::new_static( "A list authored by the profile actor, with enough metadata for profile tabs and links into space.polymodel.graph.getList.", ), ), required: Some( vec![ SmolStr::new_static("uri"), SmolStr::new_static("cid"), SmolStr::new_static("name"), SmolStr::new_static("itemCount"), SmolStr::new_static("createdAt") ], ), 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("createdAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("description"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("itemCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("name"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("purpose"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("uri"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::AtUri), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("profileView"), LexUserType::Object(LexObject { description: Some( CowStr::new_static( "Polymodel actor profile view (union variant). Hydrated from the space.polymodel.actor.profile record plus SQLite-derived stats and viewer relationship state. Returned when the actor authored a polymodel profile record; otherwise getProfile returns the app.bsky.actor.defs#profileViewDetailed variant.", ), ), required: Some( vec![ SmolStr::new_static("did"), SmolStr::new_static("handle"), SmolStr::new_static("record") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("avatar"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( "Resolved avatar URL (CDN). Null until the app view resolves the polymodel profile avatar blob.", ), ), format: Some(LexStringFormat::Uri), ..Default::default() }), ); map.insert( SmolStr::new_static("defaultLicense"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("description"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("did"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Did), ..Default::default() }), ); map.insert( SmolStr::new_static("displayName"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("followerCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("followingCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("handle"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("indexedAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("links"), LexObjectProperty::Array(LexArray { items: LexArrayItem::String(LexString { format: Some(LexStringFormat::Uri), ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("lists"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static( "space.polymodel.actor.defs#profileListView", ), ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("printers"), LexObjectProperty::Array(LexArray { items: LexArrayItem::String(LexString { ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("pronouns"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("record"), LexObjectProperty::Unknown(LexUnknown { ..Default::default() }), ); map.insert( SmolStr::new_static("thingCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("totalLikes"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("viewer"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static( "space.polymodel.library.defs#actorViewerState", ), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("profileViewUnion"), LexUserType::Union(LexRefUnion { refs: vec![ CowStr::new_static("space.polymodel.actor.defs#profileView"), CowStr::new_static("app.bsky.actor.defs#profileViewDetailed") ], closed: Some(true), ..Default::default() }), ); map }, ..Default::default() }}
pub mod profile_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 Record; } /// 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 Record = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetDid<St> {} impl<St: State> State for SetDid<St> { type Did = Set<members::did>; type Handle = St::Handle; type Record = St::Record; } ///State transition - sets the `handle` field to Set pub struct SetHandle<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetHandle<St> {} impl<St: State> State for SetHandle<St> { type Did = St::Did; type Handle = Set<members::handle>; type Record = St::Record; } ///State transition - sets the `record` field to Set pub struct SetRecord<St: State = Empty>(PhantomData<fn() -> St>); impl<St: State> sealed::Sealed for SetRecord<St> {} impl<St: State> State for SetRecord<St> { type Did = St::Did; type Handle = St::Handle; type Record = Set<members::record>; } /// 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 `record` field pub struct record(()); }}
/// Builder for constructing an instance of this type.pub struct ProfileViewBuilder<St: profile_view_state::State, S: BosStr = DefaultStr> { _state: PhantomData<fn() -> St>, _fields: ( Option<UriValue<S>>, Option<S>, Option<S>, Option<Did<S>>, Option<S>, Option<i64>, Option<i64>, Option<S>, Option<Datetime>, Option<Vec<UriValue<S>>>, Option<Vec<actor::ProfileListView<S>>>, Option<Vec<S>>, Option<S>, Option<Data<S>>, Option<i64>, Option<i64>, Option<ActorViewerState<S>>, ), _type: PhantomData<fn() -> S>,}
impl ProfileView<DefaultStr> { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ProfileViewBuilder<profile_view_state::Empty, DefaultStr> { ProfileViewBuilder::new() }}
impl<S: BosStr> ProfileView<S> { /// Create a new builder for this type pub fn builder() -> ProfileViewBuilder<profile_view_state::Empty, S> { ProfileViewBuilder::builder() }}
impl ProfileViewBuilder<profile_view_state::Empty, DefaultStr> { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { ProfileViewBuilder { _state: PhantomData, _fields: ( None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ), _type: PhantomData, } }}
impl<S: BosStr> ProfileViewBuilder<profile_view_state::Empty, S> { /// Create a new builder with all fields unset pub fn builder() -> Self { ProfileViewBuilder { _state: PhantomData, _fields: ( None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ), _type: PhantomData, } }}
impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> { /// Set the `avatar` field (optional) pub fn avatar(mut self, value: impl Into<Option<UriValue<S>>>) -> Self { self._fields.0 = value.into(); self } /// Set the `avatar` field to an Option value (optional) pub fn maybe_avatar(mut self, value: Option<UriValue<S>>) -> Self { self._fields.0 = value; self }}
impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> { /// Set the `defaultLicense` field (optional) pub fn default_license(mut self, value: impl Into<Option<S>>) -> Self { self._fields.1 = value.into(); self } /// Set the `defaultLicense` field to an Option value (optional) pub fn maybe_default_license(mut self, value: Option<S>) -> Self { self._fields.1 = value; self }}
impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> { /// Set the `description` field (optional) pub fn description(mut self, value: impl Into<Option<S>>) -> Self { self._fields.2 = value.into(); self } /// Set the `description` field to an Option value (optional) pub fn maybe_description(mut self, value: Option<S>) -> Self { self._fields.2 = value; self }}
impl<St, S: BosStr> ProfileViewBuilder<St, S>where St: profile_view_state::State, St::Did: profile_view_state::IsUnset,{ /// Set the `did` field (required) pub fn did( mut self, value: impl Into<Did<S>>, ) -> ProfileViewBuilder<profile_view_state::SetDid<St>, S> { self._fields.3 = Option::Some(value.into()); ProfileViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> { /// Set the `displayName` field (optional) pub fn display_name(mut self, value: impl Into<Option<S>>) -> Self { self._fields.4 = value.into(); self } /// Set the `displayName` field to an Option value (optional) pub fn maybe_display_name(mut self, value: Option<S>) -> Self { self._fields.4 = value; self }}
impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> { /// Set the `followerCount` field (optional) pub fn follower_count(mut self, value: impl Into<Option<i64>>) -> Self { self._fields.5 = value.into(); self } /// Set the `followerCount` field to an Option value (optional) pub fn maybe_follower_count(mut self, value: Option<i64>) -> Self { self._fields.5 = value; self }}
impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> { /// Set the `followingCount` field (optional) pub fn following_count(mut self, value: impl Into<Option<i64>>) -> Self { self._fields.6 = value.into(); self } /// Set the `followingCount` field to an Option value (optional) pub fn maybe_following_count(mut self, value: Option<i64>) -> Self { self._fields.6 = value; self }}
impl<St, S: BosStr> ProfileViewBuilder<St, S>where St: profile_view_state::State, St::Handle: profile_view_state::IsUnset,{ /// Set the `handle` field (required) pub fn handle( mut self, value: impl Into<S>, ) -> ProfileViewBuilder<profile_view_state::SetHandle<St>, S> { self._fields.7 = Option::Some(value.into()); ProfileViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> { /// Set the `indexedAt` field (optional) pub fn indexed_at(mut self, value: impl Into<Option<Datetime>>) -> Self { self._fields.8 = value.into(); self } /// Set the `indexedAt` field to an Option value (optional) pub fn maybe_indexed_at(mut self, value: Option<Datetime>) -> Self { self._fields.8 = value; self }}
impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> { /// Set the `links` field (optional) pub fn links(mut self, value: impl Into<Option<Vec<UriValue<S>>>>) -> Self { self._fields.9 = value.into(); self } /// Set the `links` field to an Option value (optional) pub fn maybe_links(mut self, value: Option<Vec<UriValue<S>>>) -> Self { self._fields.9 = value; self }}
impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> { /// Set the `lists` field (optional) pub fn lists( mut self, value: impl Into<Option<Vec<actor::ProfileListView<S>>>>, ) -> Self { self._fields.10 = value.into(); self } /// Set the `lists` field to an Option value (optional) pub fn maybe_lists(mut self, value: Option<Vec<actor::ProfileListView<S>>>) -> Self { self._fields.10 = value; self }}
impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> { /// Set the `printers` field (optional) pub fn printers(mut self, value: impl Into<Option<Vec<S>>>) -> Self { self._fields.11 = value.into(); self } /// Set the `printers` field to an Option value (optional) pub fn maybe_printers(mut self, value: Option<Vec<S>>) -> Self { self._fields.11 = value; self }}
impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> { /// Set the `pronouns` field (optional) pub fn pronouns(mut self, value: impl Into<Option<S>>) -> Self { self._fields.12 = value.into(); self } /// Set the `pronouns` field to an Option value (optional) pub fn maybe_pronouns(mut self, value: Option<S>) -> Self { self._fields.12 = value; self }}
impl<St, S: BosStr> ProfileViewBuilder<St, S>where St: profile_view_state::State, St::Record: profile_view_state::IsUnset,{ /// Set the `record` field (required) pub fn record( mut self, value: impl Into<Data<S>>, ) -> ProfileViewBuilder<profile_view_state::SetRecord<St>, S> { self._fields.13 = Option::Some(value.into()); ProfileViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } }}
impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> { /// Set the `thingCount` field (optional) pub fn thing_count(mut self, value: impl Into<Option<i64>>) -> Self { self._fields.14 = value.into(); self } /// Set the `thingCount` field to an Option value (optional) pub fn maybe_thing_count(mut self, value: Option<i64>) -> Self { self._fields.14 = value; self }}
impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> { /// Set the `totalLikes` field (optional) pub fn total_likes(mut self, value: impl Into<Option<i64>>) -> Self { self._fields.15 = value.into(); self } /// Set the `totalLikes` field to an Option value (optional) pub fn maybe_total_likes(mut self, value: Option<i64>) -> Self { self._fields.15 = value; self }}
impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> { /// Set the `viewer` field (optional) pub fn viewer(mut self, value: impl Into<Option<ActorViewerState<S>>>) -> Self { self._fields.16 = value.into(); self } /// Set the `viewer` field to an Option value (optional) pub fn maybe_viewer(mut self, value: Option<ActorViewerState<S>>) -> Self { self._fields.16 = value; self }}
impl<St, S: BosStr> ProfileViewBuilder<St, S>where St: profile_view_state::State, St::Did: profile_view_state::IsSet, St::Handle: profile_view_state::IsSet, St::Record: profile_view_state::IsSet,{ /// Build the final struct. pub fn build(self) -> ProfileView<S> { ProfileView { avatar: self._fields.0, default_license: self._fields.1, description: self._fields.2, did: self._fields.3.unwrap(), display_name: self._fields.4, follower_count: self._fields.5, following_count: self._fields.6, handle: self._fields.7.unwrap(), indexed_at: self._fields.8, links: self._fields.9, lists: self._fields.10, printers: self._fields.11, pronouns: self._fields.12, record: self._fields.13.unwrap(), thing_count: self._fields.14, total_likes: self._fields.15, viewer: self._fields.16, extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: BTreeMap<SmolStr, Data<S>>, ) -> ProfileView<S> { ProfileView { avatar: self._fields.0, default_license: self._fields.1, description: self._fields.2, did: self._fields.3.unwrap(), display_name: self._fields.4, follower_count: self._fields.5, following_count: self._fields.6, handle: self._fields.7.unwrap(), indexed_at: self._fields.8, links: self._fields.9, lists: self._fields.10, printers: self._fields.11, pronouns: self._fields.12, record: self._fields.13.unwrap(), thing_count: self._fields.14, total_likes: self._fields.15, viewer: self._fields.16, extra_data: Some(extra_data), } }}