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

//! Generated bindings for the `tech.tokimeki.kaku` Lexicon namespace/module.
pub mod collection;
pub mod collection_item;
pub mod post;
pub mod reaction;
pub mod request;
pub mod request_response;
pub mod room_gate;


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

#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::app_bsky::actor::ProfileViewBasic;
use crate::com_atproto::repo::strong_ref::StrongRef;
use crate::tech_tokimeki::kaku;
/// Width and height representing the aspect ratio of an image

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct AspectRatio<S: BosStr = DefaultStr> {
    ///Height component of aspect ratio
    pub height: i64,
    ///Width component of aspect ratio
    pub width: i64,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// A view of a collection with author profile and item count

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct CollectionView<S: BosStr = DefaultStr> {
    ///Collection owner profile
    pub author: ProfileViewBasic<S>,
    ///CID of the collection record
    pub cid: Cid<S>,
    ///Timestamp when the collection was created
    pub created_at: Datetime,
    ///Collection description
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<S>,
    ///Timestamp when the collection was indexed
    #[serde(skip_serializing_if = "Option::is_none")]
    pub indexed_at: Option<Datetime>,
    ///Whether the collection is publicly visible  Defaults to `true`.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default = "_default_collection_view_is_public")]
    pub is_public: Option<bool>,
    ///Number of items in the collection
    #[serde(skip_serializing_if = "Option::is_none")]
    pub item_count: Option<i64>,
    ///Collection name
    pub name: S,
    ///AT-URI of the collection record
    pub uri: AtUri<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// A view of a drawing post with author profile and metadata

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct PostView<S: BosStr = DefaultStr> {
    ///Aspect ratio of the image
    pub aspect_ratio: kaku::AspectRatio<S>,
    ///Author profile
    pub author: ProfileViewBasic<S>,
    ///CID of the post record
    pub cid: Cid<S>,
    ///Timestamp when the post was created
    pub created_at: Datetime,
    ///URL of the drawing image
    pub image: UriValue<S>,
    ///Timestamp when the post was indexed
    #[serde(skip_serializing_if = "Option::is_none")]
    pub indexed_at: Option<Datetime>,
    ///Reference to linked Bluesky post
    #[serde(skip_serializing_if = "Option::is_none")]
    pub linked_post: Option<StrongRef<S>>,
    ///Counts of each reaction type
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reaction_counts: Option<kaku::ReactionCounts<S>>,
    ///Tags for categorization
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<S>>,
    ///Optional description or title
    #[serde(skip_serializing_if = "Option::is_none")]
    pub text: Option<S>,
    ///AT-URI of the post record
    pub uri: AtUri<S>,
    ///Current user's reaction to this post
    #[serde(skip_serializing_if = "Option::is_none")]
    pub viewer_reaction: Option<kaku::ReactionType<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// Counts of each reaction type on a post

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ReactionCounts<S: BosStr = DefaultStr> {
    ///Count of kami (godly) reactions  Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default = "_default_reaction_counts_kami")]
    pub kami: Option<i64>,
    ///Count of kawaii (cute) reactions  Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default = "_default_reaction_counts_kawaii")]
    pub kawaii: Option<i64>,
    ///Count of sugoi (amazing) reactions  Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default = "_default_reaction_counts_sugoi")]
    pub sugoi: Option<i64>,
    ///Count of suki (like) reactions  Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default = "_default_reaction_counts_suki")]
    pub suki: Option<i64>,
    ///Count of tasukaru (helpful) reactions  Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default = "_default_reaction_counts_tasukaru")]
    pub tasukaru: Option<i64>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// Type of reaction to a post

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ReactionType<S: BosStr = DefaultStr> {
    Suki,
    Tasukaru,
    Sugoi,
    Kawaii,
    Kami,
    Other(S),
}

impl<S: BosStr> ReactionType<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Suki => "suki",
            Self::Tasukaru => "tasukaru",
            Self::Sugoi => "sugoi",
            Self::Kawaii => "kawaii",
            Self::Kami => "kami",
            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() {
            "suki" => Self::Suki,
            "tasukaru" => Self::Tasukaru,
            "sugoi" => Self::Sugoi,
            "kawaii" => Self::Kawaii,
            "kami" => Self::Kami,
            _ => Self::Other(s),
        }
    }
}

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

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

impl<S: BosStr> Serialize for ReactionType<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 ReactionType<S> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = S::deserialize(deserializer)?;
        Ok(Self::from_value(s))
    }
}

impl<S: BosStr> jacquard_common::IntoStatic for ReactionType<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = ReactionType<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            ReactionType::Suki => ReactionType::Suki,
            ReactionType::Tasukaru => ReactionType::Tasukaru,
            ReactionType::Sugoi => ReactionType::Sugoi,
            ReactionType::Kawaii => ReactionType::Kawaii,
            ReactionType::Kami => ReactionType::Kami,
            ReactionType::Other(v) => ReactionType::Other(v.into_static()),
        }
    }
}

