pub mod block;
pub mod follow;
pub mod get_actor_starter_packs;
pub mod get_blocks;
pub mod get_followers;
pub mod get_follows;
pub mod get_known_followers;
pub mod get_list;
pub mod get_list_blocks;
pub mod get_list_mutes;
pub mod get_lists;
pub mod get_lists_with_membership;
pub mod get_mutes;
pub mod get_relationships;
pub mod get_starter_pack;
pub mod get_starter_packs;
pub mod get_starter_packs_with_membership;
pub mod get_suggested_follows_by_actor;
pub mod list;
pub mod listblock;
pub mod listitem;
pub mod mute_actor;
pub mod mute_actor_list;
pub mod mute_thread;
pub mod search_starter_packs;
pub mod starterpack;
pub mod unmute_actor;
pub mod unmute_actor_list;
pub mod unmute_thread;
pub mod verification;
#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::ident::AtIdentifier;
use jacquard_common::types::string::{Did, AtUri, Cid, Datetime, UriValue};
use jacquard_common::types::value::Data;
use jacquard_derive::IntoStatic;
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::app_bsky::actor::ProfileView;
use crate::app_bsky::actor::ProfileViewBasic;
use crate::app_bsky::feed::GeneratorView;
use crate::app_bsky::richtext::facet::Facet;
use crate::com_atproto::label::Label;
use crate::app_bsky::graph;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct Curatelist;
impl core::fmt::Display for Curatelist {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "curatelist")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ListItemView<S: BosStr = DefaultStr> {
pub subject: ProfileView<S>,
pub uri: AtUri<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ListPurpose<S: BosStr = DefaultStr> {
AppBskyGraphDefsModlist,
AppBskyGraphDefsCuratelist,
AppBskyGraphDefsReferencelist,
Other(S),
}
impl<S: BosStr> ListPurpose<S> {
pub fn as_str(&self) -> &str {
match self {
Self::AppBskyGraphDefsModlist => "app.bsky.graph.defs#modlist",
Self::AppBskyGraphDefsCuratelist => "app.bsky.graph.defs#curatelist",
Self::AppBskyGraphDefsReferencelist => "app.bsky.graph.defs#referencelist",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"app.bsky.graph.defs#modlist" => Self::AppBskyGraphDefsModlist,
"app.bsky.graph.defs#curatelist" => Self::AppBskyGraphDefsCuratelist,
"app.bsky.graph.defs#referencelist" => Self::AppBskyGraphDefsReferencelist,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> AsRef<str> for ListPurpose<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> core::fmt::Display for ListPurpose<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> Serialize for ListPurpose<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ListPurpose<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ListPurpose<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ListPurpose<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ListPurpose::AppBskyGraphDefsModlist => ListPurpose::AppBskyGraphDefsModlist,
ListPurpose::AppBskyGraphDefsCuratelist => {
ListPurpose::AppBskyGraphDefsCuratelist
}
ListPurpose::AppBskyGraphDefsReferencelist => {
ListPurpose::AppBskyGraphDefsReferencelist
}
ListPurpose::Other(v) => ListPurpose::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ListView<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar: Option<UriValue<S>>,
pub cid: Cid<S>,
pub creator: ProfileView<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description_facets: Option<Vec<Facet<S>>>,
pub indexed_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<Label<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub list_item_count: Option<i64>,
pub name: S,
pub purpose: graph::ListPurpose<S>,
pub uri: AtUri<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub viewer: Option<graph::ListViewerState<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 ListViewBasic<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar: Option<UriValue<S>>,
pub cid: Cid<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 list_item_count: Option<i64>,
pub name: S,
pub purpose: graph::ListPurpose<S>,
pub uri: AtUri<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub viewer: Option<graph::ListViewerState<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 ListViewerState<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub blocked: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub muted: 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, Hash)]
pub struct Modlist;
impl core::fmt::Display for Modlist {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "modlist")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct NotFoundActor<S: BosStr = DefaultStr> {
pub actor: AtIdentifier<S>,
pub not_found: 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, Hash)]
pub struct Referencelist;
impl core::fmt::Display for Referencelist {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "referencelist")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Relationship<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub blocked_by: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub blocked_by_list: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub blocking: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub blocking_by_list: Option<AtUri<S>>,
pub did: Did<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(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 StarterPackView<S: BosStr = DefaultStr> {
pub cid: Cid<S>,
pub creator: ProfileViewBasic<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub feeds: Option<Vec<GeneratorView<S>>>,
pub indexed_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub joined_all_time_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub joined_week_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<Label<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub list: Option<graph::ListViewBasic<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub list_items_sample: Option<Vec<graph::ListItemView<S>>>,
pub record: Data<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 StarterPackViewBasic<S: BosStr = DefaultStr> {
pub cid: Cid<S>,
pub creator: ProfileViewBasic<S>,
pub indexed_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub joined_all_time_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub joined_week_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<Label<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub list_item_count: Option<i64>,
pub record: Data<S>,
pub uri: AtUri<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> LexiconSchema for ListItemView<S> {
fn nsid() -> &'static str {
"app.bsky.graph.defs"
}
fn def_name() -> &'static str {
"listItemView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_graph_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ListView<S> {
fn nsid() -> &'static str {
"app.bsky.graph.defs"
}
fn def_name() -> &'static str {
"listView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_graph_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.description {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 3000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("description"),
max: 3000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.description {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 300usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("description"),
max: 300usize,
actual: count,
});
}
}
}
if let Some(ref value) = self.list_item_count {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("list_item_count"),
min: 0i64,
actual: *value,
});
}
}
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 64usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("name"),
max: 64usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) < 1usize {
return Err(ConstraintError::MinLength {
path: ValidationPath::from_field("name"),
min: 1usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ListViewBasic<S> {
fn nsid() -> &'static str {
"app.bsky.graph.defs"
}
fn def_name() -> &'static str {
"listViewBasic"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_graph_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.list_item_count {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("list_item_count"),
min: 0i64,
actual: *value,
});
}
}
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 64usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("name"),
max: 64usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) < 1usize {
return Err(ConstraintError::MinLength {
path: ValidationPath::from_field("name"),
min: 1usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ListViewerState<S> {
fn nsid() -> &'static str {
"app.bsky.graph.defs"
}
fn def_name() -> &'static str {
"listViewerState"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_graph_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for NotFoundActor<S> {
fn nsid() -> &'static str {
"app.bsky.graph.defs"
}
fn def_name() -> &'static str {
"notFoundActor"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_graph_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Relationship<S> {
fn nsid() -> &'static str {
"app.bsky.graph.defs"
}
fn def_name() -> &'static str {
"relationship"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_graph_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for StarterPackView<S> {
fn nsid() -> &'static str {
"app.bsky.graph.defs"
}
fn def_name() -> &'static str {
"starterPackView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_graph_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.feeds {
#[allow(unused_comparisons)]
if value.len() > 3usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("feeds"),
max: 3usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.joined_all_time_count {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("joined_all_time_count"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.joined_week_count {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("joined_week_count"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.list_items_sample {
#[allow(unused_comparisons)]
if value.len() > 12usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("list_items_sample"),
max: 12usize,
actual: value.len(),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for StarterPackViewBasic<S> {
fn nsid() -> &'static str {
"app.bsky.graph.defs"
}
fn def_name() -> &'static str {
"starterPackViewBasic"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_graph_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.joined_all_time_count {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("joined_all_time_count"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.joined_week_count {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("joined_week_count"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.list_item_count {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("list_item_count"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
pub mod list_item_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 Uri;
type Subject;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
type Subject = 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>;
type Subject = St::Subject;
}
pub struct SetSubject<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSubject<St> {}
impl<St: State> State for SetSubject<St> {
type Uri = St::Uri;
type Subject = Set<members::subject>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
pub struct subject(());
}
}
pub struct ListItemViewBuilder<S: BosStr, St: list_item_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<ProfileView<S>>, Option<AtUri<S>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ListItemView<S> {
pub fn new() -> ListItemViewBuilder<S, list_item_view_state::Empty> {
ListItemViewBuilder::new()
}
}
impl<S: BosStr> ListItemViewBuilder<S, list_item_view_state::Empty> {
pub fn new() -> Self {
ListItemViewBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ListItemViewBuilder<S, St>
where
St: list_item_view_state::State,
St::Subject: list_item_view_state::IsUnset,
{
pub fn subject(
mut self,
value: impl Into<ProfileView<S>>,
) -> ListItemViewBuilder<S, list_item_view_state::SetSubject<St>> {
self._fields.0 = Option::Some(value.into());
ListItemViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ListItemViewBuilder<S, St>
where
St: list_item_view_state::State,
St::Uri: list_item_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> ListItemViewBuilder<S, list_item_view_state::SetUri<St>> {
self._fields.1 = Option::Some(value.into());
ListItemViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ListItemViewBuilder<S, St>
where
St: list_item_view_state::State,
St::Uri: list_item_view_state::IsSet,
St::Subject: list_item_view_state::IsSet,
{
pub fn build(self) -> ListItemView<S> {
ListItemView {
subject: self._fields.0.unwrap(),
uri: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> ListItemView<S> {
ListItemView {
subject: self._fields.0.unwrap(),
uri: self._fields.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_app_bsky_graph_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("app.bsky.graph.defs"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("curatelist"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("listItemView"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("uri"), SmolStr::new_static("subject")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("subject"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.actor.defs#profileView",
),
..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("listPurpose"),
LexUserType::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("listView"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("uri"), SmolStr::new_static("cid"),
SmolStr::new_static("creator"), SmolStr::new_static("name"),
SmolStr::new_static("purpose"),
SmolStr::new_static("indexedAt")
],
),
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("cid"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Cid),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("creator"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.actor.defs#profileView",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("description"),
LexObjectProperty::String(LexString {
max_length: Some(3000usize),
max_graphemes: Some(300usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("descriptionFacets"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("app.bsky.richtext.facet"),
..Default::default()
}),
..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("listItemCount"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
min_length: Some(1usize),
max_length: Some(64usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("purpose"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#listPurpose"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("viewer"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#listViewerState"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("listViewBasic"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("uri"), SmolStr::new_static("cid"),
SmolStr::new_static("name"), SmolStr::new_static("purpose")
],
),
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("cid"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Cid),
..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("listItemCount"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
min_length: Some(1usize),
max_length: Some(64usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("purpose"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#listPurpose"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("viewer"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#listViewerState"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("listViewerState"),
LexUserType::Object(LexObject {
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("muted"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("modlist"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("notFoundActor"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"indicates that a handle or DID could not be resolved",
),
),
required: Some(
vec![
SmolStr::new_static("actor"), SmolStr::new_static("notFound")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("actor"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtIdentifier),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("notFound"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("referencelist"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("relationship"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object)",
),
),
required: Some(vec![SmolStr::new_static("did")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("blockedBy"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"if the actor is blocked by this DID, contains the AT-URI of the block record",
),
),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("blockedByList"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"if the actor is blocked by this DID via a block list, contains the AT-URI of the listblock record",
),
),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("blocking"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"if the actor blocks this DID, this is the AT-URI of the block record",
),
),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("blockingByList"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"if the actor blocks this DID via a block list, this is the AT-URI of the listblock record",
),
),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("followedBy"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"if the actor is followed by this DID, contains the AT-URI of the follow record",
),
),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("following"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"if the actor follows this DID, this is the AT-URI of the follow record",
),
),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("starterPackView"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("uri"), SmolStr::new_static("cid"),
SmolStr::new_static("record"),
SmolStr::new_static("creator"),
SmolStr::new_static("indexedAt")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("cid"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Cid),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("creator"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.actor.defs#profileViewBasic",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("feeds"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.feed.defs#generatorView",
),
..Default::default()
}),
max_length: Some(3usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("indexedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("joinedAllTimeCount"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("joinedWeekCount"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..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("list"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#listViewBasic"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("listItemsSample"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#listItemView"),
..Default::default()
}),
max_length: Some(12usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("record"),
LexObjectProperty::Unknown(LexUnknown {
..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("starterPackViewBasic"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("uri"), SmolStr::new_static("cid"),
SmolStr::new_static("record"),
SmolStr::new_static("creator"),
SmolStr::new_static("indexedAt")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("cid"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Cid),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("creator"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.actor.defs#profileViewBasic",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("indexedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("joinedAllTimeCount"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("joinedWeekCount"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..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("listItemCount"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("record"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod list_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 Purpose;
type IndexedAt;
type Uri;
type Cid;
type Name;
type Creator;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Purpose = Unset;
type IndexedAt = Unset;
type Uri = Unset;
type Cid = Unset;
type Name = Unset;
type Creator = Unset;
}
pub struct SetPurpose<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPurpose<St> {}
impl<St: State> State for SetPurpose<St> {
type Purpose = Set<members::purpose>;
type IndexedAt = St::IndexedAt;
type Uri = St::Uri;
type Cid = St::Cid;
type Name = St::Name;
type Creator = St::Creator;
}
pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
impl<St: State> State for SetIndexedAt<St> {
type Purpose = St::Purpose;
type IndexedAt = Set<members::indexed_at>;
type Uri = St::Uri;
type Cid = St::Cid;
type Name = St::Name;
type Creator = St::Creator;
}
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 Purpose = St::Purpose;
type IndexedAt = St::IndexedAt;
type Uri = Set<members::uri>;
type Cid = St::Cid;
type Name = St::Name;
type Creator = St::Creator;
}
pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCid<St> {}
impl<St: State> State for SetCid<St> {
type Purpose = St::Purpose;
type IndexedAt = St::IndexedAt;
type Uri = St::Uri;
type Cid = Set<members::cid>;
type Name = St::Name;
type Creator = St::Creator;
}
pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetName<St> {}
impl<St: State> State for SetName<St> {
type Purpose = St::Purpose;
type IndexedAt = St::IndexedAt;
type Uri = St::Uri;
type Cid = St::Cid;
type Name = Set<members::name>;
type Creator = St::Creator;
}
pub struct SetCreator<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreator<St> {}
impl<St: State> State for SetCreator<St> {
type Purpose = St::Purpose;
type IndexedAt = St::IndexedAt;
type Uri = St::Uri;
type Cid = St::Cid;
type Name = St::Name;
type Creator = Set<members::creator>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct purpose(());
pub struct indexed_at(());
pub struct uri(());
pub struct cid(());
pub struct name(());
pub struct creator(());
}
}
pub struct ListViewBuilder<S: BosStr, St: list_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<UriValue<S>>,
Option<Cid<S>>,
Option<ProfileView<S>>,
Option<S>,
Option<Vec<Facet<S>>>,
Option<Datetime>,
Option<Vec<Label<S>>>,
Option<i64>,
Option<S>,
Option<graph::ListPurpose<S>>,
Option<AtUri<S>>,
Option<graph::ListViewerState<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ListView<S> {
pub fn new() -> ListViewBuilder<S, list_view_state::Empty> {
ListViewBuilder::new()
}
}
impl<S: BosStr> ListViewBuilder<S, list_view_state::Empty> {
pub fn new() -> Self {
ListViewBuilder {
_state: PhantomData,
_fields: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: list_view_state::State> ListViewBuilder<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> ListViewBuilder<S, St>
where
St: list_view_state::State,
St::Cid: list_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<Cid<S>>,
) -> ListViewBuilder<S, list_view_state::SetCid<St>> {
self._fields.1 = Option::Some(value.into());
ListViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ListViewBuilder<S, St>
where
St: list_view_state::State,
St::Creator: list_view_state::IsUnset,
{
pub fn creator(
mut self,
value: impl Into<ProfileView<S>>,
) -> ListViewBuilder<S, list_view_state::SetCreator<St>> {
self._fields.2 = Option::Some(value.into());
ListViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: list_view_state::State> ListViewBuilder<S, St> {
pub fn description(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_description(mut self, value: Option<S>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St: list_view_state::State> ListViewBuilder<S, St> {
pub fn description_facets(
mut self,
value: impl Into<Option<Vec<Facet<S>>>>,
) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_description_facets(mut self, value: Option<Vec<Facet<S>>>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> ListViewBuilder<S, St>
where
St: list_view_state::State,
St::IndexedAt: list_view_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<Datetime>,
) -> ListViewBuilder<S, list_view_state::SetIndexedAt<St>> {
self._fields.5 = Option::Some(value.into());
ListViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: list_view_state::State> ListViewBuilder<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: list_view_state::State> ListViewBuilder<S, St> {
pub fn list_item_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_list_item_count(mut self, value: Option<i64>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St> ListViewBuilder<S, St>
where
St: list_view_state::State,
St::Name: list_view_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<S>,
) -> ListViewBuilder<S, list_view_state::SetName<St>> {
self._fields.8 = Option::Some(value.into());
ListViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ListViewBuilder<S, St>
where
St: list_view_state::State,
St::Purpose: list_view_state::IsUnset,
{
pub fn purpose(
mut self,
value: impl Into<graph::ListPurpose<S>>,
) -> ListViewBuilder<S, list_view_state::SetPurpose<St>> {
self._fields.9 = Option::Some(value.into());
ListViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ListViewBuilder<S, St>
where
St: list_view_state::State,
St::Uri: list_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> ListViewBuilder<S, list_view_state::SetUri<St>> {
self._fields.10 = Option::Some(value.into());
ListViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: list_view_state::State> ListViewBuilder<S, St> {
pub fn viewer(
mut self,
value: impl Into<Option<graph::ListViewerState<S>>>,
) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_viewer(mut self, value: Option<graph::ListViewerState<S>>) -> Self {
self._fields.11 = value;
self
}
}
impl<S: BosStr, St> ListViewBuilder<S, St>
where
St: list_view_state::State,
St::Purpose: list_view_state::IsSet,
St::IndexedAt: list_view_state::IsSet,
St::Uri: list_view_state::IsSet,
St::Cid: list_view_state::IsSet,
St::Name: list_view_state::IsSet,
St::Creator: list_view_state::IsSet,
{
pub fn build(self) -> ListView<S> {
ListView {
avatar: self._fields.0,
cid: self._fields.1.unwrap(),
creator: self._fields.2.unwrap(),
description: self._fields.3,
description_facets: self._fields.4,
indexed_at: self._fields.5.unwrap(),
labels: self._fields.6,
list_item_count: self._fields.7,
name: self._fields.8.unwrap(),
purpose: self._fields.9.unwrap(),
uri: self._fields.10.unwrap(),
viewer: self._fields.11,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ListView<S> {
ListView {
avatar: self._fields.0,
cid: self._fields.1.unwrap(),
creator: self._fields.2.unwrap(),
description: self._fields.3,
description_facets: self._fields.4,
indexed_at: self._fields.5.unwrap(),
labels: self._fields.6,
list_item_count: self._fields.7,
name: self._fields.8.unwrap(),
purpose: self._fields.9.unwrap(),
uri: self._fields.10.unwrap(),
viewer: self._fields.11,
extra_data: Some(extra_data),
}
}
}
pub mod list_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 Name;
type Uri;
type Purpose;
type Cid;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Name = Unset;
type Uri = Unset;
type Purpose = Unset;
type Cid = Unset;
}
pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetName<St> {}
impl<St: State> State for SetName<St> {
type Name = Set<members::name>;
type Uri = St::Uri;
type Purpose = St::Purpose;
type Cid = St::Cid;
}
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 Name = St::Name;
type Uri = Set<members::uri>;
type Purpose = St::Purpose;
type Cid = St::Cid;
}
pub struct SetPurpose<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPurpose<St> {}
impl<St: State> State for SetPurpose<St> {
type Name = St::Name;
type Uri = St::Uri;
type Purpose = Set<members::purpose>;
type Cid = St::Cid;
}
pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCid<St> {}
impl<St: State> State for SetCid<St> {
type Name = St::Name;
type Uri = St::Uri;
type Purpose = St::Purpose;
type Cid = Set<members::cid>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct name(());
pub struct uri(());
pub struct purpose(());
pub struct cid(());
}
}
pub struct ListViewBasicBuilder<S: BosStr, St: list_view_basic_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<UriValue<S>>,
Option<Cid<S>>,
Option<Datetime>,
Option<Vec<Label<S>>>,
Option<i64>,
Option<S>,
Option<graph::ListPurpose<S>>,
Option<AtUri<S>>,
Option<graph::ListViewerState<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ListViewBasic<S> {
pub fn new() -> ListViewBasicBuilder<S, list_view_basic_state::Empty> {
ListViewBasicBuilder::new()
}
}
impl<S: BosStr> ListViewBasicBuilder<S, list_view_basic_state::Empty> {
pub fn new() -> Self {
ListViewBasicBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: list_view_basic_state::State> ListViewBasicBuilder<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> ListViewBasicBuilder<S, St>
where
St: list_view_basic_state::State,
St::Cid: list_view_basic_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<Cid<S>>,
) -> ListViewBasicBuilder<S, list_view_basic_state::SetCid<St>> {
self._fields.1 = Option::Some(value.into());
ListViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: list_view_basic_state::State> ListViewBasicBuilder<S, St> {
pub fn indexed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_indexed_at(mut self, value: Option<Datetime>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: list_view_basic_state::State> ListViewBasicBuilder<S, St> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St: list_view_basic_state::State> ListViewBasicBuilder<S, St> {
pub fn list_item_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_list_item_count(mut self, value: Option<i64>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> ListViewBasicBuilder<S, St>
where
St: list_view_basic_state::State,
St::Name: list_view_basic_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<S>,
) -> ListViewBasicBuilder<S, list_view_basic_state::SetName<St>> {
self._fields.5 = Option::Some(value.into());
ListViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ListViewBasicBuilder<S, St>
where
St: list_view_basic_state::State,
St::Purpose: list_view_basic_state::IsUnset,
{
pub fn purpose(
mut self,
value: impl Into<graph::ListPurpose<S>>,
) -> ListViewBasicBuilder<S, list_view_basic_state::SetPurpose<St>> {
self._fields.6 = Option::Some(value.into());
ListViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ListViewBasicBuilder<S, St>
where
St: list_view_basic_state::State,
St::Uri: list_view_basic_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> ListViewBasicBuilder<S, list_view_basic_state::SetUri<St>> {
self._fields.7 = Option::Some(value.into());
ListViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: list_view_basic_state::State> ListViewBasicBuilder<S, St> {
pub fn viewer(
mut self,
value: impl Into<Option<graph::ListViewerState<S>>>,
) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_viewer(mut self, value: Option<graph::ListViewerState<S>>) -> Self {
self._fields.8 = value;
self
}
}
impl<S: BosStr, St> ListViewBasicBuilder<S, St>
where
St: list_view_basic_state::State,
St::Name: list_view_basic_state::IsSet,
St::Uri: list_view_basic_state::IsSet,
St::Purpose: list_view_basic_state::IsSet,
St::Cid: list_view_basic_state::IsSet,
{
pub fn build(self) -> ListViewBasic<S> {
ListViewBasic {
avatar: self._fields.0,
cid: self._fields.1.unwrap(),
indexed_at: self._fields.2,
labels: self._fields.3,
list_item_count: self._fields.4,
name: self._fields.5.unwrap(),
purpose: self._fields.6.unwrap(),
uri: self._fields.7.unwrap(),
viewer: self._fields.8,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> ListViewBasic<S> {
ListViewBasic {
avatar: self._fields.0,
cid: self._fields.1.unwrap(),
indexed_at: self._fields.2,
labels: self._fields.3,
list_item_count: self._fields.4,
name: self._fields.5.unwrap(),
purpose: self._fields.6.unwrap(),
uri: self._fields.7.unwrap(),
viewer: self._fields.8,
extra_data: Some(extra_data),
}
}
}
pub mod not_found_actor_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 Actor;
type NotFound;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Actor = Unset;
type NotFound = Unset;
}
pub struct SetActor<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetActor<St> {}
impl<St: State> State for SetActor<St> {
type Actor = Set<members::actor>;
type NotFound = St::NotFound;
}
pub struct SetNotFound<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetNotFound<St> {}
impl<St: State> State for SetNotFound<St> {
type Actor = St::Actor;
type NotFound = Set<members::not_found>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct actor(());
pub struct not_found(());
}
}
pub struct NotFoundActorBuilder<S: BosStr, St: not_found_actor_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<AtIdentifier<S>>, Option<bool>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> NotFoundActor<S> {
pub fn new() -> NotFoundActorBuilder<S, not_found_actor_state::Empty> {
NotFoundActorBuilder::new()
}
}
impl<S: BosStr> NotFoundActorBuilder<S, not_found_actor_state::Empty> {
pub fn new() -> Self {
NotFoundActorBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> NotFoundActorBuilder<S, St>
where
St: not_found_actor_state::State,
St::Actor: not_found_actor_state::IsUnset,
{
pub fn actor(
mut self,
value: impl Into<AtIdentifier<S>>,
) -> NotFoundActorBuilder<S, not_found_actor_state::SetActor<St>> {
self._fields.0 = Option::Some(value.into());
NotFoundActorBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> NotFoundActorBuilder<S, St>
where
St: not_found_actor_state::State,
St::NotFound: not_found_actor_state::IsUnset,
{
pub fn not_found(
mut self,
value: impl Into<bool>,
) -> NotFoundActorBuilder<S, not_found_actor_state::SetNotFound<St>> {
self._fields.1 = Option::Some(value.into());
NotFoundActorBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> NotFoundActorBuilder<S, St>
where
St: not_found_actor_state::State,
St::Actor: not_found_actor_state::IsSet,
St::NotFound: not_found_actor_state::IsSet,
{
pub fn build(self) -> NotFoundActor<S> {
NotFoundActor {
actor: self._fields.0.unwrap(),
not_found: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> NotFoundActor<S> {
NotFoundActor {
actor: self._fields.0.unwrap(),
not_found: self._fields.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod relationship_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<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 RelationshipBuilder<S: BosStr, St: relationship_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<AtUri<S>>,
Option<AtUri<S>>,
Option<AtUri<S>>,
Option<AtUri<S>>,
Option<Did<S>>,
Option<AtUri<S>>,
Option<AtUri<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Relationship<S> {
pub fn new() -> RelationshipBuilder<S, relationship_state::Empty> {
RelationshipBuilder::new()
}
}
impl<S: BosStr> RelationshipBuilder<S, relationship_state::Empty> {
pub fn new() -> Self {
RelationshipBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: relationship_state::State> RelationshipBuilder<S, St> {
pub fn blocked_by(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_blocked_by(mut self, value: Option<AtUri<S>>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: relationship_state::State> RelationshipBuilder<S, St> {
pub fn blocked_by_list(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_blocked_by_list(mut self, value: Option<AtUri<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: relationship_state::State> RelationshipBuilder<S, St> {
pub fn blocking(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_blocking(mut self, value: Option<AtUri<S>>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: relationship_state::State> RelationshipBuilder<S, St> {
pub fn blocking_by_list(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_blocking_by_list(mut self, value: Option<AtUri<S>>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> RelationshipBuilder<S, St>
where
St: relationship_state::State,
St::Did: relationship_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> RelationshipBuilder<S, relationship_state::SetDid<St>> {
self._fields.4 = Option::Some(value.into());
RelationshipBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: relationship_state::State> RelationshipBuilder<S, St> {
pub fn followed_by(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_followed_by(mut self, value: Option<AtUri<S>>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St: relationship_state::State> RelationshipBuilder<S, St> {
pub fn following(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_following(mut self, value: Option<AtUri<S>>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St> RelationshipBuilder<S, St>
where
St: relationship_state::State,
St::Did: relationship_state::IsSet,
{
pub fn build(self) -> Relationship<S> {
Relationship {
blocked_by: self._fields.0,
blocked_by_list: self._fields.1,
blocking: self._fields.2,
blocking_by_list: self._fields.3,
did: self._fields.4.unwrap(),
followed_by: self._fields.5,
following: self._fields.6,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> Relationship<S> {
Relationship {
blocked_by: self._fields.0,
blocked_by_list: self._fields.1,
blocking: self._fields.2,
blocking_by_list: self._fields.3,
did: self._fields.4.unwrap(),
followed_by: self._fields.5,
following: self._fields.6,
extra_data: Some(extra_data),
}
}
}
pub mod starter_pack_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 IndexedAt;
type Uri;
type Cid;
type Creator;
type Record;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type IndexedAt = Unset;
type Uri = Unset;
type Cid = Unset;
type Creator = Unset;
type Record = Unset;
}
pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
impl<St: State> State for SetIndexedAt<St> {
type IndexedAt = Set<members::indexed_at>;
type Uri = St::Uri;
type Cid = St::Cid;
type Creator = St::Creator;
type Record = St::Record;
}
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 IndexedAt = St::IndexedAt;
type Uri = Set<members::uri>;
type Cid = St::Cid;
type Creator = St::Creator;
type Record = St::Record;
}
pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCid<St> {}
impl<St: State> State for SetCid<St> {
type IndexedAt = St::IndexedAt;
type Uri = St::Uri;
type Cid = Set<members::cid>;
type Creator = St::Creator;
type Record = St::Record;
}
pub struct SetCreator<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreator<St> {}
impl<St: State> State for SetCreator<St> {
type IndexedAt = St::IndexedAt;
type Uri = St::Uri;
type Cid = St::Cid;
type Creator = Set<members::creator>;
type Record = St::Record;
}
pub struct SetRecord<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRecord<St> {}
impl<St: State> State for SetRecord<St> {
type IndexedAt = St::IndexedAt;
type Uri = St::Uri;
type Cid = St::Cid;
type Creator = St::Creator;
type Record = Set<members::record>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct indexed_at(());
pub struct uri(());
pub struct cid(());
pub struct creator(());
pub struct record(());
}
}
pub struct StarterPackViewBuilder<S: BosStr, St: starter_pack_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Cid<S>>,
Option<ProfileViewBasic<S>>,
Option<Vec<GeneratorView<S>>>,
Option<Datetime>,
Option<i64>,
Option<i64>,
Option<Vec<Label<S>>>,
Option<graph::ListViewBasic<S>>,
Option<Vec<graph::ListItemView<S>>>,
Option<Data<S>>,
Option<AtUri<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> StarterPackView<S> {
pub fn new() -> StarterPackViewBuilder<S, starter_pack_view_state::Empty> {
StarterPackViewBuilder::new()
}
}
impl<S: BosStr> StarterPackViewBuilder<S, starter_pack_view_state::Empty> {
pub fn new() -> Self {
StarterPackViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> StarterPackViewBuilder<S, St>
where
St: starter_pack_view_state::State,
St::Cid: starter_pack_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<Cid<S>>,
) -> StarterPackViewBuilder<S, starter_pack_view_state::SetCid<St>> {
self._fields.0 = Option::Some(value.into());
StarterPackViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> StarterPackViewBuilder<S, St>
where
St: starter_pack_view_state::State,
St::Creator: starter_pack_view_state::IsUnset,
{
pub fn creator(
mut self,
value: impl Into<ProfileViewBasic<S>>,
) -> StarterPackViewBuilder<S, starter_pack_view_state::SetCreator<St>> {
self._fields.1 = Option::Some(value.into());
StarterPackViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: starter_pack_view_state::State> StarterPackViewBuilder<S, St> {
pub fn feeds(mut self, value: impl Into<Option<Vec<GeneratorView<S>>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_feeds(mut self, value: Option<Vec<GeneratorView<S>>>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> StarterPackViewBuilder<S, St>
where
St: starter_pack_view_state::State,
St::IndexedAt: starter_pack_view_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<Datetime>,
) -> StarterPackViewBuilder<S, starter_pack_view_state::SetIndexedAt<St>> {
self._fields.3 = Option::Some(value.into());
StarterPackViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: starter_pack_view_state::State> StarterPackViewBuilder<S, St> {
pub fn joined_all_time_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_joined_all_time_count(mut self, value: Option<i64>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St: starter_pack_view_state::State> StarterPackViewBuilder<S, St> {
pub fn joined_week_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_joined_week_count(mut self, value: Option<i64>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St: starter_pack_view_state::State> StarterPackViewBuilder<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: starter_pack_view_state::State> StarterPackViewBuilder<S, St> {
pub fn list(mut self, value: impl Into<Option<graph::ListViewBasic<S>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_list(mut self, value: Option<graph::ListViewBasic<S>>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St: starter_pack_view_state::State> StarterPackViewBuilder<S, St> {
pub fn list_items_sample(
mut self,
value: impl Into<Option<Vec<graph::ListItemView<S>>>>,
) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_list_items_sample(
mut self,
value: Option<Vec<graph::ListItemView<S>>>,
) -> Self {
self._fields.8 = value;
self
}
}
impl<S: BosStr, St> StarterPackViewBuilder<S, St>
where
St: starter_pack_view_state::State,
St::Record: starter_pack_view_state::IsUnset,
{
pub fn record(
mut self,
value: impl Into<Data<S>>,
) -> StarterPackViewBuilder<S, starter_pack_view_state::SetRecord<St>> {
self._fields.9 = Option::Some(value.into());
StarterPackViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> StarterPackViewBuilder<S, St>
where
St: starter_pack_view_state::State,
St::Uri: starter_pack_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> StarterPackViewBuilder<S, starter_pack_view_state::SetUri<St>> {
self._fields.10 = Option::Some(value.into());
StarterPackViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> StarterPackViewBuilder<S, St>
where
St: starter_pack_view_state::State,
St::IndexedAt: starter_pack_view_state::IsSet,
St::Uri: starter_pack_view_state::IsSet,
St::Cid: starter_pack_view_state::IsSet,
St::Creator: starter_pack_view_state::IsSet,
St::Record: starter_pack_view_state::IsSet,
{
pub fn build(self) -> StarterPackView<S> {
StarterPackView {
cid: self._fields.0.unwrap(),
creator: self._fields.1.unwrap(),
feeds: self._fields.2,
indexed_at: self._fields.3.unwrap(),
joined_all_time_count: self._fields.4,
joined_week_count: self._fields.5,
labels: self._fields.6,
list: self._fields.7,
list_items_sample: self._fields.8,
record: self._fields.9.unwrap(),
uri: self._fields.10.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> StarterPackView<S> {
StarterPackView {
cid: self._fields.0.unwrap(),
creator: self._fields.1.unwrap(),
feeds: self._fields.2,
indexed_at: self._fields.3.unwrap(),
joined_all_time_count: self._fields.4,
joined_week_count: self._fields.5,
labels: self._fields.6,
list: self._fields.7,
list_items_sample: self._fields.8,
record: self._fields.9.unwrap(),
uri: self._fields.10.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod starter_pack_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 Creator;
type IndexedAt;
type Uri;
type Cid;
type Record;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Creator = Unset;
type IndexedAt = Unset;
type Uri = Unset;
type Cid = Unset;
type Record = Unset;
}
pub struct SetCreator<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreator<St> {}
impl<St: State> State for SetCreator<St> {
type Creator = Set<members::creator>;
type IndexedAt = St::IndexedAt;
type Uri = St::Uri;
type Cid = St::Cid;
type Record = St::Record;
}
pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
impl<St: State> State for SetIndexedAt<St> {
type Creator = St::Creator;
type IndexedAt = Set<members::indexed_at>;
type Uri = St::Uri;
type Cid = St::Cid;
type Record = St::Record;
}
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 Creator = St::Creator;
type IndexedAt = St::IndexedAt;
type Uri = Set<members::uri>;
type Cid = St::Cid;
type Record = St::Record;
}
pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCid<St> {}
impl<St: State> State for SetCid<St> {
type Creator = St::Creator;
type IndexedAt = St::IndexedAt;
type Uri = St::Uri;
type Cid = Set<members::cid>;
type Record = St::Record;
}
pub struct SetRecord<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRecord<St> {}
impl<St: State> State for SetRecord<St> {
type Creator = St::Creator;
type IndexedAt = St::IndexedAt;
type Uri = St::Uri;
type Cid = St::Cid;
type Record = Set<members::record>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct creator(());
pub struct indexed_at(());
pub struct uri(());
pub struct cid(());
pub struct record(());
}
}
pub struct StarterPackViewBasicBuilder<
S: BosStr,
St: starter_pack_view_basic_state::State,
> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Cid<S>>,
Option<ProfileViewBasic<S>>,
Option<Datetime>,
Option<i64>,
Option<i64>,
Option<Vec<Label<S>>>,
Option<i64>,
Option<Data<S>>,
Option<AtUri<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> StarterPackViewBasic<S> {
pub fn new() -> StarterPackViewBasicBuilder<
S,
starter_pack_view_basic_state::Empty,
> {
StarterPackViewBasicBuilder::new()
}
}
impl<S: BosStr> StarterPackViewBasicBuilder<S, starter_pack_view_basic_state::Empty> {
pub fn new() -> Self {
StarterPackViewBasicBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> StarterPackViewBasicBuilder<S, St>
where
St: starter_pack_view_basic_state::State,
St::Cid: starter_pack_view_basic_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<Cid<S>>,
) -> StarterPackViewBasicBuilder<S, starter_pack_view_basic_state::SetCid<St>> {
self._fields.0 = Option::Some(value.into());
StarterPackViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> StarterPackViewBasicBuilder<S, St>
where
St: starter_pack_view_basic_state::State,
St::Creator: starter_pack_view_basic_state::IsUnset,
{
pub fn creator(
mut self,
value: impl Into<ProfileViewBasic<S>>,
) -> StarterPackViewBasicBuilder<S, starter_pack_view_basic_state::SetCreator<St>> {
self._fields.1 = Option::Some(value.into());
StarterPackViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> StarterPackViewBasicBuilder<S, St>
where
St: starter_pack_view_basic_state::State,
St::IndexedAt: starter_pack_view_basic_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<Datetime>,
) -> StarterPackViewBasicBuilder<
S,
starter_pack_view_basic_state::SetIndexedAt<St>,
> {
self._fields.2 = Option::Some(value.into());
StarterPackViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<
S: BosStr,
St: starter_pack_view_basic_state::State,
> StarterPackViewBasicBuilder<S, St> {
pub fn joined_all_time_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_joined_all_time_count(mut self, value: Option<i64>) -> Self {
self._fields.3 = value;
self
}
}
impl<
S: BosStr,
St: starter_pack_view_basic_state::State,
> StarterPackViewBasicBuilder<S, St> {
pub fn joined_week_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_joined_week_count(mut self, value: Option<i64>) -> Self {
self._fields.4 = value;
self
}
}
impl<
S: BosStr,
St: starter_pack_view_basic_state::State,
> StarterPackViewBasicBuilder<S, St> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
self._fields.5 = value;
self
}
}
impl<
S: BosStr,
St: starter_pack_view_basic_state::State,
> StarterPackViewBasicBuilder<S, St> {
pub fn list_item_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_list_item_count(mut self, value: Option<i64>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St> StarterPackViewBasicBuilder<S, St>
where
St: starter_pack_view_basic_state::State,
St::Record: starter_pack_view_basic_state::IsUnset,
{
pub fn record(
mut self,
value: impl Into<Data<S>>,
) -> StarterPackViewBasicBuilder<S, starter_pack_view_basic_state::SetRecord<St>> {
self._fields.7 = Option::Some(value.into());
StarterPackViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> StarterPackViewBasicBuilder<S, St>
where
St: starter_pack_view_basic_state::State,
St::Uri: starter_pack_view_basic_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> StarterPackViewBasicBuilder<S, starter_pack_view_basic_state::SetUri<St>> {
self._fields.8 = Option::Some(value.into());
StarterPackViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> StarterPackViewBasicBuilder<S, St>
where
St: starter_pack_view_basic_state::State,
St::Creator: starter_pack_view_basic_state::IsSet,
St::IndexedAt: starter_pack_view_basic_state::IsSet,
St::Uri: starter_pack_view_basic_state::IsSet,
St::Cid: starter_pack_view_basic_state::IsSet,
St::Record: starter_pack_view_basic_state::IsSet,
{
pub fn build(self) -> StarterPackViewBasic<S> {
StarterPackViewBasic {
cid: self._fields.0.unwrap(),
creator: self._fields.1.unwrap(),
indexed_at: self._fields.2.unwrap(),
joined_all_time_count: self._fields.3,
joined_week_count: self._fields.4,
labels: self._fields.5,
list_item_count: self._fields.6,
record: self._fields.7.unwrap(),
uri: self._fields.8.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> StarterPackViewBasic<S> {
StarterPackViewBasic {
cid: self._fields.0.unwrap(),
creator: self._fields.1.unwrap(),
indexed_at: self._fields.2.unwrap(),
joined_all_time_count: self._fields.3,
joined_week_count: self._fields.4,
labels: self._fields.5,
list_item_count: self._fields.6,
record: self._fields.7.unwrap(),
uri: self._fields.8.unwrap(),
extra_data: Some(extra_data),
}
}
}