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

//! Generated bindings for the `app.bsky.actor` Lexicon namespace/module.
pub mod get_preferences;
pub mod get_profile;
pub mod get_profiles;
pub mod get_suggestions;
pub mod profile;
pub mod put_preferences;
pub mod search_actors;
pub mod search_actors_typeahead;
pub mod status;


#[allow(unused_imports)]
use alloc::collections::BTreeMap;

#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};

#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::string::{Did, Handle, AtUri, Cid, Datetime, UriValue};
use jacquard_common::types::value::Data;
use jacquard_derive::{IntoStatic, open_union};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;

#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::com_atproto::label::Label;
use crate::com_atproto::repo::strong_ref::StrongRef;
use crate::app_bsky::actor;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct AdultContentPref<S: BosStr = DefaultStr> {
    /// Defaults to `false`.
    #[serde(default = "_default_adult_content_pref_enabled")]
    pub enabled: bool,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct BskyAppProgressGuide<S: BosStr = DefaultStr> {
    pub guide: S,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct BskyAppStatePref<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub active_progress_guide: Option<actor::BskyAppProgressGuide<S>>,
    ///Storage for NUXs the user has encountered.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub nuxs: Option<Vec<actor::Nux<S>>>,
    ///An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub queued_nudges: Option<Vec<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ContentLabelPref<S: BosStr = DefaultStr> {
    pub label: S,
    ///Which labeler does this preference apply to? If undefined, applies globally.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub labeler_did: Option<Did<S>>,
    pub visibility: ContentLabelPrefVisibility<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ContentLabelPrefVisibility<S: BosStr = DefaultStr> {
    Ignore,
    Show,
    Warn,
    Hide,
    Other(S),
}

impl<S: BosStr> ContentLabelPrefVisibility<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Ignore => "ignore",
            Self::Show => "show",
            Self::Warn => "warn",
            Self::Hide => "hide",
            Self::Other(s) => s.as_ref(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "ignore" => Self::Ignore,
            "show" => Self::Show,
            "warn" => Self::Warn,
            "hide" => Self::Hide,
            _ => Self::Other(s),
        }
    }
}

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

impl<S: BosStr> AsRef<str> for ContentLabelPrefVisibility<S> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

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

impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
for ContentLabelPrefVisibility<S> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = S::deserialize(deserializer)?;
        Ok(Self::from_value(s))
    }
}

impl<S: BosStr + Default> Default for ContentLabelPrefVisibility<S> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl<S: BosStr> jacquard_common::IntoStatic for ContentLabelPrefVisibility<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = ContentLabelPrefVisibility<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            ContentLabelPrefVisibility::Ignore => ContentLabelPrefVisibility::Ignore,
            ContentLabelPrefVisibility::Show => ContentLabelPrefVisibility::Show,
            ContentLabelPrefVisibility::Warn => ContentLabelPrefVisibility::Warn,
            ContentLabelPrefVisibility::Hide => ContentLabelPrefVisibility::Hide,
            ContentLabelPrefVisibility::Other(v) => {
                ContentLabelPrefVisibility::Other(v.into_static())
            }
        }
    }
}

/// Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DeclaredAgePref<S: BosStr = DefaultStr> {
    ///Indicates if the user has declared that they are over 13 years of age.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub is_over_age13: Option<bool>,
    ///Indicates if the user has declared that they are over 16 years of age.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub is_over_age16: Option<bool>,
    ///Indicates if the user has declared that they are over 18 years of age.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub is_over_age18: Option<bool>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct FeedViewPref<S: BosStr = DefaultStr> {
    ///The URI of the feed, or an identifier which describes the feed.
    pub feed: S,
    ///Hide quote posts in the feed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub hide_quote_posts: Option<bool>,
    ///Hide replies in the feed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub hide_replies: Option<bool>,
    ///Hide replies in the feed if they do not have this number of likes.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub hide_replies_by_like_count: Option<i64>,
    ///Hide replies in the feed if they are not by followed users.  Defaults to `true`.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default = "_default_feed_view_pref_hide_replies_by_unfollowed")]
    pub hide_replies_by_unfollowed: Option<bool>,
    ///Hide reposts in the feed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub hide_reposts: Option<bool>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct HiddenPostsPref<S: BosStr = DefaultStr> {
    ///A list of URIs of posts the account owner has hidden.
    pub items: Vec<AtUri<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct InterestsPref<S: BosStr = DefaultStr> {
    ///A list of tags which describe the account owner's interests gathered during onboarding.
    pub tags: Vec<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// The subject's followers whom you also follow

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct KnownFollowers<S: BosStr = DefaultStr> {
    pub count: i64,
    pub followers: Vec<actor::ProfileViewBasic<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct LabelerPrefItem<S: BosStr = DefaultStr> {
    pub did: Did<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct LabelersPref<S: BosStr = DefaultStr> {
    pub labelers: Vec<actor::LabelerPrefItem<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// Preferences for live events.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct LiveEventPreferences<S: BosStr = DefaultStr> {
    ///A list of feed IDs that the user has hidden from live events.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub hidden_feed_ids: Option<Vec<S>>,
    ///Whether to hide all feeds from live events.  Defaults to `false`.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default = "_default_live_event_preferences_hide_all_feeds")]
    pub hide_all_feeds: Option<bool>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// A word that the account owner has muted.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct MutedWord<S: BosStr = DefaultStr> {
    ///Groups of users to apply the muted word to. If undefined, applies to all users.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub actor_target: Option<MutedWordActorTarget<S>>,
    ///The date and time at which the muted word will expire and no longer be applied.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub expires_at: Option<Datetime>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<S>,
    ///The intended targets of the muted word.
    pub targets: Vec<actor::MutedWordTarget<S>>,
    ///The muted word itself.
    pub value: S,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// Groups of users to apply the muted word to. If undefined, applies to all users.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum MutedWordActorTarget<S: BosStr = DefaultStr> {
    All,
    ExcludeFollowing,
    Other(S),
}

impl<S: BosStr> MutedWordActorTarget<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::All => "all",
            Self::ExcludeFollowing => "exclude-following",
            Self::Other(s) => s.as_ref(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "all" => Self::All,
            "exclude-following" => Self::ExcludeFollowing,
            _ => Self::Other(s),
        }
    }
}

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

impl<S: BosStr> AsRef<str> for MutedWordActorTarget<S> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

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

impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for MutedWordActorTarget<S> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = S::deserialize(deserializer)?;
        Ok(Self::from_value(s))
    }
}

impl<S: BosStr + Default> Default for MutedWordActorTarget<S> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl<S: BosStr> jacquard_common::IntoStatic for MutedWordActorTarget<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = MutedWordActorTarget<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            MutedWordActorTarget::All => MutedWordActorTarget::All,
            MutedWordActorTarget::ExcludeFollowing => {
                MutedWordActorTarget::ExcludeFollowing
            }
            MutedWordActorTarget::Other(v) => {
                MutedWordActorTarget::Other(v.into_static())
            }
        }
    }
}


#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum MutedWordTarget<S: BosStr = DefaultStr> {
    Content,
    Tag,
    Other(S),
}

impl<S: BosStr> MutedWordTarget<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Content => "content",
            Self::Tag => "tag",
            Self::Other(s) => s.as_ref(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "content" => Self::Content,
            "tag" => Self::Tag,
            _ => Self::Other(s),
        }
    }
}

impl<S: BosStr> AsRef<str> for MutedWordTarget<S> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

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

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

impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for MutedWordTarget<S> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = S::deserialize(deserializer)?;
        Ok(Self::from_value(s))
    }
}

impl<S: BosStr> jacquard_common::IntoStatic for MutedWordTarget<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = MutedWordTarget<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            MutedWordTarget::Content => MutedWordTarget::Content,
            MutedWordTarget::Tag => MutedWordTarget::Tag,
            MutedWordTarget::Other(v) => MutedWordTarget::Other(v.into_static()),
        }
    }
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct MutedWordsPref<S: BosStr = DefaultStr> {
    ///A list of words the account owner has muted.
    pub items: Vec<actor::MutedWord<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// A new user experiences (NUX) storage object

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Nux<S: BosStr = DefaultStr> {
    /// Defaults to `false`.
    #[serde(default = "_default_nux_completed")]
    pub completed: bool,
    ///Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub data: Option<S>,
    ///The date and time at which the NUX will expire and should be considered completed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub expires_at: Option<Datetime>,
    pub id: S,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct PersonalDetailsPref<S: BosStr = DefaultStr> {
    ///The birth date of account owner.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub birth_date: Option<Datetime>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct PostInteractionSettingsPref<S: BosStr = DefaultStr> {
    ///Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub postgate_embedding_rules: Option<Vec<Data<S>>>,
    ///Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub threadgate_allow_rules: Option<
        Vec<PostInteractionSettingsPrefThreadgateAllowRulesItem<S>>,
    >,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum PostInteractionSettingsPrefThreadgateAllowRulesItem<S: BosStr = DefaultStr> {}

#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum PreferencesItem<S: BosStr = DefaultStr> {
    #[serde(rename = "app.bsky.actor.defs#adultContentPref")]
    AdultContentPref(Box<actor::AdultContentPref<S>>),
    #[serde(rename = "app.bsky.actor.defs#contentLabelPref")]
    ContentLabelPref(Box<actor::ContentLabelPref<S>>),
    #[serde(rename = "app.bsky.actor.defs#savedFeedsPref")]
    SavedFeedsPref(Box<actor::SavedFeedsPref<S>>),
    #[serde(rename = "app.bsky.actor.defs#savedFeedsPrefV2")]
    SavedFeedsPrefV2(Box<actor::SavedFeedsPrefV2<S>>),
    #[serde(rename = "app.bsky.actor.defs#personalDetailsPref")]
    PersonalDetailsPref(Box<actor::PersonalDetailsPref<S>>),
    #[serde(rename = "app.bsky.actor.defs#declaredAgePref")]
    DeclaredAgePref(Box<actor::DeclaredAgePref<S>>),
    #[serde(rename = "app.bsky.actor.defs#feedViewPref")]
    FeedViewPref(Box<actor::FeedViewPref<S>>),
    #[serde(rename = "app.bsky.actor.defs#threadViewPref")]
    ThreadViewPref(Box<actor::ThreadViewPref<S>>),
    #[serde(rename = "app.bsky.actor.defs#interestsPref")]
    InterestsPref(Box<actor::InterestsPref<S>>),
    #[serde(rename = "app.bsky.actor.defs#mutedWordsPref")]
    MutedWordsPref(Box<actor::MutedWordsPref<S>>),
    #[serde(rename = "app.bsky.actor.defs#hiddenPostsPref")]
    HiddenPostsPref(Box<actor::HiddenPostsPref<S>>),
    #[serde(rename = "app.bsky.actor.defs#bskyAppStatePref")]
    BskyAppStatePref(Box<actor::BskyAppStatePref<S>>),
    #[serde(rename = "app.bsky.actor.defs#labelersPref")]
    LabelersPref(Box<actor::LabelersPref<S>>),
    #[serde(rename = "app.bsky.actor.defs#postInteractionSettingsPref")]
    PostInteractionSettingsPref(Box<actor::PostInteractionSettingsPref<S>>),
    #[serde(rename = "app.bsky.actor.defs#verificationPrefs")]
    VerificationPrefs(Box<actor::VerificationPrefs<S>>),
    #[serde(rename = "app.bsky.actor.defs#liveEventPreferences")]
    LiveEventPreferences(Box<actor::LiveEventPreferences<S>>),
}

pub type Preferences<S = DefaultStr> = Vec<PreferencesItem<S>>;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ProfileAssociated<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub activity_subscription: Option<actor::ProfileAssociatedActivitySubscription<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub chat: Option<actor::ProfileAssociatedChat<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub feedgens: Option<i64>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub germ: Option<actor::ProfileAssociatedGerm<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub labeler: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub lists: Option<i64>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub starter_packs: Option<i64>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ProfileAssociatedActivitySubscription<S: BosStr = DefaultStr> {
    pub allow_subscriptions: ProfileAssociatedActivitySubscriptionAllowSubscriptions<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ProfileAssociatedActivitySubscriptionAllowSubscriptions<
    S: BosStr = DefaultStr,
> {
    Followers,
    Mutuals,
    None,
    Other(S),
}

impl<S: BosStr> ProfileAssociatedActivitySubscriptionAllowSubscriptions<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Followers => "followers",
            Self::Mutuals => "mutuals",
            Self::None => "none",
            Self::Other(s) => s.as_ref(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "followers" => Self::Followers,
            "mutuals" => Self::Mutuals,
            "none" => Self::None,
            _ => Self::Other(s),
        }
    }
}

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

impl<S: BosStr> AsRef<str>
for ProfileAssociatedActivitySubscriptionAllowSubscriptions<S> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

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

impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
for ProfileAssociatedActivitySubscriptionAllowSubscriptions<S> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = S::deserialize(deserializer)?;
        Ok(Self::from_value(s))
    }
}

impl<S: BosStr + Default> Default
for ProfileAssociatedActivitySubscriptionAllowSubscriptions<S> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl<S: BosStr> jacquard_common::IntoStatic
for ProfileAssociatedActivitySubscriptionAllowSubscriptions<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = ProfileAssociatedActivitySubscriptionAllowSubscriptions<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            ProfileAssociatedActivitySubscriptionAllowSubscriptions::Followers => {
                ProfileAssociatedActivitySubscriptionAllowSubscriptions::Followers
            }
            ProfileAssociatedActivitySubscriptionAllowSubscriptions::Mutuals => {
                ProfileAssociatedActivitySubscriptionAllowSubscriptions::Mutuals
            }
            ProfileAssociatedActivitySubscriptionAllowSubscriptions::None => {
                ProfileAssociatedActivitySubscriptionAllowSubscriptions::None
            }
            ProfileAssociatedActivitySubscriptionAllowSubscriptions::Other(v) => {
                ProfileAssociatedActivitySubscriptionAllowSubscriptions::Other(
                    v.into_static(),
                )
            }
        }
    }
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ProfileAssociatedChat<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub allow_group_invites: Option<ProfileAssociatedChatAllowGroupInvites<S>>,
    pub allow_incoming: ProfileAssociatedChatAllowIncoming<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ProfileAssociatedChatAllowGroupInvites<S: BosStr = DefaultStr> {
    All,
    None,
    Following,
    Other(S),
}