/// A view of a Bluesky reply to a linked post

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ReplyView<S: BosStr = DefaultStr> {
    ///Reply author profile
    pub author: ProfileViewBasic<S>,
    ///CID of the Bluesky reply
    pub cid: Cid<S>,
    ///Timestamp when the reply was created
    pub created_at: Datetime,
    ///Reply text content
    pub text: S,
    ///AT-URI of the Bluesky reply
    pub uri: AtUri<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// A view of a response to a drawing request

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct RequestResponseView<S: BosStr = DefaultStr> {
    ///Response author profile
    pub author: ProfileViewBasic<S>,
    ///CID of the response record
    pub cid: Cid<S>,
    ///Timestamp when the response was created
    pub created_at: Datetime,
    ///Optional message to the requester
    #[serde(skip_serializing_if = "Option::is_none")]
    pub message: Option<S>,
    ///The drawing post submitted as response
    pub post: kaku::PostView<S>,
    ///AT-URI of the response record
    pub uri: AtUri<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// A view of a drawing request with author profile and response count

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct RequestView<S: BosStr = DefaultStr> {
    ///Request author profile
    pub author: ProfileViewBasic<S>,
    ///CID of the request record
    pub cid: Cid<S>,
    ///Timestamp when the request was created
    pub created_at: Datetime,
    ///Timestamp when the request was indexed
    #[serde(skip_serializing_if = "Option::is_none")]
    pub indexed_at: Option<Datetime>,
    ///Whether the request is still accepting responses
    pub is_open: bool,
    ///URLs of reference images for the request
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reference_images: Option<Vec<UriValue<S>>>,
    ///Number of responses to this request
    #[serde(skip_serializing_if = "Option::is_none")]
    pub response_count: Option<i64>,
    ///Tags for categorization
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<S>>,
    ///Specific artist the request is directed to
    #[serde(skip_serializing_if = "Option::is_none")]
    pub target_actor: Option<ProfileViewBasic<S>>,
    ///Description of what to draw
    pub text: S,
    ///AT-URI of the request record
    pub uri: AtUri<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

impl<S: BosStr> LexiconSchema for AspectRatio<S> {
    fn nsid() -> &'static str {
        "tech.tokimeki.kaku.defs"
    }
    fn def_name() -> &'static str {
        "aspectRatio"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_tech_tokimeki_kaku_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        {
            let value = &self.height;
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("height"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        {
            let value = &self.width;
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("width"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for CollectionView<S> {
    fn nsid() -> &'static str {
        "tech.tokimeki.kaku.defs"
    }
    fn def_name() -> &'static str {
        "collectionView"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_tech_tokimeki_kaku_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.description {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("description"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.description {
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 200usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("description"),
                        max: 200usize,
                        actual: count,
                    });
                }
            }
        }
        {
            let value = &self.name;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("name"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.name;
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 50usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("name"),
                        max: 50usize,
                        actual: count,
                    });
                }
            }
        }
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for PostView<S> {
    fn nsid() -> &'static str {
        "tech.tokimeki.kaku.defs"
    }
    fn def_name() -> &'static str {
        "postView"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_tech_tokimeki_kaku_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.tags {
            #[allow(unused_comparisons)]
            if value.len() > 8usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("tags"),
                    max: 8usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.text {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 1000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("text"),
                    max: 1000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.text {
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 300usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("text"),
                        max: 300usize,
                        actual: count,
                    });
                }
            }
        }
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for ReactionCounts<S> {
    fn nsid() -> &'static str {
        "tech.tokimeki.kaku.defs"
    }
    fn def_name() -> &'static str {
        "reactionCounts"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_tech_tokimeki_kaku_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for ReplyView<S> {
    fn nsid() -> &'static str {
        "tech.tokimeki.kaku.defs"
    }
    fn def_name() -> &'static str {
        "replyView"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_tech_tokimeki_kaku_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        {
            let value = &self.text;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 3000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("text"),
                    max: 3000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.text;
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 300usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("text"),
                        max: 300usize,
                        actual: count,
                    });
                }
            }
        }
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for RequestResponseView<S> {
    fn nsid() -> &'static str {
        "tech.tokimeki.kaku.defs"
    }
    fn def_name() -> &'static str {
        "requestResponseView"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_tech_tokimeki_kaku_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.message {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("message"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.message {
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 150usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("message"),
                        max: 150usize,
                        actual: count,
                    });
                }
            }
        }
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for RequestView<S> {
    fn nsid() -> &'static str {
        "tech.tokimeki.kaku.defs"
    }
    fn def_name() -> &'static str {
        "requestView"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_tech_tokimeki_kaku_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.reference_images {
            #[allow(unused_comparisons)]
            if value.len() > 4usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("reference_images"),
                    max: 4usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.tags {
            #[allow(unused_comparisons)]
            if value.len() > 8usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("tags"),
                    max: 8usize,
                    actual: value.len(),
                });
            }
        }
        {
            let value = &self.text;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 1000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("text"),
                    max: 1000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.text;
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 300usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("text"),
                        max: 300usize,
                        actual: count,
                    });
                }
            }
        }
        Ok(())
    }
}

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

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

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

