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

pub mod get_age_assurance_state;
pub mod get_config;
pub mod get_onboarding_suggested_starter_packs;
pub mod get_onboarding_suggested_starter_packs_skeleton;
pub mod get_onboarding_suggested_users_skeleton;
pub mod get_popular_feed_generators;
pub mod get_post_thread_other_v2;
pub mod get_post_thread_v2;
pub mod get_suggested_feeds;
pub mod get_suggested_feeds_skeleton;
pub mod get_suggested_onboarding_users;
pub mod get_suggested_starter_packs;
pub mod get_suggested_starter_packs_skeleton;
pub mod get_suggested_users;
pub mod get_suggested_users_skeleton;
pub mod get_suggestions_skeleton;
pub mod get_tagged_suggestions;
pub mod get_trending_topics;
pub mod get_trends;
pub mod get_trends_skeleton;
pub mod init_age_assurance;
pub mod search_actors_skeleton;
pub mod search_posts_skeleton;
pub mod search_starter_packs_skeleton;


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

#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::CowStr;

#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::types::string::{Did, AtUri, Datetime};
use jacquard_derive::{IntoStatic, lexicon};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;

#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::app_bsky::actor::ProfileViewBasic;
use crate::app_bsky::feed::BlockedAuthor;
use crate::app_bsky::feed::PostView;
/// Object used to store age assurance data in stash.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct AgeAssuranceEvent<'a> {
    ///The unique identifier for this instance of the age assurance flow, in UUID format.
    #[serde(borrow)]
    pub attempt_id: CowStr<'a>,
    ///The IP address used when completing the AA flow.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub complete_ip: Option<CowStr<'a>>,
    ///The user agent used when completing the AA flow.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub complete_ua: Option<CowStr<'a>>,
    ///The date and time of this write operation.
    pub created_at: Datetime,
    ///The email used for AA.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub email: Option<CowStr<'a>>,
    ///The IP address used when initiating the AA flow.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub init_ip: Option<CowStr<'a>>,
    ///The user agent used when initiating the AA flow.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub init_ua: Option<CowStr<'a>>,
    ///The status of the age assurance process.
    #[serde(borrow)]
    pub status: AgeAssuranceEventStatus<'a>,
}

/// The status of the age assurance process.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AgeAssuranceEventStatus<'a> {
    Unknown,
    Pending,
    Assured,
    Other(CowStr<'a>),
}

impl<'a> AgeAssuranceEventStatus<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Unknown => "unknown",
            Self::Pending => "pending",
            Self::Assured => "assured",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for AgeAssuranceEventStatus<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "unknown" => Self::Unknown,
            "pending" => Self::Pending,
            "assured" => Self::Assured,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for AgeAssuranceEventStatus<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "unknown" => Self::Unknown,
            "pending" => Self::Pending,
            "assured" => Self::Assured,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

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

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

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

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

impl<'a> Default for AgeAssuranceEventStatus<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for AgeAssuranceEventStatus<'_> {
    type Output = AgeAssuranceEventStatus<'static>;
    fn into_static(self) -> Self::Output {
        match self {
            AgeAssuranceEventStatus::Unknown => AgeAssuranceEventStatus::Unknown,
            AgeAssuranceEventStatus::Pending => AgeAssuranceEventStatus::Pending,
            AgeAssuranceEventStatus::Assured => AgeAssuranceEventStatus::Assured,
            AgeAssuranceEventStatus::Other(v) => {
                AgeAssuranceEventStatus::Other(v.into_static())
            }
        }
    }
}

/// The computed state of the age assurance process, returned to the user in question on certain authenticated requests.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct AgeAssuranceState<'a> {
    ///The timestamp when this state was last updated.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub last_initiated_at: Option<Datetime>,
    ///The status of the age assurance process.
    #[serde(borrow)]
    pub status: AgeAssuranceStateStatus<'a>,
}

/// The status of the age assurance process.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AgeAssuranceStateStatus<'a> {
    Unknown,
    Pending,
    Assured,
    Blocked,
    Other(CowStr<'a>),
}

impl<'a> AgeAssuranceStateStatus<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Unknown => "unknown",
            Self::Pending => "pending",
            Self::Assured => "assured",
            Self::Blocked => "blocked",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for AgeAssuranceStateStatus<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "unknown" => Self::Unknown,
            "pending" => Self::Pending,
            "assured" => Self::Assured,
            "blocked" => Self::Blocked,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for AgeAssuranceStateStatus<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "unknown" => Self::Unknown,
            "pending" => Self::Pending,
            "assured" => Self::Assured,
            "blocked" => Self::Blocked,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

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

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

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

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

impl<'a> Default for AgeAssuranceStateStatus<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for AgeAssuranceStateStatus<'_> {
    type Output = AgeAssuranceStateStatus<'static>;
    fn into_static(self) -> Self::Output {
        match self {
            AgeAssuranceStateStatus::Unknown => AgeAssuranceStateStatus::Unknown,
            AgeAssuranceStateStatus::Pending => AgeAssuranceStateStatus::Pending,
            AgeAssuranceStateStatus::Assured => AgeAssuranceStateStatus::Assured,
            AgeAssuranceStateStatus::Blocked => AgeAssuranceStateStatus::Blocked,
            AgeAssuranceStateStatus::Other(v) => {
                AgeAssuranceStateStatus::Other(v.into_static())
            }
        }
    }
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SkeletonSearchActor<'a> {
    #[serde(borrow)]
    pub did: Did<'a>,
}


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


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


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SkeletonTrend<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub category: Option<CowStr<'a>>,
    #[serde(borrow)]
    pub dids: Vec<Did<'a>>,
    #[serde(borrow)]
    pub display_name: CowStr<'a>,
    #[serde(borrow)]
    pub link: CowStr<'a>,
    pub post_count: i64,
    pub started_at: Datetime,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub status: Option<SkeletonTrendStatus<'a>>,
    #[serde(borrow)]
    pub topic: CowStr<'a>,
}


