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

//! Generated bindings for the `app.bsky.feed` Lexicon namespace/module.
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, BosStr, DefaultStr, FromStaticStr};

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

#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::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::gallery;
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;

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


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct BlockedPost<S: BosStr = DefaultStr> {
    pub author: feed::BlockedAuthor<S>,
    pub blocked: bool,
    pub uri: AtUri<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

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


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct FeedViewPost<S: BosStr = DefaultStr> {
    ///Context provided by feed generator that may be passed back alongside interactions.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub feed_context: Option<S>,
    pub post: feed::PostView<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reason: Option<FeedViewPostReason<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reply: Option<feed::ReplyRef<S>>,
    ///Unique identifier per request that may be passed back alongside interactions.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub req_id: Option<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


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


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct GeneratorView<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub accepts_interactions: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub avatar: Option<UriValue<S>>,
    pub cid: Cid<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub content_mode: Option<GeneratorViewContentMode<S>>,
    pub creator: ProfileView<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description_facets: Option<Vec<Facet<S>>>,
    pub did: Did<S>,
    pub display_name: S,
    pub indexed_at: Datetime,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub labels: Option<Vec<Label<S>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub like_count: Option<i64>,
    pub uri: AtUri<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub viewer: Option<feed::GeneratorViewerState<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


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

impl<S: BosStr> GeneratorViewContentMode<S> {
    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(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "app.bsky.feed.defs#contentModeUnspecified" => Self::ContentModeUnspecified,
            "app.bsky.feed.defs#contentModeVideo" => Self::ContentModeVideo,
            _ => Self::Other(s),
        }
    }
}

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

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

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

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

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

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


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


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Interaction<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event: Option<InteractionEvent<S>>,
    ///Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub feed_context: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub item: Option<AtUri<S>>,
    ///Unique identifier per request that may be passed back alongside interactions.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub req_id: Option<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


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

impl<S: BosStr> InteractionEvent<S> {
    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(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "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(s),
        }
    }
}

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

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

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

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

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

