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

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

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Podcast<'a> {
    ///Cover artwork for the podcast. Recommended: 1400x1400 to 3000x3000 pixels, square, no alpha channel.
    #[serde(borrow)]
    pub artwork: BlobRef<'a>,
    ///Podcast categories (max 3).
    #[serde(borrow)]
    pub categories: Vec<AppleCategory<'a>>,
    ///When the podcast record was created.
    pub created_at: Datetime,
    ///A description of the podcast.
    #[serde(borrow)]
    pub description: CowStr<'a>,
    ///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.
    #[serde(borrow)]
    pub feed_url: UriValue<'a>,
    ///Podcasting 2.0 UUIDv5 GUID of the podcast. Must match the record key.
    #[serde(borrow)]
    pub guid: CowStr<'a>,
    ///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")]
    #[serde(borrow)]
    pub link: Option<UriValue<'a>>,
    ///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")]
    #[serde(borrow)]
    pub moved_to: Option<AtUri<'a>>,
    ///The name of the podcast.
    #[serde(borrow)]
    pub title: CowStr<'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 PodcastGetRecordOutput<'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: Podcast<'a>,
}

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

/// 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<'de> = PodcastGetRecordOutput<'de>;
    type Err<'de> = RecordError<'de>;
}

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

impl Collection for Podcast<'_> {
    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<'a> LexiconSchema for Podcast<'a> {
    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 FeedUrl;
        type Title;
        type Language;
        type Categories;
        type CreatedAt;
        type Guid;
        type Description;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Artwork = Unset;
        type FeedUrl = Unset;
        type Title = Unset;
        type Language = Unset;
        type Categories = Unset;
        type CreatedAt = Unset;
        type Guid = Unset;
        type Description = Unset;
    }
    ///State transition - sets the `artwork` field to Set
    pub struct SetArtwork<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetArtwork<S> {}
    impl<S: State> State for SetArtwork<S> {
        type Artwork = Set<members::artwork>;
        type FeedUrl = S::FeedUrl;
        type Title = S::Title;
        type Language = S::Language;
        type Categories = S::Categories;
        type CreatedAt = S::CreatedAt;
        type Guid = S::Guid;
        type Description = S::Description;
    }
    ///State transition - sets the `feed_url` field to Set
    pub struct SetFeedUrl<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetFeedUrl<S> {}
    impl<S: State> State for SetFeedUrl<S> {
        type Artwork = S::Artwork;
        type FeedUrl = Set<members::feed_url>;
        type Title = S::Title;
        type Language = S::Language;
        type Categories = S::Categories;
        type CreatedAt = S::CreatedAt;
        type Guid = S::Guid;
        type Description = S::Description;
    }
    ///State transition - sets the `title` field to Set
    pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetTitle<S> {}
    impl<S: State> State for SetTitle<S> {
        type Artwork = S::Artwork;
        type FeedUrl = S::FeedUrl;
        type Title = Set<members::title>;
        type Language = S::Language;
        type Categories = S::Categories;
        type CreatedAt = S::CreatedAt;
        type Guid = S::Guid;
        type Description = S::Description;
    }
    ///State transition - sets the `language` field to Set
    pub struct SetLanguage<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetLanguage<S> {}
    impl<S: State> State for SetLanguage<S> {
        type Artwork = S::Artwork;
        type FeedUrl = S::FeedUrl;
        type Title = S::Title;
        type Language = Set<members::language>;
        type Categories = S::Categories;
        type CreatedAt = S::CreatedAt;
        type Guid = S::Guid;
        type Description = S::Description;
    }
    ///State transition - sets the `categories` field to Set
    pub struct SetCategories<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCategories<S> {}
    impl<S: State> State for SetCategories<S> {
        type Artwork = S::Artwork;
        type FeedUrl = S::FeedUrl;
        type Title = S::Title;
        type Language = S::Language;
        type Categories = Set<members::categories>;
        type CreatedAt = S::CreatedAt;
        type Guid = S::Guid;
        type Description = S::Description;
    }
    ///State transition - sets the `created_at` field to Set
    pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
    impl<S: State> State for SetCreatedAt<S> {
        type Artwork = S::Artwork;
        type FeedUrl = S::FeedUrl;
        type Title = S::Title;
        type Language = S::Language;
        type Categories = S::Categories;
        type CreatedAt = Set<members::created_at>;
        type Guid = S::Guid;
        type Description = S::Description;
    }
    ///State transition - sets the `guid` field to Set
    pub struct SetGuid<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetGuid<S> {}
    impl<S: State> State for SetGuid<S> {
        type Artwork = S::Artwork;
        type FeedUrl = S::FeedUrl;
        type Title = S::Title;
        type Language = S::Language;
        type Categories = S::Categories;
        type CreatedAt = S::CreatedAt;
        type Guid = Set<members::guid>;
        type Description = S::Description;
    }
    ///State transition - sets the `description` field to Set
    pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetDescription<S> {}
    impl<S: State> State for SetDescription<S> {
        type Artwork = S::Artwork;
        type FeedUrl = S::FeedUrl;
        type Title = S::Title;
        type Language = S::Language;
        type Categories = S::Categories;
        type CreatedAt = S::CreatedAt;
        type Guid = S::Guid;
        type Description = Set<members::description>;
    }
    /// 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 `feed_url` field
        pub struct feed_url(());
        ///Marker type for the `title` field
        pub struct title(());
        ///Marker type for the `language` field
        pub struct language(());
        ///Marker type for the `categories` field
        pub struct categories(());
        ///Marker type for the `created_at` field
        pub struct created_at(());
        ///Marker type for the `guid` field
        pub struct guid(());
        ///Marker type for the `description` field
        pub struct description(());
    }
}

/// Builder for constructing an instance of this type
pub struct PodcastBuilder<'a, S: podcast_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<BlobRef<'a>>,
        Option<Vec<AppleCategory<'a>>>,
        Option<Datetime>,
        Option<CowStr<'a>>,
        Option<bool>,
        Option<UriValue<'a>>,
        Option<CowStr<'a>>,
        Option<Language>,
        Option<UriValue<'a>>,
        Option<AtUri<'a>>,
        Option<CowStr<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

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

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

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

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

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

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

impl<'a, S: podcast_state::State> PodcastBuilder<'a, 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<'a, S> PodcastBuilder<'a, S>
where
    S: podcast_state::State,
    S::FeedUrl: podcast_state::IsUnset,
{
    /// Set the `feedUrl` field (required)
    pub fn feed_url(
        mut self,
        value: impl Into<UriValue<'a>>,
    ) -> PodcastBuilder<'a, podcast_state::SetFeedUrl<S>> {
        self._fields.5 = Option::Some(value.into());
        PodcastBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

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

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

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

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

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

impl<'a, S> PodcastBuilder<'a, S>
where
    S: podcast_state::State,
    S::Artwork: podcast_state::IsSet,
    S::FeedUrl: podcast_state::IsSet,
    S::Title: podcast_state::IsSet,
    S::Language: podcast_state::IsSet,
    S::Categories: podcast_state::IsSet,
    S::CreatedAt: podcast_state::IsSet,
    S::Guid: podcast_state::IsSet,
    S::Description: podcast_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> Podcast<'a> {
        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<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> Podcast<'a> {
        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()
    }
}