#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SkeletonTrendStatus<'a> {
    Hot,
    Other(CowStr<'a>),
}

impl<'a> SkeletonTrendStatus<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Hot => "hot",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for SkeletonTrendStatus<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "hot" => Self::Hot,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for SkeletonTrendStatus<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "hot" => Self::Hot,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

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

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

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

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

impl<'a> Default for SkeletonTrendStatus<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for SkeletonTrendStatus<'_> {
    type Output = SkeletonTrendStatus<'static>;
    fn into_static(self) -> Self::Output {
        match self {
            SkeletonTrendStatus::Hot => SkeletonTrendStatus::Hot,
            SkeletonTrendStatus::Other(v) => SkeletonTrendStatus::Other(v.into_static()),
        }
    }
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ThreadItemBlocked<'a> {
    #[serde(borrow)]
    pub author: BlockedAuthor<'a>,
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ThreadItemNoUnauthenticated<'a> {}

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ThreadItemNotFound<'a> {}

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ThreadItemPost<'a> {
    ///The threadgate created by the author indicates this post as a reply to be hidden for everyone consuming the thread.
    pub hidden_by_threadgate: bool,
    ///This post has more parents that were not present in the response. This is just a boolean, without the number of parents.
    pub more_parents: bool,
    ///This post has more replies that were not present in the response. This is a numeric value, which is best-effort and might not be accurate.
    pub more_replies: i64,
    ///This is by an account muted by the viewer requesting it.
    pub muted_by_viewer: bool,
    ///This post is part of a contiguous thread by the OP from the thread root. Many different OP threads can happen in the same thread.
    pub op_thread: bool,
    #[serde(borrow)]
    pub post: PostView<'a>,
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct TrendView<'a> {
    #[serde(borrow)]
    pub actors: Vec<ProfileViewBasic<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub category: Option<CowStr<'a>>,
    #[serde(borrow)]
    pub display_name: CowStr<'a>,
    #[serde(borrow)]
    pub link: CowStr<'a>,
    pub post_count: i64,
    pub started_at: Datetime,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub status: Option<TrendViewStatus<'a>>,
    #[serde(borrow)]
    pub topic: CowStr<'a>,
}


#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TrendViewStatus<'a> {
    Hot,
    Other(CowStr<'a>),
}

impl<'a> TrendViewStatus<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Hot => "hot",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for TrendViewStatus<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "hot" => Self::Hot,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for TrendViewStatus<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "hot" => Self::Hot,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

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

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

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

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

impl<'a> Default for TrendViewStatus<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for TrendViewStatus<'_> {
    type Output = TrendViewStatus<'static>;
    fn into_static(self) -> Self::Output {
        match self {
            TrendViewStatus::Hot => TrendViewStatus::Hot,
            TrendViewStatus::Other(v) => TrendViewStatus::Other(v.into_static()),
        }
    }
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct TrendingTopic<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub description: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub display_name: Option<CowStr<'a>>,
    #[serde(borrow)]
    pub link: CowStr<'a>,
    #[serde(borrow)]
    pub topic: CowStr<'a>,
}

impl<'a> LexiconSchema for AgeAssuranceEvent<'a> {
    fn nsid() -> &'static str {
        "app.bsky.unspecced.defs"
    }
    fn def_name() -> &'static str {
        "ageAssuranceEvent"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_unspecced_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for AgeAssuranceState<'a> {
    fn nsid() -> &'static str {
        "app.bsky.unspecced.defs"
    }
    fn def_name() -> &'static str {
        "ageAssuranceState"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_unspecced_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for SkeletonSearchActor<'a> {
    fn nsid() -> &'static str {
        "app.bsky.unspecced.defs"
    }
    fn def_name() -> &'static str {
        "skeletonSearchActor"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_unspecced_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for SkeletonSearchPost<'a> {
    fn nsid() -> &'static str {
        "app.bsky.unspecced.defs"
    }
    fn def_name() -> &'static str {
        "skeletonSearchPost"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_unspecced_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for SkeletonSearchStarterPack<'a> {
    fn nsid() -> &'static str {
        "app.bsky.unspecced.defs"
    }
    fn def_name() -> &'static str {
        "skeletonSearchStarterPack"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_unspecced_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for SkeletonTrend<'a> {
    fn nsid() -> &'static str {
        "app.bsky.unspecced.defs"
    }
    fn def_name() -> &'static str {
        "skeletonTrend"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_unspecced_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for ThreadItemBlocked<'a> {
    fn nsid() -> &'static str {
        "app.bsky.unspecced.defs"
    }
    fn def_name() -> &'static str {
        "threadItemBlocked"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_unspecced_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for ThreadItemNoUnauthenticated<'a> {
    fn nsid() -> &'static str {
        "app.bsky.unspecced.defs"
    }
    fn def_name() -> &'static str {
        "threadItemNoUnauthenticated"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_unspecced_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for ThreadItemNotFound<'a> {
    fn nsid() -> &'static str {
        "app.bsky.unspecced.defs"
    }
    fn def_name() -> &'static str {
        "threadItemNotFound"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_unspecced_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for ThreadItemPost<'a> {
    fn nsid() -> &'static str {
        "app.bsky.unspecced.defs"
    }
    fn def_name() -> &'static str {
        "threadItemPost"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_unspecced_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for TrendView<'a> {
    fn nsid() -> &'static str {
        "app.bsky.unspecced.defs"
    }
    fn def_name() -> &'static str {
        "trendView"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_unspecced_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for TrendingTopic<'a> {
    fn nsid() -> &'static str {
        "app.bsky.unspecced.defs"
    }
    fn def_name() -> &'static str {
        "trendingTopic"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_unspecced_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

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

