// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: org.atpodcasting.podcast
//
// 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::blob::BlobRef;
use jacquard_common::types::collection::{Collection, RecordError};
use jacquard_common::types::string::{AtUri, Cid, Datetime, Language, UriValue};
use jacquard_common::types::uri::{RecordUri, UriError};
use jacquard_common::types::value::Data;
use jacquard_common::xrpc::XrpcResp;
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::org_atpodcasting::AppleCategory;
/// A podcast feed/show. Record key is the podcast's Podcasting 2.0 UUIDv5 GUID, enabling direct lookup from RSS feed metadata.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
    rename_all = "camelCase",
    rename = "org.atpodcasting.podcast",
    tag = "$type",
    bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Podcast<S: BosStr = DefaultStr> {
    ///Cover artwork for the podcast. Recommended: 1400x1400 to 3000x3000 pixels, square, no alpha channel.
    pub artwork: BlobRef<S>,
    ///Podcast categories (max 3).
    pub categories: Vec<AppleCategory<S>>,
    ///When the podcast record was created.
    pub created_at: Datetime,
    ///A description of the podcast.
    pub description: S,
    ///Whether the podcast contains explicit content. Defaults to false.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub explicit: Option<bool>,
    ///URL of the podcast's RSS feed.
    pub feed_url: UriValue<S>,
    ///Podcasting 2.0 UUIDv5 GUID of the podcast. Must match the record key.
    pub guid: S,
    ///Primary language of the podcast (ISO 639-1 two-letter code, e.g. 'en', 'es', 'pt').
    pub language: Language,
    ///URL of the podcast's homepage or companion website.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub link: Option<UriValue<S>>,
    ///AT URI of the new canonical podcast record after an ownership transfer. When set, consumers should follow this reference to the current record.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub moved_to: Option<AtUri<S>>,
    ///The name of the podcast.
    pub title: S,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// 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 PodcastGetRecordOutput<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cid: Option<Cid<S>>,
    pub uri: AtUri<S>,
    pub value: Podcast<S>,
}

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

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

#[derive(Debug, Serialize, Deserialize)]
pub struct PodcastRecord;
impl XrpcResp for PodcastRecord {
    const NSID: &'static str = "org.atpodcasting.podcast";
    const ENCODING: &'static str = "application/json";
    type Output<S: BosStr> = PodcastGetRecordOutput<S>;
    type Err = RecordError;
}

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

impl<S: BosStr> Collection for Podcast<S> {
    const NSID: &'static str = "org.atpodcasting.podcast";
    type Record = PodcastRecord;
}

impl Collection for PodcastRecord {
    const NSID: &'static str = "org.atpodcasting.podcast";
    type Record = PodcastRecord;
}

