// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: social.flockfeeds.lexical.type.Brand
//
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.

#[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::collection::{Collection, RecordError};
use jacquard_common::types::string::{AtUri, Cid};
use jacquard_common::types::uri::{RecordUri, UriError};
use jacquard_common::types::value::Data;
use jacquard_common::xrpc::XrpcResp;
use jacquard_derive::{IntoStatic, lexicon, open_union};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;

#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::social_flockfeeds::lexical::r#type::event;
use crate::social_flockfeeds::lexical::r#type::image_object;
/// A brand is a name used by an organization or business person for labeling a product, product group, or similar.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Embedded<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub additional_type: Option<EmbeddedAdditionalType<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub aggregate_rating: Option<EmbeddedAggregateRating<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub alternate_name: Option<EmbeddedAlternateName<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<EmbeddedDescription<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub disambiguating_description: Option<EmbeddedDisambiguatingDescription<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub identifier: Option<EmbeddedIdentifier<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub image: Option<EmbeddedImage<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub logo: Option<EmbeddedLogo<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub main_entity_of_page: Option<EmbeddedMainEntityOfPage<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<EmbeddedName<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub potential_action: Option<EmbeddedPotentialAction<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub review: Option<EmbeddedReview<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub same_as: Option<EmbeddedSameAs<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub slogan: Option<EmbeddedSlogan<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub subject_of: Option<EmbeddedSubjectOf<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub url: Option<EmbeddedUrl<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


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

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

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

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

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

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

#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum EmbeddedImage<S: BosStr = DefaultStr> {
    #[serde(rename = "social.flockfeeds.lexical.type.ImageObject#embedded")]
    ImageObjectEmbedded(Box<image_object::Embedded<S>>),
}


#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum EmbeddedLogo<S: BosStr = DefaultStr> {
    #[serde(rename = "social.flockfeeds.lexical.type.ImageObject#embedded")]
    ImageObjectEmbedded(Box<image_object::Embedded<S>>),
}


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

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

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

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

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

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

#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum EmbeddedSubjectOf<S: BosStr = DefaultStr> {
    #[serde(rename = "social.flockfeeds.lexical.type.Event#embedded")]
    EventEmbedded(Box<event::Embedded<S>>),
}


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

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
    rename_all = "camelCase",
    rename = "social.flockfeeds.lexical.type.Brand",
    tag = "$type",
    bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Brand<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub additional_type: Option<BrandAdditionalType<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub aggregate_rating: Option<BrandAggregateRating<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub alternate_name: Option<BrandAlternateName<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<BrandDescription<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub disambiguating_description: Option<BrandDisambiguatingDescription<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub identifier: Option<BrandIdentifier<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub image: Option<BrandImage<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub logo: Option<BrandLogo<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub main_entity_of_page: Option<BrandMainEntityOfPage<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<BrandName<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub potential_action: Option<BrandPotentialAction<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub review: Option<BrandReview<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub same_as: Option<BrandSameAs<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub slogan: Option<BrandSlogan<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub subject_of: Option<BrandSubjectOf<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub url: Option<BrandUrl<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


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

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

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

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

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

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

#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum BrandImage<S: BosStr = DefaultStr> {
    #[serde(rename = "social.flockfeeds.lexical.type.ImageObject#embedded")]
    ImageObjectEmbedded(Box<image_object::Embedded<S>>),
}


#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum BrandLogo<S: BosStr = DefaultStr> {
    #[serde(rename = "social.flockfeeds.lexical.type.ImageObject#embedded")]
    ImageObjectEmbedded(Box<image_object::Embedded<S>>),
}


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

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

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

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

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

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

#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum BrandSubjectOf<S: BosStr = DefaultStr> {
    #[serde(rename = "social.flockfeeds.lexical.type.Event#embedded")]
    EventEmbedded(Box<event::Embedded<S>>),
}


#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum BrandUrl<S: BosStr = DefaultStr> {}
/// Typed wrapper for GetRecord response with this collection's record type.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct BrandGetRecordOutput<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cid: Option<Cid<S>>,
    pub uri: AtUri<S>,
    pub value: Brand<S>,
}

impl<S: BosStr> Brand<S> {
    pub fn uri(uri: S) -> Result<RecordUri<S, BrandRecord>, UriError> {
        RecordUri::try_from_uri(AtUri::new(uri)?)
    }
}

impl<S: BosStr> LexiconSchema for Embedded<S> {
    fn nsid() -> &'static str {
        "social.flockfeeds.lexical.type.Brand"
    }
    fn def_name() -> &'static str {
        "embedded"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_social_flockfeeds_lexical_type_Brand()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

