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::CowStr;
use jacquard_common::deps::bytes::Bytes;
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::types::string::{Did, Handle, AtUri, Datetime, UriValue};
use jacquard_derive::{IntoStatic, lexicon, open_union};
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::com_atproto::label::Label;
use crate::com_atproto::repo::strong_ref::StrongRef;
use crate::sh_weaver::actor;
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Author<'a> {
#[serde(borrow)]
pub did: Did<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default, with = "jacquard_common::opt_serde_bytes_helper")]
pub signature: Option<Bytes>,
}
pub type PinnedList<'a> = Vec<StrongRef<'a>>;
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ProfileDataView<'a> {
#[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>,
#[serde(borrow)]
pub inner: ProfileDataViewInner<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
pub notebook_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub viewer: Option<actor::ViewerState<'a>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ProfileDataViewInner<'a> {
#[serde(rename = "sh.weaver.actor.defs#profileView")]
ProfileView(Box<actor::ProfileView<'a>>),
#[serde(rename = "app.bsky.actor.defs#profileViewDetailed")]
ProfileViewDetailed(Box<ProfileViewDetailed<'a>>),
#[serde(rename = "sh.weaver.actor.defs#tangledProfileView")]
TangledProfileView(Box<actor::TangledProfileView<'a>>),
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ProfileDataViewBasic<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub follower_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub following_count: Option<i64>,
#[serde(borrow)]
pub inner: ProfileDataViewBasicInner<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub viewer: Option<actor::ViewerStateBasic<'a>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ProfileDataViewBasicInner<'a> {
#[serde(rename = "sh.weaver.actor.defs#profileViewBasic")]
ProfileViewBasic(Box<crate::sh_weaver::actor::ProfileViewBasic<'a>>),
#[serde(rename = "app.bsky.actor.defs#profileViewBasic")]
BskyProfileViewBasic(Box<crate::app_bsky::actor::ProfileViewBasic<'a>>),
#[serde(rename = "sh.weaver.actor.defs#tangledProfileView")]
TangledProfileView(Box<actor::TangledProfileView<'a>>),
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ProfileView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub avatar: Option<UriValue<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub banner: Option<UriValue<'a>>,
#[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")]
#[serde(borrow)]
pub description: Option<CowStr<'a>>,
#[serde(borrow)]
pub did: Did<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub display_name: Option<CowStr<'a>>,
#[serde(borrow)]
pub handle: Handle<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
pub indexed_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub labels: Option<Vec<Label<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub links: Option<Vec<UriValue<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub location: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub pinned: Option<actor::PinnedList<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub pronouns: Option<actor::PronounsList<'a>>,
#[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>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ProfileViewBasic<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub avatar: Option<UriValue<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<Datetime>,
#[serde(borrow)]
pub did: Did<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub display_name: Option<CowStr<'a>>,
#[serde(borrow)]
pub handle: Handle<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
pub indexed_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub labels: Option<Vec<Label<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub pronouns: Option<actor::PronounsList<'a>>,
}
pub type PronounsList<'a> = Vec<CowStr<'a>>;
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SubscribedNotebook<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub path: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub title: Option<CowStr<'a>>,
#[serde(borrow)]
pub uri: AtUri<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct TangledProfileView<'a> {
pub bluesky: bool,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub description: Option<CowStr<'a>>,
#[serde(borrow)]
pub did: Did<'a>,
#[serde(borrow)]
pub handle: Handle<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub links: Option<Vec<UriValue<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub location: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub pinned_repositories: Option<Vec<AtUri<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub stats: Option<Vec<CowStr<'a>>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ViewerState<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub blocked: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub blocked_by: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub follow_requested: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub follow_requested_by: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub followed_by: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub following: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub muted: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub subscribed_notebooks: Option<Vec<actor::SubscribedNotebook<'a>>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ViewerStateBasic<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub blocked: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub blocked_by: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub follow_requested: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub follow_requested_by: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub followed_by: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub following: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub muted: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub subscribed_notebook_count: Option<i64>,
}
impl<'a> LexiconSchema for Author<'a> {
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<'a> LexiconSchema for ProfileDataView<'a> {
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<'a> LexiconSchema for ProfileDataViewBasic<'a> {
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<'a> LexiconSchema for ProfileView<'a> {
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<'a> LexiconSchema for ProfileViewBasic<'a> {
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<'a> LexiconSchema for SubscribedNotebook<'a> {
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<'a> LexiconSchema for TangledProfileView<'a> {
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<'a> LexiconSchema for ViewerState<'a> {
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<'a> LexiconSchema for ViewerStateBasic<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Did = Set<members::did>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
}
}
pub struct AuthorBuilder<'a, S: author_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<Did<'a>>, Option<Bytes>),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> Author<'a> {
pub fn new() -> AuthorBuilder<'a, author_state::Empty> {
AuthorBuilder::new()
}
}
impl<'a> AuthorBuilder<'a, author_state::Empty> {
pub fn new() -> Self {
AuthorBuilder {
_state: PhantomData,
_fields: (None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> AuthorBuilder<'a, S>
where
S: author_state::State,
S::Did: author_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<'a>>,
) -> AuthorBuilder<'a, author_state::SetDid<S>> {
self._fields.0 = Option::Some(value.into());
AuthorBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: author_state::State> AuthorBuilder<'a, S> {
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<'a, S> AuthorBuilder<'a, S>
where
S: author_state::State,
S::Did: author_state::IsSet,
{
pub fn build(self) -> Author<'a> {
Author {
did: self._fields.0.unwrap(),
signature: self._fields.1,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> Author<'a> {
Author {
did: self._fields.0.unwrap(),
signature: self._fields.1,
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_sh_weaver_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("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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetInner<S> {}
impl<S: State> State for SetInner<S> {
type Inner = Set<members::inner>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct inner(());
}
}
pub struct ProfileDataViewBuilder<'a, S: profile_data_view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<i64>,
Option<i64>,
Option<i64>,
Option<i64>,
Option<ProfileDataViewInner<'a>>,
Option<i64>,
Option<actor::ViewerState<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ProfileDataView<'a> {
pub fn new() -> ProfileDataViewBuilder<'a, profile_data_view_state::Empty> {
ProfileDataViewBuilder::new()
}
}
impl<'a> ProfileDataViewBuilder<'a, profile_data_view_state::Empty> {
pub fn new() -> Self {
ProfileDataViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> {
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<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> {
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<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> {
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<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> {
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<'a, S> ProfileDataViewBuilder<'a, S>
where
S: profile_data_view_state::State,
S::Inner: profile_data_view_state::IsUnset,
{
pub fn inner(
mut self,
value: impl Into<ProfileDataViewInner<'a>>,
) -> ProfileDataViewBuilder<'a, profile_data_view_state::SetInner<S>> {
self._fields.4 = Option::Some(value.into());
ProfileDataViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> {
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<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> {
pub fn viewer(mut self, value: impl Into<Option<actor::ViewerState<'a>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_viewer(mut self, value: Option<actor::ViewerState<'a>>) -> Self {
self._fields.6 = value;
self
}
}
impl<'a, S> ProfileDataViewBuilder<'a, S>
where
S: profile_data_view_state::State,
S::Inner: profile_data_view_state::IsSet,
{
pub fn build(self) -> ProfileDataView<'a> {
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<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> ProfileDataView<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetInner<S> {}
impl<S: State> State for SetInner<S> {
type Inner = Set<members::inner>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct inner(());
}
}
pub struct ProfileDataViewBasicBuilder<'a, S: profile_data_view_basic_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<i64>,
Option<i64>,
Option<ProfileDataViewBasicInner<'a>>,
Option<actor::ViewerStateBasic<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ProfileDataViewBasic<'a> {
pub fn new() -> ProfileDataViewBasicBuilder<
'a,
profile_data_view_basic_state::Empty,
> {
ProfileDataViewBasicBuilder::new()
}
}
impl<'a> ProfileDataViewBasicBuilder<'a, profile_data_view_basic_state::Empty> {
pub fn new() -> Self {
ProfileDataViewBasicBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_data_view_basic_state::State> ProfileDataViewBasicBuilder<'a, S> {
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<'a, S: profile_data_view_basic_state::State> ProfileDataViewBasicBuilder<'a, S> {
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<'a, S> ProfileDataViewBasicBuilder<'a, S>
where
S: profile_data_view_basic_state::State,
S::Inner: profile_data_view_basic_state::IsUnset,
{
pub fn inner(
mut self,
value: impl Into<ProfileDataViewBasicInner<'a>>,
) -> ProfileDataViewBasicBuilder<'a, profile_data_view_basic_state::SetInner<S>> {
self._fields.2 = Option::Some(value.into());
ProfileDataViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_data_view_basic_state::State> ProfileDataViewBasicBuilder<'a, S> {
pub fn viewer(
mut self,
value: impl Into<Option<actor::ViewerStateBasic<'a>>>,
) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_viewer(mut self, value: Option<actor::ViewerStateBasic<'a>>) -> Self {
self._fields.3 = value;
self
}
}
impl<'a, S> ProfileDataViewBasicBuilder<'a, S>
where
S: profile_data_view_basic_state::State,
S::Inner: profile_data_view_basic_state::IsSet,
{
pub fn build(self) -> ProfileDataViewBasic<'a> {
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<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> ProfileDataViewBasic<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetHandle<S> {}
impl<S: State> State for SetHandle<S> {
type Handle = Set<members::handle>;
type Did = S::Did;
}
pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Handle = S::Handle;
type Did = Set<members::did>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct handle(());
pub struct did(());
}
}
pub struct ProfileViewBuilder<'a, S: profile_view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<UriValue<'a>>,
Option<UriValue<'a>>,
Option<bool>,
Option<Datetime>,
Option<CowStr<'a>>,
Option<Did<'a>>,
Option<CowStr<'a>>,
Option<Handle<'a>>,
Option<Datetime>,
Option<Vec<Label<'a>>>,
Option<Vec<UriValue<'a>>>,
Option<CowStr<'a>>,
Option<actor::PinnedList<'a>>,
Option<actor::PronounsList<'a>>,
Option<bool>,
Option<i64>,
Option<i64>,
Option<bool>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ProfileView<'a> {
pub fn new() -> ProfileViewBuilder<'a, profile_view_state::Empty> {
ProfileViewBuilder::new()
}
}
impl<'a> ProfileViewBuilder<'a, 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,
),
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn avatar(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_avatar(mut self, value: Option<UriValue<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn banner(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_banner(mut self, value: Option<UriValue<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
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<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
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<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn description(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_description(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S> ProfileViewBuilder<'a, S>
where
S: profile_view_state::State,
S::Did: profile_view_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<'a>>,
) -> ProfileViewBuilder<'a, profile_view_state::SetDid<S>> {
self._fields.5 = Option::Some(value.into());
ProfileViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn display_name(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_display_name(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.6 = value;
self
}
}
impl<'a, S> ProfileViewBuilder<'a, S>
where
S: profile_view_state::State,
S::Handle: profile_view_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<'a>>,
) -> ProfileViewBuilder<'a, profile_view_state::SetHandle<S>> {
self._fields.7 = Option::Some(value.into());
ProfileViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
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<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
self._fields.9 = value;
self
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn links(mut self, value: impl Into<Option<Vec<UriValue<'a>>>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_links(mut self, value: Option<Vec<UriValue<'a>>>) -> Self {
self._fields.10 = value;
self
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn location(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_location(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.11 = value;
self
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn pinned(mut self, value: impl Into<Option<actor::PinnedList<'a>>>) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_pinned(mut self, value: Option<actor::PinnedList<'a>>) -> Self {
self._fields.12 = value;
self
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn pronouns(
mut self,
value: impl Into<Option<actor::PronounsList<'a>>>,
) -> Self {
self._fields.13 = value.into();
self
}
pub fn maybe_pronouns(mut self, value: Option<actor::PronounsList<'a>>) -> Self {
self._fields.13 = value;
self
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
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<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
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<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
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<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
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<'a, S> ProfileViewBuilder<'a, S>
where
S: profile_view_state::State,
S::Handle: profile_view_state::IsSet,
S::Did: profile_view_state::IsSet,
{
pub fn build(self) -> ProfileView<'a> {
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<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> ProfileView<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Did = Set<members::did>;
type Handle = S::Handle;
}
pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetHandle<S> {}
impl<S: State> State for SetHandle<S> {
type Did = S::Did;
type Handle = Set<members::handle>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
pub struct handle(());
}
}
pub struct ProfileViewBasicBuilder<'a, S: profile_view_basic_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<UriValue<'a>>,
Option<Datetime>,
Option<Did<'a>>,
Option<CowStr<'a>>,
Option<Handle<'a>>,
Option<Datetime>,
Option<Vec<Label<'a>>>,
Option<actor::PronounsList<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ProfileViewBasic<'a> {
pub fn new() -> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> {
ProfileViewBasicBuilder::new()
}
}
impl<'a> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> {
pub fn new() -> Self {
ProfileViewBasicBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
pub fn avatar(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_avatar(mut self, value: Option<UriValue<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
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<'a, S> ProfileViewBasicBuilder<'a, S>
where
S: profile_view_basic_state::State,
S::Did: profile_view_basic_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<'a>>,
) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetDid<S>> {
self._fields.2 = Option::Some(value.into());
ProfileViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
pub fn display_name(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_display_name(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.3 = value;
self
}
}
impl<'a, S> ProfileViewBasicBuilder<'a, S>
where
S: profile_view_basic_state::State,
S::Handle: profile_view_basic_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<'a>>,
) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetHandle<S>> {
self._fields.4 = Option::Some(value.into());
ProfileViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
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<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
self._fields.6 = value;
self
}
}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
pub fn pronouns(
mut self,
value: impl Into<Option<actor::PronounsList<'a>>>,
) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_pronouns(mut self, value: Option<actor::PronounsList<'a>>) -> Self {
self._fields.7 = value;
self
}
}
impl<'a, S> ProfileViewBasicBuilder<'a, S>
where
S: profile_view_basic_state::State,
S::Did: profile_view_basic_state::IsSet,
S::Handle: profile_view_basic_state::IsSet,
{
pub fn build(self) -> ProfileViewBasic<'a> {
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<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> ProfileViewBasic<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
}
}
pub struct SubscribedNotebookBuilder<'a, S: subscribed_notebook_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<CowStr<'a>>, Option<CowStr<'a>>, Option<AtUri<'a>>),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> SubscribedNotebook<'a> {
pub fn new() -> SubscribedNotebookBuilder<'a, subscribed_notebook_state::Empty> {
SubscribedNotebookBuilder::new()
}
}
impl<'a> SubscribedNotebookBuilder<'a, subscribed_notebook_state::Empty> {
pub fn new() -> Self {
SubscribedNotebookBuilder {
_state: PhantomData,
_fields: (None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: subscribed_notebook_state::State> SubscribedNotebookBuilder<'a, S> {
pub fn path(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_path(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S: subscribed_notebook_state::State> SubscribedNotebookBuilder<'a, S> {
pub fn title(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_title(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S> SubscribedNotebookBuilder<'a, S>
where
S: subscribed_notebook_state::State,
S::Uri: subscribed_notebook_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<'a>>,
) -> SubscribedNotebookBuilder<'a, subscribed_notebook_state::SetUri<S>> {
self._fields.2 = Option::Some(value.into());
SubscribedNotebookBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SubscribedNotebookBuilder<'a, S>
where
S: subscribed_notebook_state::State,
S::Uri: subscribed_notebook_state::IsSet,
{
pub fn build(self) -> SubscribedNotebook<'a> {
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<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> SubscribedNotebook<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Did;
type Handle;
type Bluesky;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
type Handle = Unset;
type Bluesky = Unset;
}
pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Did = Set<members::did>;
type Handle = S::Handle;
type Bluesky = S::Bluesky;
}
pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetHandle<S> {}
impl<S: State> State for SetHandle<S> {
type Did = S::Did;
type Handle = Set<members::handle>;
type Bluesky = S::Bluesky;
}
pub struct SetBluesky<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetBluesky<S> {}
impl<S: State> State for SetBluesky<S> {
type Did = S::Did;
type Handle = S::Handle;
type Bluesky = Set<members::bluesky>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
pub struct handle(());
pub struct bluesky(());
}
}
pub struct TangledProfileViewBuilder<'a, S: tangled_profile_view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<bool>,
Option<CowStr<'a>>,
Option<Did<'a>>,
Option<Handle<'a>>,
Option<Vec<UriValue<'a>>>,
Option<CowStr<'a>>,
Option<Vec<AtUri<'a>>>,
Option<Vec<CowStr<'a>>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> TangledProfileView<'a> {
pub fn new() -> TangledProfileViewBuilder<'a, tangled_profile_view_state::Empty> {
TangledProfileViewBuilder::new()
}
}
impl<'a> TangledProfileViewBuilder<'a, tangled_profile_view_state::Empty> {
pub fn new() -> Self {
TangledProfileViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> TangledProfileViewBuilder<'a, S>
where
S: tangled_profile_view_state::State,
S::Bluesky: tangled_profile_view_state::IsUnset,
{
pub fn bluesky(
mut self,
value: impl Into<bool>,
) -> TangledProfileViewBuilder<'a, tangled_profile_view_state::SetBluesky<S>> {
self._fields.0 = Option::Some(value.into());
TangledProfileViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> {
pub fn description(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_description(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S> TangledProfileViewBuilder<'a, S>
where
S: tangled_profile_view_state::State,
S::Did: tangled_profile_view_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<'a>>,
) -> TangledProfileViewBuilder<'a, tangled_profile_view_state::SetDid<S>> {
self._fields.2 = Option::Some(value.into());
TangledProfileViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> TangledProfileViewBuilder<'a, S>
where
S: tangled_profile_view_state::State,
S::Handle: tangled_profile_view_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<'a>>,
) -> TangledProfileViewBuilder<'a, tangled_profile_view_state::SetHandle<S>> {
self._fields.3 = Option::Some(value.into());
TangledProfileViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> {
pub fn links(mut self, value: impl Into<Option<Vec<UriValue<'a>>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_links(mut self, value: Option<Vec<UriValue<'a>>>) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> {
pub fn location(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_location(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.5 = value;
self
}
}
impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> {
pub fn pinned_repositories(
mut self,
value: impl Into<Option<Vec<AtUri<'a>>>>,
) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_pinned_repositories(mut self, value: Option<Vec<AtUri<'a>>>) -> Self {
self._fields.6 = value;
self
}
}
impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> {
pub fn stats(mut self, value: impl Into<Option<Vec<CowStr<'a>>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_stats(mut self, value: Option<Vec<CowStr<'a>>>) -> Self {
self._fields.7 = value;
self
}
}
impl<'a, S> TangledProfileViewBuilder<'a, S>
where
S: tangled_profile_view_state::State,
S::Did: tangled_profile_view_state::IsSet,
S::Handle: tangled_profile_view_state::IsSet,
S::Bluesky: tangled_profile_view_state::IsSet,
{
pub fn build(self) -> TangledProfileView<'a> {
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<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> TangledProfileView<'a> {
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),
}
}
}