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

pub mod describe_feed_generator;
pub mod generator;
pub mod get_actor_feeds;
pub mod get_actor_likes;
pub mod get_author_feed;
pub mod get_feed;
pub mod get_feed_generator;
pub mod get_feed_generators;
pub mod get_feed_skeleton;
pub mod get_likes;
pub mod get_list_feed;
pub mod get_post_thread;
pub mod get_posts;
pub mod get_quotes;
pub mod get_reposted_by;
pub mod get_suggested_feeds;
pub mod get_timeline;
pub mod like;
pub mod post;
pub mod postgate;
pub mod repost;
pub mod search_posts;
pub mod send_interactions;
pub mod threadgate;


#[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, Cid, Datetime, UriValue};
use jacquard_common::types::value::Data;
use jacquard_derive::{IntoStatic, lexicon, open_union};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;

#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::app_bsky::actor::ProfileView;
use crate::app_bsky::actor::ProfileViewBasic;
use crate::app_bsky::graph::ListViewBasic;
use crate::app_bsky::richtext::facet::Facet;
use crate::com_atproto::label::Label;
use crate::app_bsky::actor;
use crate::app_bsky::embed::external;
use crate::app_bsky::embed::images;
use crate::app_bsky::embed::record;
use crate::app_bsky::embed::record_with_media;
use crate::app_bsky::embed::video;
use crate::app_bsky::feed;

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


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

/// User clicked through to the author of the feed item

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ClickthroughAuthor;
impl core::fmt::Display for ClickthroughAuthor {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "clickthroughAuthor")
    }
}

/// User clicked through to the embedded content of the feed item

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ClickthroughEmbed;
impl core::fmt::Display for ClickthroughEmbed {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "clickthroughEmbed")
    }
}

/// User clicked through to the feed item

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ClickthroughItem;
impl core::fmt::Display for ClickthroughItem {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "clickthroughItem")
    }
}

/// User clicked through to the reposter of the feed item

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ClickthroughReposter;
impl core::fmt::Display for ClickthroughReposter {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "clickthroughReposter")
    }
}

/// Declares the feed generator returns any types of posts.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ContentModeUnspecified;
impl core::fmt::Display for ContentModeUnspecified {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "contentModeUnspecified")
    }
}

/// Declares the feed generator returns posts containing app.bsky.embed.video embeds.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ContentModeVideo;
impl core::fmt::Display for ContentModeVideo {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "contentModeVideo")
    }
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct FeedViewPost<'a> {
    ///Context provided by feed generator that may be passed back alongside interactions.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub feed_context: Option<CowStr<'a>>,
    #[serde(borrow)]
    pub post: feed::PostView<'a>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub reason: Option<FeedViewPostReason<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub reply: Option<feed::ReplyRef<'a>>,
    ///Unique identifier per request that may be passed back alongside interactions.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub req_id: Option<CowStr<'a>>,
}


#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum FeedViewPostReason<'a> {
    #[serde(rename = "app.bsky.feed.defs#reasonRepost")]
    ReasonRepost(Box<feed::ReasonRepost<'a>>),
    #[serde(rename = "app.bsky.feed.defs#reasonPin")]
    ReasonPin(Box<feed::ReasonPin<'a>>),
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GeneratorView<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub accepts_interactions: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub avatar: Option<UriValue<'a>>,
    #[serde(borrow)]
    pub cid: Cid<'a>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub content_mode: Option<GeneratorViewContentMode<'a>>,
    #[serde(borrow)]
    pub creator: ProfileView<'a>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub description: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub description_facets: Option<Vec<Facet<'a>>>,
    #[serde(borrow)]
    pub did: Did<'a>,
    #[serde(borrow)]
    pub display_name: CowStr<'a>,
    pub indexed_at: Datetime,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub labels: Option<Vec<Label<'a>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub like_count: Option<i64>,
    #[serde(borrow)]
    pub uri: AtUri<'a>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub viewer: Option<feed::GeneratorViewerState<'a>>,
}


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

impl<'a> GeneratorViewContentMode<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::ContentModeUnspecified => "app.bsky.feed.defs#contentModeUnspecified",
            Self::ContentModeVideo => "app.bsky.feed.defs#contentModeVideo",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for GeneratorViewContentMode<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "app.bsky.feed.defs#contentModeUnspecified" => Self::ContentModeUnspecified,
            "app.bsky.feed.defs#contentModeVideo" => Self::ContentModeVideo,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for GeneratorViewContentMode<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "app.bsky.feed.defs#contentModeUnspecified" => Self::ContentModeUnspecified,
            "app.bsky.feed.defs#contentModeVideo" => Self::ContentModeVideo,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

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

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

impl<'a> serde::Serialize for GeneratorViewContentMode<'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 GeneratorViewContentMode<'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 GeneratorViewContentMode<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

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


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


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Interaction<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub event: Option<InteractionEvent<'a>>,
    ///Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub feed_context: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub item: Option<AtUri<'a>>,
    ///Unique identifier per request that may be passed back alongside interactions.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub req_id: Option<CowStr<'a>>,
}


#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum InteractionEvent<'a> {
    RequestLess,
    RequestMore,
    ClickthroughItem,
    ClickthroughAuthor,
    ClickthroughReposter,
    ClickthroughEmbed,
    InteractionSeen,
    InteractionLike,
    InteractionRepost,
    InteractionReply,
    InteractionQuote,
    InteractionShare,
    Other(CowStr<'a>),
}