impl<S: BosStr> ProfileAssociatedChatAllowGroupInvites<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::All => "all",
            Self::None => "none",
            Self::Following => "following",
            Self::Other(s) => s.as_ref(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "all" => Self::All,
            "none" => Self::None,
            "following" => Self::Following,
            _ => Self::Other(s),
        }
    }
}

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

impl<S: BosStr> AsRef<str> for ProfileAssociatedChatAllowGroupInvites<S> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

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

impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
for ProfileAssociatedChatAllowGroupInvites<S> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = S::deserialize(deserializer)?;
        Ok(Self::from_value(s))
    }
}

impl<S: BosStr + Default> Default for ProfileAssociatedChatAllowGroupInvites<S> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl<S: BosStr> jacquard_common::IntoStatic for ProfileAssociatedChatAllowGroupInvites<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = ProfileAssociatedChatAllowGroupInvites<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            ProfileAssociatedChatAllowGroupInvites::All => {
                ProfileAssociatedChatAllowGroupInvites::All
            }
            ProfileAssociatedChatAllowGroupInvites::None => {
                ProfileAssociatedChatAllowGroupInvites::None
            }
            ProfileAssociatedChatAllowGroupInvites::Following => {
                ProfileAssociatedChatAllowGroupInvites::Following
            }
            ProfileAssociatedChatAllowGroupInvites::Other(v) => {
                ProfileAssociatedChatAllowGroupInvites::Other(v.into_static())
            }
        }
    }
}


#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ProfileAssociatedChatAllowIncoming<S: BosStr = DefaultStr> {
    All,
    None,
    Following,
    Other(S),
}

impl<S: BosStr> ProfileAssociatedChatAllowIncoming<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::All => "all",
            Self::None => "none",
            Self::Following => "following",
            Self::Other(s) => s.as_ref(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "all" => Self::All,
            "none" => Self::None,
            "following" => Self::Following,
            _ => Self::Other(s),
        }
    }
}

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

impl<S: BosStr> AsRef<str> for ProfileAssociatedChatAllowIncoming<S> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

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

impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
for ProfileAssociatedChatAllowIncoming<S> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = S::deserialize(deserializer)?;
        Ok(Self::from_value(s))
    }
}

impl<S: BosStr + Default> Default for ProfileAssociatedChatAllowIncoming<S> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl<S: BosStr> jacquard_common::IntoStatic for ProfileAssociatedChatAllowIncoming<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = ProfileAssociatedChatAllowIncoming<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            ProfileAssociatedChatAllowIncoming::All => {
                ProfileAssociatedChatAllowIncoming::All
            }
            ProfileAssociatedChatAllowIncoming::None => {
                ProfileAssociatedChatAllowIncoming::None
            }
            ProfileAssociatedChatAllowIncoming::Following => {
                ProfileAssociatedChatAllowIncoming::Following
            }
            ProfileAssociatedChatAllowIncoming::Other(v) => {
                ProfileAssociatedChatAllowIncoming::Other(v.into_static())
            }
        }
    }
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ProfileAssociatedGerm<S: BosStr = DefaultStr> {
    pub message_me_url: UriValue<S>,
    pub show_button_to: ProfileAssociatedGermShowButtonTo<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ProfileAssociatedGermShowButtonTo<S: BosStr = DefaultStr> {
    UsersIFollow,
    Everyone,
    Other(S),
}

impl<S: BosStr> ProfileAssociatedGermShowButtonTo<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::UsersIFollow => "usersIFollow",
            Self::Everyone => "everyone",
            Self::Other(s) => s.as_ref(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "usersIFollow" => Self::UsersIFollow,
            "everyone" => Self::Everyone,
            _ => Self::Other(s),
        }
    }
}

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

impl<S: BosStr> AsRef<str> for ProfileAssociatedGermShowButtonTo<S> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

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

impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
for ProfileAssociatedGermShowButtonTo<S> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = S::deserialize(deserializer)?;
        Ok(Self::from_value(s))
    }
}

impl<S: BosStr + Default> Default for ProfileAssociatedGermShowButtonTo<S> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl<S: BosStr> jacquard_common::IntoStatic for ProfileAssociatedGermShowButtonTo<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = ProfileAssociatedGermShowButtonTo<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            ProfileAssociatedGermShowButtonTo::UsersIFollow => {
                ProfileAssociatedGermShowButtonTo::UsersIFollow
            }
            ProfileAssociatedGermShowButtonTo::Everyone => {
                ProfileAssociatedGermShowButtonTo::Everyone
            }
            ProfileAssociatedGermShowButtonTo::Other(v) => {
                ProfileAssociatedGermShowButtonTo::Other(v.into_static())
            }
        }
    }
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ProfileView<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub associated: Option<actor::ProfileAssociated<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub avatar: Option<UriValue<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub created_at: Option<Datetime>,
    ///Debug information for internal development
    #[serde(skip_serializing_if = "Option::is_none")]
    pub debug: Option<Data<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<S>,
    pub did: Did<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub display_name: Option<S>,
    pub handle: Handle<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub indexed_at: Option<Datetime>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub labels: Option<Vec<Label<S>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pronouns: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub status: Option<actor::StatusView<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub verification: Option<actor::VerificationState<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub viewer: Option<actor::ViewerState<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ProfileViewBasic<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub associated: Option<actor::ProfileAssociated<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub avatar: Option<UriValue<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub created_at: Option<Datetime>,
    ///Debug information for internal development
    #[serde(skip_serializing_if = "Option::is_none")]
    pub debug: Option<Data<S>>,
    pub did: Did<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub display_name: Option<S>,
    pub handle: Handle<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub labels: Option<Vec<Label<S>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pronouns: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub status: Option<actor::StatusView<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub verification: Option<actor::VerificationState<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub viewer: Option<actor::ViewerState<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ProfileViewDetailed<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub associated: Option<actor::ProfileAssociated<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub avatar: Option<UriValue<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub banner: Option<UriValue<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub created_at: Option<Datetime>,
    ///Debug information for internal development
    #[serde(skip_serializing_if = "Option::is_none")]
    pub debug: Option<Data<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<S>,
    pub did: Did<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub display_name: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub followers_count: Option<i64>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub follows_count: Option<i64>,
    pub handle: Handle<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub indexed_at: Option<Datetime>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub joined_via_starter_pack: Option<Data<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub labels: Option<Vec<Label<S>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pinned_post: Option<StrongRef<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub posts_count: Option<i64>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pronouns: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub status: Option<actor::StatusView<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub verification: Option<actor::VerificationState<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub viewer: Option<actor::ViewerState<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub website: Option<UriValue<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SavedFeed<S: BosStr = DefaultStr> {
    pub id: S,
    pub pinned: bool,
    pub r#type: SavedFeedType<S>,
    pub value: S,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SavedFeedType<S: BosStr = DefaultStr> {
    Feed,
    List,
    Timeline,
    Other(S),
}

impl<S: BosStr> SavedFeedType<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Feed => "feed",
            Self::List => "list",
            Self::Timeline => "timeline",
            Self::Other(s) => s.as_ref(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "feed" => Self::Feed,
            "list" => Self::List,
            "timeline" => Self::Timeline,
            _ => Self::Other(s),
        }
    }
}

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

impl<S: BosStr> AsRef<str> for SavedFeedType<S> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

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

impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for SavedFeedType<S> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = S::deserialize(deserializer)?;
        Ok(Self::from_value(s))
    }
}

impl<S: BosStr + Default> Default for SavedFeedType<S> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl<S: BosStr> jacquard_common::IntoStatic for SavedFeedType<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = SavedFeedType<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            SavedFeedType::Feed => SavedFeedType::Feed,
            SavedFeedType::List => SavedFeedType::List,
            SavedFeedType::Timeline => SavedFeedType::Timeline,
            SavedFeedType::Other(v) => SavedFeedType::Other(v.into_static()),
        }
    }
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SavedFeedsPref<S: BosStr = DefaultStr> {
    pub pinned: Vec<AtUri<S>>,
    pub saved: Vec<AtUri<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub timeline_index: Option<i64>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SavedFeedsPrefV2<S: BosStr = DefaultStr> {
    pub items: Vec<actor::SavedFeed<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct StatusView<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cid: Option<Cid<S>>,
    ///An optional embed associated with the status.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub embed: Option<Data<S>>,
    ///The date when this status will expire. The application might choose to no longer return the status after expiration.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub expires_at: Option<Datetime>,
    ///True if the status is not expired, false if it is expired. Only present if expiration was set.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub is_active: Option<bool>,
    ///True if the user's go-live access has been disabled by a moderator, false otherwise.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub is_disabled: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub labels: Option<Vec<Label<S>>>,
    pub record: Data<S>,
    ///The status for the account.
    pub status: StatusViewStatus<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub uri: Option<AtUri<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// The status for the account.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum StatusViewStatus<S: BosStr = DefaultStr> {
    Live,
    Other(S),
}

impl<S: BosStr> StatusViewStatus<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Live => "app.bsky.actor.status#live",
            Self::Other(s) => s.as_ref(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "app.bsky.actor.status#live" => Self::Live,
            _ => Self::Other(s),
        }
    }
}

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

impl<S: BosStr> AsRef<str> for StatusViewStatus<S> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

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

impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for StatusViewStatus<S> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = S::deserialize(deserializer)?;
        Ok(Self::from_value(s))
    }
}

impl<S: BosStr + Default> Default for StatusViewStatus<S> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl<S: BosStr> jacquard_common::IntoStatic for StatusViewStatus<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = StatusViewStatus<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            StatusViewStatus::Live => StatusViewStatus::Live,
            StatusViewStatus::Other(v) => StatusViewStatus::Other(v.into_static()),
        }
    }
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ThreadViewPref<S: BosStr = DefaultStr> {
    ///Sorting mode for threads.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sort: Option<ThreadViewPrefSort<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// Sorting mode for threads.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThreadViewPrefSort<S: BosStr = DefaultStr> {
    Oldest,
    Newest,
    MostLikes,
    Random,
    Hotness,
    Other(S),
}

impl<S: BosStr> ThreadViewPrefSort<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Oldest => "oldest",
            Self::Newest => "newest",
            Self::MostLikes => "most-likes",
            Self::Random => "random",
            Self::Hotness => "hotness",
            Self::Other(s) => s.as_ref(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "oldest" => Self::Oldest,
            "newest" => Self::Newest,
            "most-likes" => Self::MostLikes,
            "random" => Self::Random,
            "hotness" => Self::Hotness,
            _ => Self::Other(s),
        }
    }
}

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

impl<S: BosStr> AsRef<str> for ThreadViewPrefSort<S> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

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

impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ThreadViewPrefSort<S> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = S::deserialize(deserializer)?;
        Ok(Self::from_value(s))
    }
}

impl<S: BosStr + Default> Default for ThreadViewPrefSort<S> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl<S: BosStr> jacquard_common::IntoStatic for ThreadViewPrefSort<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = ThreadViewPrefSort<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            ThreadViewPrefSort::Oldest => ThreadViewPrefSort::Oldest,
            ThreadViewPrefSort::Newest => ThreadViewPrefSort::Newest,
            ThreadViewPrefSort::MostLikes => ThreadViewPrefSort::MostLikes,
            ThreadViewPrefSort::Random => ThreadViewPrefSort::Random,
            ThreadViewPrefSort::Hotness => ThreadViewPrefSort::Hotness,
            ThreadViewPrefSort::Other(v) => ThreadViewPrefSort::Other(v.into_static()),
        }
    }
}

/// Preferences for how verified accounts appear in the app.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct VerificationPrefs<S: BosStr = DefaultStr> {
    ///Hide the blue check badges for verified accounts and trusted verifiers.  Defaults to `false`.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default = "_default_verification_prefs_hide_badges")]
    pub hide_badges: Option<bool>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// Represents the verification information about the user this object is attached to.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct VerificationState<S: BosStr = DefaultStr> {
    ///The user's status as a trusted verifier.
    pub trusted_verifier_status: VerificationStateTrustedVerifierStatus<S>,
    ///All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included.
    pub verifications: Vec<actor::VerificationView<S>>,
    ///The user's status as a verified account.
    pub verified_status: VerificationStateVerifiedStatus<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// The user's status as a trusted verifier.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum VerificationStateTrustedVerifierStatus<S: BosStr = DefaultStr> {
    Valid,
    Invalid,
    None,
    Other(S),
}

impl<S: BosStr> VerificationStateTrustedVerifierStatus<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Valid => "valid",
            Self::Invalid => "invalid",
            Self::None => "none",
            Self::Other(s) => s.as_ref(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "valid" => Self::Valid,
            "invalid" => Self::Invalid,
            "none" => Self::None,
            _ => Self::Other(s),
        }
    }
}

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

impl<S: BosStr> AsRef<str> for VerificationStateTrustedVerifierStatus<S> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

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

impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
for VerificationStateTrustedVerifierStatus<S> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = S::deserialize(deserializer)?;
        Ok(Self::from_value(s))
    }
}

