pub mod get_actor_entries;
pub mod get_actor_notebooks;
pub mod get_profile;
pub mod get_suggested_authors;
pub mod profile;
pub mod search_actors;
pub mod search_actors_typeahead;
#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::deps::bytes::Bytes;
use jacquard_common::{BosStr, CowStr, 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::{AtUri, Datetime, Did, Handle, UriValue};
use jacquard_common::types::value::Data;
use jacquard_derive::{IntoStatic, open_union};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
use crate::app_bsky::actor::ProfileViewDetailed;
use crate::com_atproto::label::Label;
use crate::com_atproto::repo::strong_ref::StrongRef;
use crate::sh_weaver::actor;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Author<S: BosStr = DefaultStr> {
pub did: Did<S>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default, with = "jacquard_common::opt_serde_bytes_helper")]
pub signature: Option<Bytes>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
pub type PinnedList<S = DefaultStr> = Vec<StrongRef<S>>;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ProfileDataView<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub collaboration_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub entry_count: Option<i64>,
#[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 inner: ProfileDataViewInner<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub notebook_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub viewer: Option<actor::ViewerState<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum ProfileDataViewInner<S: BosStr = DefaultStr> {
#[serde(rename = "sh.weaver.actor.defs#profileView")]
ProfileView(Box<actor::ProfileView<S>>),
#[serde(rename = "app.bsky.actor.defs#profileViewDetailed")]
ProfileViewDetailed(Box<ProfileViewDetailed<S>>),
#[serde(rename = "sh.weaver.actor.defs#tangledProfileView")]
TangledProfileView(Box<actor::TangledProfileView<S>>),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ProfileDataViewBasic<S: BosStr = DefaultStr> {
#[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 inner: ProfileDataViewBasicInner<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub viewer: Option<actor::ViewerStateBasic<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum ProfileDataViewBasicInner<S: BosStr = DefaultStr> {
#[serde(rename = "sh.weaver.actor.defs#profileViewBasic")]
ProfileViewBasic(Box<crate::sh_weaver::actor::ProfileViewBasic<S>>),
#[serde(rename = "app.bsky.actor.defs#profileViewBasic")]
BskyProfileViewBasic(Box<crate::app_bsky::actor::ProfileViewBasic<S>>),
#[serde(rename = "sh.weaver.actor.defs#tangledProfileView")]
TangledProfileView(Box<actor::TangledProfileView<S>>),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ProfileView<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar: Option<UriValue<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub banner: Option<UriValue<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bluesky: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<Datetime>,
#[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>,
pub handle: Handle<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub indexed_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<Label<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub links: Option<Vec<UriValue<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pinned: Option<actor::PinnedList<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pronouns: Option<actor::PronounsList<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub streamplace: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub subscribed_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub subscriber_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tangled: Option<bool>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ProfileViewBasic<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar: Option<UriValue<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<Datetime>,
pub did: Did<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<S>,
pub handle: Handle<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub indexed_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<Label<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pronouns: Option<actor::PronounsList<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
pub type PronounsList<S = DefaultStr> = Vec<S>;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct SubscribedNotebook<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<S>,
pub uri: AtUri<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct TangledProfileView<S: BosStr = DefaultStr> {
pub bluesky: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<S>,
pub did: Did<S>,
pub handle: Handle<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub links: Option<Vec<UriValue<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pinned_repositories: Option<Vec<AtUri<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stats: Option<Vec<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ViewerState<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub blocked: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub blocked_by: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub follow_requested: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub follow_requested_by: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub followed_by: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub following: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub muted: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub subscribed_notebooks: Option<Vec<actor::SubscribedNotebook<S>>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ViewerStateBasic<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub blocked: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub blocked_by: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub follow_requested: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub follow_requested_by: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub followed_by: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub following: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub muted: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub subscribed_notebook_count: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> LexiconSchema for Author<S> {
fn nsid() -> &'static str {
"sh.weaver.actor.defs"
}
fn def_name() -> &'static str {
"author"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_weaver_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ProfileDataView<S> {
fn nsid() -> &'static str {
"sh.weaver.actor.defs"
}
fn def_name() -> &'static str {
"profileDataView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_weaver_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ProfileDataViewBasic<S> {
fn nsid() -> &'static str {
"sh.weaver.actor.defs"
}
fn def_name() -> &'static str {
"profileDataViewBasic"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_weaver_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ProfileView<S> {
fn nsid() -> &'static str {
"sh.weaver.actor.defs"
}
fn def_name() -> &'static str {
"profileView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_weaver_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.description {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 10240usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("description"),
max: 10240usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.description {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 1024usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("description"),
max: 1024usize,
actual: count,
});
}
}
}
if let Some(ref value) = self.display_name {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 640usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("display_name"),
max: 640usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.display_name {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 64usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("display_name"),
max: 64usize,
actual: count,
});
}
}
}
if let Some(ref value) = self.links {
#[allow(unused_comparisons)]
if value.len() > 5usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("links"),
max: 5usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.links {
#[allow(unused_comparisons)]
if value.len() < 0usize {
return Err(ConstraintError::MinLength {
path: ValidationPath::from_field("links"),
min: 0usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.location {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 400usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("location"),
max: 400usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.location {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 40usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("location"),
max: 40usize,
actual: count,
});
}
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ProfileViewBasic<S> {
fn nsid() -> &'static str {
"sh.weaver.actor.defs"
}
fn def_name() -> &'static str {
"profileViewBasic"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_weaver_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.display_name {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 640usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("display_name"),
max: 640usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.display_name {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 64usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("display_name"),
max: 64usize,
actual: count,
});
}
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SubscribedNotebook<S> {
fn nsid() -> &'static str {
"sh.weaver.actor.defs"
}
fn def_name() -> &'static str {
"subscribedNotebook"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_weaver_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for TangledProfileView<S> {
fn nsid() -> &'static str {
"sh.weaver.actor.defs"
}
fn def_name() -> &'static str {
"tangledProfileView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_weaver_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.description {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2560usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("description"),
max: 2560usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.description {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 256usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("description"),
max: 256usize,
actual: count,
});
}
}
}
if let Some(ref value) = self.links {
#[allow(unused_comparisons)]
if value.len() > 5usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("links"),
max: 5usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.links {
#[allow(unused_comparisons)]
if value.len() < 0usize {
return Err(ConstraintError::MinLength {
path: ValidationPath::from_field("links"),
min: 0usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.location {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 400usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("location"),
max: 400usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.location {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 40usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("location"),
max: 40usize,
actual: count,
});
}
}
}
if let Some(ref value) = self.pinned_repositories {
#[allow(unused_comparisons)]
if value.len() > 6usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("pinned_repositories"),
max: 6usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.pinned_repositories {
#[allow(unused_comparisons)]
if value.len() < 0usize {
return Err(ConstraintError::MinLength {
path: ValidationPath::from_field("pinned_repositories"),
min: 0usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.stats {
#[allow(unused_comparisons)]
if value.len() > 2usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("stats"),
max: 2usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.stats {
#[allow(unused_comparisons)]
if value.len() < 0usize {
return Err(ConstraintError::MinLength {
path: ValidationPath::from_field("stats"),
min: 0usize,
actual: value.len(),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ViewerState<S> {
fn nsid() -> &'static str {
"sh.weaver.actor.defs"
}
fn def_name() -> &'static str {
"viewerState"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_weaver_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ViewerStateBasic<S> {
fn nsid() -> &'static str {
"sh.weaver.actor.defs"
}
fn def_name() -> &'static str {
"viewerStateBasic"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_weaver_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
pub mod author_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Did;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
}
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>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
}
}
pub struct AuthorBuilder<S: BosStr, St: author_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Did<S>>, Option<Bytes>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Author<S> {
pub fn new() -> AuthorBuilder<S, author_state::Empty> {
AuthorBuilder::new()
}
}
impl<S: BosStr> AuthorBuilder<S, author_state::Empty> {
pub fn new() -> Self {
AuthorBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> AuthorBuilder<S, St>
where
St: author_state::State,
St::Did: author_state::IsUnset,
{
pub fn did(mut self, value: impl Into<Did<S>>) -> AuthorBuilder<S, author_state::SetDid<St>> {
self._fields.0 = Option::Some(value.into());
AuthorBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: author_state::State> AuthorBuilder<S, St> {
pub fn signature(mut self, value: impl Into<Option<Bytes>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_signature(mut self, value: Option<Bytes>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> AuthorBuilder<S, St>
where
St: author_state::State,
St::Did: author_state::IsSet,
{
pub fn build(self) -> Author<S> {
Author {
did: self._fields.0.unwrap(),
signature: self._fields.1,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Author<S> {
Author {
did: self._fields.0.unwrap(),
signature: self._fields.1,
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_sh_weaver_actor_defs() -> LexiconDoc<'static> {
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("sh.weaver.actor.defs"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("author"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("A single author in a Weaver notebook.")),
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.insert(
SmolStr::new_static("signature"),
LexObjectProperty::Bytes(LexBytes {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pinnedList"),
LexUserType::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.repo.strongRef"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profileDataView"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("inner")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("collaborationCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("entryCount"),
LexObjectProperty::Integer(LexInteger {
..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("inner"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#profileView"),
CowStr::new_static("app.bsky.actor.defs#profileViewDetailed"),
CowStr::new_static("#tangledProfileView"),
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("notebookCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("viewer"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#viewerState"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profileDataViewBasic"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("inner")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
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("inner"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#profileViewBasic"),
CowStr::new_static("app.bsky.actor.defs#profileViewBasic"),
CowStr::new_static("#tangledProfileView"),
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("viewer"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#viewerStateBasic"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profileView"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("did"), SmolStr::new_static("handle")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("avatar"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("banner"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("bluesky"),
LexObjectProperty::Boolean(LexBoolean {
..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 {
max_length: Some(10240usize),
max_graphemes: Some(1024usize),
..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 {
max_length: Some(640usize),
max_graphemes: Some(64usize),
..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("labels"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.label.defs#label"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("links"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
description: Some(
CowStr::new_static(
"Any URI, intended for social profiles or websites, can be used to link DIDs/AT-URIs too.",
),
),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
min_length: Some(0usize),
max_length: Some(5usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("location"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Free-form location text."),
),
max_length: Some(400usize),
max_graphemes: Some(40usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pinned"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#pinnedList"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pronouns"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#pronounsList"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("streamplace"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subscribedCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subscriberCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tangled"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profileViewBasic"),
LexUserType::Object(LexObject {
required: Some(vec![
SmolStr::new_static("did"),
SmolStr::new_static("handle"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("avatar"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
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("displayName"),
LexObjectProperty::String(LexString {
max_length: Some(640usize),
max_graphemes: Some(64usize),
..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("labels"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.label.defs#label"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pronouns"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#pronounsList"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pronounsList"),
LexUserType::Array(LexArray {
items: LexArrayItem::String(LexString {
max_length: Some(500usize),
max_graphemes: Some(50usize),
..Default::default()
}),
max_length: Some(5usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subscribedNotebook"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static(
"A notebook the viewer subscribes to without a global follow.",
)),
required: Some(vec![SmolStr::new_static("uri")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("path"),
LexObjectProperty::String(LexString {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("title"),
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("tangledProfileView"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("bluesky"), SmolStr::new_static("did"),
SmolStr::new_static("handle")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("bluesky"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("description"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Free-form profile description text."),
),
max_length: Some(2560usize),
max_graphemes: Some(256usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("handle"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Handle),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("links"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
description: Some(
CowStr::new_static(
"Any URI, intended for social profiles or websites, can be used to link DIDs/AT-URIs too.",
),
),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
min_length: Some(0usize),
max_length: Some(5usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("location"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Free-form location text."),
),
max_length: Some(400usize),
max_graphemes: Some(40usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pinnedRepositories"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Any ATURI, it is up to appviews to validate these fields.",
),
),
items: LexArrayItem::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
min_length: Some(0usize),
max_length: Some(6usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("stats"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
description: Some(CowStr::new_static("Vanity stats.")),
..Default::default()
}),
min_length: Some(0usize),
max_length: Some(2usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("viewerState"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static(
"Viewer's relationship state with an actor (detailed version).",
)),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("blocked"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("blockedBy"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("followRequested"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("followRequestedBy"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("followedBy"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("following"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("muted"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subscribedNotebooks"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#subscribedNotebook"),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("viewerStateBasic"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static(
"Viewer's relationship state with an actor (basic version).",
)),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("blocked"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("blockedBy"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("followRequested"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("followRequestedBy"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("followedBy"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("following"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("muted"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subscribedNotebookCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod profile_data_view_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Inner;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Inner = Unset;
}
pub struct SetInner<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetInner<St> {}
impl<St: State> State for SetInner<St> {
type Inner = Set<members::inner>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct inner(());
}
}
pub struct ProfileDataViewBuilder<S: BosStr, St: profile_data_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<i64>,
Option<i64>,
Option<i64>,
Option<i64>,
Option<ProfileDataViewInner<S>>,
Option<i64>,
Option<actor::ViewerState<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ProfileDataView<S> {
pub fn new() -> ProfileDataViewBuilder<S, profile_data_view_state::Empty> {
ProfileDataViewBuilder::new()
}
}
impl<S: BosStr> ProfileDataViewBuilder<S, profile_data_view_state::Empty> {
pub fn new() -> Self {
ProfileDataViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_data_view_state::State> ProfileDataViewBuilder<S, St> {
pub fn collaboration_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_collaboration_count(mut self, value: Option<i64>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: profile_data_view_state::State> ProfileDataViewBuilder<S, St> {
pub fn entry_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_entry_count(mut self, value: Option<i64>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: profile_data_view_state::State> ProfileDataViewBuilder<S, St> {
pub fn follower_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_follower_count(mut self, value: Option<i64>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: profile_data_view_state::State> ProfileDataViewBuilder<S, St> {
pub fn following_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_following_count(mut self, value: Option<i64>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> ProfileDataViewBuilder<S, St>
where
St: profile_data_view_state::State,
St::Inner: profile_data_view_state::IsUnset,
{
pub fn inner(
mut self,
value: impl Into<ProfileDataViewInner<S>>,
) -> ProfileDataViewBuilder<S, profile_data_view_state::SetInner<St>> {
self._fields.4 = Option::Some(value.into());
ProfileDataViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_data_view_state::State> ProfileDataViewBuilder<S, St> {
pub fn notebook_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_notebook_count(mut self, value: Option<i64>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St: profile_data_view_state::State> ProfileDataViewBuilder<S, St> {
pub fn viewer(mut self, value: impl Into<Option<actor::ViewerState<S>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_viewer(mut self, value: Option<actor::ViewerState<S>>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St> ProfileDataViewBuilder<S, St>
where
St: profile_data_view_state::State,
St::Inner: profile_data_view_state::IsSet,
{
pub fn build(self) -> ProfileDataView<S> {
ProfileDataView {
collaboration_count: self._fields.0,
entry_count: self._fields.1,
follower_count: self._fields.2,
following_count: self._fields.3,
inner: self._fields.4.unwrap(),
notebook_count: self._fields.5,
viewer: self._fields.6,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ProfileDataView<S> {
ProfileDataView {
collaboration_count: self._fields.0,
entry_count: self._fields.1,
follower_count: self._fields.2,
following_count: self._fields.3,
inner: self._fields.4.unwrap(),
notebook_count: self._fields.5,
viewer: self._fields.6,
extra_data: Some(extra_data),
}
}
}
pub mod profile_data_view_basic_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Inner;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Inner = Unset;
}
pub struct SetInner<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetInner<St> {}
impl<St: State> State for SetInner<St> {
type Inner = Set<members::inner>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct inner(());
}
}
pub struct ProfileDataViewBasicBuilder<S: BosStr, St: profile_data_view_basic_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<i64>,
Option<i64>,
Option<ProfileDataViewBasicInner<S>>,
Option<actor::ViewerStateBasic<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ProfileDataViewBasic<S> {
pub fn new() -> ProfileDataViewBasicBuilder<S, profile_data_view_basic_state::Empty> {
ProfileDataViewBasicBuilder::new()
}
}
impl<S: BosStr> ProfileDataViewBasicBuilder<S, profile_data_view_basic_state::Empty> {
pub fn new() -> Self {
ProfileDataViewBasicBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_data_view_basic_state::State> ProfileDataViewBasicBuilder<S, St> {
pub fn follower_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_follower_count(mut self, value: Option<i64>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: profile_data_view_basic_state::State> ProfileDataViewBasicBuilder<S, St> {
pub fn following_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_following_count(mut self, value: Option<i64>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> ProfileDataViewBasicBuilder<S, St>
where
St: profile_data_view_basic_state::State,
St::Inner: profile_data_view_basic_state::IsUnset,
{
pub fn inner(
mut self,
value: impl Into<ProfileDataViewBasicInner<S>>,
) -> ProfileDataViewBasicBuilder<S, profile_data_view_basic_state::SetInner<St>> {
self._fields.2 = Option::Some(value.into());
ProfileDataViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_data_view_basic_state::State> ProfileDataViewBasicBuilder<S, St> {
pub fn viewer(mut self, value: impl Into<Option<actor::ViewerStateBasic<S>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_viewer(mut self, value: Option<actor::ViewerStateBasic<S>>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> ProfileDataViewBasicBuilder<S, St>
where
St: profile_data_view_basic_state::State,
St::Inner: profile_data_view_basic_state::IsSet,
{
pub fn build(self) -> ProfileDataViewBasic<S> {
ProfileDataViewBasic {
follower_count: self._fields.0,
following_count: self._fields.1,
inner: self._fields.2.unwrap(),
viewer: self._fields.3,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> ProfileDataViewBasic<S> {
ProfileDataViewBasic {
follower_count: self._fields.0,
following_count: self._fields.1,
inner: self._fields.2.unwrap(),
viewer: self._fields.3,
extra_data: Some(extra_data),
}
}
}
pub mod profile_view_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Handle;
type Did;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Handle = Unset;
type Did = Unset;
}
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 Handle = Set<members::handle>;
type Did = St::Did;
}
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 Handle = St::Handle;
type Did = Set<members::did>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct handle(());
pub struct did(());
}
}
pub struct ProfileViewBuilder<S: BosStr, St: profile_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<UriValue<S>>,
Option<UriValue<S>>,
Option<bool>,
Option<Datetime>,
Option<S>,
Option<Did<S>>,
Option<S>,
Option<Handle<S>>,
Option<Datetime>,
Option<Vec<Label<S>>>,
Option<Vec<UriValue<S>>>,
Option<S>,
Option<actor::PinnedList<S>>,
Option<actor::PronounsList<S>>,
Option<bool>,
Option<i64>,
Option<i64>,
Option<bool>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ProfileView<S> {
pub fn new() -> ProfileViewBuilder<S, profile_view_state::Empty> {
ProfileViewBuilder::new()
}
}
impl<S: BosStr> ProfileViewBuilder<S, profile_view_state::Empty> {
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, None,
),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn avatar(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_avatar(mut self, value: Option<UriValue<S>>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn banner(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_banner(mut self, value: Option<UriValue<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn bluesky(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_bluesky(mut self, value: Option<bool>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn created_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_created_at(mut self, value: Option<Datetime>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn description(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_description(mut self, value: Option<S>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> ProfileViewBuilder<S, St>
where
St: profile_view_state::State,
St::Did: profile_view_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> ProfileViewBuilder<S, profile_view_state::SetDid<St>> {
self._fields.5 = Option::Some(value.into());
ProfileViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn display_name(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_display_name(mut self, value: Option<S>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St> ProfileViewBuilder<S, St>
where
St: profile_view_state::State,
St::Handle: profile_view_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<S>>,
) -> ProfileViewBuilder<S, profile_view_state::SetHandle<St>> {
self._fields.7 = Option::Some(value.into());
ProfileViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn indexed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_indexed_at(mut self, value: Option<Datetime>) -> Self {
self._fields.8 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
self._fields.9 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn links(mut self, value: impl Into<Option<Vec<UriValue<S>>>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_links(mut self, value: Option<Vec<UriValue<S>>>) -> Self {
self._fields.10 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn location(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_location(mut self, value: Option<S>) -> Self {
self._fields.11 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn pinned(mut self, value: impl Into<Option<actor::PinnedList<S>>>) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_pinned(mut self, value: Option<actor::PinnedList<S>>) -> Self {
self._fields.12 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn pronouns(mut self, value: impl Into<Option<actor::PronounsList<S>>>) -> Self {
self._fields.13 = value.into();
self
}
pub fn maybe_pronouns(mut self, value: Option<actor::PronounsList<S>>) -> Self {
self._fields.13 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn streamplace(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.14 = value.into();
self
}
pub fn maybe_streamplace(mut self, value: Option<bool>) -> Self {
self._fields.14 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn subscribed_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.15 = value.into();
self
}
pub fn maybe_subscribed_count(mut self, value: Option<i64>) -> Self {
self._fields.15 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn subscriber_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.16 = value.into();
self
}
pub fn maybe_subscriber_count(mut self, value: Option<i64>) -> Self {
self._fields.16 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn tangled(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.17 = value.into();
self
}
pub fn maybe_tangled(mut self, value: Option<bool>) -> Self {
self._fields.17 = value;
self
}
}
impl<S: BosStr, St> ProfileViewBuilder<S, St>
where
St: profile_view_state::State,
St::Handle: profile_view_state::IsSet,
St::Did: profile_view_state::IsSet,
{
pub fn build(self) -> ProfileView<S> {
ProfileView {
avatar: self._fields.0,
banner: self._fields.1,
bluesky: self._fields.2,
created_at: self._fields.3,
description: self._fields.4,
did: self._fields.5.unwrap(),
display_name: self._fields.6,
handle: self._fields.7.unwrap(),
indexed_at: self._fields.8,
labels: self._fields.9,
links: self._fields.10,
location: self._fields.11,
pinned: self._fields.12,
pronouns: self._fields.13,
streamplace: self._fields.14,
subscribed_count: self._fields.15,
subscriber_count: self._fields.16,
tangled: self._fields.17,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ProfileView<S> {
ProfileView {
avatar: self._fields.0,
banner: self._fields.1,
bluesky: self._fields.2,
created_at: self._fields.3,
description: self._fields.4,
did: self._fields.5.unwrap(),
display_name: self._fields.6,
handle: self._fields.7.unwrap(),
indexed_at: self._fields.8,
labels: self._fields.9,
links: self._fields.10,
location: self._fields.11,
pinned: self._fields.12,
pronouns: self._fields.13,
streamplace: self._fields.14,
subscribed_count: self._fields.15,
subscriber_count: self._fields.16,
tangled: self._fields.17,
extra_data: Some(extra_data),
}
}
}
pub mod profile_view_basic_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Did;
type Handle;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
type Handle = Unset;
}
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;
}
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>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
pub struct handle(());
}
}
pub struct ProfileViewBasicBuilder<S: BosStr, St: profile_view_basic_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<UriValue<S>>,
Option<Datetime>,
Option<Did<S>>,
Option<S>,
Option<Handle<S>>,
Option<Datetime>,
Option<Vec<Label<S>>>,
Option<actor::PronounsList<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ProfileViewBasic<S> {
pub fn new() -> ProfileViewBasicBuilder<S, profile_view_basic_state::Empty> {
ProfileViewBasicBuilder::new()
}
}
impl<S: BosStr> ProfileViewBasicBuilder<S, profile_view_basic_state::Empty> {
pub fn new() -> Self {
ProfileViewBasicBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn avatar(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_avatar(mut self, value: Option<UriValue<S>>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn created_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_created_at(mut self, value: Option<Datetime>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> ProfileViewBasicBuilder<S, St>
where
St: profile_view_basic_state::State,
St::Did: profile_view_basic_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> ProfileViewBasicBuilder<S, profile_view_basic_state::SetDid<St>> {
self._fields.2 = Option::Some(value.into());
ProfileViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn display_name(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_display_name(mut self, value: Option<S>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> ProfileViewBasicBuilder<S, St>
where
St: profile_view_basic_state::State,
St::Handle: profile_view_basic_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<S>>,
) -> ProfileViewBasicBuilder<S, profile_view_basic_state::SetHandle<St>> {
self._fields.4 = Option::Some(value.into());
ProfileViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn indexed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_indexed_at(mut self, value: Option<Datetime>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn pronouns(mut self, value: impl Into<Option<actor::PronounsList<S>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_pronouns(mut self, value: Option<actor::PronounsList<S>>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St> ProfileViewBasicBuilder<S, St>
where
St: profile_view_basic_state::State,
St::Did: profile_view_basic_state::IsSet,
St::Handle: profile_view_basic_state::IsSet,
{
pub fn build(self) -> ProfileViewBasic<S> {
ProfileViewBasic {
avatar: self._fields.0,
created_at: self._fields.1,
did: self._fields.2.unwrap(),
display_name: self._fields.3,
handle: self._fields.4.unwrap(),
indexed_at: self._fields.5,
labels: self._fields.6,
pronouns: self._fields.7,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ProfileViewBasic<S> {
ProfileViewBasic {
avatar: self._fields.0,
created_at: self._fields.1,
did: self._fields.2.unwrap(),
display_name: self._fields.3,
handle: self._fields.4.unwrap(),
indexed_at: self._fields.5,
labels: self._fields.6,
pronouns: self._fields.7,
extra_data: Some(extra_data),
}
}
}
pub mod subscribed_notebook_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
}
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 Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
}
}
pub struct SubscribedNotebookBuilder<S: BosStr, St: subscribed_notebook_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<S>, Option<AtUri<S>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> SubscribedNotebook<S> {
pub fn new() -> SubscribedNotebookBuilder<S, subscribed_notebook_state::Empty> {
SubscribedNotebookBuilder::new()
}
}
impl<S: BosStr> SubscribedNotebookBuilder<S, subscribed_notebook_state::Empty> {
pub fn new() -> Self {
SubscribedNotebookBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: subscribed_notebook_state::State> SubscribedNotebookBuilder<S, St> {
pub fn path(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_path(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: subscribed_notebook_state::State> SubscribedNotebookBuilder<S, St> {
pub fn title(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_title(mut self, value: Option<S>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> SubscribedNotebookBuilder<S, St>
where
St: subscribed_notebook_state::State,
St::Uri: subscribed_notebook_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> SubscribedNotebookBuilder<S, subscribed_notebook_state::SetUri<St>> {
self._fields.2 = Option::Some(value.into());
SubscribedNotebookBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SubscribedNotebookBuilder<S, St>
where
St: subscribed_notebook_state::State,
St::Uri: subscribed_notebook_state::IsSet,
{
pub fn build(self) -> SubscribedNotebook<S> {
SubscribedNotebook {
path: self._fields.0,
title: self._fields.1,
uri: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> SubscribedNotebook<S> {
SubscribedNotebook {
path: self._fields.0,
title: self._fields.1,
uri: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod tangled_profile_view_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Bluesky;
type Did;
type Handle;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Bluesky = Unset;
type Did = Unset;
type Handle = Unset;
}
pub struct SetBluesky<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetBluesky<St> {}
impl<St: State> State for SetBluesky<St> {
type Bluesky = Set<members::bluesky>;
type Did = St::Did;
type Handle = St::Handle;
}
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 Bluesky = St::Bluesky;
type Did = Set<members::did>;
type Handle = St::Handle;
}
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 Bluesky = St::Bluesky;
type Did = St::Did;
type Handle = Set<members::handle>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct bluesky(());
pub struct did(());
pub struct handle(());
}
}
pub struct TangledProfileViewBuilder<S: BosStr, St: tangled_profile_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<bool>,
Option<S>,
Option<Did<S>>,
Option<Handle<S>>,
Option<Vec<UriValue<S>>>,
Option<S>,
Option<Vec<AtUri<S>>>,
Option<Vec<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> TangledProfileView<S> {
pub fn new() -> TangledProfileViewBuilder<S, tangled_profile_view_state::Empty> {
TangledProfileViewBuilder::new()
}
}
impl<S: BosStr> TangledProfileViewBuilder<S, tangled_profile_view_state::Empty> {
pub fn new() -> Self {
TangledProfileViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> TangledProfileViewBuilder<S, St>
where
St: tangled_profile_view_state::State,
St::Bluesky: tangled_profile_view_state::IsUnset,
{
pub fn bluesky(
mut self,
value: impl Into<bool>,
) -> TangledProfileViewBuilder<S, tangled_profile_view_state::SetBluesky<St>> {
self._fields.0 = Option::Some(value.into());
TangledProfileViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: tangled_profile_view_state::State> TangledProfileViewBuilder<S, St> {
pub fn description(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_description(mut self, value: Option<S>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> TangledProfileViewBuilder<S, St>
where
St: tangled_profile_view_state::State,
St::Did: tangled_profile_view_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> TangledProfileViewBuilder<S, tangled_profile_view_state::SetDid<St>> {
self._fields.2 = Option::Some(value.into());
TangledProfileViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> TangledProfileViewBuilder<S, St>
where
St: tangled_profile_view_state::State,
St::Handle: tangled_profile_view_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<S>>,
) -> TangledProfileViewBuilder<S, tangled_profile_view_state::SetHandle<St>> {
self._fields.3 = Option::Some(value.into());
TangledProfileViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: tangled_profile_view_state::State> TangledProfileViewBuilder<S, St> {
pub fn links(mut self, value: impl Into<Option<Vec<UriValue<S>>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_links(mut self, value: Option<Vec<UriValue<S>>>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St: tangled_profile_view_state::State> TangledProfileViewBuilder<S, St> {
pub fn location(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_location(mut self, value: Option<S>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St: tangled_profile_view_state::State> TangledProfileViewBuilder<S, St> {
pub fn pinned_repositories(mut self, value: impl Into<Option<Vec<AtUri<S>>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_pinned_repositories(mut self, value: Option<Vec<AtUri<S>>>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St: tangled_profile_view_state::State> TangledProfileViewBuilder<S, St> {
pub fn stats(mut self, value: impl Into<Option<Vec<S>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_stats(mut self, value: Option<Vec<S>>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St> TangledProfileViewBuilder<S, St>
where
St: tangled_profile_view_state::State,
St::Bluesky: tangled_profile_view_state::IsSet,
St::Did: tangled_profile_view_state::IsSet,
St::Handle: tangled_profile_view_state::IsSet,
{
pub fn build(self) -> TangledProfileView<S> {
TangledProfileView {
bluesky: self._fields.0.unwrap(),
description: self._fields.1,
did: self._fields.2.unwrap(),
handle: self._fields.3.unwrap(),
links: self._fields.4,
location: self._fields.5,
pinned_repositories: self._fields.6,
stats: self._fields.7,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> TangledProfileView<S> {
TangledProfileView {
bluesky: self._fields.0.unwrap(),
description: self._fields.1,
did: self._fields.2.unwrap(),
handle: self._fields.3.unwrap(),
links: self._fields.4,
location: self._fields.5,
pinned_repositories: self._fields.6,
stats: self._fields.7,
extra_data: Some(extra_data),
}
}
}