/// Builder for constructing an instance of this type
pub struct AgeAssuranceEventBuilder<'a, S: age_assurance_event_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<Datetime>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<AgeAssuranceEventStatus<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> AgeAssuranceEvent<'a> {
    /// Create a new builder for this type
    pub fn new() -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::Empty> {
        AgeAssuranceEventBuilder::new()
    }
}

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

impl<'a, S> AgeAssuranceEventBuilder<'a, S>
where
    S: age_assurance_event_state::State,
    S::AttemptId: age_assurance_event_state::IsUnset,
{
    /// Set the `attemptId` field (required)
    pub fn attempt_id(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetAttemptId<S>> {
        self._fields.0 = Option::Some(value.into());
        AgeAssuranceEventBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
    /// Set the `completeIp` field (optional)
    pub fn complete_ip(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `completeIp` field to an Option value (optional)
    pub fn maybe_complete_ip(mut self, value: Option<CowStr<'a>>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
    /// Set the `completeUa` field (optional)
    pub fn complete_ua(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `completeUa` field to an Option value (optional)
    pub fn maybe_complete_ua(mut self, value: Option<CowStr<'a>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<'a, S> AgeAssuranceEventBuilder<'a, S>
where
    S: age_assurance_event_state::State,
    S::CreatedAt: age_assurance_event_state::IsUnset,
{
    /// Set the `createdAt` field (required)
    pub fn created_at(
        mut self,
        value: impl Into<Datetime>,
    ) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetCreatedAt<S>> {
        self._fields.3 = Option::Some(value.into());
        AgeAssuranceEventBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
    /// Set the `email` field (optional)
    pub fn email(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `email` field to an Option value (optional)
    pub fn maybe_email(mut self, value: Option<CowStr<'a>>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
    /// Set the `initIp` field (optional)
    pub fn init_ip(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
        self._fields.5 = value.into();
        self
    }
    /// Set the `initIp` field to an Option value (optional)
    pub fn maybe_init_ip(mut self, value: Option<CowStr<'a>>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
    /// Set the `initUa` field (optional)
    pub fn init_ua(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `initUa` field to an Option value (optional)
    pub fn maybe_init_ua(mut self, value: Option<CowStr<'a>>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<'a, S> AgeAssuranceEventBuilder<'a, S>
where
    S: age_assurance_event_state::State,
    S::Status: age_assurance_event_state::IsUnset,
{
    /// Set the `status` field (required)
    pub fn status(
        mut self,
        value: impl Into<AgeAssuranceEventStatus<'a>>,
    ) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetStatus<S>> {
        self._fields.7 = Option::Some(value.into());
        AgeAssuranceEventBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> AgeAssuranceEventBuilder<'a, S>
where
    S: age_assurance_event_state::State,
    S::AttemptId: age_assurance_event_state::IsSet,
    S::CreatedAt: age_assurance_event_state::IsSet,
    S::Status: age_assurance_event_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> AgeAssuranceEvent<'a> {
        AgeAssuranceEvent {
            attempt_id: self._fields.0.unwrap(),
            complete_ip: self._fields.1,
            complete_ua: self._fields.2,
            created_at: self._fields.3.unwrap(),
            email: self._fields.4,
            init_ip: self._fields.5,
            init_ua: self._fields.6,
            status: self._fields.7.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> AgeAssuranceEvent<'a> {
        AgeAssuranceEvent {
            attempt_id: self._fields.0.unwrap(),
            complete_ip: self._fields.1,
            complete_ua: self._fields.2,
            created_at: self._fields.3.unwrap(),
            email: self._fields.4,
            init_ip: self._fields.5,
            init_ua: self._fields.6,
            status: self._fields.7.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

fn lexicon_doc_app_bsky_unspecced_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.unspecced.defs"),
        defs: {
            let mut map = BTreeMap::new();
            map.insert(
                SmolStr::new_static("ageAssuranceEvent"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Object used to store age assurance data in stash.",
                        ),
                    ),
                    required: Some(
                        vec![
                            SmolStr::new_static("createdAt"),
                            SmolStr::new_static("status"),
                            SmolStr::new_static("attemptId")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("attemptId"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The unique identifier for this instance of the age assurance flow, in UUID format.",
                                    ),
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("completeIp"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The IP address used when completing the AA flow.",
                                    ),
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("completeUa"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The user agent used when completing the AA flow.",
                                    ),
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("createdAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The date and time of this write operation.",
                                    ),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("email"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("The email used for AA."),
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("initIp"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The IP address used when initiating the AA flow.",
                                    ),
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("initUa"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The user agent used when initiating the AA flow.",
                                    ),
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("status"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The status of the age assurance process.",
                                    ),
                                ),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("ageAssuranceState"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "The computed state of the age assurance process, returned to the user in question on certain authenticated requests.",
                        ),
                    ),
                    required: Some(vec![SmolStr::new_static("status")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("lastInitiatedAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The timestamp when this state was last updated.",
                                    ),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("status"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The status of the age assurance process.",
                                    ),
                                ),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("skeletonSearchActor"),
                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("skeletonSearchPost"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("uri")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("skeletonSearchStarterPack"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("uri")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("skeletonTrend"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![
                            SmolStr::new_static("topic"),
                            SmolStr::new_static("displayName"),
                            SmolStr::new_static("link"),
                            SmolStr::new_static("startedAt"),
                            SmolStr::new_static("postCount"), SmolStr::new_static("dids")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("category"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("dids"),
                            LexObjectProperty::Array(LexArray {
                                items: LexArrayItem::String(LexString {
                                    format: Some(LexStringFormat::Did),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("displayName"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("link"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("postCount"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("startedAt"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("status"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("topic"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("threadItemBlocked"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("author")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("author"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static(
                                    "app.bsky.feed.defs#blockedAuthor",
                                ),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("threadItemNoUnauthenticated"),
                LexUserType::Object(LexObject {
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("threadItemNotFound"),
                LexUserType::Object(LexObject {
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("threadItemPost"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![
                            SmolStr::new_static("post"),
                            SmolStr::new_static("moreParents"),
                            SmolStr::new_static("moreReplies"),
                            SmolStr::new_static("opThread"),
                            SmolStr::new_static("hiddenByThreadgate"),
                            SmolStr::new_static("mutedByViewer")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("hiddenByThreadgate"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("moreParents"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("moreReplies"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("mutedByViewer"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("opThread"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("post"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("app.bsky.feed.defs#postView"),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("trendView"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![
                            SmolStr::new_static("topic"),
                            SmolStr::new_static("displayName"),
                            SmolStr::new_static("link"),
                            SmolStr::new_static("startedAt"),
                            SmolStr::new_static("postCount"),
                            SmolStr::new_static("actors")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("actors"),
                            LexObjectProperty::Array(LexArray {
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static(
                                        "app.bsky.actor.defs#profileViewBasic",
                                    ),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("category"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("displayName"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("link"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("postCount"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("startedAt"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("status"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("topic"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("trendingTopic"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![SmolStr::new_static("topic"), SmolStr::new_static("link")],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("description"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("displayName"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("link"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("topic"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map
        },
        ..Default::default()
    }
}

pub mod skeleton_search_actor_state {

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

/// Builder for constructing an instance of this type
pub struct SkeletonSearchActorBuilder<'a, S: skeleton_search_actor_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (Option<Did<'a>>,),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> SkeletonSearchActor<'a> {
    /// Create a new builder for this type
    pub fn new() -> SkeletonSearchActorBuilder<'a, skeleton_search_actor_state::Empty> {
        SkeletonSearchActorBuilder::new()
    }
}

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

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

impl<'a, S> SkeletonSearchActorBuilder<'a, S>
where
    S: skeleton_search_actor_state::State,
    S::Did: skeleton_search_actor_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> SkeletonSearchActor<'a> {
        SkeletonSearchActor {
            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<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> SkeletonSearchActor<'a> {
        SkeletonSearchActor {
            did: self._fields.0.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

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

/// Builder for constructing an instance of this type
pub struct SkeletonSearchPostBuilder<'a, S: skeleton_search_post_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (Option<AtUri<'a>>,),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> SkeletonSearchPost<'a> {
    /// Create a new builder for this type
    pub fn new() -> SkeletonSearchPostBuilder<'a, skeleton_search_post_state::Empty> {
        SkeletonSearchPostBuilder::new()
    }
}

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

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

impl<'a, S> SkeletonSearchPostBuilder<'a, S>
where
    S: skeleton_search_post_state::State,
    S::Uri: skeleton_search_post_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> SkeletonSearchPost<'a> {
        SkeletonSearchPost {
            uri: 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<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> SkeletonSearchPost<'a> {
        SkeletonSearchPost {
            uri: self._fields.0.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

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

/// Builder for constructing an instance of this type
pub struct SkeletonSearchStarterPackBuilder<
    'a,
    S: skeleton_search_starter_pack_state::State,
> {
    _state: PhantomData<fn() -> S>,
    _fields: (Option<AtUri<'a>>,),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> SkeletonSearchStarterPack<'a> {
    /// Create a new builder for this type
    pub fn new() -> SkeletonSearchStarterPackBuilder<
        'a,
        skeleton_search_starter_pack_state::Empty,
    > {
        SkeletonSearchStarterPackBuilder::new()
    }
}

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

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

impl<'a, S> SkeletonSearchStarterPackBuilder<'a, S>
where
    S: skeleton_search_starter_pack_state::State,
    S::Uri: skeleton_search_starter_pack_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> SkeletonSearchStarterPack<'a> {
        SkeletonSearchStarterPack {
            uri: 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<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> SkeletonSearchStarterPack<'a> {
        SkeletonSearchStarterPack {
            uri: self._fields.0.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod skeleton_trend_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 Dids;
        type Topic;
        type DisplayName;
        type Link;
        type PostCount;
        type StartedAt;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Dids = Unset;
        type Topic = Unset;
        type DisplayName = Unset;
        type Link = Unset;
        type PostCount = Unset;
        type StartedAt = Unset;
    }
    ///State transition - sets the `dids` field to Set
    pub struct SetDids<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetDids<S> {}
    impl<S: State> State for SetDids<S> {
        type Dids = Set<members::dids>;
        type Topic = S::Topic;
        type DisplayName = S::DisplayName;
        type Link = S::Link;
        type PostCount = S::PostCount;
        type StartedAt = S::StartedAt;
    }
    ///State transition - sets the `topic` field to Set
    pub struct SetTopic<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetTopic<S> {}
    impl<S: State> State for SetTopic<S> {
        type Dids = S::Dids;
        type Topic = Set<members::topic>;
        type DisplayName = S::DisplayName;
        type Link = S::Link;
        type PostCount = S::PostCount;
        type StartedAt = S::StartedAt;
    }
    ///State transition - sets the `display_name` field to Set
    pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetDisplayName<S> {}
    impl<S: State> State for SetDisplayName<S> {
        type Dids = S::Dids;
        type Topic = S::Topic;
        type DisplayName = Set<members::display_name>;
        type Link = S::Link;
        type PostCount = S::PostCount;
        type StartedAt = S::StartedAt;
    }
    ///State transition - sets the `link` field to Set
    pub struct SetLink<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetLink<S> {}
    impl<S: State> State for SetLink<S> {
        type Dids = S::Dids;
        type Topic = S::Topic;
        type DisplayName = S::DisplayName;
        type Link = Set<members::link>;
        type PostCount = S::PostCount;
        type StartedAt = S::StartedAt;
    }
    ///State transition - sets the `post_count` field to Set
    pub struct SetPostCount<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetPostCount<S> {}
    impl<S: State> State for SetPostCount<S> {
        type Dids = S::Dids;
        type Topic = S::Topic;
        type DisplayName = S::DisplayName;
        type Link = S::Link;
        type PostCount = Set<members::post_count>;
        type StartedAt = S::StartedAt;
    }
    ///State transition - sets the `started_at` field to Set
    pub struct SetStartedAt<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetStartedAt<S> {}
    impl<S: State> State for SetStartedAt<S> {
        type Dids = S::Dids;
        type Topic = S::Topic;
        type DisplayName = S::DisplayName;
        type Link = S::Link;
        type PostCount = S::PostCount;
        type StartedAt = Set<members::started_at>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `dids` field
        pub struct dids(());
        ///Marker type for the `topic` field
        pub struct topic(());
        ///Marker type for the `display_name` field
        pub struct display_name(());
        ///Marker type for the `link` field
        pub struct link(());
        ///Marker type for the `post_count` field
        pub struct post_count(());
        ///Marker type for the `started_at` field
        pub struct started_at(());
    }
}

/// Builder for constructing an instance of this type
pub struct SkeletonTrendBuilder<'a, S: skeleton_trend_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<CowStr<'a>>,
        Option<Vec<Did<'a>>>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<i64>,
        Option<Datetime>,
        Option<SkeletonTrendStatus<'a>>,
        Option<CowStr<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> SkeletonTrend<'a> {
    /// Create a new builder for this type
    pub fn new() -> SkeletonTrendBuilder<'a, skeleton_trend_state::Empty> {
        SkeletonTrendBuilder::new()
    }
}

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

impl<'a, S: skeleton_trend_state::State> SkeletonTrendBuilder<'a, S> {
    /// Set the `category` field (optional)
    pub fn category(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `category` field to an Option value (optional)
    pub fn maybe_category(mut self, value: Option<CowStr<'a>>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<'a, S> SkeletonTrendBuilder<'a, S>
where
    S: skeleton_trend_state::State,
    S::Dids: skeleton_trend_state::IsUnset,
{
    /// Set the `dids` field (required)
    pub fn dids(
        mut self,
        value: impl Into<Vec<Did<'a>>>,
    ) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetDids<S>> {
        self._fields.1 = Option::Some(value.into());
        SkeletonTrendBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> SkeletonTrendBuilder<'a, S>
where
    S: skeleton_trend_state::State,
    S::DisplayName: skeleton_trend_state::IsUnset,
{
    /// Set the `displayName` field (required)
    pub fn display_name(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetDisplayName<S>> {
        self._fields.2 = Option::Some(value.into());
        SkeletonTrendBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> SkeletonTrendBuilder<'a, S>
where
    S: skeleton_trend_state::State,
    S::Link: skeleton_trend_state::IsUnset,
{
    /// Set the `link` field (required)
    pub fn link(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetLink<S>> {
        self._fields.3 = Option::Some(value.into());
        SkeletonTrendBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> SkeletonTrendBuilder<'a, S>
where
    S: skeleton_trend_state::State,
    S::PostCount: skeleton_trend_state::IsUnset,
{
    /// Set the `postCount` field (required)
    pub fn post_count(
        mut self,
        value: impl Into<i64>,
    ) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetPostCount<S>> {
        self._fields.4 = Option::Some(value.into());
        SkeletonTrendBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> SkeletonTrendBuilder<'a, S>
where
    S: skeleton_trend_state::State,
    S::StartedAt: skeleton_trend_state::IsUnset,
{
    /// Set the `startedAt` field (required)
    pub fn started_at(
        mut self,
        value: impl Into<Datetime>,
    ) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetStartedAt<S>> {
        self._fields.5 = Option::Some(value.into());
        SkeletonTrendBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: skeleton_trend_state::State> SkeletonTrendBuilder<'a, S> {
    /// Set the `status` field (optional)
    pub fn status(mut self, value: impl Into<Option<SkeletonTrendStatus<'a>>>) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `status` field to an Option value (optional)
    pub fn maybe_status(mut self, value: Option<SkeletonTrendStatus<'a>>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<'a, S> SkeletonTrendBuilder<'a, S>
where
    S: skeleton_trend_state::State,
    S::Topic: skeleton_trend_state::IsUnset,
{
    /// Set the `topic` field (required)
    pub fn topic(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetTopic<S>> {
        self._fields.7 = Option::Some(value.into());
        SkeletonTrendBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> SkeletonTrendBuilder<'a, S>
where
    S: skeleton_trend_state::State,
    S::Dids: skeleton_trend_state::IsSet,
    S::Topic: skeleton_trend_state::IsSet,
    S::DisplayName: skeleton_trend_state::IsSet,
    S::Link: skeleton_trend_state::IsSet,
    S::PostCount: skeleton_trend_state::IsSet,
    S::StartedAt: skeleton_trend_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> SkeletonTrend<'a> {
        SkeletonTrend {
            category: self._fields.0,
            dids: self._fields.1.unwrap(),
            display_name: self._fields.2.unwrap(),
            link: self._fields.3.unwrap(),
            post_count: self._fields.4.unwrap(),
            started_at: self._fields.5.unwrap(),
            status: self._fields.6,
            topic: self._fields.7.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> SkeletonTrend<'a> {
        SkeletonTrend {
            category: self._fields.0,
            dids: self._fields.1.unwrap(),
            display_name: self._fields.2.unwrap(),
            link: self._fields.3.unwrap(),
            post_count: self._fields.4.unwrap(),
            started_at: self._fields.5.unwrap(),
            status: self._fields.6,
            topic: self._fields.7.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

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

/// Builder for constructing an instance of this type
pub struct ThreadItemBlockedBuilder<'a, S: thread_item_blocked_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (Option<BlockedAuthor<'a>>,),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> ThreadItemBlocked<'a> {
    /// Create a new builder for this type
    pub fn new() -> ThreadItemBlockedBuilder<'a, thread_item_blocked_state::Empty> {
        ThreadItemBlockedBuilder::new()
    }
}

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

impl<'a, S> ThreadItemBlockedBuilder<'a, S>
where
    S: thread_item_blocked_state::State,
    S::Author: thread_item_blocked_state::IsUnset,
{
    /// Set the `author` field (required)
    pub fn author(
        mut self,
        value: impl Into<BlockedAuthor<'a>>,
    ) -> ThreadItemBlockedBuilder<'a, thread_item_blocked_state::SetAuthor<S>> {
        self._fields.0 = Option::Some(value.into());
        ThreadItemBlockedBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> ThreadItemBlockedBuilder<'a, S>
where
    S: thread_item_blocked_state::State,
    S::Author: thread_item_blocked_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> ThreadItemBlocked<'a> {
        ThreadItemBlocked {
            author: 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<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> ThreadItemBlocked<'a> {
        ThreadItemBlocked {
            author: self._fields.0.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod thread_item_post_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 OpThread;
        type MoreReplies;
        type HiddenByThreadgate;
        type MoreParents;
        type Post;
        type MutedByViewer;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type OpThread = Unset;
        type MoreReplies = Unset;
        type HiddenByThreadgate = Unset;
        type MoreParents = Unset;
        type Post = Unset;
        type MutedByViewer = Unset;
    }
    ///State transition - sets the `op_thread` field to Set
    pub struct SetOpThread<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetOpThread<S> {}
    impl<S: State> State for SetOpThread<S> {
        type OpThread = Set<members::op_thread>;
        type MoreReplies = S::MoreReplies;
        type HiddenByThreadgate = S::HiddenByThreadgate;
        type MoreParents = S::MoreParents;
        type Post = S::Post;
        type MutedByViewer = S::MutedByViewer;
    }
    ///State transition - sets the `more_replies` field to Set
    pub struct SetMoreReplies<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetMoreReplies<S> {}
    impl<S: State> State for SetMoreReplies<S> {
        type OpThread = S::OpThread;
        type MoreReplies = Set<members::more_replies>;
        type HiddenByThreadgate = S::HiddenByThreadgate;
        type MoreParents = S::MoreParents;
        type Post = S::Post;
        type MutedByViewer = S::MutedByViewer;
    }
    ///State transition - sets the `hidden_by_threadgate` field to Set
    pub struct SetHiddenByThreadgate<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetHiddenByThreadgate<S> {}
    impl<S: State> State for SetHiddenByThreadgate<S> {
        type OpThread = S::OpThread;
        type MoreReplies = S::MoreReplies;
        type HiddenByThreadgate = Set<members::hidden_by_threadgate>;
        type MoreParents = S::MoreParents;
        type Post = S::Post;
        type MutedByViewer = S::MutedByViewer;
    }
    ///State transition - sets the `more_parents` field to Set
    pub struct SetMoreParents<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetMoreParents<S> {}
    impl<S: State> State for SetMoreParents<S> {
        type OpThread = S::OpThread;
        type MoreReplies = S::MoreReplies;
        type HiddenByThreadgate = S::HiddenByThreadgate;
        type MoreParents = Set<members::more_parents>;
        type Post = S::Post;
        type MutedByViewer = S::MutedByViewer;
    }
    ///State transition - sets the `post` field to Set
    pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetPost<S> {}
    impl<S: State> State for SetPost<S> {
        type OpThread = S::OpThread;
        type MoreReplies = S::MoreReplies;
        type HiddenByThreadgate = S::HiddenByThreadgate;
        type MoreParents = S::MoreParents;
        type Post = Set<members::post>;
        type MutedByViewer = S::MutedByViewer;
    }
    ///State transition - sets the `muted_by_viewer` field to Set
    pub struct SetMutedByViewer<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetMutedByViewer<S> {}
    impl<S: State> State for SetMutedByViewer<S> {
        type OpThread = S::OpThread;
        type MoreReplies = S::MoreReplies;
        type HiddenByThreadgate = S::HiddenByThreadgate;
        type MoreParents = S::MoreParents;
        type Post = S::Post;
        type MutedByViewer = Set<members::muted_by_viewer>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `op_thread` field
        pub struct op_thread(());
        ///Marker type for the `more_replies` field
        pub struct more_replies(());
        ///Marker type for the `hidden_by_threadgate` field
        pub struct hidden_by_threadgate(());
        ///Marker type for the `more_parents` field
        pub struct more_parents(());
        ///Marker type for the `post` field
        pub struct post(());
        ///Marker type for the `muted_by_viewer` field
        pub struct muted_by_viewer(());
    }
}

/// Builder for constructing an instance of this type
pub struct ThreadItemPostBuilder<'a, S: thread_item_post_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<bool>,
        Option<bool>,
        Option<i64>,
        Option<bool>,
        Option<bool>,
        Option<PostView<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> ThreadItemPost<'a> {
    /// Create a new builder for this type
    pub fn new() -> ThreadItemPostBuilder<'a, thread_item_post_state::Empty> {
        ThreadItemPostBuilder::new()
    }
}

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

impl<'a, S> ThreadItemPostBuilder<'a, S>
where
    S: thread_item_post_state::State,
    S::HiddenByThreadgate: thread_item_post_state::IsUnset,
{
    /// Set the `hiddenByThreadgate` field (required)
    pub fn hidden_by_threadgate(
        mut self,
        value: impl Into<bool>,
    ) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetHiddenByThreadgate<S>> {
        self._fields.0 = Option::Some(value.into());
        ThreadItemPostBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> ThreadItemPostBuilder<'a, S>
where
    S: thread_item_post_state::State,
    S::MoreParents: thread_item_post_state::IsUnset,
{
    /// Set the `moreParents` field (required)
    pub fn more_parents(
        mut self,
        value: impl Into<bool>,
    ) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetMoreParents<S>> {
        self._fields.1 = Option::Some(value.into());
        ThreadItemPostBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> ThreadItemPostBuilder<'a, S>
where
    S: thread_item_post_state::State,
    S::MoreReplies: thread_item_post_state::IsUnset,
{
    /// Set the `moreReplies` field (required)
    pub fn more_replies(
        mut self,
        value: impl Into<i64>,
    ) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetMoreReplies<S>> {
        self._fields.2 = Option::Some(value.into());
        ThreadItemPostBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> ThreadItemPostBuilder<'a, S>
where
    S: thread_item_post_state::State,
    S::MutedByViewer: thread_item_post_state::IsUnset,
{
    /// Set the `mutedByViewer` field (required)
    pub fn muted_by_viewer(
        mut self,
        value: impl Into<bool>,
    ) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetMutedByViewer<S>> {
        self._fields.3 = Option::Some(value.into());
        ThreadItemPostBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> ThreadItemPostBuilder<'a, S>
where
    S: thread_item_post_state::State,
    S::OpThread: thread_item_post_state::IsUnset,
{
    /// Set the `opThread` field (required)
    pub fn op_thread(
        mut self,
        value: impl Into<bool>,
    ) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetOpThread<S>> {
        self._fields.4 = Option::Some(value.into());
        ThreadItemPostBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> ThreadItemPostBuilder<'a, S>
where
    S: thread_item_post_state::State,
    S::Post: thread_item_post_state::IsUnset,
{
    /// Set the `post` field (required)
    pub fn post(
        mut self,
        value: impl Into<PostView<'a>>,
    ) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetPost<S>> {
        self._fields.5 = Option::Some(value.into());
        ThreadItemPostBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> ThreadItemPostBuilder<'a, S>
where
    S: thread_item_post_state::State,
    S::OpThread: thread_item_post_state::IsSet,
    S::MoreReplies: thread_item_post_state::IsSet,
    S::HiddenByThreadgate: thread_item_post_state::IsSet,
    S::MoreParents: thread_item_post_state::IsSet,
    S::Post: thread_item_post_state::IsSet,
    S::MutedByViewer: thread_item_post_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> ThreadItemPost<'a> {
        ThreadItemPost {
            hidden_by_threadgate: self._fields.0.unwrap(),
            more_parents: self._fields.1.unwrap(),
            more_replies: self._fields.2.unwrap(),
            muted_by_viewer: self._fields.3.unwrap(),
            op_thread: self._fields.4.unwrap(),
            post: 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<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> ThreadItemPost<'a> {
        ThreadItemPost {
            hidden_by_threadgate: self._fields.0.unwrap(),
            more_parents: self._fields.1.unwrap(),
            more_replies: self._fields.2.unwrap(),
            muted_by_viewer: self._fields.3.unwrap(),
            op_thread: self._fields.4.unwrap(),
            post: self._fields.5.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod trend_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 DisplayName;
        type PostCount;
        type Link;
        type Actors;
        type StartedAt;
        type Topic;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type DisplayName = Unset;
        type PostCount = Unset;
        type Link = Unset;
        type Actors = Unset;
        type StartedAt = Unset;
        type Topic = Unset;
    }
    ///State transition - sets the `display_name` field to Set
    pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetDisplayName<S> {}
    impl<S: State> State for SetDisplayName<S> {
        type DisplayName = Set<members::display_name>;
        type PostCount = S::PostCount;
        type Link = S::Link;
        type Actors = S::Actors;
        type StartedAt = S::StartedAt;
        type Topic = S::Topic;
    }
    ///State transition - sets the `post_count` field to Set
    pub struct SetPostCount<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetPostCount<S> {}
    impl<S: State> State for SetPostCount<S> {
        type DisplayName = S::DisplayName;
        type PostCount = Set<members::post_count>;
        type Link = S::Link;
        type Actors = S::Actors;
        type StartedAt = S::StartedAt;
        type Topic = S::Topic;
    }
    ///State transition - sets the `link` field to Set
    pub struct SetLink<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetLink<S> {}
    impl<S: State> State for SetLink<S> {
        type DisplayName = S::DisplayName;
        type PostCount = S::PostCount;
        type Link = Set<members::link>;
        type Actors = S::Actors;
        type StartedAt = S::StartedAt;
        type Topic = S::Topic;
    }
    ///State transition - sets the `actors` field to Set
    pub struct SetActors<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetActors<S> {}
    impl<S: State> State for SetActors<S> {
        type DisplayName = S::DisplayName;
        type PostCount = S::PostCount;
        type Link = S::Link;
        type Actors = Set<members::actors>;
        type StartedAt = S::StartedAt;
        type Topic = S::Topic;
    }
    ///State transition - sets the `started_at` field to Set
    pub struct SetStartedAt<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetStartedAt<S> {}
    impl<S: State> State for SetStartedAt<S> {
        type DisplayName = S::DisplayName;
        type PostCount = S::PostCount;
        type Link = S::Link;
        type Actors = S::Actors;
        type StartedAt = Set<members::started_at>;
        type Topic = S::Topic;
    }
    ///State transition - sets the `topic` field to Set
    pub struct SetTopic<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetTopic<S> {}
    impl<S: State> State for SetTopic<S> {
        type DisplayName = S::DisplayName;
        type PostCount = S::PostCount;
        type Link = S::Link;
        type Actors = S::Actors;
        type StartedAt = S::StartedAt;
        type Topic = Set<members::topic>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `display_name` field
        pub struct display_name(());
        ///Marker type for the `post_count` field
        pub struct post_count(());
        ///Marker type for the `link` field
        pub struct link(());
        ///Marker type for the `actors` field
        pub struct actors(());
        ///Marker type for the `started_at` field
        pub struct started_at(());
        ///Marker type for the `topic` field
        pub struct topic(());
    }
}

/// Builder for constructing an instance of this type
pub struct TrendViewBuilder<'a, S: trend_view_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<Vec<ProfileViewBasic<'a>>>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<i64>,
        Option<Datetime>,
        Option<TrendViewStatus<'a>>,
        Option<CowStr<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> TrendView<'a> {
    /// Create a new builder for this type
    pub fn new() -> TrendViewBuilder<'a, trend_view_state::Empty> {
        TrendViewBuilder::new()
    }
}

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

impl<'a, S> TrendViewBuilder<'a, S>
where
    S: trend_view_state::State,
    S::Actors: trend_view_state::IsUnset,
{
    /// Set the `actors` field (required)
    pub fn actors(
        mut self,
        value: impl Into<Vec<ProfileViewBasic<'a>>>,
    ) -> TrendViewBuilder<'a, trend_view_state::SetActors<S>> {
        self._fields.0 = Option::Some(value.into());
        TrendViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: trend_view_state::State> TrendViewBuilder<'a, S> {
    /// Set the `category` field (optional)
    pub fn category(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `category` field to an Option value (optional)
    pub fn maybe_category(mut self, value: Option<CowStr<'a>>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<'a, S> TrendViewBuilder<'a, S>
where
    S: trend_view_state::State,
    S::DisplayName: trend_view_state::IsUnset,
{
    /// Set the `displayName` field (required)
    pub fn display_name(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> TrendViewBuilder<'a, trend_view_state::SetDisplayName<S>> {
        self._fields.2 = Option::Some(value.into());
        TrendViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> TrendViewBuilder<'a, S>
where
    S: trend_view_state::State,
    S::Link: trend_view_state::IsUnset,
{
    /// Set the `link` field (required)
    pub fn link(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> TrendViewBuilder<'a, trend_view_state::SetLink<S>> {
        self._fields.3 = Option::Some(value.into());
        TrendViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> TrendViewBuilder<'a, S>
where
    S: trend_view_state::State,
    S::PostCount: trend_view_state::IsUnset,
{
    /// Set the `postCount` field (required)
    pub fn post_count(
        mut self,
        value: impl Into<i64>,
    ) -> TrendViewBuilder<'a, trend_view_state::SetPostCount<S>> {
        self._fields.4 = Option::Some(value.into());
        TrendViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> TrendViewBuilder<'a, S>
where
    S: trend_view_state::State,
    S::StartedAt: trend_view_state::IsUnset,
{
    /// Set the `startedAt` field (required)
    pub fn started_at(
        mut self,
        value: impl Into<Datetime>,
    ) -> TrendViewBuilder<'a, trend_view_state::SetStartedAt<S>> {
        self._fields.5 = Option::Some(value.into());
        TrendViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: trend_view_state::State> TrendViewBuilder<'a, S> {
    /// Set the `status` field (optional)
    pub fn status(mut self, value: impl Into<Option<TrendViewStatus<'a>>>) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `status` field to an Option value (optional)
    pub fn maybe_status(mut self, value: Option<TrendViewStatus<'a>>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<'a, S> TrendViewBuilder<'a, S>
where
    S: trend_view_state::State,
    S::Topic: trend_view_state::IsUnset,
{
    /// Set the `topic` field (required)
    pub fn topic(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> TrendViewBuilder<'a, trend_view_state::SetTopic<S>> {
        self._fields.7 = Option::Some(value.into());
        TrendViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> TrendViewBuilder<'a, S>
where
    S: trend_view_state::State,
    S::DisplayName: trend_view_state::IsSet,
    S::PostCount: trend_view_state::IsSet,
    S::Link: trend_view_state::IsSet,
    S::Actors: trend_view_state::IsSet,
    S::StartedAt: trend_view_state::IsSet,
    S::Topic: trend_view_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> TrendView<'a> {
        TrendView {
            actors: self._fields.0.unwrap(),
            category: self._fields.1,
            display_name: self._fields.2.unwrap(),
            link: self._fields.3.unwrap(),
            post_count: self._fields.4.unwrap(),
            started_at: self._fields.5.unwrap(),
            status: self._fields.6,
            topic: self._fields.7.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> TrendView<'a> {
        TrendView {
            actors: self._fields.0.unwrap(),
            category: self._fields.1,
            display_name: self._fields.2.unwrap(),
            link: self._fields.3.unwrap(),
            post_count: self._fields.4.unwrap(),
            started_at: self._fields.5.unwrap(),
            status: self._fields.6,
            topic: self._fields.7.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}