impl<S: BosStr + Default> Default for VerificationStateTrustedVerifierStatus<S> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl<S: BosStr> jacquard_common::IntoStatic for VerificationStateTrustedVerifierStatus<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = VerificationStateTrustedVerifierStatus<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            VerificationStateTrustedVerifierStatus::Valid => {
                VerificationStateTrustedVerifierStatus::Valid
            }
            VerificationStateTrustedVerifierStatus::Invalid => {
                VerificationStateTrustedVerifierStatus::Invalid
            }
            VerificationStateTrustedVerifierStatus::None => {
                VerificationStateTrustedVerifierStatus::None
            }
            VerificationStateTrustedVerifierStatus::Other(v) => {
                VerificationStateTrustedVerifierStatus::Other(v.into_static())
            }
        }
    }
}

/// The user's status as a verified account.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum VerificationStateVerifiedStatus<S: BosStr = DefaultStr> {
    Valid,
    Invalid,
    None,
    Other(S),
}

impl<S: BosStr> VerificationStateVerifiedStatus<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Valid => "valid",
            Self::Invalid => "invalid",
            Self::None => "none",
            Self::Other(s) => s.as_ref(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "valid" => Self::Valid,
            "invalid" => Self::Invalid,
            "none" => Self::None,
            _ => Self::Other(s),
        }
    }
}

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

impl<S: BosStr> AsRef<str> for VerificationStateVerifiedStatus<S> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

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

impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
for VerificationStateVerifiedStatus<S> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = S::deserialize(deserializer)?;
        Ok(Self::from_value(s))
    }
}

impl<S: BosStr + Default> Default for VerificationStateVerifiedStatus<S> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl<S: BosStr> jacquard_common::IntoStatic for VerificationStateVerifiedStatus<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = VerificationStateVerifiedStatus<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            VerificationStateVerifiedStatus::Valid => {
                VerificationStateVerifiedStatus::Valid
            }
            VerificationStateVerifiedStatus::Invalid => {
                VerificationStateVerifiedStatus::Invalid
            }
            VerificationStateVerifiedStatus::None => {
                VerificationStateVerifiedStatus::None
            }
            VerificationStateVerifiedStatus::Other(v) => {
                VerificationStateVerifiedStatus::Other(v.into_static())
            }
        }
    }
}

/// An individual verification for an associated subject.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct VerificationView<S: BosStr = DefaultStr> {
    ///Timestamp when the verification was created.
    pub created_at: Datetime,
    ///True if the verification passes validation, otherwise false.
    pub is_valid: bool,
    ///The user who issued this verification.
    pub issuer: Did<S>,
    ///The display name of the issuer.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub issuer_display_name: Option<S>,
    ///The handle of the issuer.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub issuer_handle: Option<Handle<S>>,
    ///The AT-URI of the verification record.
    pub uri: AtUri<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ViewerState<S: BosStr = DefaultStr> {
    ///This property is present only in selected cases, as an optimization.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub activity_subscription: Option<Data<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub blocked_by: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub blocking: Option<AtUri<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub blocking_by_list: Option<Data<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub followed_by: Option<AtUri<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub following: Option<AtUri<S>>,
    ///This property is present only in selected cases, as an optimization.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub known_followers: Option<actor::KnownFollowers<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub muted: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub muted_by_list: Option<Data<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

impl<S: BosStr> LexiconSchema for AdultContentPref<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "adultContentPref"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for BskyAppProgressGuide<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "bskyAppProgressGuide"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        {
            let value = &self.guide;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("guide"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for BskyAppStatePref<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "bskyAppStatePref"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.nuxs {
            #[allow(unused_comparisons)]
            if value.len() > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("nuxs"),
                    max: 100usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.queued_nudges {
            #[allow(unused_comparisons)]
            if value.len() > 1000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("queued_nudges"),
                    max: 1000usize,
                    actual: value.len(),
                });
            }
        }
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for ContentLabelPref<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "contentLabelPref"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for DeclaredAgePref<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "declaredAgePref"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for FeedViewPref<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "feedViewPref"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for HiddenPostsPref<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "hiddenPostsPref"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for InterestsPref<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "interestsPref"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        {
            let value = &self.tags;
            #[allow(unused_comparisons)]
            if value.len() > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("tags"),
                    max: 100usize,
                    actual: value.len(),
                });
            }
        }
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for KnownFollowers<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "knownFollowers"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        {
            let value = &self.followers;
            #[allow(unused_comparisons)]
            if value.len() > 5usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("followers"),
                    max: 5usize,
                    actual: value.len(),
                });
            }
        }
        {
            let value = &self.followers;
            #[allow(unused_comparisons)]
            if value.len() < 0usize {
                return Err(ConstraintError::MinLength {
                    path: ValidationPath::from_field("followers"),
                    min: 0usize,
                    actual: value.len(),
                });
            }
        }
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for LabelerPrefItem<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "labelerPrefItem"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for LabelersPref<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "labelersPref"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for LiveEventPreferences<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "liveEventPreferences"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for MutedWord<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "mutedWord"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        {
            let value = &self.value;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 10000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("value"),
                    max: 10000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.value;
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 1000usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("value"),
                        max: 1000usize,
                        actual: count,
                    });
                }
            }
        }
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for MutedWordsPref<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "mutedWordsPref"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for Nux<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "nux"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.data {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 3000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("data"),
                    max: 3000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.data {
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 300usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("data"),
                        max: 300usize,
                        actual: count,
                    });
                }
            }
        }
        {
            let value = &self.id;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("id"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for PersonalDetailsPref<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "personalDetailsPref"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for PostInteractionSettingsPref<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "postInteractionSettingsPref"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.postgate_embedding_rules {
            #[allow(unused_comparisons)]
            if value.len() > 5usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("postgate_embedding_rules"),
                    max: 5usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.threadgate_allow_rules {
            #[allow(unused_comparisons)]
            if value.len() > 5usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("threadgate_allow_rules"),
                    max: 5usize,
                    actual: value.len(),
                });
            }
        }
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for ProfileAssociated<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "profileAssociated"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for ProfileAssociatedActivitySubscription<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "profileAssociatedActivitySubscription"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for ProfileAssociatedChat<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "profileAssociatedChat"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for ProfileAssociatedGerm<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "profileAssociatedGerm"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for ProfileView<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "profileView"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.description {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 2560usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("description"),
                    max: 2560usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.description {
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 256usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("description"),
                        max: 256usize,
                        actual: count,
                    });
                }
            }
        }
        if let Some(ref value) = self.display_name {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 640usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("display_name"),
                    max: 640usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.display_name {
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 64usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("display_name"),
                        max: 64usize,
                        actual: count,
                    });
                }
            }
        }
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for ProfileViewBasic<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "profileViewBasic"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.display_name {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 640usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("display_name"),
                    max: 640usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.display_name {
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 64usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("display_name"),
                        max: 64usize,
                        actual: count,
                    });
                }
            }
        }
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for ProfileViewDetailed<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "profileViewDetailed"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.description {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 2560usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("description"),
                    max: 2560usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.description {
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 256usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("description"),
                        max: 256usize,
                        actual: count,
                    });
                }
            }
        }
        if let Some(ref value) = self.display_name {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 640usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("display_name"),
                    max: 640usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.display_name {
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 64usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("display_name"),
                        max: 64usize,
                        actual: count,
                    });
                }
            }
        }
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for SavedFeed<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "savedFeed"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for SavedFeedsPref<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "savedFeedsPref"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for SavedFeedsPrefV2<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "savedFeedsPrefV2"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for StatusView<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "statusView"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for ThreadViewPref<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "threadViewPref"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for VerificationPrefs<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "verificationPrefs"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for VerificationState<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "verificationState"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for VerificationView<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "verificationView"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for ViewerState<S> {
    fn nsid() -> &'static str {
        "app.bsky.actor.defs"
    }
    fn def_name() -> &'static str {
        "viewerState"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_actor_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

fn _default_adult_content_pref_enabled() -> bool {
    false
}

impl Default for AdultContentPref {
    fn default() -> Self {
        Self {
            enabled: false,
            extra_data: Default::default(),
        }
    }
}

pub mod adult_content_pref_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 Enabled;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Enabled = Unset;
    }
    ///State transition - sets the `enabled` field to Set
    pub struct SetEnabled<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetEnabled<St> {}
    impl<St: State> State for SetEnabled<St> {
        type Enabled = Set<members::enabled>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `enabled` field
        pub struct enabled(());
    }
}

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

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

