// @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.

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;

#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
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, lexicon};
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")
    }
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ListItemView<'a> {
    #[serde(borrow)]
    pub subject: ProfileView<'a>,
    #[serde(borrow)]
    pub uri: AtUri<'a>,
}


#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ListPurpose<'a> {
    AppBskyGraphDefsModlist,
    AppBskyGraphDefsCuratelist,
    AppBskyGraphDefsReferencelist,
    Other(CowStr<'a>),
}

impl<'a> ListPurpose<'a> {
    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(),
        }
    }
}

impl<'a> From<&'a str> for ListPurpose<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "app.bsky.graph.defs#modlist" => Self::AppBskyGraphDefsModlist,
            "app.bsky.graph.defs#curatelist" => Self::AppBskyGraphDefsCuratelist,
            "app.bsky.graph.defs#referencelist" => Self::AppBskyGraphDefsReferencelist,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for ListPurpose<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "app.bsky.graph.defs#modlist" => Self::AppBskyGraphDefsModlist,
            "app.bsky.graph.defs#curatelist" => Self::AppBskyGraphDefsCuratelist,
            "app.bsky.graph.defs#referencelist" => Self::AppBskyGraphDefsReferencelist,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> AsRef<str> for ListPurpose<'a> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<'a> core::fmt::Display for ListPurpose<'a> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<'a> serde::Serialize for ListPurpose<'a> {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, 'a> serde::Deserialize<'de> for ListPurpose<'a>
where
    'de: 'a,
{
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = <&'de str>::deserialize(deserializer)?;
        Ok(Self::from(s))
    }
}

impl jacquard_common::IntoStatic for ListPurpose<'_> {
    type Output = ListPurpose<'static>;
    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()),
        }
    }
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ListView<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub avatar: Option<UriValue<'a>>,
    #[serde(borrow)]
    pub cid: Cid<'a>,
    #[serde(borrow)]
    pub creator: ProfileView<'a>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub description: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub description_facets: Option<Vec<Facet<'a>>>,
    pub indexed_at: Datetime,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub labels: Option<Vec<Label<'a>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub list_item_count: Option<i64>,
    #[serde(borrow)]
    pub name: CowStr<'a>,
    #[serde(borrow)]
    pub purpose: graph::ListPurpose<'a>,
    #[serde(borrow)]
    pub uri: AtUri<'a>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub viewer: Option<graph::ListViewerState<'a>>,
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ListViewBasic<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub avatar: Option<UriValue<'a>>,
    #[serde(borrow)]
    pub cid: Cid<'a>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub indexed_at: Option<Datetime>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub labels: Option<Vec<Label<'a>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub list_item_count: Option<i64>,
    #[serde(borrow)]
    pub name: CowStr<'a>,
    #[serde(borrow)]
    pub purpose: graph::ListPurpose<'a>,
    #[serde(borrow)]
    pub uri: AtUri<'a>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub viewer: Option<graph::ListViewerState<'a>>,
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ListViewerState<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub blocked: Option<AtUri<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub muted: Option<bool>,
}

/// 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

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct NotFoundActor<'a> {
    #[serde(borrow)]
    pub actor: AtIdentifier<'a>,
    pub not_found: bool,
}

/// 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)

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Relationship<'a> {
    ///if the actor is blocked by this DID, contains the AT-URI of the block record
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub blocked_by: Option<AtUri<'a>>,
    ///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")]
    #[serde(borrow)]
    pub blocked_by_list: Option<AtUri<'a>>,
    ///if the actor blocks this DID, this is the AT-URI of the block record
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub blocking: Option<AtUri<'a>>,
    ///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")]
    #[serde(borrow)]
    pub blocking_by_list: Option<AtUri<'a>>,
    #[serde(borrow)]
    pub did: Did<'a>,
    ///if the actor is followed by this DID, contains the AT-URI of the follow record
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub followed_by: Option<AtUri<'a>>,
    ///if the actor follows this DID, this is the AT-URI of the follow record
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub following: Option<AtUri<'a>>,
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct StarterPackView<'a> {
    #[serde(borrow)]
    pub cid: Cid<'a>,
    #[serde(borrow)]
    pub creator: ProfileViewBasic<'a>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub feeds: Option<Vec<GeneratorView<'a>>>,
    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")]
    #[serde(borrow)]
    pub labels: Option<Vec<Label<'a>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub list: Option<graph::ListViewBasic<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub list_items_sample: Option<Vec<graph::ListItemView<'a>>>,
    #[serde(borrow)]
    pub record: Data<'a>,
    #[serde(borrow)]
    pub uri: AtUri<'a>,
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct StarterPackViewBasic<'a> {
    #[serde(borrow)]
    pub cid: Cid<'a>,
    #[serde(borrow)]
    pub creator: ProfileViewBasic<'a>,
    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")]
    #[serde(borrow)]
    pub labels: Option<Vec<Label<'a>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub list_item_count: Option<i64>,
    #[serde(borrow)]
    pub record: Data<'a>,
    #[serde(borrow)]
    pub uri: AtUri<'a>,
}

