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

pub mod entry;


#[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::blob::BlobRef;
use jacquard_common::types::string::UriValue;
use jacquard_derive::{IntoStatic, lexicon};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;

#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::app_greengale::blog;
/// Metadata for uploaded binary content

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct BlobMetadata<'a> {
    ///Alt text for accessibility
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub alt: Option<CowStr<'a>>,
    ///Reference to the blob
    #[serde(borrow)]
    pub blobref: BlobRef<'a>,
    ///Content labels (self-labels) for this image
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub labels: Option<blog::SelfLabels<'a>>,
    ///Original filename
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub name: Option<CowStr<'a>>,
}

/// Custom color values (CSS color strings)

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct CustomColors<'a> {
    ///Accent/link color
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub accent: Option<CowStr<'a>>,
    ///Background color
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub background: Option<CowStr<'a>>,
    ///Code block background color
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub code_background: Option<CowStr<'a>>,
    ///Primary text color
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub text: Option<CowStr<'a>>,
}

/// Open Graph Protocol metadata for social sharing

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Ogp<'a> {
    ///Image height in pixels
    #[serde(skip_serializing_if = "Option::is_none")]
    pub height: Option<i64>,
    ///URL of the OGP image
    #[serde(borrow)]
    pub url: UriValue<'a>,
    ///Image width in pixels
    #[serde(skip_serializing_if = "Option::is_none")]
    pub width: Option<i64>,
}

/// Metadata tag on an atproto resource, published by the author

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct SelfLabel<'a> {
    ///The short string name of the value or type of this label
    #[serde(borrow)]
    pub val: CowStr<'a>,
}

/// Metadata tags on an atproto resource, published by the author

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SelfLabels<'a> {
    #[serde(borrow)]
    pub values: Vec<blog::SelfLabel<'a>>,
}

/// Theme configuration for a blog entry

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Theme<'a> {
    ///Custom color overrides
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub custom: Option<blog::CustomColors<'a>>,
    ///Predefined color theme
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub preset: Option<CowStr<'a>>,
}

/// Voice theme configuration for TTS playback

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct VoiceTheme<'a> {
    ///Pitch multiplier x100 (100 = normal, range 50-150)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pitch: Option<i64>,
    ///Playback speed multiplier x100 (100 = normal, range 50-200)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub speed: Option<i64>,
    ///Voice ID for TTS (e.g., 'af_heart', 'am_adam')
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub voice: Option<CowStr<'a>>,
}