impl<S: BosStr> AdultContentPref<S> {
    /// Create a new builder for this type
    pub fn builder() -> AdultContentPrefBuilder<adult_content_pref_state::Empty, S> {
        AdultContentPrefBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> AdultContentPrefBuilder<St, S>
where
    St: adult_content_pref_state::State,
    St::Enabled: adult_content_pref_state::IsUnset,
{
    /// Set the `enabled` field (required)
    pub fn enabled(
        mut self,
        value: impl Into<bool>,
    ) -> AdultContentPrefBuilder<adult_content_pref_state::SetEnabled<St>, S> {
        self._fields.0 = Option::Some(value.into());
        AdultContentPrefBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> AdultContentPrefBuilder<St, S>
where
    St: adult_content_pref_state::State,
    St::Enabled: adult_content_pref_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> AdultContentPref<S> {
        AdultContentPref {
            enabled: self._fields.0.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> AdultContentPref<S> {
        AdultContentPref {
            enabled: self._fields.0.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> {
    #[allow(unused_imports)]
    use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
    use jacquard_lexicon::lexicon::*;
    use alloc::collections::BTreeMap;
    LexiconDoc {
        lexicon: Lexicon::Lexicon1,
        id: CowStr::new_static("app.bsky.actor.defs"),
        defs: {
            let mut map = BTreeMap::new();
            map.insert(
                SmolStr::new_static("adultContentPref"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("enabled")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("enabled"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("bskyAppProgressGuide"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress.",
                        ),
                    ),
                    required: Some(vec![SmolStr::new_static("guide")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("guide"),
                            LexObjectProperty::String(LexString {
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("bskyAppStatePref"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this.",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("activeProgressGuide"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#bskyAppProgressGuide"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("nuxs"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static(
                                        "Storage for NUXs the user has encountered.",
                                    ),
                                ),
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("app.bsky.actor.defs#nux"),
                                    ..Default::default()
                                }),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("queuedNudges"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static(
                                        "An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user.",
                                    ),
                                ),
                                items: LexArrayItem::String(LexString {
                                    max_length: Some(100usize),
                                    ..Default::default()
                                }),
                                max_length: Some(1000usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("contentLabelPref"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![
                            SmolStr::new_static("label"),
                            SmolStr::new_static("visibility")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("label"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("labelerDid"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Which labeler does this preference apply to? If undefined, applies globally.",
                                    ),
                                ),
                                format: Some(LexStringFormat::Did),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("visibility"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("declaredAgePref"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration.",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("isOverAge13"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("isOverAge16"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("isOverAge18"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("feedViewPref"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("feed")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("feed"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The URI of the feed, or an identifier which describes the feed.",
                                    ),
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("hideQuotePosts"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("hideReplies"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("hideRepliesByLikeCount"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("hideRepliesByUnfollowed"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("hideReposts"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("hiddenPostsPref"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("items")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("items"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static(
                                        "A list of URIs of posts the account owner has hidden.",
                                    ),
                                ),
                                items: LexArrayItem::String(LexString {
                                    format: Some(LexStringFormat::AtUri),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("interestsPref"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("tags")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("tags"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static(
                                        "A list of tags which describe the account owner's interests gathered during onboarding.",
                                    ),
                                ),
                                items: LexArrayItem::String(LexString {
                                    max_length: Some(640usize),
                                    max_graphemes: Some(64usize),
                                    ..Default::default()
                                }),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("knownFollowers"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "The subject's followers whom you also follow",
                        ),
                    ),
                    required: Some(
                        vec![
                            SmolStr::new_static("count"),
                            SmolStr::new_static("followers")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("count"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("followers"),
                            LexObjectProperty::Array(LexArray {
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("#profileViewBasic"),
                                    ..Default::default()
                                }),
                                min_length: Some(0usize),
                                max_length: Some(5usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("labelerPrefItem"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("did")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("did"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Did),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("labelersPref"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("labelers")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("labelers"),
                            LexObjectProperty::Array(LexArray {
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("#labelerPrefItem"),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("liveEventPreferences"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Preferences for live events."),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("hiddenFeedIds"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static(
                                        "A list of feed IDs that the user has hidden from live events.",
                                    ),
                                ),
                                items: LexArrayItem::String(LexString {
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("hideAllFeeds"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("mutedWord"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("A word that the account owner has muted."),
                    ),
                    required: Some(
                        vec![
                            SmolStr::new_static("value"), SmolStr::new_static("targets")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("actorTarget"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Groups of users to apply the muted word to. If undefined, applies to all users.",
                                    ),
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("expiresAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The date and time at which the muted word will expire and no longer be applied.",
                                    ),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("id"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("targets"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static(
                                        "The intended targets of the muted word.",
                                    ),
                                ),
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static(
                                        "app.bsky.actor.defs#mutedWordTarget",
                                    ),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("value"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("The muted word itself."),
                                ),
                                max_length: Some(10000usize),
                                max_graphemes: Some(1000usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("mutedWordTarget"),
                LexUserType::String(LexString {
                    max_length: Some(640usize),
                    max_graphemes: Some(64usize),
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("mutedWordsPref"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("items")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("items"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static(
                                        "A list of words the account owner has muted.",
                                    ),
                                ),
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("app.bsky.actor.defs#mutedWord"),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("nux"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("A new user experiences (NUX) storage object"),
                    ),
                    required: Some(
                        vec![SmolStr::new_static("id"), SmolStr::new_static("completed")],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("completed"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("data"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters.",
                                    ),
                                ),
                                max_length: Some(3000usize),
                                max_graphemes: Some(300usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("expiresAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The date and time at which the NUX will expire and should be considered completed.",
                                    ),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("id"),
                            LexObjectProperty::String(LexString {
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("personalDetailsPref"),
                LexUserType::Object(LexObject {
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("birthDate"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("The birth date of account owner."),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("postInteractionSettingsPref"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly.",
                        ),
                    ),
                    required: Some(vec![]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("postgateEmbeddingRules"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static(
                                        "Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed.",
                                    ),
                                ),
                                items: LexArrayItem::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("app.bsky.feed.postgate#disableRule")
                                    ],
                                    ..Default::default()
                                }),
                                max_length: Some(5usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("threadgateAllowRules"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static(
                                        "Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply.",
                                    ),
                                ),
                                items: LexArrayItem::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("app.bsky.feed.threadgate#mentionRule"),
                                        CowStr::new_static("app.bsky.feed.threadgate#followerRule"),
                                        CowStr::new_static("app.bsky.feed.threadgate#followingRule"),
                                        CowStr::new_static("app.bsky.feed.threadgate#listRule")
                                    ],
                                    ..Default::default()
                                }),
                                max_length: Some(5usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("preferences"),
                LexUserType::Array(LexArray {
                    items: LexArrayItem::Union(LexRefUnion {
                        refs: vec![
                            CowStr::new_static("#adultContentPref"),
                            CowStr::new_static("#contentLabelPref"),
                            CowStr::new_static("#savedFeedsPref"),
                            CowStr::new_static("#savedFeedsPrefV2"),
                            CowStr::new_static("#personalDetailsPref"),
                            CowStr::new_static("#declaredAgePref"),
                            CowStr::new_static("#feedViewPref"),
                            CowStr::new_static("#threadViewPref"),
                            CowStr::new_static("#interestsPref"),
                            CowStr::new_static("#mutedWordsPref"),
                            CowStr::new_static("#hiddenPostsPref"),
                            CowStr::new_static("#bskyAppStatePref"),
                            CowStr::new_static("#labelersPref"),
                            CowStr::new_static("#postInteractionSettingsPref"),
                            CowStr::new_static("#verificationPrefs"),
                            CowStr::new_static("#liveEventPreferences")
                        ],
                        ..Default::default()
                    }),
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("profileAssociated"),
                LexUserType::Object(LexObject {
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("activitySubscription"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static(
                                    "#profileAssociatedActivitySubscription",
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("chat"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#profileAssociatedChat"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("feedgens"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("germ"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#profileAssociatedGerm"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("labeler"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("lists"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("starterPacks"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("profileAssociatedActivitySubscription"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("allowSubscriptions")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("allowSubscriptions"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("profileAssociatedChat"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("allowIncoming")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("allowGroupInvites"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("allowIncoming"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("profileAssociatedGerm"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![
                            SmolStr::new_static("showButtonTo"),
                            SmolStr::new_static("messageMeUrl")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("messageMeUrl"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Uri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("showButtonTo"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("profileView"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![SmolStr::new_static("did"), SmolStr::new_static("handle")],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("associated"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#profileAssociated"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("avatar"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Uri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("createdAt"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("debug"),
                            LexObjectProperty::Unknown(LexUnknown {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("description"),
                            LexObjectProperty::String(LexString {
                                max_length: Some(2560usize),
                                max_graphemes: Some(256usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("did"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Did),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("displayName"),
                            LexObjectProperty::String(LexString {
                                max_length: Some(640usize),
                                max_graphemes: Some(64usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("handle"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Handle),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("indexedAt"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("labels"),
                            LexObjectProperty::Array(LexArray {
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("com.atproto.label.defs#label"),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("pronouns"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("status"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#statusView"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("verification"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#verificationState"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("viewer"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#viewerState"),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("profileViewBasic"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![SmolStr::new_static("did"), SmolStr::new_static("handle")],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("associated"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#profileAssociated"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("avatar"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Uri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("createdAt"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("debug"),
                            LexObjectProperty::Unknown(LexUnknown {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("did"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Did),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("displayName"),
                            LexObjectProperty::String(LexString {
                                max_length: Some(640usize),
                                max_graphemes: Some(64usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("handle"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Handle),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("labels"),
                            LexObjectProperty::Array(LexArray {
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("com.atproto.label.defs#label"),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("pronouns"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("status"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#statusView"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("verification"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#verificationState"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("viewer"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#viewerState"),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("profileViewDetailed"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![SmolStr::new_static("did"), SmolStr::new_static("handle")],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("associated"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#profileAssociated"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("avatar"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Uri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("banner"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Uri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("createdAt"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("debug"),
                            LexObjectProperty::Unknown(LexUnknown {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("description"),
                            LexObjectProperty::String(LexString {
                                max_length: Some(2560usize),
                                max_graphemes: Some(256usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("did"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Did),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("displayName"),
                            LexObjectProperty::String(LexString {
                                max_length: Some(640usize),
                                max_graphemes: Some(64usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("followersCount"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("followsCount"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("handle"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Handle),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("indexedAt"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("joinedViaStarterPack"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static(
                                    "app.bsky.graph.defs#starterPackViewBasic",
                                ),
                                ..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("pinnedPost"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("com.atproto.repo.strongRef"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("postsCount"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("pronouns"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("status"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#statusView"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("verification"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#verificationState"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("viewer"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#viewerState"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("website"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Uri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("savedFeed"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![
                            SmolStr::new_static("id"), SmolStr::new_static("type"),
                            SmolStr::new_static("value"), SmolStr::new_static("pinned")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("id"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("pinned"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("type"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("value"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("savedFeedsPref"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![SmolStr::new_static("pinned"), SmolStr::new_static("saved")],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("pinned"),
                            LexObjectProperty::Array(LexArray {
                                items: LexArrayItem::String(LexString {
                                    format: Some(LexStringFormat::AtUri),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("saved"),
                            LexObjectProperty::Array(LexArray {
                                items: LexArrayItem::String(LexString {
                                    format: Some(LexStringFormat::AtUri),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("timelineIndex"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("savedFeedsPrefV2"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("items")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("items"),
                            LexObjectProperty::Array(LexArray {
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("app.bsky.actor.defs#savedFeed"),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("statusView"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![
                            SmolStr::new_static("status"), SmolStr::new_static("record")
                        ],
                    ),
                    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("embed"),
                            LexObjectProperty::Union(LexRefUnion {
                                description: Some(
                                    CowStr::new_static(
                                        "An optional embed associated with the status.",
                                    ),
                                ),
                                refs: vec![
                                    CowStr::new_static("app.bsky.embed.external#view")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("expiresAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The date when this status will expire. The application might choose to no longer return the status after expiration.",
                                    ),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("isActive"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("isDisabled"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..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("record"),
                            LexObjectProperty::Unknown(LexUnknown {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("status"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("The status for the account."),
                                ),
                                ..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("threadViewPref"),
                LexUserType::Object(LexObject {
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("sort"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Sorting mode for threads."),
                                ),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("verificationPrefs"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Preferences for how verified accounts appear in the app.",
                        ),
                    ),
                    required: Some(vec![]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("hideBadges"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("verificationState"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Represents the verification information about the user this object is attached to.",
                        ),
                    ),
                    required: Some(
                        vec![
                            SmolStr::new_static("verifications"),
                            SmolStr::new_static("verifiedStatus"),
                            SmolStr::new_static("trustedVerifierStatus")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("trustedVerifierStatus"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The user's status as a trusted verifier.",
                                    ),
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("verifications"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static(
                                        "All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included.",
                                    ),
                                ),
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("#verificationView"),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("verifiedStatus"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The user's status as a verified account.",
                                    ),
                                ),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("verificationView"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "An individual verification for an associated subject.",
                        ),
                    ),
                    required: Some(
                        vec![
                            SmolStr::new_static("issuer"), SmolStr::new_static("uri"),
                            SmolStr::new_static("isValid"),
                            SmolStr::new_static("createdAt")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("createdAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Timestamp when the verification was created.",
                                    ),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("isValid"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("issuer"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("The user who issued this verification."),
                                ),
                                format: Some(LexStringFormat::Did),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("issuerDisplayName"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("The display name of the issuer."),
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("issuerHandle"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("The handle of the issuer."),
                                ),
                                format: Some(LexStringFormat::Handle),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("The AT-URI of the verification record."),
                                ),
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("viewerState"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("activitySubscription"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static(
                                    "app.bsky.notification.defs#activitySubscription",
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("blockedBy"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("blocking"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("blockingByList"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static(
                                    "app.bsky.graph.defs#listViewBasic",
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("followedBy"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("following"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("knownFollowers"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#knownFollowers"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("muted"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("mutedByList"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static(
                                    "app.bsky.graph.defs#listViewBasic",
                                ),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map
        },
        ..Default::default()
    }
}

fn _default_feed_view_pref_hide_replies_by_unfollowed() -> Option<bool> {
    Some(true)
}

pub mod hidden_posts_pref_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 Items;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Items = Unset;
    }
    ///State transition - sets the `items` field to Set
    pub struct SetItems<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetItems<St> {}
    impl<St: State> State for SetItems<St> {
        type Items = Set<members::items>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `items` field
        pub struct items(());
    }
}

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

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

impl<S: BosStr> HiddenPostsPref<S> {
    /// Create a new builder for this type
    pub fn builder() -> HiddenPostsPrefBuilder<hidden_posts_pref_state::Empty, S> {
        HiddenPostsPrefBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> HiddenPostsPrefBuilder<St, S>
where
    St: hidden_posts_pref_state::State,
    St::Items: hidden_posts_pref_state::IsUnset,
{
    /// Set the `items` field (required)
    pub fn items(
        mut self,
        value: impl Into<Vec<AtUri<S>>>,
    ) -> HiddenPostsPrefBuilder<hidden_posts_pref_state::SetItems<St>, S> {
        self._fields.0 = Option::Some(value.into());
        HiddenPostsPrefBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> HiddenPostsPrefBuilder<St, S>
where
    St: hidden_posts_pref_state::State,
    St::Items: hidden_posts_pref_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> HiddenPostsPref<S> {
        HiddenPostsPref {
            items: self._fields.0.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> HiddenPostsPref<S> {
        HiddenPostsPref {
            items: self._fields.0.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod interests_pref_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 Tags;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Tags = Unset;
    }
    ///State transition - sets the `tags` field to Set
    pub struct SetTags<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetTags<St> {}
    impl<St: State> State for SetTags<St> {
        type Tags = Set<members::tags>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `tags` field
        pub struct tags(());
    }
}

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

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

impl<S: BosStr> InterestsPref<S> {
    /// Create a new builder for this type
    pub fn builder() -> InterestsPrefBuilder<interests_pref_state::Empty, S> {
        InterestsPrefBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> InterestsPrefBuilder<St, S>
where
    St: interests_pref_state::State,
    St::Tags: interests_pref_state::IsUnset,
{
    /// Set the `tags` field (required)
    pub fn tags(
        mut self,
        value: impl Into<Vec<S>>,
    ) -> InterestsPrefBuilder<interests_pref_state::SetTags<St>, S> {
        self._fields.0 = Option::Some(value.into());
        InterestsPrefBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> InterestsPrefBuilder<St, S>
where
    St: interests_pref_state::State,
    St::Tags: interests_pref_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> InterestsPref<S> {
        InterestsPref {
            tags: self._fields.0.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> InterestsPref<S> {
        InterestsPref {
            tags: self._fields.0.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod known_followers_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 Count;
        type Followers;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Count = Unset;
        type Followers = Unset;
    }
    ///State transition - sets the `count` field to Set
    pub struct SetCount<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCount<St> {}
    impl<St: State> State for SetCount<St> {
        type Count = Set<members::count>;
        type Followers = St::Followers;
    }
    ///State transition - sets the `followers` field to Set
    pub struct SetFollowers<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetFollowers<St> {}
    impl<St: State> State for SetFollowers<St> {
        type Count = St::Count;
        type Followers = Set<members::followers>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `count` field
        pub struct count(());
        ///Marker type for the `followers` field
        pub struct followers(());
    }
}

/// Builder for constructing an instance of this type.
pub struct KnownFollowersBuilder<
    St: known_followers_state::State,
    S: BosStr = DefaultStr,
> {
    _state: PhantomData<fn() -> St>,
    _fields: (Option<i64>, Option<Vec<actor::ProfileViewBasic<S>>>),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> KnownFollowers<S> {
    /// Create a new builder for this type
    pub fn builder() -> KnownFollowersBuilder<known_followers_state::Empty, S> {
        KnownFollowersBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> KnownFollowersBuilder<St, S>
where
    St: known_followers_state::State,
    St::Count: known_followers_state::IsUnset,
{
    /// Set the `count` field (required)
    pub fn count(
        mut self,
        value: impl Into<i64>,
    ) -> KnownFollowersBuilder<known_followers_state::SetCount<St>, S> {
        self._fields.0 = Option::Some(value.into());
        KnownFollowersBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> KnownFollowersBuilder<St, S>
where
    St: known_followers_state::State,
    St::Followers: known_followers_state::IsUnset,
{
    /// Set the `followers` field (required)
    pub fn followers(
        mut self,
        value: impl Into<Vec<actor::ProfileViewBasic<S>>>,
    ) -> KnownFollowersBuilder<known_followers_state::SetFollowers<St>, S> {
        self._fields.1 = Option::Some(value.into());
        KnownFollowersBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> KnownFollowersBuilder<St, S>
where
    St: known_followers_state::State,
    St::Count: known_followers_state::IsSet,
    St::Followers: known_followers_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> KnownFollowers<S> {
        KnownFollowers {
            count: self._fields.0.unwrap(),
            followers: self._fields.1.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> KnownFollowers<S> {
        KnownFollowers {
            count: self._fields.0.unwrap(),
            followers: self._fields.1.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod labeler_pref_item_state {

    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
    #[allow(unused)]
    use ::core::marker::PhantomData;
    mod sealed {
        pub trait Sealed {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Did;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Did = Unset;
    }
    ///State transition - sets the `did` field to Set
    pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetDid<St> {}
    impl<St: State> State for SetDid<St> {
        type Did = Set<members::did>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `did` field
        pub struct did(());
    }
}

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

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

impl<S: BosStr> LabelerPrefItem<S> {
    /// Create a new builder for this type
    pub fn builder() -> LabelerPrefItemBuilder<labeler_pref_item_state::Empty, S> {
        LabelerPrefItemBuilder::builder()
    }
}

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

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

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

impl<St, S: BosStr> LabelerPrefItemBuilder<St, S>
where
    St: labeler_pref_item_state::State,
    St::Did: labeler_pref_item_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> LabelerPrefItem<S> {
        LabelerPrefItem {
            did: self._fields.0.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> LabelerPrefItem<S> {
        LabelerPrefItem {
            did: self._fields.0.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod labelers_pref_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 Labelers;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Labelers = Unset;
    }
    ///State transition - sets the `labelers` field to Set
    pub struct SetLabelers<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetLabelers<St> {}
    impl<St: State> State for SetLabelers<St> {
        type Labelers = Set<members::labelers>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `labelers` field
        pub struct labelers(());
    }
}

/// Builder for constructing an instance of this type.
pub struct LabelersPrefBuilder<St: labelers_pref_state::State, S: BosStr = DefaultStr> {
    _state: PhantomData<fn() -> St>,
    _fields: (Option<Vec<actor::LabelerPrefItem<S>>>,),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> LabelersPref<S> {
    /// Create a new builder for this type
    pub fn builder() -> LabelersPrefBuilder<labelers_pref_state::Empty, S> {
        LabelersPrefBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> LabelersPrefBuilder<St, S>
where
    St: labelers_pref_state::State,
    St::Labelers: labelers_pref_state::IsUnset,
{
    /// Set the `labelers` field (required)
    pub fn labelers(
        mut self,
        value: impl Into<Vec<actor::LabelerPrefItem<S>>>,
    ) -> LabelersPrefBuilder<labelers_pref_state::SetLabelers<St>, S> {
        self._fields.0 = Option::Some(value.into());
        LabelersPrefBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> LabelersPrefBuilder<St, S>
where
    St: labelers_pref_state::State,
    St::Labelers: labelers_pref_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> LabelersPref<S> {
        LabelersPref {
            labelers: self._fields.0.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> LabelersPref<S> {
        LabelersPref {
            labelers: self._fields.0.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

fn _default_live_event_preferences_hide_all_feeds() -> Option<bool> {
    Some(false)
}

impl Default for LiveEventPreferences {
    fn default() -> Self {
        Self {
            hidden_feed_ids: None,
            hide_all_feeds: Some(false),
            extra_data: Default::default(),
        }
    }
}

pub mod muted_word_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 Targets;
        type Value;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Targets = Unset;
        type Value = Unset;
    }
    ///State transition - sets the `targets` field to Set
    pub struct SetTargets<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetTargets<St> {}
    impl<St: State> State for SetTargets<St> {
        type Targets = Set<members::targets>;
        type Value = St::Value;
    }
    ///State transition - sets the `value` field to Set
    pub struct SetValue<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetValue<St> {}
    impl<St: State> State for SetValue<St> {
        type Targets = St::Targets;
        type Value = Set<members::value>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `targets` field
        pub struct targets(());
        ///Marker type for the `value` field
        pub struct value(());
    }
}

/// Builder for constructing an instance of this type.
pub struct MutedWordBuilder<St: muted_word_state::State, S: BosStr = DefaultStr> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<MutedWordActorTarget<S>>,
        Option<Datetime>,
        Option<S>,
        Option<Vec<actor::MutedWordTarget<S>>>,
        Option<S>,
    ),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> MutedWord<S> {
    /// Create a new builder for this type
    pub fn builder() -> MutedWordBuilder<muted_word_state::Empty, S> {
        MutedWordBuilder::builder()
    }
}

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

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

impl<St: muted_word_state::State, S: BosStr> MutedWordBuilder<St, S> {
    /// Set the `actorTarget` field (optional)
    pub fn actor_target(
        mut self,
        value: impl Into<Option<MutedWordActorTarget<S>>>,
    ) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `actorTarget` field to an Option value (optional)
    pub fn maybe_actor_target(mut self, value: Option<MutedWordActorTarget<S>>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<St: muted_word_state::State, S: BosStr> MutedWordBuilder<St, S> {
    /// Set the `expiresAt` field (optional)
    pub fn expires_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `expiresAt` field to an Option value (optional)
    pub fn maybe_expires_at(mut self, value: Option<Datetime>) -> Self {
        self._fields.1 = value;
        self
    }
}

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

impl<St, S: BosStr> MutedWordBuilder<St, S>
where
    St: muted_word_state::State,
    St::Targets: muted_word_state::IsUnset,
{
    /// Set the `targets` field (required)
    pub fn targets(
        mut self,
        value: impl Into<Vec<actor::MutedWordTarget<S>>>,
    ) -> MutedWordBuilder<muted_word_state::SetTargets<St>, S> {
        self._fields.3 = Option::Some(value.into());
        MutedWordBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

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

impl<St, S: BosStr> MutedWordBuilder<St, S>
where
    St: muted_word_state::State,
    St::Targets: muted_word_state::IsSet,
    St::Value: muted_word_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> MutedWord<S> {
        MutedWord {
            actor_target: self._fields.0,
            expires_at: self._fields.1,
            id: self._fields.2,
            targets: self._fields.3.unwrap(),
            value: self._fields.4.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> MutedWord<S> {
        MutedWord {
            actor_target: self._fields.0,
            expires_at: self._fields.1,
            id: self._fields.2,
            targets: self._fields.3.unwrap(),
            value: self._fields.4.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod muted_words_pref_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 Items;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Items = Unset;
    }
    ///State transition - sets the `items` field to Set
    pub struct SetItems<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetItems<St> {}
    impl<St: State> State for SetItems<St> {
        type Items = Set<members::items>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `items` field
        pub struct items(());
    }
}

/// Builder for constructing an instance of this type.
pub struct MutedWordsPrefBuilder<
    St: muted_words_pref_state::State,
    S: BosStr = DefaultStr,
> {
    _state: PhantomData<fn() -> St>,
    _fields: (Option<Vec<actor::MutedWord<S>>>,),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> MutedWordsPref<S> {
    /// Create a new builder for this type
    pub fn builder() -> MutedWordsPrefBuilder<muted_words_pref_state::Empty, S> {
        MutedWordsPrefBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> MutedWordsPrefBuilder<St, S>
where
    St: muted_words_pref_state::State,
    St::Items: muted_words_pref_state::IsUnset,
{
    /// Set the `items` field (required)
    pub fn items(
        mut self,
        value: impl Into<Vec<actor::MutedWord<S>>>,
    ) -> MutedWordsPrefBuilder<muted_words_pref_state::SetItems<St>, S> {
        self._fields.0 = Option::Some(value.into());
        MutedWordsPrefBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> MutedWordsPrefBuilder<St, S>
where
    St: muted_words_pref_state::State,
    St::Items: muted_words_pref_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> MutedWordsPref<S> {
        MutedWordsPref {
            items: self._fields.0.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> MutedWordsPref<S> {
        MutedWordsPref {
            items: self._fields.0.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

fn _default_nux_completed() -> bool {
    false
}

pub mod nux_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 Completed;
        type Id;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Completed = Unset;
        type Id = Unset;
    }
    ///State transition - sets the `completed` field to Set
    pub struct SetCompleted<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCompleted<St> {}
    impl<St: State> State for SetCompleted<St> {
        type Completed = Set<members::completed>;
        type Id = St::Id;
    }
    ///State transition - sets the `id` field to Set
    pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetId<St> {}
    impl<St: State> State for SetId<St> {
        type Completed = St::Completed;
        type Id = Set<members::id>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `completed` field
        pub struct completed(());
        ///Marker type for the `id` field
        pub struct id(());
    }
}

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

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

impl<S: BosStr> Nux<S> {
    /// Create a new builder for this type
    pub fn builder() -> NuxBuilder<nux_state::Empty, S> {
        NuxBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> NuxBuilder<St, S>
where
    St: nux_state::State,
    St::Completed: nux_state::IsUnset,
{
    /// Set the `completed` field (required)
    pub fn completed(
        mut self,
        value: impl Into<bool>,
    ) -> NuxBuilder<nux_state::SetCompleted<St>, S> {
        self._fields.0 = Option::Some(value.into());
        NuxBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: nux_state::State, S: BosStr> NuxBuilder<St, S> {
    /// Set the `data` field (optional)
    pub fn data(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `data` field to an Option value (optional)
    pub fn maybe_data(mut self, value: Option<S>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<St: nux_state::State, S: BosStr> NuxBuilder<St, S> {
    /// Set the `expiresAt` field (optional)
    pub fn expires_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `expiresAt` field to an Option value (optional)
    pub fn maybe_expires_at(mut self, value: Option<Datetime>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<St, S: BosStr> NuxBuilder<St, S>
where
    St: nux_state::State,
    St::Id: nux_state::IsUnset,
{
    /// Set the `id` field (required)
    pub fn id(mut self, value: impl Into<S>) -> NuxBuilder<nux_state::SetId<St>, S> {
        self._fields.3 = Option::Some(value.into());
        NuxBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> NuxBuilder<St, S>
where
    St: nux_state::State,
    St::Completed: nux_state::IsSet,
    St::Id: nux_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> Nux<S> {
        Nux {
            completed: self._fields.0.unwrap(),
            data: self._fields.1,
            expires_at: self._fields.2,
            id: self._fields.3.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Nux<S> {
        Nux {
            completed: self._fields.0.unwrap(),
            data: self._fields.1,
            expires_at: self._fields.2,
            id: self._fields.3.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod profile_associated_germ_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 MessageMeUrl;
        type ShowButtonTo;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type MessageMeUrl = Unset;
        type ShowButtonTo = Unset;
    }
    ///State transition - sets the `message_me_url` field to Set
    pub struct SetMessageMeUrl<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetMessageMeUrl<St> {}
    impl<St: State> State for SetMessageMeUrl<St> {
        type MessageMeUrl = Set<members::message_me_url>;
        type ShowButtonTo = St::ShowButtonTo;
    }
    ///State transition - sets the `show_button_to` field to Set
    pub struct SetShowButtonTo<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetShowButtonTo<St> {}
    impl<St: State> State for SetShowButtonTo<St> {
        type MessageMeUrl = St::MessageMeUrl;
        type ShowButtonTo = Set<members::show_button_to>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `message_me_url` field
        pub struct message_me_url(());
        ///Marker type for the `show_button_to` field
        pub struct show_button_to(());
    }
}

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

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

impl<S: BosStr> ProfileAssociatedGerm<S> {
    /// Create a new builder for this type
    pub fn builder() -> ProfileAssociatedGermBuilder<
        profile_associated_germ_state::Empty,
        S,
    > {
        ProfileAssociatedGermBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> ProfileAssociatedGermBuilder<St, S>
where
    St: profile_associated_germ_state::State,
    St::MessageMeUrl: profile_associated_germ_state::IsUnset,
{
    /// Set the `messageMeUrl` field (required)
    pub fn message_me_url(
        mut self,
        value: impl Into<UriValue<S>>,
    ) -> ProfileAssociatedGermBuilder<
        profile_associated_germ_state::SetMessageMeUrl<St>,
        S,
    > {
        self._fields.0 = Option::Some(value.into());
        ProfileAssociatedGermBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> ProfileAssociatedGermBuilder<St, S>
where
    St: profile_associated_germ_state::State,
    St::ShowButtonTo: profile_associated_germ_state::IsUnset,
{
    /// Set the `showButtonTo` field (required)
    pub fn show_button_to(
        mut self,
        value: impl Into<ProfileAssociatedGermShowButtonTo<S>>,
    ) -> ProfileAssociatedGermBuilder<
        profile_associated_germ_state::SetShowButtonTo<St>,
        S,
    > {
        self._fields.1 = Option::Some(value.into());
        ProfileAssociatedGermBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> ProfileAssociatedGermBuilder<St, S>
where
    St: profile_associated_germ_state::State,
    St::MessageMeUrl: profile_associated_germ_state::IsSet,
    St::ShowButtonTo: profile_associated_germ_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> ProfileAssociatedGerm<S> {
        ProfileAssociatedGerm {
            message_me_url: self._fields.0.unwrap(),
            show_button_to: self._fields.1.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> ProfileAssociatedGerm<S> {
        ProfileAssociatedGerm {
            message_me_url: self._fields.0.unwrap(),
            show_button_to: self._fields.1.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod profile_view_state {

    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
    #[allow(unused)]
    use ::core::marker::PhantomData;
    mod sealed {
        pub trait Sealed {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Did;
        type Handle;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Did = Unset;
        type Handle = Unset;
    }
    ///State transition - sets the `did` field to Set
    pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetDid<St> {}
    impl<St: State> State for SetDid<St> {
        type Did = Set<members::did>;
        type Handle = St::Handle;
    }
    ///State transition - sets the `handle` field to Set
    pub struct SetHandle<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetHandle<St> {}
    impl<St: State> State for SetHandle<St> {
        type Did = St::Did;
        type Handle = Set<members::handle>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `did` field
        pub struct did(());
        ///Marker type for the `handle` field
        pub struct handle(());
    }
}

/// Builder for constructing an instance of this type.
pub struct ProfileViewBuilder<St: profile_view_state::State, S: BosStr = DefaultStr> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<actor::ProfileAssociated<S>>,
        Option<UriValue<S>>,
        Option<Datetime>,
        Option<Data<S>>,
        Option<S>,
        Option<Did<S>>,
        Option<S>,
        Option<Handle<S>>,
        Option<Datetime>,
        Option<Vec<Label<S>>>,
        Option<S>,
        Option<actor::StatusView<S>>,
        Option<actor::VerificationState<S>>,
        Option<actor::ViewerState<S>>,
    ),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> ProfileView<S> {
    /// Create a new builder for this type
    pub fn builder() -> ProfileViewBuilder<profile_view_state::Empty, S> {
        ProfileViewBuilder::builder()
    }
}

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

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

impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> {
    /// Set the `associated` field (optional)
    pub fn associated(
        mut self,
        value: impl Into<Option<actor::ProfileAssociated<S>>>,
    ) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `associated` field to an Option value (optional)
    pub fn maybe_associated(
        mut self,
        value: Option<actor::ProfileAssociated<S>>,
    ) -> Self {
        self._fields.0 = value;
        self
    }
}

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

impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> {
    /// Set the `createdAt` field (optional)
    pub fn created_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `createdAt` field to an Option value (optional)
    pub fn maybe_created_at(mut self, value: Option<Datetime>) -> Self {
        self._fields.2 = value;
        self
    }
}

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

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

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

impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> {
    /// Set the `displayName` field (optional)
    pub fn display_name(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `displayName` field to an Option value (optional)
    pub fn maybe_display_name(mut self, value: Option<S>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<St, S: BosStr> ProfileViewBuilder<St, S>
where
    St: profile_view_state::State,
    St::Handle: profile_view_state::IsUnset,
{
    /// Set the `handle` field (required)
    pub fn handle(
        mut self,
        value: impl Into<Handle<S>>,
    ) -> ProfileViewBuilder<profile_view_state::SetHandle<St>, S> {
        self._fields.7 = Option::Some(value.into());
        ProfileViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> {
    /// Set the `indexedAt` field (optional)
    pub fn indexed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.8 = 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.8 = value;
        self
    }
}

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

impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> {
    /// Set the `pronouns` field (optional)
    pub fn pronouns(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.10 = value.into();
        self
    }
    /// Set the `pronouns` field to an Option value (optional)
    pub fn maybe_pronouns(mut self, value: Option<S>) -> Self {
        self._fields.10 = value;
        self
    }
}

impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> {
    /// Set the `status` field (optional)
    pub fn status(mut self, value: impl Into<Option<actor::StatusView<S>>>) -> Self {
        self._fields.11 = value.into();
        self
    }
    /// Set the `status` field to an Option value (optional)
    pub fn maybe_status(mut self, value: Option<actor::StatusView<S>>) -> Self {
        self._fields.11 = value;
        self
    }
}

impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> {
    /// Set the `verification` field (optional)
    pub fn verification(
        mut self,
        value: impl Into<Option<actor::VerificationState<S>>>,
    ) -> Self {
        self._fields.12 = value.into();
        self
    }
    /// Set the `verification` field to an Option value (optional)
    pub fn maybe_verification(
        mut self,
        value: Option<actor::VerificationState<S>>,
    ) -> Self {
        self._fields.12 = value;
        self
    }
}

impl<St: profile_view_state::State, S: BosStr> ProfileViewBuilder<St, S> {
    /// Set the `viewer` field (optional)
    pub fn viewer(mut self, value: impl Into<Option<actor::ViewerState<S>>>) -> Self {
        self._fields.13 = value.into();
        self
    }
    /// Set the `viewer` field to an Option value (optional)
    pub fn maybe_viewer(mut self, value: Option<actor::ViewerState<S>>) -> Self {
        self._fields.13 = value;
        self
    }
}

impl<St, S: BosStr> ProfileViewBuilder<St, S>
where
    St: profile_view_state::State,
    St::Did: profile_view_state::IsSet,
    St::Handle: profile_view_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> ProfileView<S> {
        ProfileView {
            associated: self._fields.0,
            avatar: self._fields.1,
            created_at: self._fields.2,
            debug: self._fields.3,
            description: self._fields.4,
            did: self._fields.5.unwrap(),
            display_name: self._fields.6,
            handle: self._fields.7.unwrap(),
            indexed_at: self._fields.8,
            labels: self._fields.9,
            pronouns: self._fields.10,
            status: self._fields.11,
            verification: self._fields.12,
            viewer: self._fields.13,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> ProfileView<S> {
        ProfileView {
            associated: self._fields.0,
            avatar: self._fields.1,
            created_at: self._fields.2,
            debug: self._fields.3,
            description: self._fields.4,
            did: self._fields.5.unwrap(),
            display_name: self._fields.6,
            handle: self._fields.7.unwrap(),
            indexed_at: self._fields.8,
            labels: self._fields.9,
            pronouns: self._fields.10,
            status: self._fields.11,
            verification: self._fields.12,
            viewer: self._fields.13,
            extra_data: Some(extra_data),
        }
    }
}

pub mod profile_view_basic_state {

    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
    #[allow(unused)]
    use ::core::marker::PhantomData;
    mod sealed {
        pub trait Sealed {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Did;
        type Handle;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Did = Unset;
        type Handle = Unset;
    }
    ///State transition - sets the `did` field to Set
    pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetDid<St> {}
    impl<St: State> State for SetDid<St> {
        type Did = Set<members::did>;
        type Handle = St::Handle;
    }
    ///State transition - sets the `handle` field to Set
    pub struct SetHandle<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetHandle<St> {}
    impl<St: State> State for SetHandle<St> {
        type Did = St::Did;
        type Handle = Set<members::handle>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `did` field
        pub struct did(());
        ///Marker type for the `handle` field
        pub struct handle(());
    }
}

/// Builder for constructing an instance of this type.
pub struct ProfileViewBasicBuilder<
    St: profile_view_basic_state::State,
    S: BosStr = DefaultStr,
> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<actor::ProfileAssociated<S>>,
        Option<UriValue<S>>,
        Option<Datetime>,
        Option<Data<S>>,
        Option<Did<S>>,
        Option<S>,
        Option<Handle<S>>,
        Option<Vec<Label<S>>>,
        Option<S>,
        Option<actor::StatusView<S>>,
        Option<actor::VerificationState<S>>,
        Option<actor::ViewerState<S>>,
    ),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> ProfileViewBasic<S> {
    /// Create a new builder for this type
    pub fn builder() -> ProfileViewBasicBuilder<profile_view_basic_state::Empty, S> {
        ProfileViewBasicBuilder::builder()
    }
}

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

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

impl<St: profile_view_basic_state::State, S: BosStr> ProfileViewBasicBuilder<St, S> {
    /// Set the `associated` field (optional)
    pub fn associated(
        mut self,
        value: impl Into<Option<actor::ProfileAssociated<S>>>,
    ) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `associated` field to an Option value (optional)
    pub fn maybe_associated(
        mut self,
        value: Option<actor::ProfileAssociated<S>>,
    ) -> Self {
        self._fields.0 = value;
        self
    }
}

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

impl<St: profile_view_basic_state::State, S: BosStr> ProfileViewBasicBuilder<St, S> {
    /// Set the `createdAt` field (optional)
    pub fn created_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `createdAt` field to an Option value (optional)
    pub fn maybe_created_at(mut self, value: Option<Datetime>) -> Self {
        self._fields.2 = value;
        self
    }
}

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

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

impl<St: profile_view_basic_state::State, S: BosStr> ProfileViewBasicBuilder<St, S> {
    /// Set the `displayName` field (optional)
    pub fn display_name(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.5 = value.into();
        self
    }
    /// Set the `displayName` field to an Option value (optional)
    pub fn maybe_display_name(mut self, value: Option<S>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<St, S: BosStr> ProfileViewBasicBuilder<St, S>
where
    St: profile_view_basic_state::State,
    St::Handle: profile_view_basic_state::IsUnset,
{
    /// Set the `handle` field (required)
    pub fn handle(
        mut self,
        value: impl Into<Handle<S>>,
    ) -> ProfileViewBasicBuilder<profile_view_basic_state::SetHandle<St>, S> {
        self._fields.6 = Option::Some(value.into());
        ProfileViewBasicBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

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

impl<St: profile_view_basic_state::State, S: BosStr> ProfileViewBasicBuilder<St, S> {
    /// Set the `pronouns` field (optional)
    pub fn pronouns(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.8 = value.into();
        self
    }
    /// Set the `pronouns` field to an Option value (optional)
    pub fn maybe_pronouns(mut self, value: Option<S>) -> Self {
        self._fields.8 = value;
        self
    }
}

impl<St: profile_view_basic_state::State, S: BosStr> ProfileViewBasicBuilder<St, S> {
    /// Set the `status` field (optional)
    pub fn status(mut self, value: impl Into<Option<actor::StatusView<S>>>) -> Self {
        self._fields.9 = value.into();
        self
    }
    /// Set the `status` field to an Option value (optional)
    pub fn maybe_status(mut self, value: Option<actor::StatusView<S>>) -> Self {
        self._fields.9 = value;
        self
    }
}

impl<St: profile_view_basic_state::State, S: BosStr> ProfileViewBasicBuilder<St, S> {
    /// Set the `verification` field (optional)
    pub fn verification(
        mut self,
        value: impl Into<Option<actor::VerificationState<S>>>,
    ) -> Self {
        self._fields.10 = value.into();
        self
    }
    /// Set the `verification` field to an Option value (optional)
    pub fn maybe_verification(
        mut self,
        value: Option<actor::VerificationState<S>>,
    ) -> Self {
        self._fields.10 = value;
        self
    }
}

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

impl<St, S: BosStr> ProfileViewBasicBuilder<St, S>
where
    St: profile_view_basic_state::State,
    St::Did: profile_view_basic_state::IsSet,
    St::Handle: profile_view_basic_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> ProfileViewBasic<S> {
        ProfileViewBasic {
            associated: self._fields.0,
            avatar: self._fields.1,
            created_at: self._fields.2,
            debug: self._fields.3,
            did: self._fields.4.unwrap(),
            display_name: self._fields.5,
            handle: self._fields.6.unwrap(),
            labels: self._fields.7,
            pronouns: self._fields.8,
            status: self._fields.9,
            verification: self._fields.10,
            viewer: self._fields.11,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> ProfileViewBasic<S> {
        ProfileViewBasic {
            associated: self._fields.0,
            avatar: self._fields.1,
            created_at: self._fields.2,
            debug: self._fields.3,
            did: self._fields.4.unwrap(),
            display_name: self._fields.5,
            handle: self._fields.6.unwrap(),
            labels: self._fields.7,
            pronouns: self._fields.8,
            status: self._fields.9,
            verification: self._fields.10,
            viewer: self._fields.11,
            extra_data: Some(extra_data),
        }
    }
}

pub mod profile_view_detailed_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;
        type Handle;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Did = Unset;
        type Handle = Unset;
    }
    ///State transition - sets the `did` field to Set
    pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetDid<St> {}
    impl<St: State> State for SetDid<St> {
        type Did = Set<members::did>;
        type Handle = St::Handle;
    }
    ///State transition - sets the `handle` field to Set
    pub struct SetHandle<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetHandle<St> {}
    impl<St: State> State for SetHandle<St> {
        type Did = St::Did;
        type Handle = Set<members::handle>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `did` field
        pub struct did(());
        ///Marker type for the `handle` field
        pub struct handle(());
    }
}

/// Builder for constructing an instance of this type.
pub struct ProfileViewDetailedBuilder<
    St: profile_view_detailed_state::State,
    S: BosStr = DefaultStr,
> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<actor::ProfileAssociated<S>>,
        Option<UriValue<S>>,
        Option<UriValue<S>>,
        Option<Datetime>,
        Option<Data<S>>,
        Option<S>,
        Option<Did<S>>,
        Option<S>,
        Option<i64>,
        Option<i64>,
        Option<Handle<S>>,
        Option<Datetime>,
        Option<Data<S>>,
        Option<Vec<Label<S>>>,
        Option<StrongRef<S>>,
        Option<i64>,
        Option<S>,
        Option<actor::StatusView<S>>,
        Option<actor::VerificationState<S>>,
        Option<actor::ViewerState<S>>,
        Option<UriValue<S>>,
    ),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> ProfileViewDetailed<S> {
    /// Create a new builder for this type
    pub fn builder() -> ProfileViewDetailedBuilder<
        profile_view_detailed_state::Empty,
        S,
    > {
        ProfileViewDetailedBuilder::builder()
    }
}

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

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

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `associated` field (optional)
    pub fn associated(
        mut self,
        value: impl Into<Option<actor::ProfileAssociated<S>>>,
    ) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `associated` field to an Option value (optional)
    pub fn maybe_associated(
        mut self,
        value: Option<actor::ProfileAssociated<S>>,
    ) -> Self {
        self._fields.0 = value;
        self
    }
}

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

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `banner` field (optional)
    pub fn banner(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `banner` field to an Option value (optional)
    pub fn maybe_banner(mut self, value: Option<UriValue<S>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `createdAt` field (optional)
    pub fn created_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `createdAt` field to an Option value (optional)
    pub fn maybe_created_at(mut self, value: Option<Datetime>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `debug` field (optional)
    pub fn debug(mut self, value: impl Into<Option<Data<S>>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `debug` field to an Option value (optional)
    pub fn maybe_debug(mut self, value: Option<Data<S>>) -> Self {
        self._fields.4 = value;
        self
    }
}

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

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

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `displayName` field (optional)
    pub fn display_name(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.7 = value.into();
        self
    }
    /// Set the `displayName` field to an Option value (optional)
    pub fn maybe_display_name(mut self, value: Option<S>) -> Self {
        self._fields.7 = value;
        self
    }
}

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `followersCount` field (optional)
    pub fn followers_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.8 = value.into();
        self
    }
    /// Set the `followersCount` field to an Option value (optional)
    pub fn maybe_followers_count(mut self, value: Option<i64>) -> Self {
        self._fields.8 = value;
        self
    }
}

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `followsCount` field (optional)
    pub fn follows_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.9 = value.into();
        self
    }
    /// Set the `followsCount` field to an Option value (optional)
    pub fn maybe_follows_count(mut self, value: Option<i64>) -> Self {
        self._fields.9 = value;
        self
    }
}

impl<St, S: BosStr> ProfileViewDetailedBuilder<St, S>
where
    St: profile_view_detailed_state::State,
    St::Handle: profile_view_detailed_state::IsUnset,
{
    /// Set the `handle` field (required)
    pub fn handle(
        mut self,
        value: impl Into<Handle<S>>,
    ) -> ProfileViewDetailedBuilder<profile_view_detailed_state::SetHandle<St>, S> {
        self._fields.10 = Option::Some(value.into());
        ProfileViewDetailedBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `indexedAt` field (optional)
    pub fn indexed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.11 = 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.11 = value;
        self
    }
}

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `joinedViaStarterPack` field (optional)
    pub fn joined_via_starter_pack(mut self, value: impl Into<Option<Data<S>>>) -> Self {
        self._fields.12 = value.into();
        self
    }
    /// Set the `joinedViaStarterPack` field to an Option value (optional)
    pub fn maybe_joined_via_starter_pack(mut self, value: Option<Data<S>>) -> Self {
        self._fields.12 = value;
        self
    }
}

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

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `pinnedPost` field (optional)
    pub fn pinned_post(mut self, value: impl Into<Option<StrongRef<S>>>) -> Self {
        self._fields.14 = value.into();
        self
    }
    /// Set the `pinnedPost` field to an Option value (optional)
    pub fn maybe_pinned_post(mut self, value: Option<StrongRef<S>>) -> Self {
        self._fields.14 = value;
        self
    }
}

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `postsCount` field (optional)
    pub fn posts_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.15 = value.into();
        self
    }
    /// Set the `postsCount` field to an Option value (optional)
    pub fn maybe_posts_count(mut self, value: Option<i64>) -> Self {
        self._fields.15 = value;
        self
    }
}

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `pronouns` field (optional)
    pub fn pronouns(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.16 = value.into();
        self
    }
    /// Set the `pronouns` field to an Option value (optional)
    pub fn maybe_pronouns(mut self, value: Option<S>) -> Self {
        self._fields.16 = value;
        self
    }
}

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `status` field (optional)
    pub fn status(mut self, value: impl Into<Option<actor::StatusView<S>>>) -> Self {
        self._fields.17 = value.into();
        self
    }
    /// Set the `status` field to an Option value (optional)
    pub fn maybe_status(mut self, value: Option<actor::StatusView<S>>) -> Self {
        self._fields.17 = value;
        self
    }
}

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `verification` field (optional)
    pub fn verification(
        mut self,
        value: impl Into<Option<actor::VerificationState<S>>>,
    ) -> Self {
        self._fields.18 = value.into();
        self
    }
    /// Set the `verification` field to an Option value (optional)
    pub fn maybe_verification(
        mut self,
        value: Option<actor::VerificationState<S>>,
    ) -> Self {
        self._fields.18 = value;
        self
    }
}

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `viewer` field (optional)
    pub fn viewer(mut self, value: impl Into<Option<actor::ViewerState<S>>>) -> Self {
        self._fields.19 = value.into();
        self
    }
    /// Set the `viewer` field to an Option value (optional)
    pub fn maybe_viewer(mut self, value: Option<actor::ViewerState<S>>) -> Self {
        self._fields.19 = value;
        self
    }
}

impl<
    St: profile_view_detailed_state::State,
    S: BosStr,
> ProfileViewDetailedBuilder<St, S> {
    /// Set the `website` field (optional)
    pub fn website(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
        self._fields.20 = value.into();
        self
    }
    /// Set the `website` field to an Option value (optional)
    pub fn maybe_website(mut self, value: Option<UriValue<S>>) -> Self {
        self._fields.20 = value;
        self
    }
}

impl<St, S: BosStr> ProfileViewDetailedBuilder<St, S>
where
    St: profile_view_detailed_state::State,
    St::Did: profile_view_detailed_state::IsSet,
    St::Handle: profile_view_detailed_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> ProfileViewDetailed<S> {
        ProfileViewDetailed {
            associated: self._fields.0,
            avatar: self._fields.1,
            banner: self._fields.2,
            created_at: self._fields.3,
            debug: self._fields.4,
            description: self._fields.5,
            did: self._fields.6.unwrap(),
            display_name: self._fields.7,
            followers_count: self._fields.8,
            follows_count: self._fields.9,
            handle: self._fields.10.unwrap(),
            indexed_at: self._fields.11,
            joined_via_starter_pack: self._fields.12,
            labels: self._fields.13,
            pinned_post: self._fields.14,
            posts_count: self._fields.15,
            pronouns: self._fields.16,
            status: self._fields.17,
            verification: self._fields.18,
            viewer: self._fields.19,
            website: self._fields.20,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> ProfileViewDetailed<S> {
        ProfileViewDetailed {
            associated: self._fields.0,
            avatar: self._fields.1,
            banner: self._fields.2,
            created_at: self._fields.3,
            debug: self._fields.4,
            description: self._fields.5,
            did: self._fields.6.unwrap(),
            display_name: self._fields.7,
            followers_count: self._fields.8,
            follows_count: self._fields.9,
            handle: self._fields.10.unwrap(),
            indexed_at: self._fields.11,
            joined_via_starter_pack: self._fields.12,
            labels: self._fields.13,
            pinned_post: self._fields.14,
            posts_count: self._fields.15,
            pronouns: self._fields.16,
            status: self._fields.17,
            verification: self._fields.18,
            viewer: self._fields.19,
            website: self._fields.20,
            extra_data: Some(extra_data),
        }
    }
}

pub mod saved_feed_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 Id;
        type Pinned;
        type Type;
        type Value;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Id = Unset;
        type Pinned = Unset;
        type Type = Unset;
        type Value = Unset;
    }
    ///State transition - sets the `id` field to Set
    pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetId<St> {}
    impl<St: State> State for SetId<St> {
        type Id = Set<members::id>;
        type Pinned = St::Pinned;
        type Type = St::Type;
        type Value = St::Value;
    }
    ///State transition - sets the `pinned` field to Set
    pub struct SetPinned<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetPinned<St> {}
    impl<St: State> State for SetPinned<St> {
        type Id = St::Id;
        type Pinned = Set<members::pinned>;
        type Type = St::Type;
        type Value = St::Value;
    }
    ///State transition - sets the `type` field to Set
    pub struct SetType<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetType<St> {}
    impl<St: State> State for SetType<St> {
        type Id = St::Id;
        type Pinned = St::Pinned;
        type Type = Set<members::r#type>;
        type Value = St::Value;
    }
    ///State transition - sets the `value` field to Set
    pub struct SetValue<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetValue<St> {}
    impl<St: State> State for SetValue<St> {
        type Id = St::Id;
        type Pinned = St::Pinned;
        type Type = St::Type;
        type Value = Set<members::value>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `id` field
        pub struct id(());
        ///Marker type for the `pinned` field
        pub struct pinned(());
        ///Marker type for the `type` field
        pub struct r#type(());
        ///Marker type for the `value` field
        pub struct value(());
    }
}

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

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

impl<S: BosStr> SavedFeed<S> {
    /// Create a new builder for this type
    pub fn builder() -> SavedFeedBuilder<saved_feed_state::Empty, S> {
        SavedFeedBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> SavedFeedBuilder<St, S>
where
    St: saved_feed_state::State,
    St::Id: saved_feed_state::IsUnset,
{
    /// Set the `id` field (required)
    pub fn id(
        mut self,
        value: impl Into<S>,
    ) -> SavedFeedBuilder<saved_feed_state::SetId<St>, S> {
        self._fields.0 = Option::Some(value.into());
        SavedFeedBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> SavedFeedBuilder<St, S>
where
    St: saved_feed_state::State,
    St::Pinned: saved_feed_state::IsUnset,
{
    /// Set the `pinned` field (required)
    pub fn pinned(
        mut self,
        value: impl Into<bool>,
    ) -> SavedFeedBuilder<saved_feed_state::SetPinned<St>, S> {
        self._fields.1 = Option::Some(value.into());
        SavedFeedBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> SavedFeedBuilder<St, S>
where
    St: saved_feed_state::State,
    St::Type: saved_feed_state::IsUnset,
{
    /// Set the `type` field (required)
    pub fn r#type(
        mut self,
        value: impl Into<SavedFeedType<S>>,
    ) -> SavedFeedBuilder<saved_feed_state::SetType<St>, S> {
        self._fields.2 = Option::Some(value.into());
        SavedFeedBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> SavedFeedBuilder<St, S>
where
    St: saved_feed_state::State,
    St::Value: saved_feed_state::IsUnset,
{
    /// Set the `value` field (required)
    pub fn value(
        mut self,
        value: impl Into<S>,
    ) -> SavedFeedBuilder<saved_feed_state::SetValue<St>, S> {
        self._fields.3 = Option::Some(value.into());
        SavedFeedBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> SavedFeedBuilder<St, S>
where
    St: saved_feed_state::State,
    St::Id: saved_feed_state::IsSet,
    St::Pinned: saved_feed_state::IsSet,
    St::Type: saved_feed_state::IsSet,
    St::Value: saved_feed_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> SavedFeed<S> {
        SavedFeed {
            id: self._fields.0.unwrap(),
            pinned: self._fields.1.unwrap(),
            r#type: self._fields.2.unwrap(),
            value: self._fields.3.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> SavedFeed<S> {
        SavedFeed {
            id: self._fields.0.unwrap(),
            pinned: self._fields.1.unwrap(),
            r#type: self._fields.2.unwrap(),
            value: self._fields.3.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod saved_feeds_pref_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 Pinned;
        type Saved;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Pinned = Unset;
        type Saved = Unset;
    }
    ///State transition - sets the `pinned` field to Set
    pub struct SetPinned<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetPinned<St> {}
    impl<St: State> State for SetPinned<St> {
        type Pinned = Set<members::pinned>;
        type Saved = St::Saved;
    }
    ///State transition - sets the `saved` field to Set
    pub struct SetSaved<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetSaved<St> {}
    impl<St: State> State for SetSaved<St> {
        type Pinned = St::Pinned;
        type Saved = Set<members::saved>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `pinned` field
        pub struct pinned(());
        ///Marker type for the `saved` field
        pub struct saved(());
    }
}

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

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

impl<S: BosStr> SavedFeedsPref<S> {
    /// Create a new builder for this type
    pub fn builder() -> SavedFeedsPrefBuilder<saved_feeds_pref_state::Empty, S> {
        SavedFeedsPrefBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> SavedFeedsPrefBuilder<St, S>
where
    St: saved_feeds_pref_state::State,
    St::Pinned: saved_feeds_pref_state::IsUnset,
{
    /// Set the `pinned` field (required)
    pub fn pinned(
        mut self,
        value: impl Into<Vec<AtUri<S>>>,
    ) -> SavedFeedsPrefBuilder<saved_feeds_pref_state::SetPinned<St>, S> {
        self._fields.0 = Option::Some(value.into());
        SavedFeedsPrefBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> SavedFeedsPrefBuilder<St, S>
where
    St: saved_feeds_pref_state::State,
    St::Saved: saved_feeds_pref_state::IsUnset,
{
    /// Set the `saved` field (required)
    pub fn saved(
        mut self,
        value: impl Into<Vec<AtUri<S>>>,
    ) -> SavedFeedsPrefBuilder<saved_feeds_pref_state::SetSaved<St>, S> {
        self._fields.1 = Option::Some(value.into());
        SavedFeedsPrefBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: saved_feeds_pref_state::State, S: BosStr> SavedFeedsPrefBuilder<St, S> {
    /// Set the `timelineIndex` field (optional)
    pub fn timeline_index(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `timelineIndex` field to an Option value (optional)
    pub fn maybe_timeline_index(mut self, value: Option<i64>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<St, S: BosStr> SavedFeedsPrefBuilder<St, S>
where
    St: saved_feeds_pref_state::State,
    St::Pinned: saved_feeds_pref_state::IsSet,
    St::Saved: saved_feeds_pref_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> SavedFeedsPref<S> {
        SavedFeedsPref {
            pinned: self._fields.0.unwrap(),
            saved: self._fields.1.unwrap(),
            timeline_index: self._fields.2,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> SavedFeedsPref<S> {
        SavedFeedsPref {
            pinned: self._fields.0.unwrap(),
            saved: self._fields.1.unwrap(),
            timeline_index: self._fields.2,
            extra_data: Some(extra_data),
        }
    }
}

pub mod saved_feeds_pref_v2_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 Items;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Items = Unset;
    }
    ///State transition - sets the `items` field to Set
    pub struct SetItems<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetItems<St> {}
    impl<St: State> State for SetItems<St> {
        type Items = Set<members::items>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `items` field
        pub struct items(());
    }
}

/// Builder for constructing an instance of this type.
pub struct SavedFeedsPrefV2Builder<
    St: saved_feeds_pref_v2_state::State,
    S: BosStr = DefaultStr,
> {
    _state: PhantomData<fn() -> St>,
    _fields: (Option<Vec<actor::SavedFeed<S>>>,),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> SavedFeedsPrefV2<S> {
    /// Create a new builder for this type
    pub fn builder() -> SavedFeedsPrefV2Builder<saved_feeds_pref_v2_state::Empty, S> {
        SavedFeedsPrefV2Builder::builder()
    }
}

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

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

impl<St, S: BosStr> SavedFeedsPrefV2Builder<St, S>
where
    St: saved_feeds_pref_v2_state::State,
    St::Items: saved_feeds_pref_v2_state::IsUnset,
{
    /// Set the `items` field (required)
    pub fn items(
        mut self,
        value: impl Into<Vec<actor::SavedFeed<S>>>,
    ) -> SavedFeedsPrefV2Builder<saved_feeds_pref_v2_state::SetItems<St>, S> {
        self._fields.0 = Option::Some(value.into());
        SavedFeedsPrefV2Builder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> SavedFeedsPrefV2Builder<St, S>
where
    St: saved_feeds_pref_v2_state::State,
    St::Items: saved_feeds_pref_v2_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> SavedFeedsPrefV2<S> {
        SavedFeedsPrefV2 {
            items: self._fields.0.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> SavedFeedsPrefV2<S> {
        SavedFeedsPrefV2 {
            items: self._fields.0.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod status_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 Record;
        type Status;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Record = Unset;
        type Status = Unset;
    }
    ///State transition - sets the `record` field to Set
    pub struct SetRecord<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetRecord<St> {}
    impl<St: State> State for SetRecord<St> {
        type Record = Set<members::record>;
        type Status = St::Status;
    }
    ///State transition - sets the `status` field to Set
    pub struct SetStatus<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetStatus<St> {}
    impl<St: State> State for SetStatus<St> {
        type Record = St::Record;
        type Status = Set<members::status>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `record` field
        pub struct record(());
        ///Marker type for the `status` field
        pub struct status(());
    }
}

/// Builder for constructing an instance of this type.
pub struct StatusViewBuilder<St: status_view_state::State, S: BosStr = DefaultStr> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<Cid<S>>,
        Option<Data<S>>,
        Option<Datetime>,
        Option<bool>,
        Option<bool>,
        Option<Vec<Label<S>>>,
        Option<Data<S>>,
        Option<StatusViewStatus<S>>,
        Option<AtUri<S>>,
    ),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> StatusView<S> {
    /// Create a new builder for this type
    pub fn builder() -> StatusViewBuilder<status_view_state::Empty, S> {
        StatusViewBuilder::builder()
    }
}

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

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

impl<St: status_view_state::State, S: BosStr> StatusViewBuilder<St, S> {
    /// Set the `cid` field (optional)
    pub fn cid(mut self, value: impl Into<Option<Cid<S>>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `cid` field to an Option value (optional)
    pub fn maybe_cid(mut self, value: Option<Cid<S>>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<St: status_view_state::State, S: BosStr> StatusViewBuilder<St, S> {
    /// Set the `embed` field (optional)
    pub fn embed(mut self, value: impl Into<Option<Data<S>>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `embed` field to an Option value (optional)
    pub fn maybe_embed(mut self, value: Option<Data<S>>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<St: status_view_state::State, S: BosStr> StatusViewBuilder<St, S> {
    /// Set the `expiresAt` field (optional)
    pub fn expires_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `expiresAt` field to an Option value (optional)
    pub fn maybe_expires_at(mut self, value: Option<Datetime>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<St: status_view_state::State, S: BosStr> StatusViewBuilder<St, S> {
    /// Set the `isActive` field (optional)
    pub fn is_active(mut self, value: impl Into<Option<bool>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `isActive` field to an Option value (optional)
    pub fn maybe_is_active(mut self, value: Option<bool>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<St: status_view_state::State, S: BosStr> StatusViewBuilder<St, S> {
    /// Set the `isDisabled` field (optional)
    pub fn is_disabled(mut self, value: impl Into<Option<bool>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `isDisabled` field to an Option value (optional)
    pub fn maybe_is_disabled(mut self, value: Option<bool>) -> Self {
        self._fields.4 = value;
        self
    }
}

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

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

impl<St, S: BosStr> StatusViewBuilder<St, S>
where
    St: status_view_state::State,
    St::Status: status_view_state::IsUnset,
{
    /// Set the `status` field (required)
    pub fn status(
        mut self,
        value: impl Into<StatusViewStatus<S>>,
    ) -> StatusViewBuilder<status_view_state::SetStatus<St>, S> {
        self._fields.7 = Option::Some(value.into());
        StatusViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: status_view_state::State, S: BosStr> StatusViewBuilder<St, S> {
    /// Set the `uri` field (optional)
    pub fn uri(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
        self._fields.8 = value.into();
        self
    }
    /// Set the `uri` field to an Option value (optional)
    pub fn maybe_uri(mut self, value: Option<AtUri<S>>) -> Self {
        self._fields.8 = value;
        self
    }
}

impl<St, S: BosStr> StatusViewBuilder<St, S>
where
    St: status_view_state::State,
    St::Record: status_view_state::IsSet,
    St::Status: status_view_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> StatusView<S> {
        StatusView {
            cid: self._fields.0,
            embed: self._fields.1,
            expires_at: self._fields.2,
            is_active: self._fields.3,
            is_disabled: self._fields.4,
            labels: self._fields.5,
            record: self._fields.6.unwrap(),
            status: self._fields.7.unwrap(),
            uri: self._fields.8,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> StatusView<S> {
        StatusView {
            cid: self._fields.0,
            embed: self._fields.1,
            expires_at: self._fields.2,
            is_active: self._fields.3,
            is_disabled: self._fields.4,
            labels: self._fields.5,
            record: self._fields.6.unwrap(),
            status: self._fields.7.unwrap(),
            uri: self._fields.8,
            extra_data: Some(extra_data),
        }
    }
}

fn _default_verification_prefs_hide_badges() -> Option<bool> {
    Some(false)
}

impl Default for VerificationPrefs {
    fn default() -> Self {
        Self {
            hide_badges: Some(false),
            extra_data: Default::default(),
        }
    }
}

pub mod verification_state_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 TrustedVerifierStatus;
        type Verifications;
        type VerifiedStatus;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type TrustedVerifierStatus = Unset;
        type Verifications = Unset;
        type VerifiedStatus = Unset;
    }
    ///State transition - sets the `trusted_verifier_status` field to Set
    pub struct SetTrustedVerifierStatus<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetTrustedVerifierStatus<St> {}
    impl<St: State> State for SetTrustedVerifierStatus<St> {
        type TrustedVerifierStatus = Set<members::trusted_verifier_status>;
        type Verifications = St::Verifications;
        type VerifiedStatus = St::VerifiedStatus;
    }
    ///State transition - sets the `verifications` field to Set
    pub struct SetVerifications<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetVerifications<St> {}
    impl<St: State> State for SetVerifications<St> {
        type TrustedVerifierStatus = St::TrustedVerifierStatus;
        type Verifications = Set<members::verifications>;
        type VerifiedStatus = St::VerifiedStatus;
    }
    ///State transition - sets the `verified_status` field to Set
    pub struct SetVerifiedStatus<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetVerifiedStatus<St> {}
    impl<St: State> State for SetVerifiedStatus<St> {
        type TrustedVerifierStatus = St::TrustedVerifierStatus;
        type Verifications = St::Verifications;
        type VerifiedStatus = Set<members::verified_status>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `trusted_verifier_status` field
        pub struct trusted_verifier_status(());
        ///Marker type for the `verifications` field
        pub struct verifications(());
        ///Marker type for the `verified_status` field
        pub struct verified_status(());
    }
}

/// Builder for constructing an instance of this type.
pub struct VerificationStateBuilder<
    St: verification_state_state::State,
    S: BosStr = DefaultStr,
> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<VerificationStateTrustedVerifierStatus<S>>,
        Option<Vec<actor::VerificationView<S>>>,
        Option<VerificationStateVerifiedStatus<S>>,
    ),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> VerificationState<S> {
    /// Create a new builder for this type
    pub fn builder() -> VerificationStateBuilder<verification_state_state::Empty, S> {
        VerificationStateBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> VerificationStateBuilder<St, S>
where
    St: verification_state_state::State,
    St::TrustedVerifierStatus: verification_state_state::IsUnset,
{
    /// Set the `trustedVerifierStatus` field (required)
    pub fn trusted_verifier_status(
        mut self,
        value: impl Into<VerificationStateTrustedVerifierStatus<S>>,
    ) -> VerificationStateBuilder<
        verification_state_state::SetTrustedVerifierStatus<St>,
        S,
    > {
        self._fields.0 = Option::Some(value.into());
        VerificationStateBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> VerificationStateBuilder<St, S>
where
    St: verification_state_state::State,
    St::Verifications: verification_state_state::IsUnset,
{
    /// Set the `verifications` field (required)
    pub fn verifications(
        mut self,
        value: impl Into<Vec<actor::VerificationView<S>>>,
    ) -> VerificationStateBuilder<verification_state_state::SetVerifications<St>, S> {
        self._fields.1 = Option::Some(value.into());
        VerificationStateBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> VerificationStateBuilder<St, S>
where
    St: verification_state_state::State,
    St::VerifiedStatus: verification_state_state::IsUnset,
{
    /// Set the `verifiedStatus` field (required)
    pub fn verified_status(
        mut self,
        value: impl Into<VerificationStateVerifiedStatus<S>>,
    ) -> VerificationStateBuilder<verification_state_state::SetVerifiedStatus<St>, S> {
        self._fields.2 = Option::Some(value.into());
        VerificationStateBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> VerificationStateBuilder<St, S>
where
    St: verification_state_state::State,
    St::TrustedVerifierStatus: verification_state_state::IsSet,
    St::Verifications: verification_state_state::IsSet,
    St::VerifiedStatus: verification_state_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> VerificationState<S> {
        VerificationState {
            trusted_verifier_status: self._fields.0.unwrap(),
            verifications: self._fields.1.unwrap(),
            verified_status: self._fields.2.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> VerificationState<S> {
        VerificationState {
            trusted_verifier_status: self._fields.0.unwrap(),
            verifications: self._fields.1.unwrap(),
            verified_status: self._fields.2.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod verification_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 CreatedAt;
        type IsValid;
        type Issuer;
        type Uri;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type CreatedAt = Unset;
        type IsValid = Unset;
        type Issuer = Unset;
        type Uri = Unset;
    }
    ///State transition - sets the `created_at` field to Set
    pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
    impl<St: State> State for SetCreatedAt<St> {
        type CreatedAt = Set<members::created_at>;
        type IsValid = St::IsValid;
        type Issuer = St::Issuer;
        type Uri = St::Uri;
    }
    ///State transition - sets the `is_valid` field to Set
    pub struct SetIsValid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetIsValid<St> {}
    impl<St: State> State for SetIsValid<St> {
        type CreatedAt = St::CreatedAt;
        type IsValid = Set<members::is_valid>;
        type Issuer = St::Issuer;
        type Uri = St::Uri;
    }
    ///State transition - sets the `issuer` field to Set
    pub struct SetIssuer<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetIssuer<St> {}
    impl<St: State> State for SetIssuer<St> {
        type CreatedAt = St::CreatedAt;
        type IsValid = St::IsValid;
        type Issuer = Set<members::issuer>;
        type Uri = St::Uri;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetUri<St> {}
    impl<St: State> State for SetUri<St> {
        type CreatedAt = St::CreatedAt;
        type IsValid = St::IsValid;
        type Issuer = St::Issuer;
        type Uri = Set<members::uri>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `created_at` field
        pub struct created_at(());
        ///Marker type for the `is_valid` field
        pub struct is_valid(());
        ///Marker type for the `issuer` field
        pub struct issuer(());
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

/// Builder for constructing an instance of this type.
pub struct VerificationViewBuilder<
    St: verification_view_state::State,
    S: BosStr = DefaultStr,
> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<Datetime>,
        Option<bool>,
        Option<Did<S>>,
        Option<S>,
        Option<Handle<S>>,
        Option<AtUri<S>>,
    ),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> VerificationView<S> {
    /// Create a new builder for this type
    pub fn builder() -> VerificationViewBuilder<verification_view_state::Empty, S> {
        VerificationViewBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> VerificationViewBuilder<St, S>
where
    St: verification_view_state::State,
    St::CreatedAt: verification_view_state::IsUnset,
{
    /// Set the `createdAt` field (required)
    pub fn created_at(
        mut self,
        value: impl Into<Datetime>,
    ) -> VerificationViewBuilder<verification_view_state::SetCreatedAt<St>, S> {
        self._fields.0 = Option::Some(value.into());
        VerificationViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> VerificationViewBuilder<St, S>
where
    St: verification_view_state::State,
    St::IsValid: verification_view_state::IsUnset,
{
    /// Set the `isValid` field (required)
    pub fn is_valid(
        mut self,
        value: impl Into<bool>,
    ) -> VerificationViewBuilder<verification_view_state::SetIsValid<St>, S> {
        self._fields.1 = Option::Some(value.into());
        VerificationViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> VerificationViewBuilder<St, S>
where
    St: verification_view_state::State,
    St::Issuer: verification_view_state::IsUnset,
{
    /// Set the `issuer` field (required)
    pub fn issuer(
        mut self,
        value: impl Into<Did<S>>,
    ) -> VerificationViewBuilder<verification_view_state::SetIssuer<St>, S> {
        self._fields.2 = Option::Some(value.into());
        VerificationViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

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

impl<St: verification_view_state::State, S: BosStr> VerificationViewBuilder<St, S> {
    /// Set the `issuerHandle` field (optional)
    pub fn issuer_handle(mut self, value: impl Into<Option<Handle<S>>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `issuerHandle` field to an Option value (optional)
    pub fn maybe_issuer_handle(mut self, value: Option<Handle<S>>) -> Self {
        self._fields.4 = value;
        self
    }
}

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

impl<St, S: BosStr> VerificationViewBuilder<St, S>
where
    St: verification_view_state::State,
    St::CreatedAt: verification_view_state::IsSet,
    St::IsValid: verification_view_state::IsSet,
    St::Issuer: verification_view_state::IsSet,
    St::Uri: verification_view_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> VerificationView<S> {
        VerificationView {
            created_at: self._fields.0.unwrap(),
            is_valid: self._fields.1.unwrap(),
            issuer: self._fields.2.unwrap(),
            issuer_display_name: self._fields.3,
            issuer_handle: self._fields.4,
            uri: self._fields.5.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> VerificationView<S> {
        VerificationView {
            created_at: self._fields.0.unwrap(),
            is_valid: self._fields.1.unwrap(),
            issuer: self._fields.2.unwrap(),
            issuer_display_name: self._fields.3,
            issuer_handle: self._fields.4,
            uri: self._fields.5.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}