impl<S: BosStr> AspectRatio<S> {
    /// Create a new builder for this type
    pub fn builder() -> AspectRatioBuilder<aspect_ratio_state::Empty, S> {
        AspectRatioBuilder::builder()
    }
}

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

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

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

impl<St, S: BosStr> AspectRatioBuilder<St, S>
where
    St: aspect_ratio_state::State,
    St::Width: aspect_ratio_state::IsUnset,
{
    /// Set the `width` field (required)
    pub fn width(
        mut self,
        value: impl Into<i64>,
    ) -> AspectRatioBuilder<aspect_ratio_state::SetWidth<St>, S> {
        self._fields.1 = Option::Some(value.into());
        AspectRatioBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> AspectRatioBuilder<St, S>
where
    St: aspect_ratio_state::State,
    St::Height: aspect_ratio_state::IsSet,
    St::Width: aspect_ratio_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> AspectRatio<S> {
        AspectRatio {
            height: self._fields.0.unwrap(),
            width: 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>>,
    ) -> AspectRatio<S> {
        AspectRatio {
            height: self._fields.0.unwrap(),
            width: self._fields.1.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

fn lexicon_doc_tech_tokimeki_kaku_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("tech.tokimeki.kaku.defs"),
        defs: {
            let mut map = BTreeMap::new();
            map.insert(
                SmolStr::new_static("aspectRatio"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Width and height representing the aspect ratio of an image",
                        ),
                    ),
                    required: Some(
                        vec![SmolStr::new_static("width"), SmolStr::new_static("height")],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("height"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("width"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("collectionView"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "A view of a collection with author profile and item count",
                        ),
                    ),
                    required: Some(
                        vec![
                            SmolStr::new_static("uri"), SmolStr::new_static("cid"),
                            SmolStr::new_static("author"), SmolStr::new_static("name"),
                            SmolStr::new_static("createdAt")
                        ],
                    ),
                    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("cid"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("CID of the collection record"),
                                ),
                                format: Some(LexStringFormat::Cid),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("createdAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Timestamp when the collection was created",
                                    ),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("description"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Collection description"),
                                ),
                                max_length: Some(500usize),
                                max_graphemes: Some(200usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("indexedAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Timestamp when the collection was indexed",
                                    ),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("isPublic"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("itemCount"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("name"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Collection name")),
                                max_length: Some(100usize),
                                max_graphemes: Some(50usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("AT-URI of the collection record"),
                                ),
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("postView"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "A view of a drawing post with author profile and metadata",
                        ),
                    ),
                    required: Some(
                        vec![
                            SmolStr::new_static("uri"), SmolStr::new_static("cid"),
                            SmolStr::new_static("author"), SmolStr::new_static("image"),
                            SmolStr::new_static("aspectRatio"),
                            SmolStr::new_static("createdAt")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("aspectRatio"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#aspectRatio"),
                                ..Default::default()
                            }),
                        );
                        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("cid"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("CID of the post record"),
                                ),
                                format: Some(LexStringFormat::Cid),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("createdAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Timestamp when the post was created"),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("image"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("URL of the drawing image"),
                                ),
                                format: Some(LexStringFormat::Uri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("indexedAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Timestamp when the post was indexed"),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("linkedPost"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("com.atproto.repo.strongRef"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("reactionCounts"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#reactionCounts"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("tags"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static("Tags for categorization"),
                                ),
                                items: LexArrayItem::String(LexString {
                                    max_length: Some(64usize),
                                    max_graphemes: Some(32usize),
                                    ..Default::default()
                                }),
                                max_length: Some(8usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("text"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Optional description or title"),
                                ),
                                max_length: Some(1000usize),
                                max_graphemes: Some(300usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("AT-URI of the post record"),
                                ),
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("viewerReaction"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#reactionType"),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("reactionCounts"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Counts of each reaction type on a post"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("kami"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("kawaii"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("sugoi"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("suki"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("tasukaru"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("reactionType"),
                LexUserType::String(LexString {
                    description: Some(CowStr::new_static("Type of reaction to a post")),
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("replyView"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("A view of a Bluesky reply to a linked post"),
                    ),
                    required: Some(
                        vec![
                            SmolStr::new_static("uri"), SmolStr::new_static("cid"),
                            SmolStr::new_static("author"), SmolStr::new_static("text"),
                            SmolStr::new_static("createdAt")
                        ],
                    ),
                    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("cid"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("CID of the Bluesky reply"),
                                ),
                                format: Some(LexStringFormat::Cid),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("createdAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Timestamp when the reply was created"),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("text"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Reply text content")),
                                max_length: Some(3000usize),
                                max_graphemes: Some(300usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("AT-URI of the Bluesky reply"),
                                ),
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("requestResponseView"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("A view of a response to a drawing request"),
                    ),
                    required: Some(
                        vec![
                            SmolStr::new_static("uri"), SmolStr::new_static("cid"),
                            SmolStr::new_static("author"), SmolStr::new_static("post"),
                            SmolStr::new_static("createdAt")
                        ],
                    ),
                    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("cid"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("CID of the response record"),
                                ),
                                format: Some(LexStringFormat::Cid),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("createdAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Timestamp when the response was created",
                                    ),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("message"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Optional message to the requester"),
                                ),
                                max_length: Some(500usize),
                                max_graphemes: Some(150usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("post"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#postView"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("AT-URI of the response record"),
                                ),
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("requestView"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "A view of a drawing request with author profile and response count",
                        ),
                    ),
                    required: Some(
                        vec![
                            SmolStr::new_static("uri"), SmolStr::new_static("cid"),
                            SmolStr::new_static("author"), SmolStr::new_static("text"),
                            SmolStr::new_static("isOpen"),
                            SmolStr::new_static("createdAt")
                        ],
                    ),
                    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("cid"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("CID of the request record"),
                                ),
                                format: Some(LexStringFormat::Cid),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("createdAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Timestamp when the request was created"),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("indexedAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Timestamp when the request was indexed"),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("isOpen"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("referenceImages"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static(
                                        "URLs of reference images for the request",
                                    ),
                                ),
                                items: LexArrayItem::String(LexString {
                                    format: Some(LexStringFormat::Uri),
                                    ..Default::default()
                                }),
                                max_length: Some(4usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("responseCount"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("tags"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static("Tags for categorization"),
                                ),
                                items: LexArrayItem::String(LexString {
                                    max_length: Some(64usize),
                                    max_graphemes: Some(32usize),
                                    ..Default::default()
                                }),
                                max_length: Some(8usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("targetActor"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static(
                                    "app.bsky.actor.defs#profileViewBasic",
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("text"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Description of what to draw"),
                                ),
                                max_length: Some(1000usize),
                                max_graphemes: Some(300usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("AT-URI of the request record"),
                                ),
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map
        },
        ..Default::default()
    }
}

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

pub mod collection_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 CreatedAt;
        type Name;
        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 CreatedAt = Unset;
        type Name = 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 CreatedAt = St::CreatedAt;
        type Name = St::Name;
        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 CreatedAt = St::CreatedAt;
        type Name = St::Name;
        type Uri = St::Uri;
    }
    ///State transition - sets the `created_at` field to Set
    pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
    impl<St: State> State for SetCreatedAt<St> {
        type Author = St::Author;
        type Cid = St::Cid;
        type CreatedAt = Set<members::created_at>;
        type Name = St::Name;
        type Uri = St::Uri;
    }
    ///State transition - sets the `name` field to Set
    pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetName<St> {}
    impl<St: State> State for SetName<St> {
        type Author = St::Author;
        type Cid = St::Cid;
        type CreatedAt = St::CreatedAt;
        type Name = Set<members::name>;
        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 CreatedAt = St::CreatedAt;
        type Name = St::Name;
        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 `created_at` field
        pub struct created_at(());
        ///Marker type for the `name` field
        pub struct name(());
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

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

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

impl<S: BosStr> CollectionView<S> {
    /// Create a new builder for this type
    pub fn builder() -> CollectionViewBuilder<collection_view_state::Empty, S> {
        CollectionViewBuilder::builder()
    }
}

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

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

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

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

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

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

impl<St: collection_view_state::State, S: BosStr> CollectionViewBuilder<St, S> {
    /// Set the `indexedAt` field (optional)
    pub fn indexed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `indexedAt` field to an Option value (optional)
    pub fn maybe_indexed_at(mut self, value: Option<Datetime>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<St: collection_view_state::State, S: BosStr> CollectionViewBuilder<St, S> {
    /// Set the `isPublic` field (optional)
    pub fn is_public(mut self, value: impl Into<Option<bool>>) -> Self {
        self._fields.5 = value.into();
        self
    }
    /// Set the `isPublic` field to an Option value (optional)
    pub fn maybe_is_public(mut self, value: Option<bool>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<St: collection_view_state::State, S: BosStr> CollectionViewBuilder<St, S> {
    /// Set the `itemCount` field (optional)
    pub fn item_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `itemCount` field to an Option value (optional)
    pub fn maybe_item_count(mut self, value: Option<i64>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<St, S: BosStr> CollectionViewBuilder<St, S>
where
    St: collection_view_state::State,
    St::Name: collection_view_state::IsUnset,
{
    /// Set the `name` field (required)
    pub fn name(
        mut self,
        value: impl Into<S>,
    ) -> CollectionViewBuilder<collection_view_state::SetName<St>, S> {
        self._fields.7 = Option::Some(value.into());
        CollectionViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

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

impl<St, S: BosStr> CollectionViewBuilder<St, S>
where
    St: collection_view_state::State,
    St::Author: collection_view_state::IsSet,
    St::Cid: collection_view_state::IsSet,
    St::CreatedAt: collection_view_state::IsSet,
    St::Name: collection_view_state::IsSet,
    St::Uri: collection_view_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> CollectionView<S> {
        CollectionView {
            author: self._fields.0.unwrap(),
            cid: self._fields.1.unwrap(),
            created_at: self._fields.2.unwrap(),
            description: self._fields.3,
            indexed_at: self._fields.4,
            is_public: self._fields.5.or_else(|| Some(true)),
            item_count: self._fields.6,
            name: self._fields.7.unwrap(),
            uri: self._fields.8.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> CollectionView<S> {
        CollectionView {
            author: self._fields.0.unwrap(),
            cid: self._fields.1.unwrap(),
            created_at: self._fields.2.unwrap(),
            description: self._fields.3,
            indexed_at: self._fields.4,
            is_public: self._fields.5.or_else(|| Some(true)),
            item_count: self._fields.6,
            name: self._fields.7.unwrap(),
            uri: self._fields.8.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 AspectRatio;
        type Author;
        type Cid;
        type CreatedAt;
        type Image;
        type Uri;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type AspectRatio = Unset;
        type Author = Unset;
        type Cid = Unset;
        type CreatedAt = Unset;
        type Image = Unset;
        type Uri = Unset;
    }
    ///State transition - sets the `aspect_ratio` field to Set
    pub struct SetAspectRatio<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetAspectRatio<St> {}
    impl<St: State> State for SetAspectRatio<St> {
        type AspectRatio = Set<members::aspect_ratio>;
        type Author = St::Author;
        type Cid = St::Cid;
        type CreatedAt = St::CreatedAt;
        type Image = St::Image;
        type Uri = St::Uri;
    }
    ///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 AspectRatio = St::AspectRatio;
        type Author = Set<members::author>;
        type Cid = St::Cid;
        type CreatedAt = St::CreatedAt;
        type Image = St::Image;
        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 AspectRatio = St::AspectRatio;
        type Author = St::Author;
        type Cid = Set<members::cid>;
        type CreatedAt = St::CreatedAt;
        type Image = St::Image;
        type Uri = St::Uri;
    }
    ///State transition - sets the `created_at` field to Set
    pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
    impl<St: State> State for SetCreatedAt<St> {
        type AspectRatio = St::AspectRatio;
        type Author = St::Author;
        type Cid = St::Cid;
        type CreatedAt = Set<members::created_at>;
        type Image = St::Image;
        type Uri = St::Uri;
    }
    ///State transition - sets the `image` field to Set
    pub struct SetImage<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetImage<St> {}
    impl<St: State> State for SetImage<St> {
        type AspectRatio = St::AspectRatio;
        type Author = St::Author;
        type Cid = St::Cid;
        type CreatedAt = St::CreatedAt;
        type Image = Set<members::image>;
        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 AspectRatio = St::AspectRatio;
        type Author = St::Author;
        type Cid = St::Cid;
        type CreatedAt = St::CreatedAt;
        type Image = St::Image;
        type Uri = Set<members::uri>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `aspect_ratio` field
        pub struct aspect_ratio(());
        ///Marker type for the `author` field
        pub struct author(());
        ///Marker type for the `cid` field
        pub struct cid(());
        ///Marker type for the `created_at` field
        pub struct created_at(());
        ///Marker type for the `image` field
        pub struct image(());
        ///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<kaku::AspectRatio<S>>,
        Option<ProfileViewBasic<S>>,
        Option<Cid<S>>,
        Option<Datetime>,
        Option<UriValue<S>>,
        Option<Datetime>,
        Option<StrongRef<S>>,
        Option<kaku::ReactionCounts<S>>,
        Option<Vec<S>>,
        Option<S>,
        Option<AtUri<S>>,
        Option<kaku::ReactionType<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,
            ),
            _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,
            ),
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> PostViewBuilder<St, S>
where
    St: post_view_state::State,
    St::AspectRatio: post_view_state::IsUnset,
{
    /// Set the `aspectRatio` field (required)
    pub fn aspect_ratio(
        mut self,
        value: impl Into<kaku::AspectRatio<S>>,
    ) -> PostViewBuilder<post_view_state::SetAspectRatio<St>, S> {
        self._fields.0 = Option::Some(value.into());
        PostViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _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.1 = Option::Some(value.into());
        PostViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

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

impl<St, S: BosStr> PostViewBuilder<St, S>
where
    St: post_view_state::State,
    St::Image: post_view_state::IsUnset,
{
    /// Set the `image` field (required)
    pub fn image(
        mut self,
        value: impl Into<UriValue<S>>,
    ) -> PostViewBuilder<post_view_state::SetImage<St>, S> {
        self._fields.4 = 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 `indexedAt` field (optional)
    pub fn indexed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.5 = value.into();
        self
    }
    /// Set the `indexedAt` field to an Option value (optional)
    pub fn maybe_indexed_at(mut self, value: Option<Datetime>) -> Self {
        self._fields.5 = value;
        self
    }
}

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

impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, S> {
    /// Set the `reactionCounts` field (optional)
    pub fn reaction_counts(
        mut self,
        value: impl Into<Option<kaku::ReactionCounts<S>>>,
    ) -> Self {
        self._fields.7 = value.into();
        self
    }
    /// Set the `reactionCounts` field to an Option value (optional)
    pub fn maybe_reaction_counts(
        mut self,
        value: Option<kaku::ReactionCounts<S>>,
    ) -> Self {
        self._fields.7 = value;
        self
    }
}

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

impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, S> {
    /// Set the `text` field (optional)
    pub fn text(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.9 = value.into();
        self
    }
    /// Set the `text` field to an Option value (optional)
    pub fn maybe_text(mut self, value: Option<S>) -> Self {
        self._fields.9 = 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.10 = 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 `viewerReaction` field (optional)
    pub fn viewer_reaction(
        mut self,
        value: impl Into<Option<kaku::ReactionType<S>>>,
    ) -> Self {
        self._fields.11 = value.into();
        self
    }
    /// Set the `viewerReaction` field to an Option value (optional)
    pub fn maybe_viewer_reaction(
        mut self,
        value: Option<kaku::ReactionType<S>>,
    ) -> Self {
        self._fields.11 = value;
        self
    }
}

impl<St, S: BosStr> PostViewBuilder<St, S>
where
    St: post_view_state::State,
    St::AspectRatio: post_view_state::IsSet,
    St::Author: post_view_state::IsSet,
    St::Cid: post_view_state::IsSet,
    St::CreatedAt: post_view_state::IsSet,
    St::Image: post_view_state::IsSet,
    St::Uri: post_view_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> PostView<S> {
        PostView {
            aspect_ratio: self._fields.0.unwrap(),
            author: self._fields.1.unwrap(),
            cid: self._fields.2.unwrap(),
            created_at: self._fields.3.unwrap(),
            image: self._fields.4.unwrap(),
            indexed_at: self._fields.5,
            linked_post: self._fields.6,
            reaction_counts: self._fields.7,
            tags: self._fields.8,
            text: self._fields.9,
            uri: self._fields.10.unwrap(),
            viewer_reaction: self._fields.11,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> PostView<S> {
        PostView {
            aspect_ratio: self._fields.0.unwrap(),
            author: self._fields.1.unwrap(),
            cid: self._fields.2.unwrap(),
            created_at: self._fields.3.unwrap(),
            image: self._fields.4.unwrap(),
            indexed_at: self._fields.5,
            linked_post: self._fields.6,
            reaction_counts: self._fields.7,
            tags: self._fields.8,
            text: self._fields.9,
            uri: self._fields.10.unwrap(),
            viewer_reaction: self._fields.11,
            extra_data: Some(extra_data),
        }
    }
}

fn _default_reaction_counts_kami() -> Option<i64> {
    Some(0i64)
}

fn _default_reaction_counts_kawaii() -> Option<i64> {
    Some(0i64)
}

fn _default_reaction_counts_sugoi() -> Option<i64> {
    Some(0i64)
}

fn _default_reaction_counts_suki() -> Option<i64> {
    Some(0i64)
}

fn _default_reaction_counts_tasukaru() -> Option<i64> {
    Some(0i64)
}

impl Default for ReactionCounts {
    fn default() -> Self {
        Self {
            kami: Some(0i64),
            kawaii: Some(0i64),
            sugoi: Some(0i64),
            suki: Some(0i64),
            tasukaru: Some(0i64),
            extra_data: Default::default(),
        }
    }
}

pub mod reply_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 CreatedAt;
        type Text;
        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 CreatedAt = Unset;
        type Text = 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 CreatedAt = St::CreatedAt;
        type Text = St::Text;
        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 CreatedAt = St::CreatedAt;
        type Text = St::Text;
        type Uri = St::Uri;
    }
    ///State transition - sets the `created_at` field to Set
    pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
    impl<St: State> State for SetCreatedAt<St> {
        type Author = St::Author;
        type Cid = St::Cid;
        type CreatedAt = Set<members::created_at>;
        type Text = St::Text;
        type Uri = St::Uri;
    }
    ///State transition - sets the `text` field to Set
    pub struct SetText<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetText<St> {}
    impl<St: State> State for SetText<St> {
        type Author = St::Author;
        type Cid = St::Cid;
        type CreatedAt = St::CreatedAt;
        type Text = Set<members::text>;
        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 CreatedAt = St::CreatedAt;
        type Text = St::Text;
        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 `created_at` field
        pub struct created_at(());
        ///Marker type for the `text` field
        pub struct text(());
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

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

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

impl<S: BosStr> ReplyView<S> {
    /// Create a new builder for this type
    pub fn builder() -> ReplyViewBuilder<reply_view_state::Empty, S> {
        ReplyViewBuilder::builder()
    }
}

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

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

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

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

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

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

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

impl<St, S: BosStr> ReplyViewBuilder<St, S>
where
    St: reply_view_state::State,
    St::Author: reply_view_state::IsSet,
    St::Cid: reply_view_state::IsSet,
    St::CreatedAt: reply_view_state::IsSet,
    St::Text: reply_view_state::IsSet,
    St::Uri: reply_view_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> ReplyView<S> {
        ReplyView {
            author: self._fields.0.unwrap(),
            cid: self._fields.1.unwrap(),
            created_at: self._fields.2.unwrap(),
            text: self._fields.3.unwrap(),
            uri: self._fields.4.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> ReplyView<S> {
        ReplyView {
            author: self._fields.0.unwrap(),
            cid: self._fields.1.unwrap(),
            created_at: self._fields.2.unwrap(),
            text: self._fields.3.unwrap(),
            uri: self._fields.4.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod request_response_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 CreatedAt;
        type Post;
        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 CreatedAt = Unset;
        type Post = 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 CreatedAt = St::CreatedAt;
        type Post = St::Post;
        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 CreatedAt = St::CreatedAt;
        type Post = St::Post;
        type Uri = St::Uri;
    }
    ///State transition - sets the `created_at` field to Set
    pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
    impl<St: State> State for SetCreatedAt<St> {
        type Author = St::Author;
        type Cid = St::Cid;
        type CreatedAt = Set<members::created_at>;
        type Post = St::Post;
        type Uri = St::Uri;
    }
    ///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 Author = St::Author;
        type Cid = St::Cid;
        type CreatedAt = St::CreatedAt;
        type Post = Set<members::post>;
        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 CreatedAt = St::CreatedAt;
        type Post = St::Post;
        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 `created_at` field
        pub struct created_at(());
        ///Marker type for the `post` field
        pub struct post(());
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

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

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

impl<S: BosStr> RequestResponseView<S> {
    /// Create a new builder for this type
    pub fn builder() -> RequestResponseViewBuilder<
        request_response_view_state::Empty,
        S,
    > {
        RequestResponseViewBuilder::builder()
    }
}

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

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

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

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

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

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

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

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

impl<St, S: BosStr> RequestResponseViewBuilder<St, S>
where
    St: request_response_view_state::State,
    St::Author: request_response_view_state::IsSet,
    St::Cid: request_response_view_state::IsSet,
    St::CreatedAt: request_response_view_state::IsSet,
    St::Post: request_response_view_state::IsSet,
    St::Uri: request_response_view_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> RequestResponseView<S> {
        RequestResponseView {
            author: self._fields.0.unwrap(),
            cid: self._fields.1.unwrap(),
            created_at: self._fields.2.unwrap(),
            message: self._fields.3,
            post: self._fields.4.unwrap(),
            uri: self._fields.5.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> RequestResponseView<S> {
        RequestResponseView {
            author: self._fields.0.unwrap(),
            cid: self._fields.1.unwrap(),
            created_at: self._fields.2.unwrap(),
            message: self._fields.3,
            post: self._fields.4.unwrap(),
            uri: self._fields.5.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod request_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 CreatedAt;
        type IsOpen;
        type Text;
        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 CreatedAt = Unset;
        type IsOpen = Unset;
        type Text = 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 CreatedAt = St::CreatedAt;
        type IsOpen = St::IsOpen;
        type Text = St::Text;
        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 CreatedAt = St::CreatedAt;
        type IsOpen = St::IsOpen;
        type Text = St::Text;
        type Uri = St::Uri;
    }
    ///State transition - sets the `created_at` field to Set
    pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
    impl<St: State> State for SetCreatedAt<St> {
        type Author = St::Author;
        type Cid = St::Cid;
        type CreatedAt = Set<members::created_at>;
        type IsOpen = St::IsOpen;
        type Text = St::Text;
        type Uri = St::Uri;
    }
    ///State transition - sets the `is_open` field to Set
    pub struct SetIsOpen<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetIsOpen<St> {}
    impl<St: State> State for SetIsOpen<St> {
        type Author = St::Author;
        type Cid = St::Cid;
        type CreatedAt = St::CreatedAt;
        type IsOpen = Set<members::is_open>;
        type Text = St::Text;
        type Uri = St::Uri;
    }
    ///State transition - sets the `text` field to Set
    pub struct SetText<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetText<St> {}
    impl<St: State> State for SetText<St> {
        type Author = St::Author;
        type Cid = St::Cid;
        type CreatedAt = St::CreatedAt;
        type IsOpen = St::IsOpen;
        type Text = Set<members::text>;
        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 CreatedAt = St::CreatedAt;
        type IsOpen = St::IsOpen;
        type Text = St::Text;
        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 `created_at` field
        pub struct created_at(());
        ///Marker type for the `is_open` field
        pub struct is_open(());
        ///Marker type for the `text` field
        pub struct text(());
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

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

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

impl<S: BosStr> RequestView<S> {
    /// Create a new builder for this type
    pub fn builder() -> RequestViewBuilder<request_view_state::Empty, S> {
        RequestViewBuilder::builder()
    }
}

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

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

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

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

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

impl<St: request_view_state::State, S: BosStr> RequestViewBuilder<St, S> {
    /// Set the `indexedAt` field (optional)
    pub fn indexed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `indexedAt` field to an Option value (optional)
    pub fn maybe_indexed_at(mut self, value: Option<Datetime>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<St, S: BosStr> RequestViewBuilder<St, S>
where
    St: request_view_state::State,
    St::IsOpen: request_view_state::IsUnset,
{
    /// Set the `isOpen` field (required)
    pub fn is_open(
        mut self,
        value: impl Into<bool>,
    ) -> RequestViewBuilder<request_view_state::SetIsOpen<St>, S> {
        self._fields.4 = Option::Some(value.into());
        RequestViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: request_view_state::State, S: BosStr> RequestViewBuilder<St, S> {
    /// Set the `referenceImages` field (optional)
    pub fn reference_images(
        mut self,
        value: impl Into<Option<Vec<UriValue<S>>>>,
    ) -> Self {
        self._fields.5 = value.into();
        self
    }
    /// Set the `referenceImages` field to an Option value (optional)
    pub fn maybe_reference_images(mut self, value: Option<Vec<UriValue<S>>>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<St: request_view_state::State, S: BosStr> RequestViewBuilder<St, S> {
    /// Set the `responseCount` field (optional)
    pub fn response_count(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `responseCount` field to an Option value (optional)
    pub fn maybe_response_count(mut self, value: Option<i64>) -> Self {
        self._fields.6 = value;
        self
    }
}

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

impl<St: request_view_state::State, S: BosStr> RequestViewBuilder<St, S> {
    /// Set the `targetActor` field (optional)
    pub fn target_actor(
        mut self,
        value: impl Into<Option<ProfileViewBasic<S>>>,
    ) -> Self {
        self._fields.8 = value.into();
        self
    }
    /// Set the `targetActor` field to an Option value (optional)
    pub fn maybe_target_actor(mut self, value: Option<ProfileViewBasic<S>>) -> Self {
        self._fields.8 = value;
        self
    }
}

impl<St, S: BosStr> RequestViewBuilder<St, S>
where
    St: request_view_state::State,
    St::Text: request_view_state::IsUnset,
{
    /// Set the `text` field (required)
    pub fn text(
        mut self,
        value: impl Into<S>,
    ) -> RequestViewBuilder<request_view_state::SetText<St>, S> {
        self._fields.9 = Option::Some(value.into());
        RequestViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

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

impl<St, S: BosStr> RequestViewBuilder<St, S>
where
    St: request_view_state::State,
    St::Author: request_view_state::IsSet,
    St::Cid: request_view_state::IsSet,
    St::CreatedAt: request_view_state::IsSet,
    St::IsOpen: request_view_state::IsSet,
    St::Text: request_view_state::IsSet,
    St::Uri: request_view_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> RequestView<S> {
        RequestView {
            author: self._fields.0.unwrap(),
            cid: self._fields.1.unwrap(),
            created_at: self._fields.2.unwrap(),
            indexed_at: self._fields.3,
            is_open: self._fields.4.unwrap(),
            reference_images: self._fields.5,
            response_count: self._fields.6,
            tags: self._fields.7,
            target_actor: self._fields.8,
            text: self._fields.9.unwrap(),
            uri: self._fields.10.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> RequestView<S> {
        RequestView {
            author: self._fields.0.unwrap(),
            cid: self._fields.1.unwrap(),
            created_at: self._fields.2.unwrap(),
            indexed_at: self._fields.3,
            is_open: self._fields.4.unwrap(),
            reference_images: self._fields.5,
            response_count: self._fields.6,
            tags: self._fields.7,
            target_actor: self._fields.8,
            text: self._fields.9.unwrap(),
            uri: self._fields.10.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}