// @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 { pub cid: Cid, pub created_at: Datetime, #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, pub item_count: i64, pub name: S, #[serde(skip_serializing_if = "Option::is_none")] pub purpose: Option, pub uri: AtUri, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } /// 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 { ///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>, #[serde(skip_serializing_if = "Option::is_none")] pub default_license: Option, #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, pub did: Did, #[serde(skip_serializing_if = "Option::is_none")] pub display_name: Option, #[serde(skip_serializing_if = "Option::is_none")] pub follower_count: Option, #[serde(skip_serializing_if = "Option::is_none")] pub following_count: Option, pub handle: S, #[serde(skip_serializing_if = "Option::is_none")] pub indexed_at: Option, #[serde(skip_serializing_if = "Option::is_none")] pub links: Option>>, #[serde(skip_serializing_if = "Option::is_none")] pub lists: Option>>, #[serde(skip_serializing_if = "Option::is_none")] pub printers: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub pronouns: Option, ///The raw space.polymodel.actor.profile record. pub record: Data, #[serde(skip_serializing_if = "Option::is_none")] pub thing_count: Option, #[serde(skip_serializing_if = "Option::is_none")] pub total_likes: Option, #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } ///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 { #[serde(rename = "space.polymodel.actor.defs#profileView")] ProfileView(Box>), #[serde(rename = "app.bsky.actor.defs#profileViewDetailed")] ProfileViewDetailed(Box>), } impl LexiconSchema for ProfileListView { 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 LexiconSchema for ProfileView { 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(PhantomData St>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Cid = Set; 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(PhantomData St>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type Cid = St::Cid; type CreatedAt = Set; type ItemCount = St::ItemCount; type Name = St::Name; type Uri = St::Uri; } ///State transition - sets the `item_count` field to Set pub struct SetItemCount(PhantomData St>); impl sealed::Sealed for SetItemCount {} impl State for SetItemCount { type Cid = St::Cid; type CreatedAt = St::CreatedAt; type ItemCount = Set; type Name = St::Name; type Uri = St::Uri; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { type Cid = St::Cid; type CreatedAt = St::CreatedAt; type ItemCount = St::ItemCount; type Name = Set; type Uri = St::Uri; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Cid = St::Cid; type CreatedAt = St::CreatedAt; type ItemCount = St::ItemCount; type Name = St::Name; type Uri = 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 `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 St>, _fields: ( Option>, Option, Option, Option, Option, Option, Option>, ), _type: PhantomData S>, } impl ProfileListView { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ProfileListViewBuilder { ProfileListViewBuilder::new() } } impl ProfileListView { /// Create a new builder for this type pub fn builder() -> ProfileListViewBuilder { ProfileListViewBuilder::builder() } } impl ProfileListViewBuilder { /// 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 ProfileListViewBuilder { /// 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 ProfileListViewBuilder 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>, ) -> ProfileListViewBuilder, S> { self._fields.0 = Option::Some(value.into()); ProfileListViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ProfileListViewBuilder 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, ) -> ProfileListViewBuilder, S> { self._fields.1 = Option::Some(value.into()); ProfileListViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ProfileListViewBuilder { /// Set the `description` field (optional) pub fn description(mut self, value: impl Into>) -> Self { self._fields.2 = value.into(); self } /// Set the `description` field to an Option value (optional) pub fn maybe_description(mut self, value: Option) -> Self { self._fields.2 = value; self } } impl ProfileListViewBuilder 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, ) -> ProfileListViewBuilder, S> { self._fields.3 = Option::Some(value.into()); ProfileListViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ProfileListViewBuilder 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, ) -> ProfileListViewBuilder, S> { self._fields.4 = Option::Some(value.into()); ProfileListViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ProfileListViewBuilder { /// Set the `purpose` field (optional) pub fn purpose(mut self, value: impl Into>) -> Self { self._fields.5 = value.into(); self } /// Set the `purpose` field to an Option value (optional) pub fn maybe_purpose(mut self, value: Option) -> Self { self._fields.5 = value; self } } impl ProfileListViewBuilder 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>, ) -> ProfileListViewBuilder, S> { self._fields.6 = Option::Some(value.into()); ProfileListViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ProfileListViewBuilder 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 { 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>, ) -> ProfileListView { 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(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Did = Set; type Handle = St::Handle; type Record = St::Record; } ///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 Record = St::Record; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData St>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Did = St::Did; type Handle = St::Handle; type Record = 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 `record` field pub struct record(()); } } /// Builder for constructing an instance of this type. pub struct ProfileViewBuilder { _state: PhantomData St>, _fields: ( Option>, Option, Option, Option>, Option, Option, Option, Option, Option, Option>>, Option>>, Option>, Option, Option>, Option, Option, Option>, ), _type: PhantomData S>, } impl ProfileView { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ProfileViewBuilder { ProfileViewBuilder::new() } } impl ProfileView { /// Create a new builder for this type pub fn builder() -> ProfileViewBuilder { ProfileViewBuilder::builder() } } impl ProfileViewBuilder { /// 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 ProfileViewBuilder { /// 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 ProfileViewBuilder { /// Set the `avatar` field (optional) pub fn avatar(mut self, value: impl Into>>) -> Self { self._fields.0 = value.into(); self } /// Set the `avatar` field to an Option value (optional) pub fn maybe_avatar(mut self, value: Option>) -> Self { self._fields.0 = value; self } } impl ProfileViewBuilder { /// Set the `defaultLicense` field (optional) pub fn default_license(mut self, value: impl Into>) -> 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) -> Self { self._fields.1 = value; self } } impl ProfileViewBuilder { /// Set the `description` field (optional) pub fn description(mut self, value: impl Into>) -> Self { self._fields.2 = value.into(); self } /// Set the `description` field to an Option value (optional) pub fn maybe_description(mut self, value: Option) -> Self { self._fields.2 = value; self } } impl ProfileViewBuilder 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>, ) -> ProfileViewBuilder, S> { self._fields.3 = Option::Some(value.into()); ProfileViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ProfileViewBuilder { /// Set the `displayName` field (optional) pub fn display_name(mut self, value: impl Into>) -> 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) -> Self { self._fields.4 = value; self } } impl ProfileViewBuilder { /// Set the `followerCount` field (optional) pub fn follower_count(mut self, value: impl Into>) -> 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) -> Self { self._fields.5 = value; self } } impl ProfileViewBuilder { /// Set the `followingCount` field (optional) pub fn following_count(mut self, value: impl Into>) -> 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) -> Self { self._fields.6 = value; self } } impl ProfileViewBuilder 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, ) -> ProfileViewBuilder, S> { self._fields.7 = Option::Some(value.into()); ProfileViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ProfileViewBuilder { /// Set the `indexedAt` field (optional) pub fn indexed_at(mut self, value: impl Into>) -> 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) -> Self { self._fields.8 = value; self } } impl ProfileViewBuilder { /// Set the `links` field (optional) pub fn links(mut self, value: impl Into>>>) -> Self { self._fields.9 = value.into(); self } /// Set the `links` field to an Option value (optional) pub fn maybe_links(mut self, value: Option>>) -> Self { self._fields.9 = value; self } } impl ProfileViewBuilder { /// Set the `lists` field (optional) pub fn lists( mut self, value: impl Into>>>, ) -> Self { self._fields.10 = value.into(); self } /// Set the `lists` field to an Option value (optional) pub fn maybe_lists(mut self, value: Option>>) -> Self { self._fields.10 = value; self } } impl ProfileViewBuilder { /// Set the `printers` field (optional) pub fn printers(mut self, value: impl Into>>) -> Self { self._fields.11 = value.into(); self } /// Set the `printers` field to an Option value (optional) pub fn maybe_printers(mut self, value: Option>) -> Self { self._fields.11 = value; self } } impl ProfileViewBuilder { /// Set the `pronouns` field (optional) pub fn pronouns(mut self, value: impl Into>) -> Self { self._fields.12 = value.into(); self } /// Set the `pronouns` field to an Option value (optional) pub fn maybe_pronouns(mut self, value: Option) -> Self { self._fields.12 = value; self } } impl ProfileViewBuilder 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>, ) -> ProfileViewBuilder, S> { self._fields.13 = Option::Some(value.into()); ProfileViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ProfileViewBuilder { /// Set the `thingCount` field (optional) pub fn thing_count(mut self, value: impl Into>) -> 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) -> Self { self._fields.14 = value; self } } impl ProfileViewBuilder { /// Set the `totalLikes` field (optional) pub fn total_likes(mut self, value: impl Into>) -> 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) -> Self { self._fields.15 = value; self } } impl ProfileViewBuilder { /// Set the `viewer` field (optional) pub fn viewer(mut self, value: impl Into>>) -> Self { self._fields.16 = value.into(); self } /// Set the `viewer` field to an Option value (optional) pub fn maybe_viewer(mut self, value: Option>) -> Self { self._fields.16 = value; self } } impl ProfileViewBuilder 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 { 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>, ) -> ProfileView { 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), } } }