impl<S: BosStr> LexiconSchema for Podcast<S> {
    fn nsid() -> &'static str {
        "org.atpodcasting.podcast"
    }
    fn def_name() -> &'static str {
        "main"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_org_atpodcasting_podcast()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        {
            let value = &self.artwork;
            {
                let size = value.blob().size;
                if size > 5000000usize {
                    return Err(ConstraintError::BlobTooLarge {
                        path: ValidationPath::from_field("artwork"),
                        max: 5000000usize,
                        actual: size,
                    });
                }
            }
        }
        {
            let value = &self.artwork;
            {
                let mime = value.blob().mime_type.as_str();
                let accepted: &[&str] = &["image/png", "image/jpeg"];
                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("artwork"),
                        accepted: vec![
                            "image/png".to_string(), "image/jpeg".to_string()
                        ],
                        actual: mime.to_string(),
                    });
                }
            }
        }
        {
            let value = &self.categories;
            #[allow(unused_comparisons)]
            if value.len() > 3usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("categories"),
                    max: 3usize,
                    actual: value.len(),
                });
            }
        }
        {
            let value = &self.description;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 4000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("description"),
                    max: 4000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.guid;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 36usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("guid"),
                    max: 36usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.title;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("title"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

pub mod podcast_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 Artwork;
        type Categories;
        type CreatedAt;
        type Description;
        type FeedUrl;
        type Guid;
        type Language;
        type Title;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Artwork = Unset;
        type Categories = Unset;
        type CreatedAt = Unset;
        type Description = Unset;
        type FeedUrl = Unset;
        type Guid = Unset;
        type Language = Unset;
        type Title = Unset;
    }
    ///State transition - sets the `artwork` field to Set
    pub struct SetArtwork<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetArtwork<St> {}
    impl<St: State> State for SetArtwork<St> {
        type Artwork = Set<members::artwork>;
        type Categories = St::Categories;
        type CreatedAt = St::CreatedAt;
        type Description = St::Description;
        type FeedUrl = St::FeedUrl;
        type Guid = St::Guid;
        type Language = St::Language;
        type Title = St::Title;
    }
    ///State transition - sets the `categories` field to Set
    pub struct SetCategories<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCategories<St> {}
    impl<St: State> State for SetCategories<St> {
        type Artwork = St::Artwork;
        type Categories = Set<members::categories>;
        type CreatedAt = St::CreatedAt;
        type Description = St::Description;
        type FeedUrl = St::FeedUrl;
        type Guid = St::Guid;
        type Language = St::Language;
        type Title = St::Title;
    }
    ///State transition - sets the `created_at` field to Set
    pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
    impl<St: State> State for SetCreatedAt<St> {
        type Artwork = St::Artwork;
        type Categories = St::Categories;
        type CreatedAt = Set<members::created_at>;
        type Description = St::Description;
        type FeedUrl = St::FeedUrl;
        type Guid = St::Guid;
        type Language = St::Language;
        type Title = St::Title;
    }
    ///State transition - sets the `description` field to Set
    pub struct SetDescription<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetDescription<St> {}
    impl<St: State> State for SetDescription<St> {
        type Artwork = St::Artwork;
        type Categories = St::Categories;
        type CreatedAt = St::CreatedAt;
        type Description = Set<members::description>;
        type FeedUrl = St::FeedUrl;
        type Guid = St::Guid;
        type Language = St::Language;
        type Title = St::Title;
    }
    ///State transition - sets the `feed_url` field to Set
    pub struct SetFeedUrl<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetFeedUrl<St> {}
    impl<St: State> State for SetFeedUrl<St> {
        type Artwork = St::Artwork;
        type Categories = St::Categories;
        type CreatedAt = St::CreatedAt;
        type Description = St::Description;
        type FeedUrl = Set<members::feed_url>;
        type Guid = St::Guid;
        type Language = St::Language;
        type Title = St::Title;
    }
    ///State transition - sets the `guid` field to Set
    pub struct SetGuid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetGuid<St> {}
    impl<St: State> State for SetGuid<St> {
        type Artwork = St::Artwork;
        type Categories = St::Categories;
        type CreatedAt = St::CreatedAt;
        type Description = St::Description;
        type FeedUrl = St::FeedUrl;
        type Guid = Set<members::guid>;
        type Language = St::Language;
        type Title = St::Title;
    }
    ///State transition - sets the `language` field to Set
    pub struct SetLanguage<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetLanguage<St> {}
    impl<St: State> State for SetLanguage<St> {
        type Artwork = St::Artwork;
        type Categories = St::Categories;
        type CreatedAt = St::CreatedAt;
        type Description = St::Description;
        type FeedUrl = St::FeedUrl;
        type Guid = St::Guid;
        type Language = Set<members::language>;
        type Title = St::Title;
    }
    ///State transition - sets the `title` field to Set
    pub struct SetTitle<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetTitle<St> {}
    impl<St: State> State for SetTitle<St> {
        type Artwork = St::Artwork;
        type Categories = St::Categories;
        type CreatedAt = St::CreatedAt;
        type Description = St::Description;
        type FeedUrl = St::FeedUrl;
        type Guid = St::Guid;
        type Language = St::Language;
        type Title = Set<members::title>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `artwork` field
        pub struct artwork(());
        ///Marker type for the `categories` field
        pub struct categories(());
        ///Marker type for the `created_at` field
        pub struct created_at(());
        ///Marker type for the `description` field
        pub struct description(());
        ///Marker type for the `feed_url` field
        pub struct feed_url(());
        ///Marker type for the `guid` field
        pub struct guid(());
        ///Marker type for the `language` field
        pub struct language(());
        ///Marker type for the `title` field
        pub struct title(());
    }
}