impl<S: BosStr> jacquard_common::IntoStatic for InteractionEvent<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = InteractionEvent<S::Output>;
    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")
    }
}


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


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct PostView<S: BosStr = DefaultStr> {
    pub author: ProfileViewBasic<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub bookmark_count: Option<i64>,
    pub cid: Cid<S>,
    ///Debug information for internal development
    #[serde(skip_serializing_if = "Option::is_none")]
    pub debug: Option<Data<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub embed: Option<PostViewEmbed<S>>,
    pub indexed_at: Datetime,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub labels: Option<Vec<Label<S>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub like_count: Option<i64>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub quote_count: Option<i64>,
    pub record: Data<S>,
    #[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")]
    pub threadgate: Option<feed::ThreadgateView<S>>,
    pub uri: AtUri<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub viewer: Option<feed::ViewerState<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


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


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


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ReasonRepost<S: BosStr = DefaultStr> {
    pub by: ProfileViewBasic<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cid: Option<Cid<S>>,
    pub indexed_at: Datetime,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub uri: Option<AtUri<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ReplyRef<S: BosStr = DefaultStr> {
    ///When parent is a reply to another post, this is the author of that post.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub grandparent_author: Option<ProfileViewBasic<S>>,
    pub parent: ReplyRefParent<S>,
    pub root: ReplyRefRoot<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


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


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

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


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SkeletonFeedPost<S: BosStr = DefaultStr> {
    ///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")]
    pub feed_context: Option<S>,
    pub post: AtUri<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reason: Option<SkeletonFeedPostReason<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


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


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


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

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

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


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ThreadViewPost<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub parent: Option<ThreadViewPostParent<S>>,
    pub post: feed::PostView<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub replies: Option<Vec<ThreadViewPostRepliesItem<S>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub thread_context: Option<feed::ThreadContext<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


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


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


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

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

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ViewerState<S: BosStr = DefaultStr> {
    #[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")]
    pub like: Option<AtUri<S>>,
    #[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")]
    pub repost: Option<AtUri<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub thread_muted: Option<bool>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

impl<S: BosStr> LexiconSchema for BlockedAuthor<S> {
    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<S: BosStr> LexiconSchema for BlockedPost<S> {
    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<S: BosStr> LexiconSchema for FeedViewPost<S> {
    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<S: BosStr> LexiconSchema for GeneratorView<S> {
    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<S: BosStr> LexiconSchema for GeneratorViewerState<S> {
    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<S: BosStr> LexiconSchema for Interaction<S> {
    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<S: BosStr> LexiconSchema for NotFoundPost<S> {
    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<S: BosStr> LexiconSchema for PostView<S> {
    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<S: BosStr> LexiconSchema for ReasonPin<S> {
    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<S: BosStr> LexiconSchema for ReasonRepost<S> {
    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<S: BosStr> LexiconSchema for ReplyRef<S> {
    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<S: BosStr> LexiconSchema for SkeletonFeedPost<S> {
    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<S: BosStr> LexiconSchema for SkeletonReasonPin<S> {
    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<S: BosStr> LexiconSchema for SkeletonReasonRepost<S> {
    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<S: BosStr> LexiconSchema for ThreadContext<S> {
    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<S: BosStr> LexiconSchema for ThreadViewPost<S> {
    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<S: BosStr> LexiconSchema for ThreadgateView<S> {
    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<S: BosStr> LexiconSchema for ViewerState<S> {
    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<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetDid<St> {}
    impl<St: State> State for SetDid<St> {
        type Did = Set<members::did>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `did` field
        pub struct did(());
    }
}

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

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

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

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

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

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

impl<St: blocked_author_state::State, S: BosStr> BlockedAuthorBuilder<St, S> {
    /// Set the `viewer` field (optional)
    pub fn viewer(mut self, value: impl Into<Option<actor::ViewerState<S>>>) -> 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<S>>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<St, S: BosStr> BlockedAuthorBuilder<St, S>
where
    St: blocked_author_state::State,
    St::Did: blocked_author_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> BlockedAuthor<S> {
        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<SmolStr, Data<S>>,
    ) -> BlockedAuthor<S> {
        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.gallery#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<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetAuthor<St> {}
    impl<St: State> State for SetAuthor<St> {
        type Author = Set<members::author>;
        type Blocked = St::Blocked;
        type Uri = St::Uri;
    }
    ///State transition - sets the `blocked` field to Set
    pub struct SetBlocked<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetBlocked<St> {}
    impl<St: State> State for SetBlocked<St> {
        type Author = St::Author;
        type Blocked = Set<members::blocked>;
        type Uri = St::Uri;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetUri<St> {}
    impl<St: State> State for SetUri<St> {
        type Author = St::Author;
        type Blocked = St::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<St: blocked_post_state::State, S: BosStr = DefaultStr> {
    _state: PhantomData<fn() -> St>,
    _fields: (Option<feed::BlockedAuthor<S>>, Option<bool>, Option<AtUri<S>>),
    _type: PhantomData<fn() -> S>,
}

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

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

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

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

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

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

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

impl<St, S: BosStr> BlockedPostBuilder<St, S>
where
    St: blocked_post_state::State,
    St::Author: blocked_post_state::IsSet,
    St::Blocked: blocked_post_state::IsSet,
    St::Uri: blocked_post_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> BlockedPost<S> {
        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<SmolStr, Data<S>>,
    ) -> BlockedPost<S> {
        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<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetPost<St> {}
    impl<St: State> State for SetPost<St> {
        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<St: feed_view_post_state::State, S: BosStr = DefaultStr> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<S>,
        Option<feed::PostView<S>>,
        Option<FeedViewPostReason<S>>,
        Option<feed::ReplyRef<S>>,
        Option<S>,
    ),
    _type: PhantomData<fn() -> S>,
}

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

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

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

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

impl<St: feed_view_post_state::State, S: BosStr> FeedViewPostBuilder<St, S> {
    /// Set the `feedContext` field (optional)
    pub fn feed_context(mut self, value: impl Into<Option<S>>) -> 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<S>) -> Self {
        self._fields.0 = value;
        self
    }
}

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

impl<St: feed_view_post_state::State, S: BosStr> FeedViewPostBuilder<St, S> {
    /// Set the `reason` field (optional)
    pub fn reason(mut self, value: impl Into<Option<FeedViewPostReason<S>>>) -> 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<S>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<St: feed_view_post_state::State, S: BosStr> FeedViewPostBuilder<St, S> {
    /// Set the `reply` field (optional)
    pub fn reply(mut self, value: impl Into<Option<feed::ReplyRef<S>>>) -> 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<S>>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<St: feed_view_post_state::State, S: BosStr> FeedViewPostBuilder<St, S> {
    /// Set the `reqId` field (optional)
    pub fn req_id(mut self, value: impl Into<Option<S>>) -> 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<S>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<St, S: BosStr> FeedViewPostBuilder<St, S>
where
    St: feed_view_post_state::State,
    St::Post: feed_view_post_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> FeedViewPost<S> {
        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<SmolStr, Data<S>>,
    ) -> FeedViewPost<S> {
        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 Cid;
        type Creator;
        type Did;
        type DisplayName;
        type IndexedAt;
        type Uri;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Cid = Unset;
        type Creator = Unset;
        type Did = Unset;
        type DisplayName = Unset;
        type IndexedAt = Unset;
        type Uri = Unset;
    }
    ///State transition - sets the `cid` field to Set
    pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCid<St> {}
    impl<St: State> State for SetCid<St> {
        type Cid = Set<members::cid>;
        type Creator = St::Creator;
        type Did = St::Did;
        type DisplayName = St::DisplayName;
        type IndexedAt = St::IndexedAt;
        type Uri = St::Uri;
    }
    ///State transition - sets the `creator` field to Set
    pub struct SetCreator<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCreator<St> {}
    impl<St: State> State for SetCreator<St> {
        type Cid = St::Cid;
        type Creator = Set<members::creator>;
        type Did = St::Did;
        type DisplayName = St::DisplayName;
        type IndexedAt = St::IndexedAt;
        type Uri = St::Uri;
    }
    ///State transition - sets the `did` field to Set
    pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetDid<St> {}
    impl<St: State> State for SetDid<St> {
        type Cid = St::Cid;
        type Creator = St::Creator;
        type Did = Set<members::did>;
        type DisplayName = St::DisplayName;
        type IndexedAt = St::IndexedAt;
        type Uri = St::Uri;
    }
    ///State transition - sets the `display_name` field to Set
    pub struct SetDisplayName<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetDisplayName<St> {}
    impl<St: State> State for SetDisplayName<St> {
        type Cid = St::Cid;
        type Creator = St::Creator;
        type Did = St::Did;
        type DisplayName = Set<members::display_name>;
        type IndexedAt = St::IndexedAt;
        type Uri = St::Uri;
    }
    ///State transition - sets the `indexed_at` field to Set
    pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
    impl<St: State> State for SetIndexedAt<St> {
        type Cid = St::Cid;
        type Creator = St::Creator;
        type Did = St::Did;
        type DisplayName = St::DisplayName;
        type IndexedAt = Set<members::indexed_at>;
        type Uri = St::Uri;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetUri<St> {}
    impl<St: State> State for SetUri<St> {
        type Cid = St::Cid;
        type Creator = St::Creator;
        type Did = St::Did;
        type DisplayName = St::DisplayName;
        type IndexedAt = St::IndexedAt;
        type Uri = Set<members::uri>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `cid` field
        pub struct cid(());
        ///Marker type for the `creator` field
        pub struct creator(());
        ///Marker type for the `did` field
        pub struct did(());
        ///Marker type for the `display_name` field
        pub struct display_name(());
        ///Marker type for the `indexed_at` field
        pub struct indexed_at(());
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

/// Builder for constructing an instance of this type.
pub struct GeneratorViewBuilder<
    St: generator_view_state::State,
    S: BosStr = DefaultStr,
> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<bool>,
        Option<UriValue<S>>,
        Option<Cid<S>>,
        Option<GeneratorViewContentMode<S>>,
        Option<ProfileView<S>>,
        Option<S>,
        Option<Vec<Facet<S>>>,
        Option<Did<S>>,
        Option<S>,
        Option<Datetime>,
        Option<Vec<Label<S>>>,
        Option<i64>,
        Option<AtUri<S>>,
        Option<feed::GeneratorViewerState<S>>,
    ),
    _type: PhantomData<fn() -> S>,
}

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

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

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

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

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

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

impl<St: generator_view_state::State, S: BosStr> GeneratorViewBuilder<St, S> {
    /// Set the `contentMode` field (optional)
    pub fn content_mode(
        mut self,
        value: impl Into<Option<GeneratorViewContentMode<S>>>,
    ) -> 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<S>>,
    ) -> Self {
        self._fields.3 = value;
        self
    }
}

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

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

impl<St: generator_view_state::State, S: BosStr> GeneratorViewBuilder<St, S> {
    /// Set the `descriptionFacets` field (optional)
    pub fn description_facets(
        mut self,
        value: impl Into<Option<Vec<Facet<S>>>>,
    ) -> 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<S>>>) -> Self {
        self._fields.6 = value;
        self
    }
}

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

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

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

impl<St: generator_view_state::State, S: BosStr> GeneratorViewBuilder<St, S> {
    /// Set the `labels` field (optional)
    pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> 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<S>>>) -> Self {
        self._fields.10 = value;
        self
    }
}

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

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

impl<St, S: BosStr> GeneratorViewBuilder<St, S>
where
    St: generator_view_state::State,
    St::Cid: generator_view_state::IsSet,
    St::Creator: generator_view_state::IsSet,
    St::Did: generator_view_state::IsSet,
    St::DisplayName: generator_view_state::IsSet,
    St::IndexedAt: generator_view_state::IsSet,
    St::Uri: generator_view_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> GeneratorView<S> {
        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<SmolStr, Data<S>>,
    ) -> GeneratorView<S> {
        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 NotFound;
        type Uri;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type NotFound = Unset;
        type Uri = Unset;
    }
    ///State transition - sets the `not_found` field to Set
    pub struct SetNotFound<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetNotFound<St> {}
    impl<St: State> State for SetNotFound<St> {
        type NotFound = Set<members::not_found>;
        type Uri = St::Uri;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetUri<St> {}
    impl<St: State> State for SetUri<St> {
        type NotFound = St::NotFound;
        type Uri = Set<members::uri>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `not_found` field
        pub struct not_found(());
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

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

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

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

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

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

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

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

impl<St, S: BosStr> NotFoundPostBuilder<St, S>
where
    St: not_found_post_state::State,
    St::NotFound: not_found_post_state::IsSet,
    St::Uri: not_found_post_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> NotFoundPost<S> {
        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<SmolStr, Data<S>>,
    ) -> NotFoundPost<S> {
        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 Author;
        type Cid;
        type IndexedAt;
        type Record;
        type Uri;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Author = Unset;
        type Cid = Unset;
        type IndexedAt = Unset;
        type Record = Unset;
        type Uri = Unset;
    }
    ///State transition - sets the `author` field to Set
    pub struct SetAuthor<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetAuthor<St> {}
    impl<St: State> State for SetAuthor<St> {
        type Author = Set<members::author>;
        type Cid = St::Cid;
        type IndexedAt = St::IndexedAt;
        type Record = St::Record;
        type Uri = St::Uri;
    }
    ///State transition - sets the `cid` field to Set
    pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCid<St> {}
    impl<St: State> State for SetCid<St> {
        type Author = St::Author;
        type Cid = Set<members::cid>;
        type IndexedAt = St::IndexedAt;
        type Record = St::Record;
        type Uri = St::Uri;
    }
    ///State transition - sets the `indexed_at` field to Set
    pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
    impl<St: State> State for SetIndexedAt<St> {
        type Author = St::Author;
        type Cid = St::Cid;
        type IndexedAt = Set<members::indexed_at>;
        type Record = St::Record;
        type Uri = St::Uri;
    }
    ///State transition - sets the `record` field to Set
    pub struct SetRecord<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetRecord<St> {}
    impl<St: State> State for SetRecord<St> {
        type Author = St::Author;
        type Cid = St::Cid;
        type IndexedAt = St::IndexedAt;
        type Record = Set<members::record>;
        type Uri = St::Uri;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetUri<St> {}
    impl<St: State> State for SetUri<St> {
        type Author = St::Author;
        type Cid = St::Cid;
        type IndexedAt = St::IndexedAt;
        type Record = St::Record;
        type Uri = Set<members::uri>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `author` field
        pub struct author(());
        ///Marker type for the `cid` field
        pub struct cid(());
        ///Marker type for the `indexed_at` field
        pub struct indexed_at(());
        ///Marker type for the `record` field
        pub struct record(());
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

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

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

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

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

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

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

impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, 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<St, S: BosStr> PostViewBuilder<St, S>
where
    St: post_view_state::State,
    St::Cid: post_view_state::IsUnset,
{
    /// Set the `cid` field (required)
    pub fn cid(
        mut self,
        value: impl Into<Cid<S>>,
    ) -> PostViewBuilder<post_view_state::SetCid<St>, S> {
        self._fields.2 = Option::Some(value.into());
        PostViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

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

impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, S> {
    /// Set the `embed` field (optional)
    pub fn embed(mut self, value: impl Into<Option<PostViewEmbed<S>>>) -> 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<S>>) -> Self {
        self._fields.4 = value;
        self
    }
}

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

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

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

impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, 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<St: post_view_state::State, S: BosStr> PostViewBuilder<St, 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<St: post_view_state::State, S: BosStr> PostViewBuilder<St, S> {
    /// Set the `threadgate` field (optional)
    pub fn threadgate(
        mut self,
        value: impl Into<Option<feed::ThreadgateView<S>>>,
    ) -> 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<S>>) -> Self {
        self._fields.12 = value;
        self
    }
}

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

impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, S> {
    /// Set the `viewer` field (optional)
    pub fn viewer(mut self, value: impl Into<Option<feed::ViewerState<S>>>) -> 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<S>>) -> Self {
        self._fields.14 = value;
        self
    }
}

impl<St, S: BosStr> PostViewBuilder<St, S>
where
    St: post_view_state::State,
    St::Author: post_view_state::IsSet,
    St::Cid: post_view_state::IsSet,
    St::IndexedAt: post_view_state::IsSet,
    St::Record: post_view_state::IsSet,
    St::Uri: post_view_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> PostView<S> {
        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<SmolStr, Data<S>>) -> PostView<S> {
        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 By;
        type IndexedAt;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type By = Unset;
        type IndexedAt = Unset;
    }
    ///State transition - sets the `by` field to Set
    pub struct SetBy<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetBy<St> {}
    impl<St: State> State for SetBy<St> {
        type By = Set<members::by>;
        type IndexedAt = St::IndexedAt;
    }
    ///State transition - sets the `indexed_at` field to Set
    pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
    impl<St: State> State for SetIndexedAt<St> {
        type By = St::By;
        type IndexedAt = Set<members::indexed_at>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `by` field
        pub struct by(());
        ///Marker type for the `indexed_at` field
        pub struct indexed_at(());
    }
}

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

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

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

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

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

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

impl<St: reason_repost_state::State, S: BosStr> ReasonRepostBuilder<St, S> {
    /// Set the `cid` field (optional)
    pub fn cid(mut self, value: impl Into<Option<Cid<S>>>) -> 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<S>>) -> Self {
        self._fields.1 = value;
        self
    }
}

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

impl<St: reason_repost_state::State, S: BosStr> ReasonRepostBuilder<St, S> {
    /// Set the `uri` field (optional)
    pub fn uri(mut self, value: impl Into<Option<AtUri<S>>>) -> 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<S>>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<St, S: BosStr> ReasonRepostBuilder<St, S>
where
    St: reason_repost_state::State,
    St::By: reason_repost_state::IsSet,
    St::IndexedAt: reason_repost_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> ReasonRepost<S> {
        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<SmolStr, Data<S>>,
    ) -> ReasonRepost<S> {
        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 Parent;
        type Root;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Parent = Unset;
        type Root = Unset;
    }
    ///State transition - sets the `parent` field to Set
    pub struct SetParent<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetParent<St> {}
    impl<St: State> State for SetParent<St> {
        type Parent = Set<members::parent>;
        type Root = St::Root;
    }
    ///State transition - sets the `root` field to Set
    pub struct SetRoot<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetRoot<St> {}
    impl<St: State> State for SetRoot<St> {
        type Parent = St::Parent;
        type Root = Set<members::root>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `parent` field
        pub struct parent(());
        ///Marker type for the `root` field
        pub struct root(());
    }
}

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

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

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

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

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

impl<St: reply_ref_state::State, S: BosStr> ReplyRefBuilder<St, S> {
    /// Set the `grandparentAuthor` field (optional)
    pub fn grandparent_author(
        mut self,
        value: impl Into<Option<ProfileViewBasic<S>>>,
    ) -> 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<S>>,
    ) -> Self {
        self._fields.0 = value;
        self
    }
}

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

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

impl<St, S: BosStr> ReplyRefBuilder<St, S>
where
    St: reply_ref_state::State,
    St::Parent: reply_ref_state::IsSet,
    St::Root: reply_ref_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> ReplyRef<S> {
        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<SmolStr, Data<S>>) -> ReplyRef<S> {
        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<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetPost<St> {}
    impl<St: State> State for SetPost<St> {
        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<
    St: skeleton_feed_post_state::State,
    S: BosStr = DefaultStr,
> {
    _state: PhantomData<fn() -> St>,
    _fields: (Option<S>, Option<AtUri<S>>, Option<SkeletonFeedPostReason<S>>),
    _type: PhantomData<fn() -> S>,
}

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

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

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

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

impl<St: skeleton_feed_post_state::State, S: BosStr> SkeletonFeedPostBuilder<St, S> {
    /// Set the `feedContext` field (optional)
    pub fn feed_context(mut self, value: impl Into<Option<S>>) -> 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<S>) -> Self {
        self._fields.0 = value;
        self
    }
}

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

impl<St: skeleton_feed_post_state::State, S: BosStr> SkeletonFeedPostBuilder<St, S> {
    /// Set the `reason` field (optional)
    pub fn reason(
        mut self,
        value: impl Into<Option<SkeletonFeedPostReason<S>>>,
    ) -> 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<S>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<St, S: BosStr> SkeletonFeedPostBuilder<St, S>
where
    St: skeleton_feed_post_state::State,
    St::Post: skeleton_feed_post_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> SkeletonFeedPost<S> {
        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<SmolStr, Data<S>>,
    ) -> SkeletonFeedPost<S> {
        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<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetRepost<St> {}
    impl<St: State> State for SetRepost<St> {
        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<
    St: skeleton_reason_repost_state::State,
    S: BosStr = DefaultStr,
> {
    _state: PhantomData<fn() -> St>,
    _fields: (Option<AtUri<S>>,),
    _type: PhantomData<fn() -> S>,
}

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

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

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

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

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

impl<St, S: BosStr> SkeletonReasonRepostBuilder<St, S>
where
    St: skeleton_reason_repost_state::State,
    St::Repost: skeleton_reason_repost_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> SkeletonReasonRepost<S> {
        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<SmolStr, Data<S>>,
    ) -> SkeletonReasonRepost<S> {
        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<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetPost<St> {}
    impl<St: State> State for SetPost<St> {
        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<
    St: thread_view_post_state::State,
    S: BosStr = DefaultStr,
> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<ThreadViewPostParent<S>>,
        Option<feed::PostView<S>>,
        Option<Vec<ThreadViewPostRepliesItem<S>>>,
        Option<feed::ThreadContext<S>>,
    ),
    _type: PhantomData<fn() -> S>,
}

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

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

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

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

impl<St: thread_view_post_state::State, S: BosStr> ThreadViewPostBuilder<St, S> {
    /// Set the `parent` field (optional)
    pub fn parent(mut self, value: impl Into<Option<ThreadViewPostParent<S>>>) -> 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<S>>) -> Self {
        self._fields.0 = value;
        self
    }
}

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

impl<St: thread_view_post_state::State, S: BosStr> ThreadViewPostBuilder<St, S> {
    /// Set the `replies` field (optional)
    pub fn replies(
        mut self,
        value: impl Into<Option<Vec<ThreadViewPostRepliesItem<S>>>>,
    ) -> 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<S>>>,
    ) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<St: thread_view_post_state::State, S: BosStr> ThreadViewPostBuilder<St, S> {
    /// Set the `threadContext` field (optional)
    pub fn thread_context(
        mut self,
        value: impl Into<Option<feed::ThreadContext<S>>>,
    ) -> 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<S>>,
    ) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<St, S: BosStr> ThreadViewPostBuilder<St, S>
where
    St: thread_view_post_state::State,
    St::Post: thread_view_post_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> ThreadViewPost<S> {
        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<SmolStr, Data<S>>,
    ) -> ThreadViewPost<S> {
        ThreadViewPost {
            parent: self._fields.0,
            post: self._fields.1.unwrap(),
            replies: self._fields.2,
            thread_context: self._fields.3,
            extra_data: Some(extra_data),
        }
    }
}