// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: app.bsky.graph.defs
//
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.

//! Generated bindings for the `app.bsky.graph` Lexicon namespace/module.
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;
/// A list of actors used for curation purposes such as list feeds or interaction gating.

#[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(),
        }
    }
    /// Construct from a string-like value, matching known values.
    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>>>,
}

/// A list of actors to apply an aggregate moderation action (mute/block) on.

#[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")
    }
}

/// indicates that a handle or DID could not be resolved

#[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>>>,
}

/// A list of actors used for only for reference purposes such as within a starter pack.

#[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")
    }
}

/// lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object)

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Relationship<S: BosStr = DefaultStr> {
    ///if the actor is blocked by this DID, contains the AT-URI of the block record
    #[serde(skip_serializing_if = "Option::is_none")]
    pub blocked_by: Option<AtUri<S>>,
    ///if the actor is blocked by this DID via a block list, contains the AT-URI of the listblock record
    #[serde(skip_serializing_if = "Option::is_none")]
    pub blocked_by_list: Option<AtUri<S>>,
    ///if the actor blocks this DID, this is the AT-URI of the block record
    #[serde(skip_serializing_if = "Option::is_none")]
    pub blocking: Option<AtUri<S>>,
    ///if the actor blocks this DID via a block list, this is the AT-URI of the listblock record
    #[serde(skip_serializing_if = "Option::is_none")]
    pub blocking_by_list: Option<AtUri<S>>,
    pub did: Did<S>,
    ///if the actor is followed by this DID, contains the AT-URI of the follow record
    #[serde(skip_serializing_if = "Option::is_none")]
    pub followed_by: Option<AtUri<S>>,
    ///if the actor follows this DID, this is the AT-URI of the follow record
    #[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 {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Subject;
        type Uri;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Subject = Unset;
        type Uri = Unset;
    }
    ///State transition - sets the `subject` field to Set
    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 Subject = Set<members::subject>;
        type Uri = St::Uri;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetUri<St> {}
    impl<St: State> State for SetUri<St> {
        type Subject = St::Subject;
        type Uri = Set<members::uri>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `subject` field
        pub struct subject(());
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

/// Builder for constructing an instance of this type.
pub struct ListItemViewBuilder<St: list_item_view_state::State, S: BosStr = DefaultStr> {
    _state: PhantomData<fn() -> St>,
    _fields: (Option<ProfileView<S>>, Option<AtUri<S>>),
    _type: PhantomData<fn() -> S>,
}

impl ListItemView<DefaultStr> {
    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
    pub fn new() -> ListItemViewBuilder<list_item_view_state::Empty, DefaultStr> {
        ListItemViewBuilder::new()
    }
}

impl<S: BosStr> ListItemView<S> {
    /// Create a new builder for this type
    pub fn builder() -> ListItemViewBuilder<list_item_view_state::Empty, S> {
        ListItemViewBuilder::builder()
    }
}

impl ListItemViewBuilder<list_item_view_state::Empty, DefaultStr> {
    /// Create a new builder with all fields unset, using the default string type, if needed
    pub fn new() -> Self {
        ListItemViewBuilder {
            _state: PhantomData,
            _fields: (None, None),
            _type: PhantomData,
        }
    }
}

impl<S: BosStr> ListItemViewBuilder<list_item_view_state::Empty, S> {
    /// Create a new builder with all fields unset
    pub fn builder() -> Self {
        ListItemViewBuilder {
            _state: PhantomData,
            _fields: (None, None),
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> ListItemViewBuilder<St, S>
where
    St: list_item_view_state::State,
    St::Subject: list_item_view_state::IsUnset,
{
    /// Set the `subject` field (required)
    pub fn subject(
        mut self,
        value: impl Into<ProfileView<S>>,
    ) -> ListItemViewBuilder<list_item_view_state::SetSubject<St>, S> {
        self._fields.0 = Option::Some(value.into());
        ListItemViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> ListItemViewBuilder<St, S>
where
    St: list_item_view_state::State,
    St::Uri: list_item_view_state::IsUnset,
{
    /// Set the `uri` field (required)
    pub fn uri(
        mut self,
        value: impl Into<AtUri<S>>,
    ) -> ListItemViewBuilder<list_item_view_state::SetUri<St>, S> {
        self._fields.1 = Option::Some(value.into());
        ListItemViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> ListItemViewBuilder<St, S>
where
    St: list_item_view_state::State,
    St::Subject: list_item_view_state::IsSet,
    St::Uri: list_item_view_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> ListItemView<S> {
        ListItemView {
            subject: self._fields.0.unwrap(),
            uri: self._fields.1.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> 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 {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Cid;
        type Creator;
        type IndexedAt;
        type Name;
        type Purpose;
        type Uri;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Cid = Unset;
        type Creator = Unset;
        type IndexedAt = Unset;
        type Name = Unset;
        type Purpose = Unset;
        type Uri = Unset;
    }
    ///State transition - sets the `cid` field to Set
    pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCid<St> {}
    impl<St: State> State for SetCid<St> {
        type Cid = Set<members::cid>;
        type Creator = St::Creator;
        type IndexedAt = St::IndexedAt;
        type Name = St::Name;
        type Purpose = St::Purpose;
        type Uri = St::Uri;
    }
    ///State transition - sets the `creator` field to Set
    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 Cid = St::Cid;
        type Creator = Set<members::creator>;
        type IndexedAt = St::IndexedAt;
        type Name = St::Name;
        type Purpose = St::Purpose;
        type Uri = St::Uri;
    }
    ///State transition - sets the `indexed_at` field to Set
    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 Cid = St::Cid;
        type Creator = St::Creator;
        type IndexedAt = Set<members::indexed_at>;
        type Name = St::Name;
        type Purpose = St::Purpose;
        type Uri = St::Uri;
    }
    ///State transition - sets the `name` field to Set
    pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetName<St> {}
    impl<St: State> State for SetName<St> {
        type Cid = St::Cid;
        type Creator = St::Creator;
        type IndexedAt = St::IndexedAt;
        type Name = Set<members::name>;
        type Purpose = St::Purpose;
        type Uri = St::Uri;
    }
    ///State transition - sets the `purpose` field to Set
    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 Cid = St::Cid;
        type Creator = St::Creator;
        type IndexedAt = St::IndexedAt;
        type Name = St::Name;
        type Purpose = Set<members::purpose>;
        type Uri = St::Uri;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetUri<St> {}
    impl<St: State> State for SetUri<St> {
        type Cid = St::Cid;
        type Creator = St::Creator;
        type IndexedAt = St::IndexedAt;
        type Name = St::Name;
        type Purpose = St::Purpose;
        type Uri = Set<members::uri>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `cid` field
        pub struct cid(());
        ///Marker type for the `creator` field
        pub struct creator(());
        ///Marker type for the `indexed_at` field
        pub struct indexed_at(());
        ///Marker type for the `name` field
        pub struct name(());
        ///Marker type for the `purpose` field
        pub struct purpose(());
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

/// Builder for constructing an instance of this type.
pub struct ListViewBuilder<St: list_view_state::State, S: BosStr = DefaultStr> {
    _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 ListView<DefaultStr> {
    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
    pub fn new() -> ListViewBuilder<list_view_state::Empty, DefaultStr> {
        ListViewBuilder::new()
    }
}

impl<S: BosStr> ListView<S> {
    /// Create a new builder for this type
    pub fn builder() -> ListViewBuilder<list_view_state::Empty, S> {
        ListViewBuilder::builder()
    }
}

impl ListViewBuilder<list_view_state::Empty, DefaultStr> {
    /// Create a new builder with all fields unset, using the default string type, if needed
    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> ListViewBuilder<list_view_state::Empty, S> {
    /// Create a new builder with all fields unset
    pub fn builder() -> Self {
        ListViewBuilder {
            _state: PhantomData,
            _fields: (
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
            ),
            _type: PhantomData,
        }
    }
}

impl<St: list_view_state::State, S: BosStr> ListViewBuilder<St, S> {
    /// Set the `avatar` field (optional)
    pub fn avatar(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `avatar` field to an Option value (optional)
    pub fn maybe_avatar(mut self, value: Option<UriValue<S>>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<St, S: BosStr> ListViewBuilder<St, S>
where
    St: list_view_state::State,
    St::Cid: list_view_state::IsUnset,
{
    /// Set the `cid` field (required)
    pub fn cid(
        mut self,
        value: impl Into<Cid<S>>,
    ) -> ListViewBuilder<list_view_state::SetCid<St>, S> {
        self._fields.1 = Option::Some(value.into());
        ListViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> ListViewBuilder<St, S>
where
    St: list_view_state::State,
    St::Creator: list_view_state::IsUnset,
{
    /// Set the `creator` field (required)
    pub fn creator(
        mut self,
        value: impl Into<ProfileView<S>>,
    ) -> ListViewBuilder<list_view_state::SetCreator<St>, S> {
        self._fields.2 = Option::Some(value.into());
        ListViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: list_view_state::State, S: BosStr> ListViewBuilder<St, S> {
    /// Set the `description` field (optional)
    pub fn description(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `description` field to an Option value (optional)
    pub fn maybe_description(mut self, value: Option<S>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<St: list_view_state::State, S: BosStr> ListViewBuilder<St, S> {
    /// Set the `descriptionFacets` field (optional)
    pub fn description_facets(
        mut self,
        value: impl Into<Option<Vec<Facet<S>>>>,
    ) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `descriptionFacets` field to an Option value (optional)
    pub fn maybe_description_facets(mut self, value: Option<Vec<Facet<S>>>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<St, S: BosStr> ListViewBuilder<St, S>
where
    St: list_view_state::State,
    St::IndexedAt: list_view_state::IsUnset,
{
    /// Set the `indexedAt` field (required)
    pub fn indexed_at(
        mut self,
        value: impl Into<Datetime>,
    ) -> ListViewBuilder<list_view_state::SetIndexedAt<St>, S> {
        self._fields.5 = Option::Some(value.into());
        ListViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: list_view_state::State, S: BosStr> ListViewBuilder<St, S> {
    /// Set the `labels` field (optional)
    pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `labels` field to an Option value (optional)
    pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<St: list_view_state::State, S: BosStr> ListViewBuilder<St, S> {
    /// Set the `listItemCount` field (optional)
    pub fn list_item_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.7 = value.into();
        self
    }
    /// Set the `listItemCount` field to an Option value (optional)
    pub fn maybe_list_item_count(mut self, value: Option<i64>) -> Self {
        self._fields.7 = value;
        self
    }
}

impl<St, S: BosStr> ListViewBuilder<St, S>
where
    St: list_view_state::State,
    St::Name: list_view_state::IsUnset,
{
    /// Set the `name` field (required)
    pub fn name(
        mut self,
        value: impl Into<S>,
    ) -> ListViewBuilder<list_view_state::SetName<St>, S> {
        self._fields.8 = Option::Some(value.into());
        ListViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> ListViewBuilder<St, S>
where
    St: list_view_state::State,
    St::Purpose: list_view_state::IsUnset,
{
    /// Set the `purpose` field (required)
    pub fn purpose(
        mut self,
        value: impl Into<graph::ListPurpose<S>>,
    ) -> ListViewBuilder<list_view_state::SetPurpose<St>, S> {
        self._fields.9 = Option::Some(value.into());
        ListViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> ListViewBuilder<St, S>
where
    St: list_view_state::State,
    St::Uri: list_view_state::IsUnset,
{
    /// Set the `uri` field (required)
    pub fn uri(
        mut self,
        value: impl Into<AtUri<S>>,
    ) -> ListViewBuilder<list_view_state::SetUri<St>, S> {
        self._fields.10 = Option::Some(value.into());
        ListViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: list_view_state::State, S: BosStr> ListViewBuilder<St, S> {
    /// Set the `viewer` field (optional)
    pub fn viewer(
        mut self,
        value: impl Into<Option<graph::ListViewerState<S>>>,
    ) -> Self {
        self._fields.11 = value.into();
        self
    }
    /// Set the `viewer` field to an Option value (optional)
    pub fn maybe_viewer(mut self, value: Option<graph::ListViewerState<S>>) -> Self {
        self._fields.11 = value;
        self
    }
}

impl<St, S: BosStr> ListViewBuilder<St, S>
where
    St: list_view_state::State,
    St::Cid: list_view_state::IsSet,
    St::Creator: list_view_state::IsSet,
    St::IndexedAt: list_view_state::IsSet,
    St::Name: list_view_state::IsSet,
    St::Purpose: list_view_state::IsSet,
    St::Uri: list_view_state::IsSet,
{
    /// Build the final struct.
    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(),
        }
    }
    /// Build the final struct with custom extra_data.
    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 {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Cid;
        type Name;
        type Purpose;
        type Uri;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Cid = Unset;
        type Name = Unset;
        type Purpose = Unset;
        type Uri = Unset;
    }
    ///State transition - sets the `cid` field to Set
    pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCid<St> {}
    impl<St: State> State for SetCid<St> {
        type Cid = Set<members::cid>;
        type Name = St::Name;
        type Purpose = St::Purpose;
        type Uri = St::Uri;
    }
    ///State transition - sets the `name` field to Set
    pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetName<St> {}
    impl<St: State> State for SetName<St> {
        type Cid = St::Cid;
        type Name = Set<members::name>;
        type Purpose = St::Purpose;
        type Uri = St::Uri;
    }
    ///State transition - sets the `purpose` field to Set
    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 Cid = St::Cid;
        type Name = St::Name;
        type Purpose = Set<members::purpose>;
        type Uri = St::Uri;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetUri<St> {}
    impl<St: State> State for SetUri<St> {
        type Cid = St::Cid;
        type Name = St::Name;
        type Purpose = St::Purpose;
        type Uri = Set<members::uri>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `cid` field
        pub struct cid(());
        ///Marker type for the `name` field
        pub struct name(());
        ///Marker type for the `purpose` field
        pub struct purpose(());
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

/// Builder for constructing an instance of this type.
pub struct ListViewBasicBuilder<
    St: list_view_basic_state::State,
    S: BosStr = DefaultStr,
> {
    _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 ListViewBasic<DefaultStr> {
    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
    pub fn new() -> ListViewBasicBuilder<list_view_basic_state::Empty, DefaultStr> {
        ListViewBasicBuilder::new()
    }
}

impl<S: BosStr> ListViewBasic<S> {
    /// Create a new builder for this type
    pub fn builder() -> ListViewBasicBuilder<list_view_basic_state::Empty, S> {
        ListViewBasicBuilder::builder()
    }
}

impl ListViewBasicBuilder<list_view_basic_state::Empty, DefaultStr> {
    /// Create a new builder with all fields unset, using the default string type, if needed
    pub fn new() -> Self {
        ListViewBasicBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None, None, None, None),
            _type: PhantomData,
        }
    }
}

impl<S: BosStr> ListViewBasicBuilder<list_view_basic_state::Empty, S> {
    /// Create a new builder with all fields unset
    pub fn builder() -> Self {
        ListViewBasicBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None, None, None, None),
            _type: PhantomData,
        }
    }
}

impl<St: list_view_basic_state::State, S: BosStr> ListViewBasicBuilder<St, S> {
    /// Set the `avatar` field (optional)
    pub fn avatar(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `avatar` field to an Option value (optional)
    pub fn maybe_avatar(mut self, value: Option<UriValue<S>>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<St, S: BosStr> ListViewBasicBuilder<St, S>
where
    St: list_view_basic_state::State,
    St::Cid: list_view_basic_state::IsUnset,
{
    /// Set the `cid` field (required)
    pub fn cid(
        mut self,
        value: impl Into<Cid<S>>,
    ) -> ListViewBasicBuilder<list_view_basic_state::SetCid<St>, S> {
        self._fields.1 = Option::Some(value.into());
        ListViewBasicBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: list_view_basic_state::State, S: BosStr> ListViewBasicBuilder<St, S> {
    /// Set the `indexedAt` field (optional)
    pub fn indexed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `indexedAt` field to an Option value (optional)
    pub fn maybe_indexed_at(mut self, value: Option<Datetime>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<St: list_view_basic_state::State, S: BosStr> ListViewBasicBuilder<St, S> {
    /// Set the `labels` field (optional)
    pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `labels` field to an Option value (optional)
    pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<St: list_view_basic_state::State, S: BosStr> ListViewBasicBuilder<St, S> {
    /// Set the `listItemCount` field (optional)
    pub fn list_item_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `listItemCount` field to an Option value (optional)
    pub fn maybe_list_item_count(mut self, value: Option<i64>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<St, S: BosStr> ListViewBasicBuilder<St, S>
where
    St: list_view_basic_state::State,
    St::Name: list_view_basic_state::IsUnset,
{
    /// Set the `name` field (required)
    pub fn name(
        mut self,
        value: impl Into<S>,
    ) -> ListViewBasicBuilder<list_view_basic_state::SetName<St>, S> {
        self._fields.5 = Option::Some(value.into());
        ListViewBasicBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> ListViewBasicBuilder<St, S>
where
    St: list_view_basic_state::State,
    St::Purpose: list_view_basic_state::IsUnset,
{
    /// Set the `purpose` field (required)
    pub fn purpose(
        mut self,
        value: impl Into<graph::ListPurpose<S>>,
    ) -> ListViewBasicBuilder<list_view_basic_state::SetPurpose<St>, S> {
        self._fields.6 = Option::Some(value.into());
        ListViewBasicBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> ListViewBasicBuilder<St, S>
where
    St: list_view_basic_state::State,
    St::Uri: list_view_basic_state::IsUnset,
{
    /// Set the `uri` field (required)
    pub fn uri(
        mut self,
        value: impl Into<AtUri<S>>,
    ) -> ListViewBasicBuilder<list_view_basic_state::SetUri<St>, S> {
        self._fields.7 = Option::Some(value.into());
        ListViewBasicBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: list_view_basic_state::State, S: BosStr> ListViewBasicBuilder<St, S> {
    /// Set the `viewer` field (optional)
    pub fn viewer(
        mut self,
        value: impl Into<Option<graph::ListViewerState<S>>>,
    ) -> Self {
        self._fields.8 = value.into();
        self
    }
    /// Set the `viewer` field to an Option value (optional)
    pub fn maybe_viewer(mut self, value: Option<graph::ListViewerState<S>>) -> Self {
        self._fields.8 = value;
        self
    }
}

impl<St, S: BosStr> ListViewBasicBuilder<St, S>
where
    St: list_view_basic_state::State,
    St::Cid: list_view_basic_state::IsSet,
    St::Name: list_view_basic_state::IsSet,
    St::Purpose: list_view_basic_state::IsSet,
    St::Uri: list_view_basic_state::IsSet,
{
    /// Build the final struct.
    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(),
        }
    }
    /// Build the final struct with custom extra_data.
    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 {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Actor;
        type NotFound;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Actor = Unset;
        type NotFound = Unset;
    }
    ///State transition - sets the `actor` field to Set
    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;
    }
    ///State transition - sets the `not_found` field to Set
    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>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `actor` field
        pub struct actor(());
        ///Marker type for the `not_found` field
        pub struct not_found(());
    }
}

/// Builder for constructing an instance of this type.
pub struct NotFoundActorBuilder<
    St: not_found_actor_state::State,
    S: BosStr = DefaultStr,
> {
    _state: PhantomData<fn() -> St>,
    _fields: (Option<AtIdentifier<S>>, Option<bool>),
    _type: PhantomData<fn() -> S>,
}

impl NotFoundActor<DefaultStr> {
    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
    pub fn new() -> NotFoundActorBuilder<not_found_actor_state::Empty, DefaultStr> {
        NotFoundActorBuilder::new()
    }
}

impl<S: BosStr> NotFoundActor<S> {
    /// Create a new builder for this type
    pub fn builder() -> NotFoundActorBuilder<not_found_actor_state::Empty, S> {
        NotFoundActorBuilder::builder()
    }
}

impl NotFoundActorBuilder<not_found_actor_state::Empty, DefaultStr> {
    /// Create a new builder with all fields unset, using the default string type, if needed
    pub fn new() -> Self {
        NotFoundActorBuilder {
            _state: PhantomData,
            _fields: (None, None),
            _type: PhantomData,
        }
    }
}

impl<S: BosStr> NotFoundActorBuilder<not_found_actor_state::Empty, S> {
    /// Create a new builder with all fields unset
    pub fn builder() -> Self {
        NotFoundActorBuilder {
            _state: PhantomData,
            _fields: (None, None),
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> NotFoundActorBuilder<St, S>
where
    St: not_found_actor_state::State,
    St::Actor: not_found_actor_state::IsUnset,
{
    /// Set the `actor` field (required)
    pub fn actor(
        mut self,
        value: impl Into<AtIdentifier<S>>,
    ) -> NotFoundActorBuilder<not_found_actor_state::SetActor<St>, S> {
        self._fields.0 = Option::Some(value.into());
        NotFoundActorBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> NotFoundActorBuilder<St, S>
where
    St: not_found_actor_state::State,
    St::NotFound: not_found_actor_state::IsUnset,
{
    /// Set the `notFound` field (required)
    pub fn not_found(
        mut self,
        value: impl Into<bool>,
    ) -> NotFoundActorBuilder<not_found_actor_state::SetNotFound<St>, S> {
        self._fields.1 = Option::Some(value.into());
        NotFoundActorBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> NotFoundActorBuilder<St, S>
where
    St: not_found_actor_state::State,
    St::Actor: not_found_actor_state::IsSet,
    St::NotFound: not_found_actor_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> NotFoundActor<S> {
        NotFoundActor {
            actor: self._fields.0.unwrap(),
            not_found: self._fields.1.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> 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 {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Did;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Did = Unset;
    }
    ///State transition - sets the `did` field to Set
    pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetDid<St> {}
    impl<St: State> State for SetDid<St> {
        type Did = Set<members::did>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `did` field
        pub struct did(());
    }
}

/// Builder for constructing an instance of this type.
pub struct RelationshipBuilder<St: relationship_state::State, S: BosStr = DefaultStr> {
    _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 Relationship<DefaultStr> {
    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
    pub fn new() -> RelationshipBuilder<relationship_state::Empty, DefaultStr> {
        RelationshipBuilder::new()
    }
}

impl<S: BosStr> Relationship<S> {
    /// Create a new builder for this type
    pub fn builder() -> RelationshipBuilder<relationship_state::Empty, S> {
        RelationshipBuilder::builder()
    }
}

impl RelationshipBuilder<relationship_state::Empty, DefaultStr> {
    /// Create a new builder with all fields unset, using the default string type, if needed
    pub fn new() -> Self {
        RelationshipBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None, None),
            _type: PhantomData,
        }
    }
}

impl<S: BosStr> RelationshipBuilder<relationship_state::Empty, S> {
    /// Create a new builder with all fields unset
    pub fn builder() -> Self {
        RelationshipBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None, None),
            _type: PhantomData,
        }
    }
}

impl<St: relationship_state::State, S: BosStr> RelationshipBuilder<St, S> {
    /// Set the `blockedBy` field (optional)
    pub fn blocked_by(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `blockedBy` field to an Option value (optional)
    pub fn maybe_blocked_by(mut self, value: Option<AtUri<S>>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<St: relationship_state::State, S: BosStr> RelationshipBuilder<St, S> {
    /// Set the `blockedByList` field (optional)
    pub fn blocked_by_list(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `blockedByList` field to an Option value (optional)
    pub fn maybe_blocked_by_list(mut self, value: Option<AtUri<S>>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<St: relationship_state::State, S: BosStr> RelationshipBuilder<St, S> {
    /// Set the `blocking` field (optional)
    pub fn blocking(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `blocking` field to an Option value (optional)
    pub fn maybe_blocking(mut self, value: Option<AtUri<S>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<St: relationship_state::State, S: BosStr> RelationshipBuilder<St, S> {
    /// Set the `blockingByList` field (optional)
    pub fn blocking_by_list(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `blockingByList` field to an Option value (optional)
    pub fn maybe_blocking_by_list(mut self, value: Option<AtUri<S>>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<St, S: BosStr> RelationshipBuilder<St, S>
where
    St: relationship_state::State,
    St::Did: relationship_state::IsUnset,
{
    /// Set the `did` field (required)
    pub fn did(
        mut self,
        value: impl Into<Did<S>>,
    ) -> RelationshipBuilder<relationship_state::SetDid<St>, S> {
        self._fields.4 = Option::Some(value.into());
        RelationshipBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: relationship_state::State, S: BosStr> RelationshipBuilder<St, S> {
    /// Set the `followedBy` field (optional)
    pub fn followed_by(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
        self._fields.5 = value.into();
        self
    }
    /// Set the `followedBy` field to an Option value (optional)
    pub fn maybe_followed_by(mut self, value: Option<AtUri<S>>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<St: relationship_state::State, S: BosStr> RelationshipBuilder<St, S> {
    /// Set the `following` field (optional)
    pub fn following(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `following` field to an Option value (optional)
    pub fn maybe_following(mut self, value: Option<AtUri<S>>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<St, S: BosStr> RelationshipBuilder<St, S>
where
    St: relationship_state::State,
    St::Did: relationship_state::IsSet,
{
    /// Build the final struct.
    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(),
        }
    }
    /// Build the final struct with custom extra_data.
    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 {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Cid;
        type Creator;
        type IndexedAt;
        type Record;
        type Uri;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Cid = Unset;
        type Creator = Unset;
        type IndexedAt = Unset;
        type Record = Unset;
        type Uri = Unset;
    }
    ///State transition - sets the `cid` field to Set
    pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCid<St> {}
    impl<St: State> State for SetCid<St> {
        type Cid = Set<members::cid>;
        type Creator = St::Creator;
        type IndexedAt = St::IndexedAt;
        type Record = St::Record;
        type Uri = St::Uri;
    }
    ///State transition - sets the `creator` field to Set
    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 Cid = St::Cid;
        type Creator = Set<members::creator>;
        type IndexedAt = St::IndexedAt;
        type Record = St::Record;
        type Uri = St::Uri;
    }
    ///State transition - sets the `indexed_at` field to Set
    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 Cid = St::Cid;
        type Creator = St::Creator;
        type IndexedAt = Set<members::indexed_at>;
        type Record = St::Record;
        type Uri = St::Uri;
    }
    ///State transition - sets the `record` field to Set
    pub struct SetRecord<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetRecord<St> {}
    impl<St: State> State for SetRecord<St> {
        type Cid = St::Cid;
        type Creator = St::Creator;
        type IndexedAt = St::IndexedAt;
        type Record = Set<members::record>;
        type Uri = St::Uri;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetUri<St> {}
    impl<St: State> State for SetUri<St> {
        type Cid = St::Cid;
        type Creator = St::Creator;
        type IndexedAt = St::IndexedAt;
        type Record = St::Record;
        type Uri = Set<members::uri>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `cid` field
        pub struct cid(());
        ///Marker type for the `creator` field
        pub struct creator(());
        ///Marker type for the `indexed_at` field
        pub struct indexed_at(());
        ///Marker type for the `record` field
        pub struct record(());
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

/// Builder for constructing an instance of this type.
pub struct StarterPackViewBuilder<
    St: starter_pack_view_state::State,
    S: BosStr = DefaultStr,
> {
    _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 StarterPackView<DefaultStr> {
    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
    pub fn new() -> StarterPackViewBuilder<starter_pack_view_state::Empty, DefaultStr> {
        StarterPackViewBuilder::new()
    }
}

impl<S: BosStr> StarterPackView<S> {
    /// Create a new builder for this type
    pub fn builder() -> StarterPackViewBuilder<starter_pack_view_state::Empty, S> {
        StarterPackViewBuilder::builder()
    }
}

impl StarterPackViewBuilder<starter_pack_view_state::Empty, DefaultStr> {
    /// Create a new builder with all fields unset, using the default string type, if needed
    pub fn new() -> Self {
        StarterPackViewBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None, None, None, None, None, None),
            _type: PhantomData,
        }
    }
}

impl<S: BosStr> StarterPackViewBuilder<starter_pack_view_state::Empty, S> {
    /// Create a new builder with all fields unset
    pub fn builder() -> Self {
        StarterPackViewBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None, None, None, None, None, None),
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> StarterPackViewBuilder<St, S>
where
    St: starter_pack_view_state::State,
    St::Cid: starter_pack_view_state::IsUnset,
{
    /// Set the `cid` field (required)
    pub fn cid(
        mut self,
        value: impl Into<Cid<S>>,
    ) -> StarterPackViewBuilder<starter_pack_view_state::SetCid<St>, S> {
        self._fields.0 = Option::Some(value.into());
        StarterPackViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> StarterPackViewBuilder<St, S>
where
    St: starter_pack_view_state::State,
    St::Creator: starter_pack_view_state::IsUnset,
{
    /// Set the `creator` field (required)
    pub fn creator(
        mut self,
        value: impl Into<ProfileViewBasic<S>>,
    ) -> StarterPackViewBuilder<starter_pack_view_state::SetCreator<St>, S> {
        self._fields.1 = Option::Some(value.into());
        StarterPackViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: starter_pack_view_state::State, S: BosStr> StarterPackViewBuilder<St, S> {
    /// Set the `feeds` field (optional)
    pub fn feeds(mut self, value: impl Into<Option<Vec<GeneratorView<S>>>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `feeds` field to an Option value (optional)
    pub fn maybe_feeds(mut self, value: Option<Vec<GeneratorView<S>>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<St, S: BosStr> StarterPackViewBuilder<St, S>
where
    St: starter_pack_view_state::State,
    St::IndexedAt: starter_pack_view_state::IsUnset,
{
    /// Set the `indexedAt` field (required)
    pub fn indexed_at(
        mut self,
        value: impl Into<Datetime>,
    ) -> StarterPackViewBuilder<starter_pack_view_state::SetIndexedAt<St>, S> {
        self._fields.3 = Option::Some(value.into());
        StarterPackViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: starter_pack_view_state::State, S: BosStr> StarterPackViewBuilder<St, S> {
    /// Set the `joinedAllTimeCount` field (optional)
    pub fn joined_all_time_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `joinedAllTimeCount` field to an Option value (optional)
    pub fn maybe_joined_all_time_count(mut self, value: Option<i64>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<St: starter_pack_view_state::State, S: BosStr> StarterPackViewBuilder<St, S> {
    /// Set the `joinedWeekCount` field (optional)
    pub fn joined_week_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.5 = value.into();
        self
    }
    /// Set the `joinedWeekCount` field to an Option value (optional)
    pub fn maybe_joined_week_count(mut self, value: Option<i64>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<St: starter_pack_view_state::State, S: BosStr> StarterPackViewBuilder<St, S> {
    /// Set the `labels` field (optional)
    pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `labels` field to an Option value (optional)
    pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<St: starter_pack_view_state::State, S: BosStr> StarterPackViewBuilder<St, S> {
    /// Set the `list` field (optional)
    pub fn list(mut self, value: impl Into<Option<graph::ListViewBasic<S>>>) -> Self {
        self._fields.7 = value.into();
        self
    }
    /// Set the `list` field to an Option value (optional)
    pub fn maybe_list(mut self, value: Option<graph::ListViewBasic<S>>) -> Self {
        self._fields.7 = value;
        self
    }
}

impl<St: starter_pack_view_state::State, S: BosStr> StarterPackViewBuilder<St, S> {
    /// Set the `listItemsSample` field (optional)
    pub fn list_items_sample(
        mut self,
        value: impl Into<Option<Vec<graph::ListItemView<S>>>>,
    ) -> Self {
        self._fields.8 = value.into();
        self
    }
    /// Set the `listItemsSample` field to an Option value (optional)
    pub fn maybe_list_items_sample(
        mut self,
        value: Option<Vec<graph::ListItemView<S>>>,
    ) -> Self {
        self._fields.8 = value;
        self
    }
}

impl<St, S: BosStr> StarterPackViewBuilder<St, S>
where
    St: starter_pack_view_state::State,
    St::Record: starter_pack_view_state::IsUnset,
{
    /// Set the `record` field (required)
    pub fn record(
        mut self,
        value: impl Into<Data<S>>,
    ) -> StarterPackViewBuilder<starter_pack_view_state::SetRecord<St>, S> {
        self._fields.9 = Option::Some(value.into());
        StarterPackViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> StarterPackViewBuilder<St, S>
where
    St: starter_pack_view_state::State,
    St::Uri: starter_pack_view_state::IsUnset,
{
    /// Set the `uri` field (required)
    pub fn uri(
        mut self,
        value: impl Into<AtUri<S>>,
    ) -> StarterPackViewBuilder<starter_pack_view_state::SetUri<St>, S> {
        self._fields.10 = Option::Some(value.into());
        StarterPackViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> StarterPackViewBuilder<St, S>
where
    St: starter_pack_view_state::State,
    St::Cid: starter_pack_view_state::IsSet,
    St::Creator: starter_pack_view_state::IsSet,
    St::IndexedAt: starter_pack_view_state::IsSet,
    St::Record: starter_pack_view_state::IsSet,
    St::Uri: starter_pack_view_state::IsSet,
{
    /// Build the final struct.
    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(),
        }
    }
    /// Build the final struct with custom extra_data.
    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 {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Cid;
        type Creator;
        type IndexedAt;
        type Record;
        type Uri;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Cid = Unset;
        type Creator = Unset;
        type IndexedAt = Unset;
        type Record = Unset;
        type Uri = Unset;
    }
    ///State transition - sets the `cid` field to Set
    pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCid<St> {}
    impl<St: State> State for SetCid<St> {
        type Cid = Set<members::cid>;
        type Creator = St::Creator;
        type IndexedAt = St::IndexedAt;
        type Record = St::Record;
        type Uri = St::Uri;
    }
    ///State transition - sets the `creator` field to Set
    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 Cid = St::Cid;
        type Creator = Set<members::creator>;
        type IndexedAt = St::IndexedAt;
        type Record = St::Record;
        type Uri = St::Uri;
    }
    ///State transition - sets the `indexed_at` field to Set
    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 Cid = St::Cid;
        type Creator = St::Creator;
        type IndexedAt = Set<members::indexed_at>;
        type Record = St::Record;
        type Uri = St::Uri;
    }
    ///State transition - sets the `record` field to Set
    pub struct SetRecord<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetRecord<St> {}
    impl<St: State> State for SetRecord<St> {
        type Cid = St::Cid;
        type Creator = St::Creator;
        type IndexedAt = St::IndexedAt;
        type Record = Set<members::record>;
        type Uri = St::Uri;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetUri<St> {}
    impl<St: State> State for SetUri<St> {
        type Cid = St::Cid;
        type Creator = St::Creator;
        type IndexedAt = St::IndexedAt;
        type Record = St::Record;
        type Uri = Set<members::uri>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `cid` field
        pub struct cid(());
        ///Marker type for the `creator` field
        pub struct creator(());
        ///Marker type for the `indexed_at` field
        pub struct indexed_at(());
        ///Marker type for the `record` field
        pub struct record(());
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

/// Builder for constructing an instance of this type.
pub struct StarterPackViewBasicBuilder<
    St: starter_pack_view_basic_state::State,
    S: BosStr = DefaultStr,
> {
    _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 StarterPackViewBasic<DefaultStr> {
    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
    pub fn new() -> StarterPackViewBasicBuilder<
        starter_pack_view_basic_state::Empty,
        DefaultStr,
    > {
        StarterPackViewBasicBuilder::new()
    }
}

impl<S: BosStr> StarterPackViewBasic<S> {
    /// Create a new builder for this type
    pub fn builder() -> StarterPackViewBasicBuilder<
        starter_pack_view_basic_state::Empty,
        S,
    > {
        StarterPackViewBasicBuilder::builder()
    }
}

impl StarterPackViewBasicBuilder<starter_pack_view_basic_state::Empty, DefaultStr> {
    /// Create a new builder with all fields unset, using the default string type, if needed
    pub fn new() -> Self {
        StarterPackViewBasicBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None, None, None, None),
            _type: PhantomData,
        }
    }
}

impl<S: BosStr> StarterPackViewBasicBuilder<starter_pack_view_basic_state::Empty, S> {
    /// Create a new builder with all fields unset
    pub fn builder() -> Self {
        StarterPackViewBasicBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None, None, None, None),
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> StarterPackViewBasicBuilder<St, S>
where
    St: starter_pack_view_basic_state::State,
    St::Cid: starter_pack_view_basic_state::IsUnset,
{
    /// Set the `cid` field (required)
    pub fn cid(
        mut self,
        value: impl Into<Cid<S>>,
    ) -> StarterPackViewBasicBuilder<starter_pack_view_basic_state::SetCid<St>, S> {
        self._fields.0 = Option::Some(value.into());
        StarterPackViewBasicBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> StarterPackViewBasicBuilder<St, S>
where
    St: starter_pack_view_basic_state::State,
    St::Creator: starter_pack_view_basic_state::IsUnset,
{
    /// Set the `creator` field (required)
    pub fn creator(
        mut self,
        value: impl Into<ProfileViewBasic<S>>,
    ) -> StarterPackViewBasicBuilder<starter_pack_view_basic_state::SetCreator<St>, S> {
        self._fields.1 = Option::Some(value.into());
        StarterPackViewBasicBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> StarterPackViewBasicBuilder<St, S>
where
    St: starter_pack_view_basic_state::State,
    St::IndexedAt: starter_pack_view_basic_state::IsUnset,
{
    /// Set the `indexedAt` field (required)
    pub fn indexed_at(
        mut self,
        value: impl Into<Datetime>,
    ) -> StarterPackViewBasicBuilder<
        starter_pack_view_basic_state::SetIndexedAt<St>,
        S,
    > {
        self._fields.2 = Option::Some(value.into());
        StarterPackViewBasicBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<
    St: starter_pack_view_basic_state::State,
    S: BosStr,
> StarterPackViewBasicBuilder<St, S> {
    /// Set the `joinedAllTimeCount` field (optional)
    pub fn joined_all_time_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `joinedAllTimeCount` field to an Option value (optional)
    pub fn maybe_joined_all_time_count(mut self, value: Option<i64>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<
    St: starter_pack_view_basic_state::State,
    S: BosStr,
> StarterPackViewBasicBuilder<St, S> {
    /// Set the `joinedWeekCount` field (optional)
    pub fn joined_week_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `joinedWeekCount` field to an Option value (optional)
    pub fn maybe_joined_week_count(mut self, value: Option<i64>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<
    St: starter_pack_view_basic_state::State,
    S: BosStr,
> StarterPackViewBasicBuilder<St, S> {
    /// Set the `labels` field (optional)
    pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
        self._fields.5 = value.into();
        self
    }
    /// Set the `labels` field to an Option value (optional)
    pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<
    St: starter_pack_view_basic_state::State,
    S: BosStr,
> StarterPackViewBasicBuilder<St, S> {
    /// Set the `listItemCount` field (optional)
    pub fn list_item_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `listItemCount` field to an Option value (optional)
    pub fn maybe_list_item_count(mut self, value: Option<i64>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<St, S: BosStr> StarterPackViewBasicBuilder<St, S>
where
    St: starter_pack_view_basic_state::State,
    St::Record: starter_pack_view_basic_state::IsUnset,
{
    /// Set the `record` field (required)
    pub fn record(
        mut self,
        value: impl Into<Data<S>>,
    ) -> StarterPackViewBasicBuilder<starter_pack_view_basic_state::SetRecord<St>, S> {
        self._fields.7 = Option::Some(value.into());
        StarterPackViewBasicBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> StarterPackViewBasicBuilder<St, S>
where
    St: starter_pack_view_basic_state::State,
    St::Uri: starter_pack_view_basic_state::IsUnset,
{
    /// Set the `uri` field (required)
    pub fn uri(
        mut self,
        value: impl Into<AtUri<S>>,
    ) -> StarterPackViewBasicBuilder<starter_pack_view_basic_state::SetUri<St>, S> {
        self._fields.8 = Option::Some(value.into());
        StarterPackViewBasicBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> StarterPackViewBasicBuilder<St, S>
where
    St: starter_pack_view_basic_state::State,
    St::Cid: starter_pack_view_basic_state::IsSet,
    St::Creator: starter_pack_view_basic_state::IsSet,
    St::IndexedAt: starter_pack_view_basic_state::IsSet,
    St::Record: starter_pack_view_basic_state::IsSet,
    St::Uri: starter_pack_view_basic_state::IsSet,
{
    /// Build the final struct.
    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(),
        }
    }
    /// Build the final struct with custom extra_data.
    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),
        }
    }
}