/// Builder for constructing an instance of this type.
pub struct PodcastBuilder<St: podcast_state::State, S: BosStr = DefaultStr> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<BlobRef<S>>,
        Option<Vec<AppleCategory<S>>>,
        Option<Datetime>,
        Option<S>,
        Option<bool>,
        Option<UriValue<S>>,
        Option<S>,
        Option<Language>,
        Option<UriValue<S>>,
        Option<AtUri<S>>,
        Option<S>,
    ),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> Podcast<S> {
    /// Create a new builder for this type
    pub fn builder() -> PodcastBuilder<podcast_state::Empty, S> {
        PodcastBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> PodcastBuilder<St, S>
where
    St: podcast_state::State,
    St::Artwork: podcast_state::IsUnset,
{
    /// Set the `artwork` field (required)
    pub fn artwork(
        mut self,
        value: impl Into<BlobRef<S>>,
    ) -> PodcastBuilder<podcast_state::SetArtwork<St>, S> {
        self._fields.0 = Option::Some(value.into());
        PodcastBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> PodcastBuilder<St, S>
where
    St: podcast_state::State,
    St::Categories: podcast_state::IsUnset,
{
    /// Set the `categories` field (required)
    pub fn categories(
        mut self,
        value: impl Into<Vec<AppleCategory<S>>>,
    ) -> PodcastBuilder<podcast_state::SetCategories<St>, S> {
        self._fields.1 = Option::Some(value.into());
        PodcastBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

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

impl<St, S: BosStr> PodcastBuilder<St, S>
where
    St: podcast_state::State,
    St::Description: podcast_state::IsUnset,
{
    /// Set the `description` field (required)
    pub fn description(
        mut self,
        value: impl Into<S>,
    ) -> PodcastBuilder<podcast_state::SetDescription<St>, S> {
        self._fields.3 = Option::Some(value.into());
        PodcastBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: podcast_state::State, S: BosStr> PodcastBuilder<St, S> {
    /// Set the `explicit` field (optional)
    pub fn explicit(mut self, value: impl Into<Option<bool>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `explicit` field to an Option value (optional)
    pub fn maybe_explicit(mut self, value: Option<bool>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<St, S: BosStr> PodcastBuilder<St, S>
where
    St: podcast_state::State,
    St::FeedUrl: podcast_state::IsUnset,
{
    /// Set the `feedUrl` field (required)
    pub fn feed_url(
        mut self,
        value: impl Into<UriValue<S>>,
    ) -> PodcastBuilder<podcast_state::SetFeedUrl<St>, S> {
        self._fields.5 = Option::Some(value.into());
        PodcastBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> PodcastBuilder<St, S>
where
    St: podcast_state::State,
    St::Guid: podcast_state::IsUnset,
{
    /// Set the `guid` field (required)
    pub fn guid(
        mut self,
        value: impl Into<S>,
    ) -> PodcastBuilder<podcast_state::SetGuid<St>, S> {
        self._fields.6 = Option::Some(value.into());
        PodcastBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> PodcastBuilder<St, S>
where
    St: podcast_state::State,
    St::Language: podcast_state::IsUnset,
{
    /// Set the `language` field (required)
    pub fn language(
        mut self,
        value: impl Into<Language>,
    ) -> PodcastBuilder<podcast_state::SetLanguage<St>, S> {
        self._fields.7 = Option::Some(value.into());
        PodcastBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: podcast_state::State, S: BosStr> PodcastBuilder<St, S> {
    /// Set the `link` field (optional)
    pub fn link(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
        self._fields.8 = value.into();
        self
    }
    /// Set the `link` field to an Option value (optional)
    pub fn maybe_link(mut self, value: Option<UriValue<S>>) -> Self {
        self._fields.8 = value;
        self
    }
}

impl<St: podcast_state::State, S: BosStr> PodcastBuilder<St, S> {
    /// Set the `movedTo` field (optional)
    pub fn moved_to(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
        self._fields.9 = value.into();
        self
    }
    /// Set the `movedTo` field to an Option value (optional)
    pub fn maybe_moved_to(mut self, value: Option<AtUri<S>>) -> Self {
        self._fields.9 = value;
        self
    }
}

impl<St, S: BosStr> PodcastBuilder<St, S>
where
    St: podcast_state::State,
    St::Title: podcast_state::IsUnset,
{
    /// Set the `title` field (required)
    pub fn title(
        mut self,
        value: impl Into<S>,
    ) -> PodcastBuilder<podcast_state::SetTitle<St>, S> {
        self._fields.10 = Option::Some(value.into());
        PodcastBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> PodcastBuilder<St, S>
where
    St: podcast_state::State,
    St::Artwork: podcast_state::IsSet,
    St::Categories: podcast_state::IsSet,
    St::CreatedAt: podcast_state::IsSet,
    St::Description: podcast_state::IsSet,
    St::FeedUrl: podcast_state::IsSet,
    St::Guid: podcast_state::IsSet,
    St::Language: podcast_state::IsSet,
    St::Title: podcast_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> Podcast<S> {
        Podcast {
            artwork: self._fields.0.unwrap(),
            categories: self._fields.1.unwrap(),
            created_at: self._fields.2.unwrap(),
            description: self._fields.3.unwrap(),
            explicit: self._fields.4,
            feed_url: self._fields.5.unwrap(),
            guid: self._fields.6.unwrap(),
            language: self._fields.7.unwrap(),
            link: self._fields.8,
            moved_to: self._fields.9,
            title: self._fields.10.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Podcast<S> {
        Podcast {
            artwork: self._fields.0.unwrap(),
            categories: self._fields.1.unwrap(),
            created_at: self._fields.2.unwrap(),
            description: self._fields.3.unwrap(),
            explicit: self._fields.4,
            feed_url: self._fields.5.unwrap(),
            guid: self._fields.6.unwrap(),
            language: self._fields.7.unwrap(),
            link: self._fields.8,
            moved_to: self._fields.9,
            title: self._fields.10.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

fn lexicon_doc_org_atpodcasting_podcast() -> 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("org.atpodcasting.podcast"),
        defs: {
            let mut map = BTreeMap::new();
            map.insert(
                SmolStr::new_static("main"),
                LexUserType::Record(LexRecord {
                    description: Some(
                        CowStr::new_static(
                            "A podcast feed/show. Record key is the podcast's Podcasting 2.0 UUIDv5 GUID, enabling direct lookup from RSS feed metadata.",
                        ),
                    ),
                    key: Some(CowStr::new_static("any")),
                    record: LexRecordRecord::Object(LexObject {
                        required: Some(
                            vec![
                                SmolStr::new_static("title"),
                                SmolStr::new_static("description"),
                                SmolStr::new_static("artwork"),
                                SmolStr::new_static("language"),
                                SmolStr::new_static("feedUrl"),
                                SmolStr::new_static("categories"),
                                SmolStr::new_static("guid"),
                                SmolStr::new_static("createdAt")
                            ],
                        ),
                        properties: {
                            #[allow(unused_mut)]
                            let mut map = BTreeMap::new();
                            map.insert(
                                SmolStr::new_static("artwork"),
                                LexObjectProperty::Blob(LexBlob { ..Default::default() }),
                            );
                            map.insert(
                                SmolStr::new_static("categories"),
                                LexObjectProperty::Array(LexArray {
                                    description: Some(
                                        CowStr::new_static("Podcast categories (max 3)."),
                                    ),
                                    items: LexArrayItem::Union(LexRefUnion {
                                        refs: vec![
                                            CowStr::new_static("org.atpodcasting.defs#appleCategory")
                                        ],
                                        ..Default::default()
                                    }),
                                    max_length: Some(3usize),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("createdAt"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static("When the podcast record was created."),
                                    ),
                                    format: Some(LexStringFormat::Datetime),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("description"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static("A description of the podcast."),
                                    ),
                                    max_length: Some(4000usize),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("explicit"),
                                LexObjectProperty::Boolean(LexBoolean {
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("feedUrl"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static("URL of the podcast's RSS feed."),
                                    ),
                                    format: Some(LexStringFormat::Uri),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("guid"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "Podcasting 2.0 UUIDv5 GUID of the podcast. Must match the record key.",
                                        ),
                                    ),
                                    max_length: Some(36usize),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("language"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "Primary language of the podcast (ISO 639-1 two-letter code, e.g. 'en', 'es', 'pt').",
                                        ),
                                    ),
                                    format: Some(LexStringFormat::Language),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("link"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "URL of the podcast's homepage or companion website.",
                                        ),
                                    ),
                                    format: Some(LexStringFormat::Uri),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("movedTo"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "AT URI of the new canonical podcast record after an ownership transfer. When set, consumers should follow this reference to the current record.",
                                        ),
                                    ),
                                    format: Some(LexStringFormat::AtUri),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("title"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static("The name of the podcast."),
                                    ),
                                    max_length: Some(500usize),
                                    ..Default::default()
                                }),
                            );
                            map
                        },
                        ..Default::default()
                    }),
                    ..Default::default()
                }),
            );
            map
        },
        ..Default::default()
    }
}