/// Marker type for deserializing records from this collection.

#[derive(Debug, Serialize, Deserialize)]
pub struct BrandRecord;
impl XrpcResp for BrandRecord {
    const NSID: &'static str = "social.flockfeeds.lexical.type.Brand";
    const ENCODING: &'static str = "application/json";
    type Output<S: BosStr> = BrandGetRecordOutput<S>;
    type Err = RecordError;
}

impl<S: BosStr> From<BrandGetRecordOutput<S>> for Brand<S> {
    fn from(output: BrandGetRecordOutput<S>) -> Self {
        output.value
    }
}

impl<S: BosStr> Collection for Brand<S> {
    const NSID: &'static str = "social.flockfeeds.lexical.type.Brand";
    type Record = BrandRecord;
}

impl Collection for BrandRecord {
    const NSID: &'static str = "social.flockfeeds.lexical.type.Brand";
    type Record = BrandRecord;
}

impl<S: BosStr> LexiconSchema for Brand<S> {
    fn nsid() -> &'static str {
        "social.flockfeeds.lexical.type.Brand"
    }
    fn def_name() -> &'static str {
        "main"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_social_flockfeeds_lexical_type_Brand()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

fn lexicon_doc_social_flockfeeds_lexical_type_Brand() -> 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("social.flockfeeds.lexical.type.Brand"),
        defs: {
            let mut map = BTreeMap::new();
            map.insert(
                SmolStr::new_static("embedded"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "A brand is a name used by an organization or business person for labeling a product, product group, or similar.",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("additionalType"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#additionalTypeScalar"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#additionalTypeList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("aggregateRating"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.type.AggregateRating#embedded"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#aggregateRatingList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("alternateName"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#alternateNameScalar"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#alternateNameList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("description"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.type.TextObject#embedded"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#descriptionScalar"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#descriptionList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("disambiguatingDescription"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#disambiguatingDescriptionScalar"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#disambiguatingDescriptionList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("identifier"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.type.PropertyValue#embedded"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#identifierScalar"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#identifierList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("image"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.type.ImageObject#embedded"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#imageScalar"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#imageList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("logo"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.type.ImageObject#embedded"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#logoScalar"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#logoList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("mainEntityOfPage"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.type.CreativeWork#embedded"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#mainEntityOfPageScalar"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#mainEntityOfPageList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("name"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#nameScalar"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#nameList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("potentialAction"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.type.Action#embedded"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#potentialActionList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("review"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.type.Review#embedded"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#reviewList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("sameAs"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#sameAsScalar"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#sameAsList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("slogan"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#sloganScalar"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#sloganList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("subjectOf"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.type.CreativeWork#embedded"),
                                    CowStr::new_static("social.flockfeeds.lexical.type.Event#embedded"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#subjectOfList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("url"),
                            LexObjectProperty::Union(LexRefUnion {
                                refs: vec![
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#urlScalar"),
                                    CowStr::new_static("social.flockfeeds.lexical.prop.brand#urlList")
                                ],
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("main"),
                LexUserType::Record(LexRecord {
                    key: Some(CowStr::new_static("tid")),
                    record: LexRecordRecord::Object(LexObject {
                        description: Some(
                            CowStr::new_static(
                                "A brand is a name used by an organization or business person for labeling a product, product group, or similar.",
                            ),
                        ),
                        properties: {
                            #[allow(unused_mut)]
                            let mut map = BTreeMap::new();
                            map.insert(
                                SmolStr::new_static("additionalType"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#additionalTypeScalar"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#additionalTypeList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("aggregateRating"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.type.AggregateRating#embedded"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#aggregateRatingList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("alternateName"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#alternateNameScalar"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#alternateNameList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("description"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.type.TextObject#embedded"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#descriptionScalar"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#descriptionList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("disambiguatingDescription"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#disambiguatingDescriptionScalar"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#disambiguatingDescriptionList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("identifier"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.type.PropertyValue#embedded"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#identifierScalar"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#identifierList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("image"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.type.ImageObject#embedded"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#imageScalar"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#imageList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("logo"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.type.ImageObject#embedded"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#logoScalar"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#logoList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("mainEntityOfPage"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.type.CreativeWork#embedded"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#mainEntityOfPageScalar"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#mainEntityOfPageList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("name"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#nameScalar"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#nameList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("potentialAction"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.type.Action#embedded"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#potentialActionList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("review"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.type.Review#embedded"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#reviewList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("sameAs"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#sameAsScalar"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#sameAsList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("slogan"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#sloganScalar"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#sloganList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("subjectOf"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.type.CreativeWork#embedded"),
                                        CowStr::new_static("social.flockfeeds.lexical.type.Event#embedded"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#subjectOfList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("url"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#urlScalar"),
                                        CowStr::new_static("social.flockfeeds.lexical.prop.brand#urlList")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map
                        },
                        ..Default::default()
                    }),
                    ..Default::default()
                }),
            );
            map
        },
        ..Default::default()
    }
}

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

/// Builder for constructing an instance of this type.
pub struct BrandBuilder<St: brand_state::State, S: BosStr = DefaultStr> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<BrandAdditionalType<S>>,
        Option<BrandAggregateRating<S>>,
        Option<BrandAlternateName<S>>,
        Option<BrandDescription<S>>,
        Option<BrandDisambiguatingDescription<S>>,
        Option<BrandIdentifier<S>>,
        Option<BrandImage<S>>,
        Option<BrandLogo<S>>,
        Option<BrandMainEntityOfPage<S>>,
        Option<BrandName<S>>,
        Option<BrandPotentialAction<S>>,
        Option<BrandReview<S>>,
        Option<BrandSameAs<S>>,
        Option<BrandSlogan<S>>,
        Option<BrandSubjectOf<S>>,
        Option<BrandUrl<S>>,
    ),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> Brand<S> {
    /// Create a new builder for this type
    pub fn builder() -> BrandBuilder<brand_state::Empty, S> {
        BrandBuilder::builder()
    }
}

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

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

impl<St: brand_state::State, S: BosStr> BrandBuilder<St, S> {
    /// Set the `additionalType` field (optional)
    pub fn additional_type(
        mut self,
        value: impl Into<Option<BrandAdditionalType<S>>>,
    ) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `additionalType` field to an Option value (optional)
    pub fn maybe_additional_type(
        mut self,
        value: Option<BrandAdditionalType<S>>,
    ) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<St: brand_state::State, S: BosStr> BrandBuilder<St, S> {
    /// Set the `aggregateRating` field (optional)
    pub fn aggregate_rating(
        mut self,
        value: impl Into<Option<BrandAggregateRating<S>>>,
    ) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `aggregateRating` field to an Option value (optional)
    pub fn maybe_aggregate_rating(
        mut self,
        value: Option<BrandAggregateRating<S>>,
    ) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<St: brand_state::State, S: BosStr> BrandBuilder<St, S> {
    /// Set the `alternateName` field (optional)
    pub fn alternate_name(
        mut self,
        value: impl Into<Option<BrandAlternateName<S>>>,
    ) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `alternateName` field to an Option value (optional)
    pub fn maybe_alternate_name(mut self, value: Option<BrandAlternateName<S>>) -> Self {
        self._fields.2 = value;
        self
    }
}

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

impl<St: brand_state::State, S: BosStr> BrandBuilder<St, S> {
    /// Set the `disambiguatingDescription` field (optional)
    pub fn disambiguating_description(
        mut self,
        value: impl Into<Option<BrandDisambiguatingDescription<S>>>,
    ) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `disambiguatingDescription` field to an Option value (optional)
    pub fn maybe_disambiguating_description(
        mut self,
        value: Option<BrandDisambiguatingDescription<S>>,
    ) -> Self {
        self._fields.4 = value;
        self
    }
}

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

impl<St: brand_state::State, S: BosStr> BrandBuilder<St, S> {
    /// Set the `image` field (optional)
    pub fn image(mut self, value: impl Into<Option<BrandImage<S>>>) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `image` field to an Option value (optional)
    pub fn maybe_image(mut self, value: Option<BrandImage<S>>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<St: brand_state::State, S: BosStr> BrandBuilder<St, S> {
    /// Set the `logo` field (optional)
    pub fn logo(mut self, value: impl Into<Option<BrandLogo<S>>>) -> Self {
        self._fields.7 = value.into();
        self
    }
    /// Set the `logo` field to an Option value (optional)
    pub fn maybe_logo(mut self, value: Option<BrandLogo<S>>) -> Self {
        self._fields.7 = value;
        self
    }
}

impl<St: brand_state::State, S: BosStr> BrandBuilder<St, S> {
    /// Set the `mainEntityOfPage` field (optional)
    pub fn main_entity_of_page(
        mut self,
        value: impl Into<Option<BrandMainEntityOfPage<S>>>,
    ) -> Self {
        self._fields.8 = value.into();
        self
    }
    /// Set the `mainEntityOfPage` field to an Option value (optional)
    pub fn maybe_main_entity_of_page(
        mut self,
        value: Option<BrandMainEntityOfPage<S>>,
    ) -> Self {
        self._fields.8 = value;
        self
    }
}

impl<St: brand_state::State, S: BosStr> BrandBuilder<St, S> {
    /// Set the `name` field (optional)
    pub fn name(mut self, value: impl Into<Option<BrandName<S>>>) -> Self {
        self._fields.9 = value.into();
        self
    }
    /// Set the `name` field to an Option value (optional)
    pub fn maybe_name(mut self, value: Option<BrandName<S>>) -> Self {
        self._fields.9 = value;
        self
    }
}

impl<St: brand_state::State, S: BosStr> BrandBuilder<St, S> {
    /// Set the `potentialAction` field (optional)
    pub fn potential_action(
        mut self,
        value: impl Into<Option<BrandPotentialAction<S>>>,
    ) -> Self {
        self._fields.10 = value.into();
        self
    }
    /// Set the `potentialAction` field to an Option value (optional)
    pub fn maybe_potential_action(
        mut self,
        value: Option<BrandPotentialAction<S>>,
    ) -> Self {
        self._fields.10 = value;
        self
    }
}

impl<St: brand_state::State, S: BosStr> BrandBuilder<St, S> {
    /// Set the `review` field (optional)
    pub fn review(mut self, value: impl Into<Option<BrandReview<S>>>) -> Self {
        self._fields.11 = value.into();
        self
    }
    /// Set the `review` field to an Option value (optional)
    pub fn maybe_review(mut self, value: Option<BrandReview<S>>) -> Self {
        self._fields.11 = value;
        self
    }
}

impl<St: brand_state::State, S: BosStr> BrandBuilder<St, S> {
    /// Set the `sameAs` field (optional)
    pub fn same_as(mut self, value: impl Into<Option<BrandSameAs<S>>>) -> Self {
        self._fields.12 = value.into();
        self
    }
    /// Set the `sameAs` field to an Option value (optional)
    pub fn maybe_same_as(mut self, value: Option<BrandSameAs<S>>) -> Self {
        self._fields.12 = value;
        self
    }
}

impl<St: brand_state::State, S: BosStr> BrandBuilder<St, S> {
    /// Set the `slogan` field (optional)
    pub fn slogan(mut self, value: impl Into<Option<BrandSlogan<S>>>) -> Self {
        self._fields.13 = value.into();
        self
    }
    /// Set the `slogan` field to an Option value (optional)
    pub fn maybe_slogan(mut self, value: Option<BrandSlogan<S>>) -> Self {
        self._fields.13 = value;
        self
    }
}

impl<St: brand_state::State, S: BosStr> BrandBuilder<St, S> {
    /// Set the `subjectOf` field (optional)
    pub fn subject_of(mut self, value: impl Into<Option<BrandSubjectOf<S>>>) -> Self {
        self._fields.14 = value.into();
        self
    }
    /// Set the `subjectOf` field to an Option value (optional)
    pub fn maybe_subject_of(mut self, value: Option<BrandSubjectOf<S>>) -> Self {
        self._fields.14 = value;
        self
    }
}

impl<St: brand_state::State, S: BosStr> BrandBuilder<St, S> {
    /// Set the `url` field (optional)
    pub fn url(mut self, value: impl Into<Option<BrandUrl<S>>>) -> Self {
        self._fields.15 = value.into();
        self
    }
    /// Set the `url` field to an Option value (optional)
    pub fn maybe_url(mut self, value: Option<BrandUrl<S>>) -> Self {
        self._fields.15 = value;
        self
    }
}

impl<St, S: BosStr> BrandBuilder<St, S>
where
    St: brand_state::State,
{
    /// Build the final struct.
    pub fn build(self) -> Brand<S> {
        Brand {
            additional_type: self._fields.0,
            aggregate_rating: self._fields.1,
            alternate_name: self._fields.2,
            description: self._fields.3,
            disambiguating_description: self._fields.4,
            identifier: self._fields.5,
            image: self._fields.6,
            logo: self._fields.7,
            main_entity_of_page: self._fields.8,
            name: self._fields.9,
            potential_action: self._fields.10,
            review: self._fields.11,
            same_as: self._fields.12,
            slogan: self._fields.13,
            subject_of: self._fields.14,
            url: self._fields.15,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Brand<S> {
        Brand {
            additional_type: self._fields.0,
            aggregate_rating: self._fields.1,
            alternate_name: self._fields.2,
            description: self._fields.3,
            disambiguating_description: self._fields.4,
            identifier: self._fields.5,
            image: self._fields.6,
            logo: self._fields.7,
            main_entity_of_page: self._fields.8,
            name: self._fields.9,
            potential_action: self._fields.10,
            review: self._fields.11,
            same_as: self._fields.12,
            slogan: self._fields.13,
            subject_of: self._fields.14,
            url: self._fields.15,
            extra_data: Some(extra_data),
        }
    }
}