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

#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
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.

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


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

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

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

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

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

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

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


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


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

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

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

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

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

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

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


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

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Brand<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub additional_type: Option<BrandAdditionalType<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub aggregate_rating: Option<BrandAggregateRating<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub alternate_name: Option<BrandAlternateName<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub description: Option<BrandDescription<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub disambiguating_description: Option<BrandDisambiguatingDescription<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub identifier: Option<BrandIdentifier<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub image: Option<BrandImage<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub logo: Option<BrandLogo<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub main_entity_of_page: Option<BrandMainEntityOfPage<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub name: Option<BrandName<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub potential_action: Option<BrandPotentialAction<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub review: Option<BrandReview<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub same_as: Option<BrandSameAs<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub slogan: Option<BrandSlogan<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub subject_of: Option<BrandSubjectOf<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub url: Option<BrandUrl<'a>>,
}


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

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

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

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

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

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

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


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


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

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

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

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

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

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

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


#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum BrandUrl<'a> {}
/// 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<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub cid: Option<Cid<'a>>,
    #[serde(borrow)]
    pub uri: AtUri<'a>,
    #[serde(borrow)]
    pub value: Brand<'a>,
}

impl<'a> Brand<'a> {
    pub fn uri(
        uri: impl Into<CowStr<'a>>,
    ) -> Result<RecordUri<'a, BrandRecord>, UriError> {
        RecordUri::try_from_uri(AtUri::new_cow(uri.into())?)
    }
}

impl<'a> LexiconSchema for Embedded<'a> {
    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<'de> = BrandGetRecordOutput<'de>;
    type Err<'de> = RecordError<'de>;
}

impl From<BrandGetRecordOutput<'_>> for Brand<'_> {
    fn from(output: BrandGetRecordOutput<'_>) -> Self {
        use jacquard_common::IntoStatic;
        output.value.into_static()
    }
}

impl Collection for Brand<'_> {
    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<'a> LexiconSchema for Brand<'a> {
    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<'a, S: brand_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<BrandAdditionalType<'a>>,
        Option<BrandAggregateRating<'a>>,
        Option<BrandAlternateName<'a>>,
        Option<BrandDescription<'a>>,
        Option<BrandDisambiguatingDescription<'a>>,
        Option<BrandIdentifier<'a>>,
        Option<BrandImage<'a>>,
        Option<BrandLogo<'a>>,
        Option<BrandMainEntityOfPage<'a>>,
        Option<BrandName<'a>>,
        Option<BrandPotentialAction<'a>>,
        Option<BrandReview<'a>>,
        Option<BrandSameAs<'a>>,
        Option<BrandSlogan<'a>>,
        Option<BrandSubjectOf<'a>>,
        Option<BrandUrl<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

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

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

impl<'a, S: brand_state::State> BrandBuilder<'a, S> {
    /// Set the `additionalType` field (optional)
    pub fn additional_type(
        mut self,
        value: impl Into<Option<BrandAdditionalType<'a>>>,
    ) -> 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<'a>>,
    ) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<'a, S: brand_state::State> BrandBuilder<'a, S> {
    /// Set the `aggregateRating` field (optional)
    pub fn aggregate_rating(
        mut self,
        value: impl Into<Option<BrandAggregateRating<'a>>>,
    ) -> 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<'a>>,
    ) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<'a, S: brand_state::State> BrandBuilder<'a, S> {
    /// Set the `alternateName` field (optional)
    pub fn alternate_name(
        mut self,
        value: impl Into<Option<BrandAlternateName<'a>>>,
    ) -> 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<'a>>,
    ) -> Self {
        self._fields.2 = value;
        self
    }
}

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

impl<'a, S: brand_state::State> BrandBuilder<'a, S> {
    /// Set the `disambiguatingDescription` field (optional)
    pub fn disambiguating_description(
        mut self,
        value: impl Into<Option<BrandDisambiguatingDescription<'a>>>,
    ) -> 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<'a>>,
    ) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<'a, S: brand_state::State> BrandBuilder<'a, S> {
    /// Set the `identifier` field (optional)
    pub fn identifier(mut self, value: impl Into<Option<BrandIdentifier<'a>>>) -> 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<'a>>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<'a, S: brand_state::State> BrandBuilder<'a, S> {
    /// Set the `image` field (optional)
    pub fn image(mut self, value: impl Into<Option<BrandImage<'a>>>) -> 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<'a>>) -> Self {
        self._fields.6 = value;
        self
    }
}

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

impl<'a, S: brand_state::State> BrandBuilder<'a, S> {
    /// Set the `mainEntityOfPage` field (optional)
    pub fn main_entity_of_page(
        mut self,
        value: impl Into<Option<BrandMainEntityOfPage<'a>>>,
    ) -> 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<'a>>,
    ) -> Self {
        self._fields.8 = value;
        self
    }
}

impl<'a, S: brand_state::State> BrandBuilder<'a, S> {
    /// Set the `name` field (optional)
    pub fn name(mut self, value: impl Into<Option<BrandName<'a>>>) -> 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<'a>>) -> Self {
        self._fields.9 = value;
        self
    }
}

impl<'a, S: brand_state::State> BrandBuilder<'a, S> {
    /// Set the `potentialAction` field (optional)
    pub fn potential_action(
        mut self,
        value: impl Into<Option<BrandPotentialAction<'a>>>,
    ) -> 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<'a>>,
    ) -> Self {
        self._fields.10 = value;
        self
    }
}

impl<'a, S: brand_state::State> BrandBuilder<'a, S> {
    /// Set the `review` field (optional)
    pub fn review(mut self, value: impl Into<Option<BrandReview<'a>>>) -> 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<'a>>) -> Self {
        self._fields.11 = value;
        self
    }
}

impl<'a, S: brand_state::State> BrandBuilder<'a, S> {
    /// Set the `sameAs` field (optional)
    pub fn same_as(mut self, value: impl Into<Option<BrandSameAs<'a>>>) -> 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<'a>>) -> Self {
        self._fields.12 = value;
        self
    }
}

impl<'a, S: brand_state::State> BrandBuilder<'a, S> {
    /// Set the `slogan` field (optional)
    pub fn slogan(mut self, value: impl Into<Option<BrandSlogan<'a>>>) -> 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<'a>>) -> Self {
        self._fields.13 = value;
        self
    }
}

impl<'a, S: brand_state::State> BrandBuilder<'a, S> {
    /// Set the `subjectOf` field (optional)
    pub fn subject_of(mut self, value: impl Into<Option<BrandSubjectOf<'a>>>) -> 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<'a>>) -> Self {
        self._fields.14 = value;
        self
    }
}

impl<'a, S: brand_state::State> BrandBuilder<'a, S> {
    /// Set the `url` field (optional)
    pub fn url(mut self, value: impl Into<Option<BrandUrl<'a>>>) -> 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<'a>>) -> Self {
        self._fields.15 = value;
        self
    }
}

impl<'a, S> BrandBuilder<'a, S>
where
    S: brand_state::State,
{
    /// Build the final struct
    pub fn build(self) -> Brand<'a> {
        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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> Brand<'a> {
        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),
        }
    }
}