impl<'a> LexiconSchema for BlobMetadata<'a> {
    fn nsid() -> &'static str {
        "app.greengale.blog.defs"
    }
    fn def_name() -> &'static str {
        "blobMetadata"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_greengale_blog_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.alt {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 1000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("alt"),
                    max: 1000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.blobref;
            {
                let mime = value.blob().mime_type.as_str();
                let accepted: &[&str] = &["*/*"];
                let matched = accepted
                    .iter()
                    .any(|pattern| {
                        if *pattern == "*/*" {
                            true
                        } else if pattern.ends_with("/*") {
                            let prefix = &pattern[..pattern.len() - 2];
                            mime.starts_with(prefix)
                                && mime.as_bytes().get(prefix.len()) == Some(&b'/')
                        } else {
                            mime == *pattern
                        }
                    });
                if !matched {
                    return Err(ConstraintError::BlobMimeTypeNotAccepted {
                        path: ValidationPath::from_field("blobref"),
                        accepted: vec!["*/*".to_string()],
                        actual: mime.to_string(),
                    });
                }
            }
        }
        if let Some(ref value) = self.name {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 256usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("name"),
                    max: 256usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for CustomColors<'a> {
    fn nsid() -> &'static str {
        "app.greengale.blog.defs"
    }
    fn def_name() -> &'static str {
        "customColors"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_greengale_blog_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.accent {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 64usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("accent"),
                    max: 64usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.background {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 64usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("background"),
                    max: 64usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.code_background {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 64usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("code_background"),
                    max: 64usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.text {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 64usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("text"),
                    max: 64usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for Ogp<'a> {
    fn nsid() -> &'static str {
        "app.greengale.blog.defs"
    }
    fn def_name() -> &'static str {
        "ogp"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_greengale_blog_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        {
            let value = &self.url;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 2048usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("url"),
                    max: 2048usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for SelfLabel<'a> {
    fn nsid() -> &'static str {
        "app.greengale.blog.defs"
    }
    fn def_name() -> &'static str {
        "selfLabel"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_greengale_blog_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        {
            let value = &self.val;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 128usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("val"),
                    max: 128usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for SelfLabels<'a> {
    fn nsid() -> &'static str {
        "app.greengale.blog.defs"
    }
    fn def_name() -> &'static str {
        "selfLabels"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_greengale_blog_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        {
            let value = &self.values;
            #[allow(unused_comparisons)]
            if value.len() > 10usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("values"),
                    max: 10usize,
                    actual: value.len(),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for Theme<'a> {
    fn nsid() -> &'static str {
        "app.greengale.blog.defs"
    }
    fn def_name() -> &'static str {
        "theme"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_greengale_blog_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.preset {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 32usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("preset"),
                    max: 32usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for VoiceTheme<'a> {
    fn nsid() -> &'static str {
        "app.greengale.blog.defs"
    }
    fn def_name() -> &'static str {
        "voiceTheme"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_greengale_blog_defs()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.voice {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 32usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("voice"),
                    max: 32usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

pub mod blob_metadata_state {

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

/// Builder for constructing an instance of this type
pub struct BlobMetadataBuilder<'a, S: blob_metadata_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<CowStr<'a>>,
        Option<BlobRef<'a>>,
        Option<blog::SelfLabels<'a>>,
        Option<CowStr<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> BlobMetadata<'a> {
    /// Create a new builder for this type
    pub fn new() -> BlobMetadataBuilder<'a, blob_metadata_state::Empty> {
        BlobMetadataBuilder::new()
    }
}

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

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

impl<'a, S> BlobMetadataBuilder<'a, S>
where
    S: blob_metadata_state::State,
    S::Blobref: blob_metadata_state::IsUnset,
{
    /// Set the `blobref` field (required)
    pub fn blobref(
        mut self,
        value: impl Into<BlobRef<'a>>,
    ) -> BlobMetadataBuilder<'a, blob_metadata_state::SetBlobref<S>> {
        self._fields.1 = Option::Some(value.into());
        BlobMetadataBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: blob_metadata_state::State> BlobMetadataBuilder<'a, S> {
    /// Set the `labels` field (optional)
    pub fn labels(mut self, value: impl Into<Option<blog::SelfLabels<'a>>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `labels` field to an Option value (optional)
    pub fn maybe_labels(mut self, value: Option<blog::SelfLabels<'a>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<'a, S: blob_metadata_state::State> BlobMetadataBuilder<'a, S> {
    /// Set the `name` field (optional)
    pub fn name(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `name` field to an Option value (optional)
    pub fn maybe_name(mut self, value: Option<CowStr<'a>>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<'a, S> BlobMetadataBuilder<'a, S>
where
    S: blob_metadata_state::State,
    S::Blobref: blob_metadata_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> BlobMetadata<'a> {
        BlobMetadata {
            alt: self._fields.0,
            blobref: self._fields.1.unwrap(),
            labels: self._fields.2,
            name: self._fields.3,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> BlobMetadata<'a> {
        BlobMetadata {
            alt: self._fields.0,
            blobref: self._fields.1.unwrap(),
            labels: self._fields.2,
            name: self._fields.3,
            extra_data: Some(extra_data),
        }
    }
}

fn lexicon_doc_app_greengale_blog_defs() -> LexiconDoc<'static> {
    #[allow(unused_imports)]
    use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
    use jacquard_lexicon::lexicon::*;
    use alloc::collections::BTreeMap;
    LexiconDoc {
        lexicon: Lexicon::Lexicon1,
        id: CowStr::new_static("app.greengale.blog.defs"),
        defs: {
            let mut map = BTreeMap::new();
            map.insert(
                SmolStr::new_static("blobMetadata"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Metadata for uploaded binary content"),
                    ),
                    required: Some(vec![SmolStr::new_static("blobref")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("alt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Alt text for accessibility"),
                                ),
                                max_length: Some(1000usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("blobref"),
                            LexObjectProperty::Blob(LexBlob { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("labels"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#selfLabels"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("name"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Original filename")),
                                max_length: Some(256usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("customColors"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Custom color values (CSS color strings)"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("accent"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Accent/link color")),
                                max_length: Some(64usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("background"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Background color")),
                                max_length: Some(64usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("codeBackground"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Code block background color"),
                                ),
                                max_length: Some(64usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("text"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Primary text color")),
                                max_length: Some(64usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("ogp"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Open Graph Protocol metadata for social sharing",
                        ),
                    ),
                    required: Some(vec![SmolStr::new_static("url")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("height"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("url"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("URL of the OGP image"),
                                ),
                                format: Some(LexStringFormat::Uri),
                                max_length: Some(2048usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("width"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("selfLabel"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Metadata tag on an atproto resource, published by the author",
                        ),
                    ),
                    required: Some(vec![SmolStr::new_static("val")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("val"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "The short string name of the value or type of this label",
                                    ),
                                ),
                                max_length: Some(128usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("selfLabels"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Metadata tags on an atproto resource, published by the author",
                        ),
                    ),
                    required: Some(vec![SmolStr::new_static("values")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("values"),
                            LexObjectProperty::Array(LexArray {
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("#selfLabel"),
                                    ..Default::default()
                                }),
                                max_length: Some(10usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("theme"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Theme configuration for a blog entry"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("custom"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#customColors"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("preset"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Predefined color theme"),
                                ),
                                max_length: Some(32usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("voiceTheme"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Voice theme configuration for TTS playback"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("pitch"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("speed"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("voice"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Voice ID for TTS (e.g., 'af_heart', 'am_adam')",
                                    ),
                                ),
                                max_length: Some(32usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map
        },
        ..Default::default()
    }
}

pub mod ogp_state {

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

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

impl<'a> Ogp<'a> {
    /// Create a new builder for this type
    pub fn new() -> OgpBuilder<'a, ogp_state::Empty> {
        OgpBuilder::new()
    }
}

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

impl<'a, S: ogp_state::State> OgpBuilder<'a, S> {
    /// Set the `height` field (optional)
    pub fn height(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `height` field to an Option value (optional)
    pub fn maybe_height(mut self, value: Option<i64>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<'a, S> OgpBuilder<'a, S>
where
    S: ogp_state::State,
    S::Url: ogp_state::IsUnset,
{
    /// Set the `url` field (required)
    pub fn url(
        mut self,
        value: impl Into<UriValue<'a>>,
    ) -> OgpBuilder<'a, ogp_state::SetUrl<S>> {
        self._fields.1 = Option::Some(value.into());
        OgpBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: ogp_state::State> OgpBuilder<'a, S> {
    /// Set the `width` field (optional)
    pub fn width(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `width` field to an Option value (optional)
    pub fn maybe_width(mut self, value: Option<i64>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<'a, S> OgpBuilder<'a, S>
where
    S: ogp_state::State,
    S::Url: ogp_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> Ogp<'a> {
        Ogp {
            height: self._fields.0,
            url: self._fields.1.unwrap(),
            width: self._fields.2,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> Ogp<'a> {
        Ogp {
            height: self._fields.0,
            url: self._fields.1.unwrap(),
            width: self._fields.2,
            extra_data: Some(extra_data),
        }
    }
}

pub mod self_labels_state {

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

/// Builder for constructing an instance of this type
pub struct SelfLabelsBuilder<'a, S: self_labels_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (Option<Vec<blog::SelfLabel<'a>>>,),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> SelfLabels<'a> {
    /// Create a new builder for this type
    pub fn new() -> SelfLabelsBuilder<'a, self_labels_state::Empty> {
        SelfLabelsBuilder::new()
    }
}

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

impl<'a, S> SelfLabelsBuilder<'a, S>
where
    S: self_labels_state::State,
    S::Values: self_labels_state::IsUnset,
{
    /// Set the `values` field (required)
    pub fn values(
        mut self,
        value: impl Into<Vec<blog::SelfLabel<'a>>>,
    ) -> SelfLabelsBuilder<'a, self_labels_state::SetValues<S>> {
        self._fields.0 = Option::Some(value.into());
        SelfLabelsBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> SelfLabelsBuilder<'a, S>
where
    S: self_labels_state::State,
    S::Values: self_labels_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> SelfLabels<'a> {
        SelfLabels {
            values: self._fields.0.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> SelfLabels<'a> {
        SelfLabels {
            values: self._fields.0.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}