impl<'a> InteractionEvent<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::RequestLess => "app.bsky.feed.defs#requestLess",
            Self::RequestMore => "app.bsky.feed.defs#requestMore",
            Self::ClickthroughItem => "app.bsky.feed.defs#clickthroughItem",
            Self::ClickthroughAuthor => "app.bsky.feed.defs#clickthroughAuthor",
            Self::ClickthroughReposter => "app.bsky.feed.defs#clickthroughReposter",
            Self::ClickthroughEmbed => "app.bsky.feed.defs#clickthroughEmbed",
            Self::InteractionSeen => "app.bsky.feed.defs#interactionSeen",
            Self::InteractionLike => "app.bsky.feed.defs#interactionLike",
            Self::InteractionRepost => "app.bsky.feed.defs#interactionRepost",
            Self::InteractionReply => "app.bsky.feed.defs#interactionReply",
            Self::InteractionQuote => "app.bsky.feed.defs#interactionQuote",
            Self::InteractionShare => "app.bsky.feed.defs#interactionShare",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for InteractionEvent<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "app.bsky.feed.defs#requestLess" => Self::RequestLess,
            "app.bsky.feed.defs#requestMore" => Self::RequestMore,
            "app.bsky.feed.defs#clickthroughItem" => Self::ClickthroughItem,
            "app.bsky.feed.defs#clickthroughAuthor" => Self::ClickthroughAuthor,
            "app.bsky.feed.defs#clickthroughReposter" => Self::ClickthroughReposter,
            "app.bsky.feed.defs#clickthroughEmbed" => Self::ClickthroughEmbed,
            "app.bsky.feed.defs#interactionSeen" => Self::InteractionSeen,
            "app.bsky.feed.defs#interactionLike" => Self::InteractionLike,
            "app.bsky.feed.defs#interactionRepost" => Self::InteractionRepost,
            "app.bsky.feed.defs#interactionReply" => Self::InteractionReply,
            "app.bsky.feed.defs#interactionQuote" => Self::InteractionQuote,
            "app.bsky.feed.defs#interactionShare" => Self::InteractionShare,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for InteractionEvent<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "app.bsky.feed.defs#requestLess" => Self::RequestLess,
            "app.bsky.feed.defs#requestMore" => Self::RequestMore,
            "app.bsky.feed.defs#clickthroughItem" => Self::ClickthroughItem,
            "app.bsky.feed.defs#clickthroughAuthor" => Self::ClickthroughAuthor,
            "app.bsky.feed.defs#clickthroughReposter" => Self::ClickthroughReposter,
            "app.bsky.feed.defs#clickthroughEmbed" => Self::ClickthroughEmbed,
            "app.bsky.feed.defs#interactionSeen" => Self::InteractionSeen,
            "app.bsky.feed.defs#interactionLike" => Self::InteractionLike,
            "app.bsky.feed.defs#interactionRepost" => Self::InteractionRepost,
            "app.bsky.feed.defs#interactionReply" => Self::InteractionReply,
            "app.bsky.feed.defs#interactionQuote" => Self::InteractionQuote,
            "app.bsky.feed.defs#interactionShare" => Self::InteractionShare,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

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

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

impl<'a> serde::Serialize for InteractionEvent<'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 InteractionEvent<'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 InteractionEvent<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for InteractionEvent<'_> {
    type Output = InteractionEvent<'static>;
    fn into_static(self) -> Self::Output {
        match self {
            InteractionEvent::RequestLess => InteractionEvent::RequestLess,
            InteractionEvent::RequestMore => InteractionEvent::RequestMore,
            InteractionEvent::ClickthroughItem => InteractionEvent::ClickthroughItem,
            InteractionEvent::ClickthroughAuthor => InteractionEvent::ClickthroughAuthor,
            InteractionEvent::ClickthroughReposter => {
                InteractionEvent::ClickthroughReposter
            }
            InteractionEvent::ClickthroughEmbed => InteractionEvent::ClickthroughEmbed,
            InteractionEvent::InteractionSeen => InteractionEvent::InteractionSeen,
            InteractionEvent::InteractionLike => InteractionEvent::InteractionLike,
            InteractionEvent::InteractionRepost => InteractionEvent::InteractionRepost,
            InteractionEvent::InteractionReply => InteractionEvent::InteractionReply,
            InteractionEvent::InteractionQuote => InteractionEvent::InteractionQuote,
            InteractionEvent::InteractionShare => InteractionEvent::InteractionShare,
            InteractionEvent::Other(v) => InteractionEvent::Other(v.into_static()),
        }
    }
}

/// User liked the feed item

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct InteractionLike;
impl core::fmt::Display for InteractionLike {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "interactionLike")
    }
}

/// User quoted the feed item

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct InteractionQuote;
impl core::fmt::Display for InteractionQuote {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "interactionQuote")
    }
}

/// User replied to the feed item

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct InteractionReply;
impl core::fmt::Display for InteractionReply {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "interactionReply")
    }
}

/// User reposted the feed item

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct InteractionRepost;
impl core::fmt::Display for InteractionRepost {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "interactionRepost")
    }
}

/// Feed item was seen by user

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct InteractionSeen;
impl core::fmt::Display for InteractionSeen {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "interactionSeen")
    }
}

/// User shared the feed item

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct InteractionShare;
impl core::fmt::Display for InteractionShare {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "interactionShare")
    }
}


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


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct PostView<'a> {
    #[serde(borrow)]
    pub author: ProfileViewBasic<'a>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub bookmark_count: Option<i64>,
    #[serde(borrow)]
    pub cid: Cid<'a>,
    ///Debug information for internal development
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub debug: Option<Data<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub embed: Option<PostViewEmbed<'a>>,
    pub indexed_at: Datetime,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub labels: Option<Vec<Label<'a>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub like_count: Option<i64>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub quote_count: Option<i64>,
    #[serde(borrow)]
    pub record: Data<'a>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reply_count: Option<i64>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub repost_count: Option<i64>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub threadgate: Option<feed::ThreadgateView<'a>>,
    #[serde(borrow)]
    pub uri: AtUri<'a>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub viewer: Option<feed::ViewerState<'a>>,
}