impl<'a> LexiconSchema for ListItemView<'a> {
    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<'a> LexiconSchema for ListView<'a> {
    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<'a> LexiconSchema for ListViewBasic<'a> {
    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<'a> LexiconSchema for ListViewerState<'a> {
    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<'a> LexiconSchema for NotFoundActor<'a> {
    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<'a> LexiconSchema for Relationship<'a> {
    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<'a> LexiconSchema for StarterPackView<'a> {
    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<'a> LexiconSchema for StarterPackViewBasic<'a> {
    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<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetSubject<S> {}
    impl<S: State> State for SetSubject<S> {
        type Subject = Set<members::subject>;
        type Uri = S::Uri;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetUri<S> {}
    impl<S: State> State for SetUri<S> {
        type Subject = S::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<'a, S: list_item_view_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (Option<ProfileView<'a>>, Option<AtUri<'a>>),
    _lifetime: PhantomData<&'a ()>,
}

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

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

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

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

impl<'a, S> ListItemViewBuilder<'a, S>
where
    S: list_item_view_state::State,
    S::Subject: list_item_view_state::IsSet,
    S::Uri: list_item_view_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> ListItemView<'a> {
        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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> ListItemView<'a> {
        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 Purpose;
        type Uri;
        type IndexedAt;
        type Cid;
        type Creator;
        type Name;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Purpose = Unset;
        type Uri = Unset;
        type IndexedAt = Unset;
        type Cid = Unset;
        type Creator = Unset;
        type Name = Unset;
    }
    ///State transition - sets the `purpose` field to Set
    pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetPurpose<S> {}
    impl<S: State> State for SetPurpose<S> {
        type Purpose = Set<members::purpose>;
        type Uri = S::Uri;
        type IndexedAt = S::IndexedAt;
        type Cid = S::Cid;
        type Creator = S::Creator;
        type Name = S::Name;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetUri<S> {}
    impl<S: State> State for SetUri<S> {
        type Purpose = S::Purpose;
        type Uri = Set<members::uri>;
        type IndexedAt = S::IndexedAt;
        type Cid = S::Cid;
        type Creator = S::Creator;
        type Name = S::Name;
    }
    ///State transition - sets the `indexed_at` field to Set
    pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
    impl<S: State> State for SetIndexedAt<S> {
        type Purpose = S::Purpose;
        type Uri = S::Uri;
        type IndexedAt = Set<members::indexed_at>;
        type Cid = S::Cid;
        type Creator = S::Creator;
        type Name = S::Name;
    }
    ///State transition - sets the `cid` field to Set
    pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCid<S> {}
    impl<S: State> State for SetCid<S> {
        type Purpose = S::Purpose;
        type Uri = S::Uri;
        type IndexedAt = S::IndexedAt;
        type Cid = Set<members::cid>;
        type Creator = S::Creator;
        type Name = S::Name;
    }
    ///State transition - sets the `creator` field to Set
    pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCreator<S> {}
    impl<S: State> State for SetCreator<S> {
        type Purpose = S::Purpose;
        type Uri = S::Uri;
        type IndexedAt = S::IndexedAt;
        type Cid = S::Cid;
        type Creator = Set<members::creator>;
        type Name = S::Name;
    }
    ///State transition - sets the `name` field to Set
    pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetName<S> {}
    impl<S: State> State for SetName<S> {
        type Purpose = S::Purpose;
        type Uri = S::Uri;
        type IndexedAt = S::IndexedAt;
        type Cid = S::Cid;
        type Creator = S::Creator;
        type Name = Set<members::name>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `purpose` field
        pub struct purpose(());
        ///Marker type for the `uri` field
        pub struct uri(());
        ///Marker type for the `indexed_at` field
        pub struct indexed_at(());
        ///Marker type for the `cid` field
        pub struct cid(());
        ///Marker type for the `creator` field
        pub struct creator(());
        ///Marker type for the `name` field
        pub struct name(());
    }
}

/// Builder for constructing an instance of this type
pub struct ListViewBuilder<'a, S: list_view_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<UriValue<'a>>,
        Option<Cid<'a>>,
        Option<ProfileView<'a>>,
        Option<CowStr<'a>>,
        Option<Vec<Facet<'a>>>,
        Option<Datetime>,
        Option<Vec<Label<'a>>>,
        Option<i64>,
        Option<CowStr<'a>>,
        Option<graph::ListPurpose<'a>>,
        Option<AtUri<'a>>,
        Option<graph::ListViewerState<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

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

impl<'a> ListViewBuilder<'a, list_view_state::Empty> {
    /// Create a new builder with all fields unset
    pub fn new() -> Self {
        ListViewBuilder {
            _state: PhantomData,
            _fields: (
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
            ),
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> {
    /// Set the `avatar` field (optional)
    pub fn avatar(mut self, value: impl Into<Option<UriValue<'a>>>) -> 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<'a>>) -> Self {
        self._fields.0 = value;
        self
    }
}

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

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

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

impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> {
    /// Set the `descriptionFacets` field (optional)
    pub fn description_facets(
        mut self,
        value: impl Into<Option<Vec<Facet<'a>>>>,
    ) -> 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<'a>>>) -> Self {
        self._fields.4 = value;
        self
    }
}

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

impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> {
    /// Set the `labels` field (optional)
    pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> 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<'a>>>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<'a, S: list_view_state::State> ListViewBuilder<'a, 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<'a, S> ListViewBuilder<'a, S>
where
    S: list_view_state::State,
    S::Name: list_view_state::IsUnset,
{
    /// Set the `name` field (required)
    pub fn name(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> ListViewBuilder<'a, list_view_state::SetName<S>> {
        self._fields.8 = Option::Some(value.into());
        ListViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

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

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

impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> {
    /// Set the `viewer` field (optional)
    pub fn viewer(
        mut self,
        value: impl Into<Option<graph::ListViewerState<'a>>>,
    ) -> 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<'a>>) -> Self {
        self._fields.11 = value;
        self
    }
}

impl<'a, S> ListViewBuilder<'a, S>
where
    S: list_view_state::State,
    S::Purpose: list_view_state::IsSet,
    S::Uri: list_view_state::IsSet,
    S::IndexedAt: list_view_state::IsSet,
    S::Cid: list_view_state::IsSet,
    S::Creator: list_view_state::IsSet,
    S::Name: list_view_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> ListView<'a> {
        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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> ListView<'a> {
        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 Name;
        type Uri;
        type Cid;
        type Purpose;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Name = Unset;
        type Uri = Unset;
        type Cid = Unset;
        type Purpose = Unset;
    }
    ///State transition - sets the `name` field to Set
    pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetName<S> {}
    impl<S: State> State for SetName<S> {
        type Name = Set<members::name>;
        type Uri = S::Uri;
        type Cid = S::Cid;
        type Purpose = S::Purpose;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetUri<S> {}
    impl<S: State> State for SetUri<S> {
        type Name = S::Name;
        type Uri = Set<members::uri>;
        type Cid = S::Cid;
        type Purpose = S::Purpose;
    }
    ///State transition - sets the `cid` field to Set
    pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCid<S> {}
    impl<S: State> State for SetCid<S> {
        type Name = S::Name;
        type Uri = S::Uri;
        type Cid = Set<members::cid>;
        type Purpose = S::Purpose;
    }
    ///State transition - sets the `purpose` field to Set
    pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetPurpose<S> {}
    impl<S: State> State for SetPurpose<S> {
        type Name = S::Name;
        type Uri = S::Uri;
        type Cid = S::Cid;
        type Purpose = Set<members::purpose>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `name` field
        pub struct name(());
        ///Marker type for the `uri` field
        pub struct uri(());
        ///Marker type for the `cid` field
        pub struct cid(());
        ///Marker type for the `purpose` field
        pub struct purpose(());
    }
}

/// Builder for constructing an instance of this type
pub struct ListViewBasicBuilder<'a, S: list_view_basic_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<UriValue<'a>>,
        Option<Cid<'a>>,
        Option<Datetime>,
        Option<Vec<Label<'a>>>,
        Option<i64>,
        Option<CowStr<'a>>,
        Option<graph::ListPurpose<'a>>,
        Option<AtUri<'a>>,
        Option<graph::ListViewerState<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

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

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

impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> {
    /// Set the `avatar` field (optional)
    pub fn avatar(mut self, value: impl Into<Option<UriValue<'a>>>) -> 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<'a>>) -> Self {
        self._fields.0 = value;
        self
    }
}

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

impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, 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<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> {
    /// Set the `labels` field (optional)
    pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> 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<'a>>>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, 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<'a, S> ListViewBasicBuilder<'a, S>
where
    S: list_view_basic_state::State,
    S::Name: list_view_basic_state::IsUnset,
{
    /// Set the `name` field (required)
    pub fn name(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> ListViewBasicBuilder<'a, list_view_basic_state::SetName<S>> {
        self._fields.5 = Option::Some(value.into());
        ListViewBasicBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

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

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

impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> {
    /// Set the `viewer` field (optional)
    pub fn viewer(
        mut self,
        value: impl Into<Option<graph::ListViewerState<'a>>>,
    ) -> 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<'a>>) -> Self {
        self._fields.8 = value;
        self
    }
}

impl<'a, S> ListViewBasicBuilder<'a, S>
where
    S: list_view_basic_state::State,
    S::Name: list_view_basic_state::IsSet,
    S::Uri: list_view_basic_state::IsSet,
    S::Cid: list_view_basic_state::IsSet,
    S::Purpose: list_view_basic_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> ListViewBasic<'a> {
        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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> ListViewBasic<'a> {
        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<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetActor<S> {}
    impl<S: State> State for SetActor<S> {
        type Actor = Set<members::actor>;
        type NotFound = S::NotFound;
    }
    ///State transition - sets the `not_found` field to Set
    pub struct SetNotFound<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetNotFound<S> {}
    impl<S: State> State for SetNotFound<S> {
        type Actor = S::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<'a, S: not_found_actor_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (Option<AtIdentifier<'a>>, Option<bool>),
    _lifetime: PhantomData<&'a ()>,
}

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

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

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

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

impl<'a, S> NotFoundActorBuilder<'a, S>
where
    S: not_found_actor_state::State,
    S::Actor: not_found_actor_state::IsSet,
    S::NotFound: not_found_actor_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> NotFoundActor<'a> {
        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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> NotFoundActor<'a> {
        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<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetDid<S> {}
    impl<S: State> State for SetDid<S> {
        type Did = Set<members::did>;
    }
    /// 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<'a, S: relationship_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<AtUri<'a>>,
        Option<AtUri<'a>>,
        Option<AtUri<'a>>,
        Option<AtUri<'a>>,
        Option<Did<'a>>,
        Option<AtUri<'a>>,
        Option<AtUri<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

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

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

impl<'a, S: relationship_state::State> RelationshipBuilder<'a, S> {
    /// Set the `blockedBy` field (optional)
    pub fn blocked_by(mut self, value: impl Into<Option<AtUri<'a>>>) -> 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<'a>>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<'a, S: relationship_state::State> RelationshipBuilder<'a, S> {
    /// Set the `blockedByList` field (optional)
    pub fn blocked_by_list(mut self, value: impl Into<Option<AtUri<'a>>>) -> 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<'a>>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<'a, S: relationship_state::State> RelationshipBuilder<'a, S> {
    /// Set the `blocking` field (optional)
    pub fn blocking(mut self, value: impl Into<Option<AtUri<'a>>>) -> 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<'a>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<'a, S: relationship_state::State> RelationshipBuilder<'a, S> {
    /// Set the `blockingByList` field (optional)
    pub fn blocking_by_list(mut self, value: impl Into<Option<AtUri<'a>>>) -> 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<'a>>) -> Self {
        self._fields.3 = value;
        self
    }
}

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

impl<'a, S: relationship_state::State> RelationshipBuilder<'a, S> {
    /// Set the `followedBy` field (optional)
    pub fn followed_by(mut self, value: impl Into<Option<AtUri<'a>>>) -> 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<'a>>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<'a, S: relationship_state::State> RelationshipBuilder<'a, S> {
    /// Set the `following` field (optional)
    pub fn following(mut self, value: impl Into<Option<AtUri<'a>>>) -> 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<'a>>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<'a, S> RelationshipBuilder<'a, S>
where
    S: relationship_state::State,
    S::Did: relationship_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> Relationship<'a> {
        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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> Relationship<'a> {
        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 IndexedAt;
        type Cid;
        type Record;
        type Uri;
        type Creator;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type IndexedAt = Unset;
        type Cid = Unset;
        type Record = Unset;
        type Uri = Unset;
        type Creator = Unset;
    }
    ///State transition - sets the `indexed_at` field to Set
    pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
    impl<S: State> State for SetIndexedAt<S> {
        type IndexedAt = Set<members::indexed_at>;
        type Cid = S::Cid;
        type Record = S::Record;
        type Uri = S::Uri;
        type Creator = S::Creator;
    }
    ///State transition - sets the `cid` field to Set
    pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCid<S> {}
    impl<S: State> State for SetCid<S> {
        type IndexedAt = S::IndexedAt;
        type Cid = Set<members::cid>;
        type Record = S::Record;
        type Uri = S::Uri;
        type Creator = S::Creator;
    }
    ///State transition - sets the `record` field to Set
    pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetRecord<S> {}
    impl<S: State> State for SetRecord<S> {
        type IndexedAt = S::IndexedAt;
        type Cid = S::Cid;
        type Record = Set<members::record>;
        type Uri = S::Uri;
        type Creator = S::Creator;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetUri<S> {}
    impl<S: State> State for SetUri<S> {
        type IndexedAt = S::IndexedAt;
        type Cid = S::Cid;
        type Record = S::Record;
        type Uri = Set<members::uri>;
        type Creator = S::Creator;
    }
    ///State transition - sets the `creator` field to Set
    pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCreator<S> {}
    impl<S: State> State for SetCreator<S> {
        type IndexedAt = S::IndexedAt;
        type Cid = S::Cid;
        type Record = S::Record;
        type Uri = S::Uri;
        type Creator = Set<members::creator>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `indexed_at` field
        pub struct indexed_at(());
        ///Marker type for the `cid` field
        pub struct cid(());
        ///Marker type for the `record` field
        pub struct record(());
        ///Marker type for the `uri` field
        pub struct uri(());
        ///Marker type for the `creator` field
        pub struct creator(());
    }
}

/// Builder for constructing an instance of this type
pub struct StarterPackViewBuilder<'a, S: starter_pack_view_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<Cid<'a>>,
        Option<ProfileViewBasic<'a>>,
        Option<Vec<GeneratorView<'a>>>,
        Option<Datetime>,
        Option<i64>,
        Option<i64>,
        Option<Vec<Label<'a>>>,
        Option<graph::ListViewBasic<'a>>,
        Option<Vec<graph::ListItemView<'a>>>,
        Option<Data<'a>>,
        Option<AtUri<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

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

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

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

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

impl<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, S> {
    /// Set the `feeds` field (optional)
    pub fn feeds(mut self, value: impl Into<Option<Vec<GeneratorView<'a>>>>) -> 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<'a>>>) -> Self {
        self._fields.2 = value;
        self
    }
}

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

impl<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, 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<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, 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<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, S> {
    /// Set the `labels` field (optional)
    pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> 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<'a>>>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, S> {
    /// Set the `list` field (optional)
    pub fn list(mut self, value: impl Into<Option<graph::ListViewBasic<'a>>>) -> 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<'a>>) -> Self {
        self._fields.7 = value;
        self
    }
}

impl<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, S> {
    /// Set the `listItemsSample` field (optional)
    pub fn list_items_sample(
        mut self,
        value: impl Into<Option<Vec<graph::ListItemView<'a>>>>,
    ) -> 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<'a>>>,
    ) -> Self {
        self._fields.8 = value;
        self
    }
}

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

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

impl<'a, S> StarterPackViewBuilder<'a, S>
where
    S: starter_pack_view_state::State,
    S::IndexedAt: starter_pack_view_state::IsSet,
    S::Cid: starter_pack_view_state::IsSet,
    S::Record: starter_pack_view_state::IsSet,
    S::Uri: starter_pack_view_state::IsSet,
    S::Creator: starter_pack_view_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> StarterPackView<'a> {
        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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> StarterPackView<'a> {
        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 IndexedAt;
        type Uri;
        type Cid;
        type Creator;
        type Record;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type IndexedAt = Unset;
        type Uri = Unset;
        type Cid = Unset;
        type Creator = Unset;
        type Record = Unset;
    }
    ///State transition - sets the `indexed_at` field to Set
    pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
    impl<S: State> State for SetIndexedAt<S> {
        type IndexedAt = Set<members::indexed_at>;
        type Uri = S::Uri;
        type Cid = S::Cid;
        type Creator = S::Creator;
        type Record = S::Record;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetUri<S> {}
    impl<S: State> State for SetUri<S> {
        type IndexedAt = S::IndexedAt;
        type Uri = Set<members::uri>;
        type Cid = S::Cid;
        type Creator = S::Creator;
        type Record = S::Record;
    }
    ///State transition - sets the `cid` field to Set
    pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCid<S> {}
    impl<S: State> State for SetCid<S> {
        type IndexedAt = S::IndexedAt;
        type Uri = S::Uri;
        type Cid = Set<members::cid>;
        type Creator = S::Creator;
        type Record = S::Record;
    }
    ///State transition - sets the `creator` field to Set
    pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCreator<S> {}
    impl<S: State> State for SetCreator<S> {
        type IndexedAt = S::IndexedAt;
        type Uri = S::Uri;
        type Cid = S::Cid;
        type Creator = Set<members::creator>;
        type Record = S::Record;
    }
    ///State transition - sets the `record` field to Set
    pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetRecord<S> {}
    impl<S: State> State for SetRecord<S> {
        type IndexedAt = S::IndexedAt;
        type Uri = S::Uri;
        type Cid = S::Cid;
        type Creator = S::Creator;
        type Record = Set<members::record>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `indexed_at` field
        pub struct indexed_at(());
        ///Marker type for the `uri` field
        pub struct uri(());
        ///Marker type for the `cid` field
        pub struct cid(());
        ///Marker type for the `creator` field
        pub struct creator(());
        ///Marker type for the `record` field
        pub struct record(());
    }
}

/// Builder for constructing an instance of this type
pub struct StarterPackViewBasicBuilder<'a, S: starter_pack_view_basic_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<Cid<'a>>,
        Option<ProfileViewBasic<'a>>,
        Option<Datetime>,
        Option<i64>,
        Option<i64>,
        Option<Vec<Label<'a>>>,
        Option<i64>,
        Option<Data<'a>>,
        Option<AtUri<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

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

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

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

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

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

impl<'a, S: starter_pack_view_basic_state::State> StarterPackViewBasicBuilder<'a, 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<'a, S: starter_pack_view_basic_state::State> StarterPackViewBasicBuilder<'a, 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<'a, S: starter_pack_view_basic_state::State> StarterPackViewBasicBuilder<'a, S> {
    /// Set the `labels` field (optional)
    pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> 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<'a>>>) -> Self {
        self._fields.5 = value;
        self
    }
}

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

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

impl<'a, S> StarterPackViewBasicBuilder<'a, S>
where
    S: starter_pack_view_basic_state::State,
    S::IndexedAt: starter_pack_view_basic_state::IsSet,
    S::Uri: starter_pack_view_basic_state::IsSet,
    S::Cid: starter_pack_view_basic_state::IsSet,
    S::Creator: starter_pack_view_basic_state::IsSet,
    S::Record: starter_pack_view_basic_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> StarterPackViewBasic<'a> {
        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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> StarterPackViewBasic<'a> {
        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),
        }
    }
}