#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum PostViewEmbed<'a> {
    #[serde(rename = "app.bsky.embed.images#view")]
    ImagesView(Box<images::View<'a>>),
    #[serde(rename = "app.bsky.embed.video#view")]
    VideoView(Box<video::View<'a>>),
    #[serde(rename = "app.bsky.embed.external#view")]
    ExternalView(Box<external::View<'a>>),
    #[serde(rename = "app.bsky.embed.record#view")]
    RecordView(Box<record::View<'a>>),
    #[serde(rename = "app.bsky.embed.recordWithMedia#view")]
    RecordWithMediaView(Box<record_with_media::View<'a>>),
}


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

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ReasonRepost<'a> {
    #[serde(borrow)]
    pub by: ProfileViewBasic<'a>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub cid: Option<Cid<'a>>,
    pub indexed_at: Datetime,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub uri: Option<AtUri<'a>>,
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ReplyRef<'a> {
    ///When parent is a reply to another post, this is the author of that post.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub grandparent_author: Option<ProfileViewBasic<'a>>,
    #[serde(borrow)]
    pub parent: ReplyRefParent<'a>,
    #[serde(borrow)]
    pub root: ReplyRefRoot<'a>,
}


#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ReplyRefParent<'a> {
    #[serde(rename = "app.bsky.feed.defs#postView")]
    PostView(Box<feed::PostView<'a>>),
    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
    NotFoundPost(Box<feed::NotFoundPost<'a>>),
    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
    BlockedPost(Box<feed::BlockedPost<'a>>),
}


#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ReplyRefRoot<'a> {
    #[serde(rename = "app.bsky.feed.defs#postView")]
    PostView(Box<feed::PostView<'a>>),
    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
    NotFoundPost(Box<feed::NotFoundPost<'a>>),
    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
    BlockedPost(Box<feed::BlockedPost<'a>>),
}

/// Request that less content like the given feed item be shown in the feed

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct RequestLess;
impl core::fmt::Display for RequestLess {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "requestLess")
    }
}

/// Request that more content like the given feed item be shown in the feed

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct RequestMore;
impl core::fmt::Display for RequestMore {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "requestMore")
    }
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SkeletonFeedPost<'a> {
    ///Context that will be passed through to client and may be passed to feed generator back alongside interactions.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub feed_context: Option<CowStr<'a>>,
    #[serde(borrow)]
    pub post: AtUri<'a>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub reason: Option<SkeletonFeedPostReason<'a>>,
}


#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum SkeletonFeedPostReason<'a> {
    #[serde(rename = "app.bsky.feed.defs#skeletonReasonRepost")]
    SkeletonReasonRepost(Box<feed::SkeletonReasonRepost<'a>>),
    #[serde(rename = "app.bsky.feed.defs#skeletonReasonPin")]
    SkeletonReasonPin(Box<feed::SkeletonReasonPin<'a>>),
}


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

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

/// Metadata about this post within the context of the thread it is in.

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


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ThreadViewPost<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub parent: Option<ThreadViewPostParent<'a>>,
    #[serde(borrow)]
    pub post: feed::PostView<'a>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub replies: Option<Vec<ThreadViewPostRepliesItem<'a>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub thread_context: Option<feed::ThreadContext<'a>>,
}


#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ThreadViewPostParent<'a> {
    #[serde(rename = "app.bsky.feed.defs#threadViewPost")]
    ThreadViewPost(Box<feed::ThreadViewPost<'a>>),
    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
    NotFoundPost(Box<feed::NotFoundPost<'a>>),
    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
    BlockedPost(Box<feed::BlockedPost<'a>>),
}


#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ThreadViewPostRepliesItem<'a> {
    #[serde(rename = "app.bsky.feed.defs#threadViewPost")]
    ThreadViewPost(Box<feed::ThreadViewPost<'a>>),
    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
    NotFoundPost(Box<feed::NotFoundPost<'a>>),
    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
    BlockedPost(Box<feed::BlockedPost<'a>>),
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ThreadgateView<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub cid: Option<Cid<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub lists: Option<Vec<ListViewBasic<'a>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub record: Option<Data<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub uri: Option<AtUri<'a>>,
}

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

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ViewerState<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub bookmarked: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub embedding_disabled: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub like: Option<AtUri<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pinned: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reply_disabled: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub repost: Option<AtUri<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub thread_muted: Option<bool>,
}

impl<'a> LexiconSchema for BlockedAuthor<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "blockedAuthor"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for BlockedPost<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "blockedPost"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for FeedViewPost<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "feedViewPost"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.feed_context {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 2000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("feed_context"),
                    max: 2000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.req_id {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("req_id"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for GeneratorView<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "generatorView"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.description {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 3000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("description"),
                    max: 3000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.description {
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 300usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("description"),
                        max: 300usize,
                        actual: count,
                    });
                }
            }
        }
        if let Some(ref value) = self.like_count {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("like_count"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for GeneratorViewerState<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "generatorViewerState"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for Interaction<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "interaction"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.feed_context {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 2000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("feed_context"),
                    max: 2000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.req_id {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("req_id"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for NotFoundPost<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "notFoundPost"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for PostView<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "postView"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for ReasonPin<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "reasonPin"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for ReasonRepost<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "reasonRepost"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for ReplyRef<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "replyRef"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for SkeletonFeedPost<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "skeletonFeedPost"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.feed_context {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 2000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("feed_context"),
                    max: 2000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for SkeletonReasonPin<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "skeletonReasonPin"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for SkeletonReasonRepost<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "skeletonReasonRepost"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for ThreadContext<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "threadContext"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for ThreadViewPost<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "threadViewPost"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for ThreadgateView<'a> {
    fn nsid() -> &'static str {
        "app.bsky.feed.defs"
    }
    fn def_name() -> &'static str {
        "threadgateView"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_bsky_feed_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

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

pub mod blocked_author_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 BlockedAuthorBuilder<'a, S: blocked_author_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (Option<Did<'a>>, Option<actor::ViewerState<'a>>),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> BlockedAuthor<'a> {
    /// Create a new builder for this type
    pub fn new() -> BlockedAuthorBuilder<'a, blocked_author_state::Empty> {
        BlockedAuthorBuilder::new()
    }
}

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

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

impl<'a, S: blocked_author_state::State> BlockedAuthorBuilder<'a, S> {
    /// Set the `viewer` field (optional)
    pub fn viewer(mut self, value: impl Into<Option<actor::ViewerState<'a>>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `viewer` field to an Option value (optional)
    pub fn maybe_viewer(mut self, value: Option<actor::ViewerState<'a>>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<'a, S> BlockedAuthorBuilder<'a, S>
where
    S: blocked_author_state::State,
    S::Did: blocked_author_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> BlockedAuthor<'a> {
        BlockedAuthor {
            did: self._fields.0.unwrap(),
            viewer: self._fields.1,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> BlockedAuthor<'a> {
        BlockedAuthor {
            did: self._fields.0.unwrap(),
            viewer: self._fields.1,
            extra_data: Some(extra_data),
        }
    }
}

fn lexicon_doc_app_bsky_feed_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.feed.defs"),
        defs: {
            let mut map = BTreeMap::new();
            map.insert(
                SmolStr::new_static("blockedAuthor"),
                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.insert(
                            SmolStr::new_static("viewer"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static(
                                    "app.bsky.actor.defs#viewerState",
                                ),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("blockedPost"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![
                            SmolStr::new_static("uri"), SmolStr::new_static("blocked"),
                            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("#blockedAuthor"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("blocked"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("clickthroughAuthor"),
                LexUserType::Token(LexToken { ..Default::default() }),
            );
            map.insert(
                SmolStr::new_static("clickthroughEmbed"),
                LexUserType::Token(LexToken { ..Default::default() }),
            );
            map.insert(
                SmolStr::new_static("clickthroughItem"),
                LexUserType::Token(LexToken { ..Default::default() }),
            );
            map.insert(
                SmolStr::new_static("clickthroughReposter"),
                LexUserType::Token(LexToken { ..Default::default() }),
            );
            map.insert(
                SmolStr::new_static("contentModeUnspecified"),
                LexUserType::Token(LexToken { ..Default::default() }),
            );
            map.insert(
                SmolStr::new_static("contentModeVideo"),
                LexUserType::Token(LexToken { ..Default::default() }),
            );
            map.insert(
                SmolStr::new_static("feedViewPost"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("post")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("feedContext"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Context provided by feed generator that may be passed back alongside interactions.",
                                    ),
                                ),
                                max_length: Some(2000usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("post"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#postView"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("reason"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("#reasonRepost"),
                                    CowStr::new_static("#reasonPin")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("reply"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#replyRef"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("reqId"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Unique identifier per request that may be passed back alongside interactions.",
                                    ),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("generatorView"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![
                            SmolStr::new_static("uri"), SmolStr::new_static("cid"),
                            SmolStr::new_static("did"), SmolStr::new_static("creator"),
                            SmolStr::new_static("displayName"),
                            SmolStr::new_static("indexedAt")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("acceptsInteractions"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("avatar"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Uri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("cid"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Cid),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("contentMode"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("creator"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static(
                                    "app.bsky.actor.defs#profileView",
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("description"),
                            LexObjectProperty::String(LexString {
                                max_length: Some(3000usize),
                                max_graphemes: Some(300usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("descriptionFacets"),
                            LexObjectProperty::Array(LexArray {
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("app.bsky.richtext.facet"),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("did"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Did),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("displayName"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("indexedAt"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("labels"),
                            LexObjectProperty::Array(LexArray {
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("com.atproto.label.defs#label"),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("likeCount"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("viewer"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#generatorViewerState"),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("generatorViewerState"),
                LexUserType::Object(LexObject {
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("like"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("interaction"),
                LexUserType::Object(LexObject {
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("event"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("feedContext"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.",
                                    ),
                                ),
                                max_length: Some(2000usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("item"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("reqId"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Unique identifier per request that may be passed back alongside interactions.",
                                    ),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("interactionLike"),
                LexUserType::Token(LexToken { ..Default::default() }),
            );
            map.insert(
                SmolStr::new_static("interactionQuote"),
                LexUserType::Token(LexToken { ..Default::default() }),
            );
            map.insert(
                SmolStr::new_static("interactionReply"),
                LexUserType::Token(LexToken { ..Default::default() }),
            );
            map.insert(
                SmolStr::new_static("interactionRepost"),
                LexUserType::Token(LexToken { ..Default::default() }),
            );
            map.insert(
                SmolStr::new_static("interactionSeen"),
                LexUserType::Token(LexToken { ..Default::default() }),
            );
            map.insert(
                SmolStr::new_static("interactionShare"),
                LexUserType::Token(LexToken { ..Default::default() }),
            );
            map.insert(
                SmolStr::new_static("notFoundPost"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![SmolStr::new_static("uri"), SmolStr::new_static("notFound")],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("notFound"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("postView"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![
                            SmolStr::new_static("uri"), SmolStr::new_static("cid"),
                            SmolStr::new_static("author"), SmolStr::new_static("record"),
                            SmolStr::new_static("indexedAt")
                        ],
                    ),
                    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.actor.defs#profileViewBasic",
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("bookmarkCount"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("cid"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Cid),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("debug"),
                            LexObjectProperty::Unknown(LexUnknown {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("embed"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("app.bsky.embed.images#view"),
                                    CowStr::new_static("app.bsky.embed.video#view"),
                                    CowStr::new_static("app.bsky.embed.external#view"),
                                    CowStr::new_static("app.bsky.embed.record#view"),
                                    CowStr::new_static("app.bsky.embed.recordWithMedia#view")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("indexedAt"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("labels"),
                            LexObjectProperty::Array(LexArray {
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("com.atproto.label.defs#label"),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("likeCount"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("quoteCount"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("record"),
                            LexObjectProperty::Unknown(LexUnknown {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("replyCount"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("repostCount"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("threadgate"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#threadgateView"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("viewer"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#viewerState"),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("reasonPin"),
                LexUserType::Object(LexObject {
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("reasonRepost"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![SmolStr::new_static("by"), SmolStr::new_static("indexedAt")],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("by"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static(
                                    "app.bsky.actor.defs#profileViewBasic",
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("cid"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Cid),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("indexedAt"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("replyRef"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![SmolStr::new_static("root"), SmolStr::new_static("parent")],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("grandparentAuthor"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static(
                                    "app.bsky.actor.defs#profileViewBasic",
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("parent"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("#postView"),
                                    CowStr::new_static("#notFoundPost"),
                                    CowStr::new_static("#blockedPost")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("root"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("#postView"),
                                    CowStr::new_static("#notFoundPost"),
                                    CowStr::new_static("#blockedPost")
                                ],
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("requestLess"),
                LexUserType::Token(LexToken { ..Default::default() }),
            );
            map.insert(
                SmolStr::new_static("requestMore"),
                LexUserType::Token(LexToken { ..Default::default() }),
            );
            map.insert(
                SmolStr::new_static("skeletonFeedPost"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("post")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("feedContext"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Context that will be passed through to client and may be passed to feed generator back alongside interactions.",
                                    ),
                                ),
                                max_length: Some(2000usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("post"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("reason"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("#skeletonReasonRepost"),
                                    CowStr::new_static("#skeletonReasonPin")
                                ],
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("skeletonReasonPin"),
                LexUserType::Object(LexObject {
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("skeletonReasonRepost"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("repost")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("repost"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("threadContext"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Metadata about this post within the context of the thread it is in.",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("rootAuthorLike"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("threadViewPost"),
                LexUserType::Object(LexObject {
                    required: Some(vec![SmolStr::new_static("post")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("parent"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("#threadViewPost"),
                                    CowStr::new_static("#notFoundPost"),
                                    CowStr::new_static("#blockedPost")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("post"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#postView"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("replies"),
                            LexObjectProperty::Array(LexArray {
                                items: LexArrayItem::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("#threadViewPost"),
                                        CowStr::new_static("#notFoundPost"),
                                        CowStr::new_static("#blockedPost")
                                    ],
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("threadContext"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#threadContext"),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("threadgateView"),
                LexUserType::Object(LexObject {
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("cid"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Cid),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("lists"),
                            LexObjectProperty::Array(LexArray {
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static(
                                        "app.bsky.graph.defs#listViewBasic",
                                    ),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("record"),
                            LexObjectProperty::Unknown(LexUnknown {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("viewerState"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("bookmarked"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("embeddingDisabled"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("like"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("pinned"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("replyDisabled"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("repost"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("threadMuted"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map
        },
        ..Default::default()
    }
}

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

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

impl<'a> BlockedPost<'a> {
    /// Create a new builder for this type
    pub fn new() -> BlockedPostBuilder<'a, blocked_post_state::Empty> {
        BlockedPostBuilder::new()
    }
}

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

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

impl<'a, S> BlockedPostBuilder<'a, S>
where
    S: blocked_post_state::State,
    S::Blocked: blocked_post_state::IsUnset,
{
    /// Set the `blocked` field (required)
    pub fn blocked(
        mut self,
        value: impl Into<bool>,
    ) -> BlockedPostBuilder<'a, blocked_post_state::SetBlocked<S>> {
        self._fields.1 = Option::Some(value.into());
        BlockedPostBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

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

impl<'a, S> BlockedPostBuilder<'a, S>
where
    S: blocked_post_state::State,
    S::Author: blocked_post_state::IsSet,
    S::Blocked: blocked_post_state::IsSet,
    S::Uri: blocked_post_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> BlockedPost<'a> {
        BlockedPost {
            author: self._fields.0.unwrap(),
            blocked: self._fields.1.unwrap(),
            uri: self._fields.2.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> BlockedPost<'a> {
        BlockedPost {
            author: self._fields.0.unwrap(),
            blocked: self._fields.1.unwrap(),
            uri: self._fields.2.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod feed_view_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 Post;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Post = Unset;
    }
    ///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 Post = Set<members::post>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `post` field
        pub struct post(());
    }
}

/// Builder for constructing an instance of this type
pub struct FeedViewPostBuilder<'a, S: feed_view_post_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<CowStr<'a>>,
        Option<feed::PostView<'a>>,
        Option<FeedViewPostReason<'a>>,
        Option<feed::ReplyRef<'a>>,
        Option<CowStr<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> FeedViewPost<'a> {
    /// Create a new builder for this type
    pub fn new() -> FeedViewPostBuilder<'a, feed_view_post_state::Empty> {
        FeedViewPostBuilder::new()
    }
}

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

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

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

impl<'a, S: feed_view_post_state::State> FeedViewPostBuilder<'a, S> {
    /// Set the `reason` field (optional)
    pub fn reason(mut self, value: impl Into<Option<FeedViewPostReason<'a>>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `reason` field to an Option value (optional)
    pub fn maybe_reason(mut self, value: Option<FeedViewPostReason<'a>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<'a, S: feed_view_post_state::State> FeedViewPostBuilder<'a, S> {
    /// Set the `reply` field (optional)
    pub fn reply(mut self, value: impl Into<Option<feed::ReplyRef<'a>>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `reply` field to an Option value (optional)
    pub fn maybe_reply(mut self, value: Option<feed::ReplyRef<'a>>) -> Self {
        self._fields.3 = value;
        self
    }
}

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

impl<'a, S> FeedViewPostBuilder<'a, S>
where
    S: feed_view_post_state::State,
    S::Post: feed_view_post_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> FeedViewPost<'a> {
        FeedViewPost {
            feed_context: self._fields.0,
            post: self._fields.1.unwrap(),
            reason: self._fields.2,
            reply: self._fields.3,
            req_id: self._fields.4,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> FeedViewPost<'a> {
        FeedViewPost {
            feed_context: self._fields.0,
            post: self._fields.1.unwrap(),
            reason: self._fields.2,
            reply: self._fields.3,
            req_id: self._fields.4,
            extra_data: Some(extra_data),
        }
    }
}

pub mod generator_view_state {

    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
    #[allow(unused)]
    use ::core::marker::PhantomData;
    mod sealed {
        pub trait Sealed {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type IndexedAt;
        type DisplayName;
        type Creator;
        type Did;
        type Cid;
        type Uri;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type IndexedAt = Unset;
        type DisplayName = Unset;
        type Creator = Unset;
        type Did = Unset;
        type Cid = Unset;
        type Uri = Unset;
    }
    ///State transition - sets the `indexed_at` field to Set
    pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
    impl<S: State> State for SetIndexedAt<S> {
        type IndexedAt = Set<members::indexed_at>;
        type DisplayName = S::DisplayName;
        type Creator = S::Creator;
        type Did = S::Did;
        type Cid = S::Cid;
        type Uri = S::Uri;
    }
    ///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 IndexedAt = S::IndexedAt;
        type DisplayName = Set<members::display_name>;
        type Creator = S::Creator;
        type Did = S::Did;
        type Cid = S::Cid;
        type Uri = S::Uri;
    }
    ///State transition - sets the `creator` field to Set
    pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCreator<S> {}
    impl<S: State> State for SetCreator<S> {
        type IndexedAt = S::IndexedAt;
        type DisplayName = S::DisplayName;
        type Creator = Set<members::creator>;
        type Did = S::Did;
        type Cid = S::Cid;
        type Uri = S::Uri;
    }
    ///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 IndexedAt = S::IndexedAt;
        type DisplayName = S::DisplayName;
        type Creator = S::Creator;
        type Did = Set<members::did>;
        type Cid = S::Cid;
        type Uri = S::Uri;
    }
    ///State transition - sets the `cid` field to Set
    pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCid<S> {}
    impl<S: State> State for SetCid<S> {
        type IndexedAt = S::IndexedAt;
        type DisplayName = S::DisplayName;
        type Creator = S::Creator;
        type Did = S::Did;
        type Cid = Set<members::cid>;
        type Uri = S::Uri;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetUri<S> {}
    impl<S: State> State for SetUri<S> {
        type IndexedAt = S::IndexedAt;
        type DisplayName = S::DisplayName;
        type Creator = S::Creator;
        type Did = S::Did;
        type Cid = S::Cid;
        type Uri = Set<members::uri>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `indexed_at` field
        pub struct indexed_at(());
        ///Marker type for the `display_name` field
        pub struct display_name(());
        ///Marker type for the `creator` field
        pub struct creator(());
        ///Marker type for the `did` field
        pub struct did(());
        ///Marker type for the `cid` field
        pub struct cid(());
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

/// Builder for constructing an instance of this type
pub struct GeneratorViewBuilder<'a, S: generator_view_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<bool>,
        Option<UriValue<'a>>,
        Option<Cid<'a>>,
        Option<GeneratorViewContentMode<'a>>,
        Option<ProfileView<'a>>,
        Option<CowStr<'a>>,
        Option<Vec<Facet<'a>>>,
        Option<Did<'a>>,
        Option<CowStr<'a>>,
        Option<Datetime>,
        Option<Vec<Label<'a>>>,
        Option<i64>,
        Option<AtUri<'a>>,
        Option<feed::GeneratorViewerState<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> GeneratorView<'a> {
    /// Create a new builder for this type
    pub fn new() -> GeneratorViewBuilder<'a, generator_view_state::Empty> {
        GeneratorViewBuilder::new()
    }
}

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

impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> {
    /// Set the `acceptsInteractions` field (optional)
    pub fn accepts_interactions(mut self, value: impl Into<Option<bool>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `acceptsInteractions` field to an Option value (optional)
    pub fn maybe_accepts_interactions(mut self, value: Option<bool>) -> Self {
        self._fields.0 = value;
        self
    }
}

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

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

impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> {
    /// Set the `contentMode` field (optional)
    pub fn content_mode(
        mut self,
        value: impl Into<Option<GeneratorViewContentMode<'a>>>,
    ) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `contentMode` field to an Option value (optional)
    pub fn maybe_content_mode(
        mut self,
        value: Option<GeneratorViewContentMode<'a>>,
    ) -> Self {
        self._fields.3 = value;
        self
    }
}

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

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

impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> {
    /// Set the `descriptionFacets` field (optional)
    pub fn description_facets(
        mut self,
        value: impl Into<Option<Vec<Facet<'a>>>>,
    ) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `descriptionFacets` field to an Option value (optional)
    pub fn maybe_description_facets(mut self, value: Option<Vec<Facet<'a>>>) -> Self {
        self._fields.6 = value;
        self
    }
}

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

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

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

impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> {
    /// Set the `labels` field (optional)
    pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
        self._fields.10 = value.into();
        self
    }
    /// Set the `labels` field to an Option value (optional)
    pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
        self._fields.10 = value;
        self
    }
}

impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> {
    /// Set the `likeCount` field (optional)
    pub fn like_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.11 = value.into();
        self
    }
    /// Set the `likeCount` field to an Option value (optional)
    pub fn maybe_like_count(mut self, value: Option<i64>) -> Self {
        self._fields.11 = value;
        self
    }
}

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

impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> {
    /// Set the `viewer` field (optional)
    pub fn viewer(
        mut self,
        value: impl Into<Option<feed::GeneratorViewerState<'a>>>,
    ) -> Self {
        self._fields.13 = value.into();
        self
    }
    /// Set the `viewer` field to an Option value (optional)
    pub fn maybe_viewer(
        mut self,
        value: Option<feed::GeneratorViewerState<'a>>,
    ) -> Self {
        self._fields.13 = value;
        self
    }
}

impl<'a, S> GeneratorViewBuilder<'a, S>
where
    S: generator_view_state::State,
    S::IndexedAt: generator_view_state::IsSet,
    S::DisplayName: generator_view_state::IsSet,
    S::Creator: generator_view_state::IsSet,
    S::Did: generator_view_state::IsSet,
    S::Cid: generator_view_state::IsSet,
    S::Uri: generator_view_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> GeneratorView<'a> {
        GeneratorView {
            accepts_interactions: self._fields.0,
            avatar: self._fields.1,
            cid: self._fields.2.unwrap(),
            content_mode: self._fields.3,
            creator: self._fields.4.unwrap(),
            description: self._fields.5,
            description_facets: self._fields.6,
            did: self._fields.7.unwrap(),
            display_name: self._fields.8.unwrap(),
            indexed_at: self._fields.9.unwrap(),
            labels: self._fields.10,
            like_count: self._fields.11,
            uri: self._fields.12.unwrap(),
            viewer: self._fields.13,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> GeneratorView<'a> {
        GeneratorView {
            accepts_interactions: self._fields.0,
            avatar: self._fields.1,
            cid: self._fields.2.unwrap(),
            content_mode: self._fields.3,
            creator: self._fields.4.unwrap(),
            description: self._fields.5,
            description_facets: self._fields.6,
            did: self._fields.7.unwrap(),
            display_name: self._fields.8.unwrap(),
            indexed_at: self._fields.9.unwrap(),
            labels: self._fields.10,
            like_count: self._fields.11,
            uri: self._fields.12.unwrap(),
            viewer: self._fields.13,
            extra_data: Some(extra_data),
        }
    }
}

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

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

impl<'a> NotFoundPost<'a> {
    /// Create a new builder for this type
    pub fn new() -> NotFoundPostBuilder<'a, not_found_post_state::Empty> {
        NotFoundPostBuilder::new()
    }
}

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

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

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

impl<'a, S> NotFoundPostBuilder<'a, S>
where
    S: not_found_post_state::State,
    S::Uri: not_found_post_state::IsSet,
    S::NotFound: not_found_post_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> NotFoundPost<'a> {
        NotFoundPost {
            not_found: self._fields.0.unwrap(),
            uri: self._fields.1.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> NotFoundPost<'a> {
        NotFoundPost {
            not_found: self._fields.0.unwrap(),
            uri: self._fields.1.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod post_view_state {

    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
    #[allow(unused)]
    use ::core::marker::PhantomData;
    mod sealed {
        pub trait Sealed {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Record;
        type Uri;
        type IndexedAt;
        type Author;
        type Cid;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Record = Unset;
        type Uri = Unset;
        type IndexedAt = Unset;
        type Author = Unset;
        type Cid = Unset;
    }
    ///State transition - sets the `record` field to Set
    pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetRecord<S> {}
    impl<S: State> State for SetRecord<S> {
        type Record = Set<members::record>;
        type Uri = S::Uri;
        type IndexedAt = S::IndexedAt;
        type Author = S::Author;
        type Cid = S::Cid;
    }
    ///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 Record = S::Record;
        type Uri = Set<members::uri>;
        type IndexedAt = S::IndexedAt;
        type Author = S::Author;
        type Cid = S::Cid;
    }
    ///State transition - sets the `indexed_at` field to Set
    pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
    impl<S: State> State for SetIndexedAt<S> {
        type Record = S::Record;
        type Uri = S::Uri;
        type IndexedAt = Set<members::indexed_at>;
        type Author = S::Author;
        type Cid = S::Cid;
    }
    ///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 Record = S::Record;
        type Uri = S::Uri;
        type IndexedAt = S::IndexedAt;
        type Author = Set<members::author>;
        type Cid = S::Cid;
    }
    ///State transition - sets the `cid` field to Set
    pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCid<S> {}
    impl<S: State> State for SetCid<S> {
        type Record = S::Record;
        type Uri = S::Uri;
        type IndexedAt = S::IndexedAt;
        type Author = S::Author;
        type Cid = Set<members::cid>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `record` field
        pub struct record(());
        ///Marker type for the `uri` field
        pub struct uri(());
        ///Marker type for the `indexed_at` field
        pub struct indexed_at(());
        ///Marker type for the `author` field
        pub struct author(());
        ///Marker type for the `cid` field
        pub struct cid(());
    }
}

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

impl<'a> PostView<'a> {
    /// Create a new builder for this type
    pub fn new() -> PostViewBuilder<'a, post_view_state::Empty> {
        PostViewBuilder::new()
    }
}

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

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

impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> {
    /// Set the `bookmarkCount` field (optional)
    pub fn bookmark_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `bookmarkCount` field to an Option value (optional)
    pub fn maybe_bookmark_count(mut self, value: Option<i64>) -> Self {
        self._fields.1 = value;
        self
    }
}

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

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

impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> {
    /// Set the `embed` field (optional)
    pub fn embed(mut self, value: impl Into<Option<PostViewEmbed<'a>>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `embed` field to an Option value (optional)
    pub fn maybe_embed(mut self, value: Option<PostViewEmbed<'a>>) -> Self {
        self._fields.4 = value;
        self
    }
}

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

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

impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> {
    /// Set the `likeCount` field (optional)
    pub fn like_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.7 = value.into();
        self
    }
    /// Set the `likeCount` field to an Option value (optional)
    pub fn maybe_like_count(mut self, value: Option<i64>) -> Self {
        self._fields.7 = value;
        self
    }
}

impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> {
    /// Set the `quoteCount` field (optional)
    pub fn quote_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.8 = value.into();
        self
    }
    /// Set the `quoteCount` field to an Option value (optional)
    pub fn maybe_quote_count(mut self, value: Option<i64>) -> Self {
        self._fields.8 = value;
        self
    }
}

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

impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> {
    /// Set the `replyCount` field (optional)
    pub fn reply_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.10 = value.into();
        self
    }
    /// Set the `replyCount` field to an Option value (optional)
    pub fn maybe_reply_count(mut self, value: Option<i64>) -> Self {
        self._fields.10 = value;
        self
    }
}

impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> {
    /// Set the `repostCount` field (optional)
    pub fn repost_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.11 = value.into();
        self
    }
    /// Set the `repostCount` field to an Option value (optional)
    pub fn maybe_repost_count(mut self, value: Option<i64>) -> Self {
        self._fields.11 = value;
        self
    }
}

impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> {
    /// Set the `threadgate` field (optional)
    pub fn threadgate(
        mut self,
        value: impl Into<Option<feed::ThreadgateView<'a>>>,
    ) -> Self {
        self._fields.12 = value.into();
        self
    }
    /// Set the `threadgate` field to an Option value (optional)
    pub fn maybe_threadgate(mut self, value: Option<feed::ThreadgateView<'a>>) -> Self {
        self._fields.12 = value;
        self
    }
}

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

impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> {
    /// Set the `viewer` field (optional)
    pub fn viewer(mut self, value: impl Into<Option<feed::ViewerState<'a>>>) -> Self {
        self._fields.14 = value.into();
        self
    }
    /// Set the `viewer` field to an Option value (optional)
    pub fn maybe_viewer(mut self, value: Option<feed::ViewerState<'a>>) -> Self {
        self._fields.14 = value;
        self
    }
}

impl<'a, S> PostViewBuilder<'a, S>
where
    S: post_view_state::State,
    S::Record: post_view_state::IsSet,
    S::Uri: post_view_state::IsSet,
    S::IndexedAt: post_view_state::IsSet,
    S::Author: post_view_state::IsSet,
    S::Cid: post_view_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> PostView<'a> {
        PostView {
            author: self._fields.0.unwrap(),
            bookmark_count: self._fields.1,
            cid: self._fields.2.unwrap(),
            debug: self._fields.3,
            embed: self._fields.4,
            indexed_at: self._fields.5.unwrap(),
            labels: self._fields.6,
            like_count: self._fields.7,
            quote_count: self._fields.8,
            record: self._fields.9.unwrap(),
            reply_count: self._fields.10,
            repost_count: self._fields.11,
            threadgate: self._fields.12,
            uri: self._fields.13.unwrap(),
            viewer: self._fields.14,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> PostView<'a> {
        PostView {
            author: self._fields.0.unwrap(),
            bookmark_count: self._fields.1,
            cid: self._fields.2.unwrap(),
            debug: self._fields.3,
            embed: self._fields.4,
            indexed_at: self._fields.5.unwrap(),
            labels: self._fields.6,
            like_count: self._fields.7,
            quote_count: self._fields.8,
            record: self._fields.9.unwrap(),
            reply_count: self._fields.10,
            repost_count: self._fields.11,
            threadgate: self._fields.12,
            uri: self._fields.13.unwrap(),
            viewer: self._fields.14,
            extra_data: Some(extra_data),
        }
    }
}

pub mod reason_repost_state {

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

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

impl<'a> ReasonRepost<'a> {
    /// Create a new builder for this type
    pub fn new() -> ReasonRepostBuilder<'a, reason_repost_state::Empty> {
        ReasonRepostBuilder::new()
    }
}

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

impl<'a, S> ReasonRepostBuilder<'a, S>
where
    S: reason_repost_state::State,
    S::By: reason_repost_state::IsUnset,
{
    /// Set the `by` field (required)
    pub fn by(
        mut self,
        value: impl Into<ProfileViewBasic<'a>>,
    ) -> ReasonRepostBuilder<'a, reason_repost_state::SetBy<S>> {
        self._fields.0 = Option::Some(value.into());
        ReasonRepostBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: reason_repost_state::State> ReasonRepostBuilder<'a, S> {
    /// Set the `cid` field (optional)
    pub fn cid(mut self, value: impl Into<Option<Cid<'a>>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `cid` field to an Option value (optional)
    pub fn maybe_cid(mut self, value: Option<Cid<'a>>) -> Self {
        self._fields.1 = value;
        self
    }
}

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

impl<'a, S: reason_repost_state::State> ReasonRepostBuilder<'a, S> {
    /// Set the `uri` field (optional)
    pub fn uri(mut self, value: impl Into<Option<AtUri<'a>>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `uri` field to an Option value (optional)
    pub fn maybe_uri(mut self, value: Option<AtUri<'a>>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<'a, S> ReasonRepostBuilder<'a, S>
where
    S: reason_repost_state::State,
    S::IndexedAt: reason_repost_state::IsSet,
    S::By: reason_repost_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> ReasonRepost<'a> {
        ReasonRepost {
            by: self._fields.0.unwrap(),
            cid: self._fields.1,
            indexed_at: self._fields.2.unwrap(),
            uri: self._fields.3,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> ReasonRepost<'a> {
        ReasonRepost {
            by: self._fields.0.unwrap(),
            cid: self._fields.1,
            indexed_at: self._fields.2.unwrap(),
            uri: self._fields.3,
            extra_data: Some(extra_data),
        }
    }
}

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

/// Builder for constructing an instance of this type
pub struct ReplyRefBuilder<'a, S: reply_ref_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<ProfileViewBasic<'a>>,
        Option<ReplyRefParent<'a>>,
        Option<ReplyRefRoot<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> ReplyRef<'a> {
    /// Create a new builder for this type
    pub fn new() -> ReplyRefBuilder<'a, reply_ref_state::Empty> {
        ReplyRefBuilder::new()
    }
}

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

impl<'a, S: reply_ref_state::State> ReplyRefBuilder<'a, S> {
    /// Set the `grandparentAuthor` field (optional)
    pub fn grandparent_author(
        mut self,
        value: impl Into<Option<ProfileViewBasic<'a>>>,
    ) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `grandparentAuthor` field to an Option value (optional)
    pub fn maybe_grandparent_author(
        mut self,
        value: Option<ProfileViewBasic<'a>>,
    ) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<'a, S> ReplyRefBuilder<'a, S>
where
    S: reply_ref_state::State,
    S::Parent: reply_ref_state::IsUnset,
{
    /// Set the `parent` field (required)
    pub fn parent(
        mut self,
        value: impl Into<ReplyRefParent<'a>>,
    ) -> ReplyRefBuilder<'a, reply_ref_state::SetParent<S>> {
        self._fields.1 = Option::Some(value.into());
        ReplyRefBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> ReplyRefBuilder<'a, S>
where
    S: reply_ref_state::State,
    S::Root: reply_ref_state::IsUnset,
{
    /// Set the `root` field (required)
    pub fn root(
        mut self,
        value: impl Into<ReplyRefRoot<'a>>,
    ) -> ReplyRefBuilder<'a, reply_ref_state::SetRoot<S>> {
        self._fields.2 = Option::Some(value.into());
        ReplyRefBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> ReplyRefBuilder<'a, S>
where
    S: reply_ref_state::State,
    S::Root: reply_ref_state::IsSet,
    S::Parent: reply_ref_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> ReplyRef<'a> {
        ReplyRef {
            grandparent_author: self._fields.0,
            parent: self._fields.1.unwrap(),
            root: self._fields.2.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> ReplyRef<'a> {
        ReplyRef {
            grandparent_author: self._fields.0,
            parent: self._fields.1.unwrap(),
            root: self._fields.2.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod skeleton_feed_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 Post;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Post = Unset;
    }
    ///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 Post = Set<members::post>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `post` field
        pub struct post(());
    }
}

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

impl<'a> SkeletonFeedPost<'a> {
    /// Create a new builder for this type
    pub fn new() -> SkeletonFeedPostBuilder<'a, skeleton_feed_post_state::Empty> {
        SkeletonFeedPostBuilder::new()
    }
}

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

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

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

impl<'a, S: skeleton_feed_post_state::State> SkeletonFeedPostBuilder<'a, S> {
    /// Set the `reason` field (optional)
    pub fn reason(
        mut self,
        value: impl Into<Option<SkeletonFeedPostReason<'a>>>,
    ) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `reason` field to an Option value (optional)
    pub fn maybe_reason(mut self, value: Option<SkeletonFeedPostReason<'a>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<'a, S> SkeletonFeedPostBuilder<'a, S>
where
    S: skeleton_feed_post_state::State,
    S::Post: skeleton_feed_post_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> SkeletonFeedPost<'a> {
        SkeletonFeedPost {
            feed_context: self._fields.0,
            post: self._fields.1.unwrap(),
            reason: self._fields.2,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> SkeletonFeedPost<'a> {
        SkeletonFeedPost {
            feed_context: self._fields.0,
            post: self._fields.1.unwrap(),
            reason: self._fields.2,
            extra_data: Some(extra_data),
        }
    }
}

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

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

impl<'a> SkeletonReasonRepost<'a> {
    /// Create a new builder for this type
    pub fn new() -> SkeletonReasonRepostBuilder<
        'a,
        skeleton_reason_repost_state::Empty,
    > {
        SkeletonReasonRepostBuilder::new()
    }
}

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

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

impl<'a, S> SkeletonReasonRepostBuilder<'a, S>
where
    S: skeleton_reason_repost_state::State,
    S::Repost: skeleton_reason_repost_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> SkeletonReasonRepost<'a> {
        SkeletonReasonRepost {
            repost: 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, Data<'a>>,
    ) -> SkeletonReasonRepost<'a> {
        SkeletonReasonRepost {
            repost: self._fields.0.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod thread_view_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 Post;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Post = Unset;
    }
    ///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 Post = Set<members::post>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `post` field
        pub struct post(());
    }
}

/// Builder for constructing an instance of this type
pub struct ThreadViewPostBuilder<'a, S: thread_view_post_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<ThreadViewPostParent<'a>>,
        Option<feed::PostView<'a>>,
        Option<Vec<ThreadViewPostRepliesItem<'a>>>,
        Option<feed::ThreadContext<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> ThreadViewPost<'a> {
    /// Create a new builder for this type
    pub fn new() -> ThreadViewPostBuilder<'a, thread_view_post_state::Empty> {
        ThreadViewPostBuilder::new()
    }
}

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

impl<'a, S: thread_view_post_state::State> ThreadViewPostBuilder<'a, S> {
    /// Set the `parent` field (optional)
    pub fn parent(mut self, value: impl Into<Option<ThreadViewPostParent<'a>>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `parent` field to an Option value (optional)
    pub fn maybe_parent(mut self, value: Option<ThreadViewPostParent<'a>>) -> Self {
        self._fields.0 = value;
        self
    }
}

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

impl<'a, S: thread_view_post_state::State> ThreadViewPostBuilder<'a, S> {
    /// Set the `replies` field (optional)
    pub fn replies(
        mut self,
        value: impl Into<Option<Vec<ThreadViewPostRepliesItem<'a>>>>,
    ) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `replies` field to an Option value (optional)
    pub fn maybe_replies(
        mut self,
        value: Option<Vec<ThreadViewPostRepliesItem<'a>>>,
    ) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<'a, S: thread_view_post_state::State> ThreadViewPostBuilder<'a, S> {
    /// Set the `threadContext` field (optional)
    pub fn thread_context(
        mut self,
        value: impl Into<Option<feed::ThreadContext<'a>>>,
    ) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `threadContext` field to an Option value (optional)
    pub fn maybe_thread_context(
        mut self,
        value: Option<feed::ThreadContext<'a>>,
    ) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<'a, S> ThreadViewPostBuilder<'a, S>
where
    S: thread_view_post_state::State,
    S::Post: thread_view_post_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> ThreadViewPost<'a> {
        ThreadViewPost {
            parent: self._fields.0,
            post: self._fields.1.unwrap(),
            replies: self._fields.2,
            thread_context: self._fields.3,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> ThreadViewPost<'a> {
        ThreadViewPost {
            parent: self._fields.0,
            post: self._fields.1.unwrap(),
            replies: self._fields.2,
            thread_context: self._fields.3,
            extra_data: Some(extra_data),
        }
    }
}