// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: fm.teal.alpha.feed.play
//
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.

#[allow(unused_imports)]
use alloc::collections::BTreeMap;

#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};

#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::collection::{Collection, RecordError};
use jacquard_common::types::string::{AtUri, Cid, Datetime, 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::fm_teal::alpha::feed::Artist;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
    rename_all = "camelCase",
    rename = "fm.teal.alpha.feed.play",
    tag = "$type",
    bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Play<S: BosStr = DefaultStr> {
    ///DEPRECATED: USE 'artists' INSTEAD. Array of Musicbrainz artist IDs.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub artist_mb_ids: Option<Vec<S>>,
    ///DEPRECATED: USE 'artists' INSTEAD. Array of artist names in order of original appearance.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub artist_names: Option<Vec<S>>,
    ///Array of artists in order of original appearance.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub artists: Option<Vec<Artist<S>>>,
    ///The length of the track in seconds
    #[serde(skip_serializing_if = "Option::is_none")]
    pub duration: Option<i64>,
    ///The ISRC code associated with the recording
    #[serde(skip_serializing_if = "Option::is_none")]
    pub isrc: Option<S>,
    ///The base domain of the music service. e.g. music.apple.com, tidal.com, spotify.com. Defaults to 'local' if unavailable or not provided.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub music_service_base_domain: Option<S>,
    ///The URL associated with this track
    #[serde(skip_serializing_if = "Option::is_none")]
    pub origin_url: Option<S>,
    ///The unix timestamp of when the track was played
    #[serde(skip_serializing_if = "Option::is_none")]
    pub played_time: Option<Datetime>,
    ///The MusicBrainz recording ID URI of the track, formatted as mbid:<uuid>
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recording_mb_id: Option<UriValue<S>>,
    ///Distinguishing information for release variants (e.g. 'Deluxe Edition', 'Remastered', '2023 Remaster', 'Special Edition'). Used to differentiate between different versions of the same base release while maintaining grouping capabilities.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub release_discriminant: Option<S>,
    ///The MusicBrainz release ID URI, formatted as mbid:<uuid>
    #[serde(skip_serializing_if = "Option::is_none")]
    pub release_mb_id: Option<UriValue<S>>,
    ///The name of the release/album
    #[serde(skip_serializing_if = "Option::is_none")]
    pub release_name: Option<S>,
    ///A metadata string specifying the user agent where the format is `<app-identifier>/<version> (<kernel/OS-base>; <platform/OS-version>; <device-model>)`. If string is provided, only `app-identifier` and `version` are required. `app-identifier` is recommended to be in reverse dns format. Defaults to 'manual/unknown' if unavailable or not provided.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub submission_client_agent: Option<S>,
    ///Distinguishing information for track variants (e.g. 'Acoustic Version', 'Live at Wembley', 'Radio Edit', 'Demo'). Used to differentiate between different versions of the same base track while maintaining grouping capabilities.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub track_discriminant: Option<S>,
    ///The MusicBrainz ID URI of the track, formatted as mbid:<uuid>
    #[serde(skip_serializing_if = "Option::is_none")]
    pub track_mb_id: Option<UriValue<S>>,
    ///The name of the track
    pub track_name: 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 PlayGetRecordOutput<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cid: Option<Cid<S>>,
    pub uri: AtUri<S>,
    pub value: Play<S>,
}

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

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

#[derive(Debug, Serialize, Deserialize)]
pub struct PlayRecord;
impl XrpcResp for PlayRecord {
    const NSID: &'static str = "fm.teal.alpha.feed.play";
    const ENCODING: &'static str = "application/json";
    type Output<S: BosStr> = PlayGetRecordOutput<S>;
    type Err = RecordError;
}

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

impl<S: BosStr> Collection for Play<S> {
    const NSID: &'static str = "fm.teal.alpha.feed.play";
    type Record = PlayRecord;
}

impl Collection for PlayRecord {
    const NSID: &'static str = "fm.teal.alpha.feed.play";
    type Record = PlayRecord;
}

impl<S: BosStr> LexiconSchema for Play<S> {
    fn nsid() -> &'static str {
        "fm.teal.alpha.feed.play"
    }
    fn def_name() -> &'static str {
        "main"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_fm_teal_alpha_feed_play()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.release_discriminant {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 128usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("release_discriminant"),
                    max: 128usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.release_discriminant {
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 1280usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("release_discriminant"),
                        max: 1280usize,
                        actual: count,
                    });
                }
            }
        }
        if let Some(ref value) = self.release_name {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 256usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("release_name"),
                    max: 256usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.release_name {
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 2560usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("release_name"),
                        max: 2560usize,
                        actual: count,
                    });
                }
            }
        }
        if let Some(ref value) = self.submission_client_agent {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 256usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("submission_client_agent"),
                    max: 256usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.submission_client_agent {
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 2560usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("submission_client_agent"),
                        max: 2560usize,
                        actual: count,
                    });
                }
            }
        }
        if let Some(ref value) = self.track_discriminant {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 128usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("track_discriminant"),
                    max: 128usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.track_discriminant {
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 1280usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("track_discriminant"),
                        max: 1280usize,
                        actual: count,
                    });
                }
            }
        }
        {
            let value = &self.track_name;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 256usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("track_name"),
                    max: 256usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.track_name;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) < 1usize {
                return Err(ConstraintError::MinLength {
                    path: ValidationPath::from_field("track_name"),
                    min: 1usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.track_name;
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 2560usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("track_name"),
                        max: 2560usize,
                        actual: count,
                    });
                }
            }
        }
        Ok(())
    }
}

pub mod play_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 TrackName;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type TrackName = Unset;
    }
    ///State transition - sets the `track_name` field to Set
    pub struct SetTrackName<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetTrackName<St> {}
    impl<St: State> State for SetTrackName<St> {
        type TrackName = Set<members::track_name>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `track_name` field
        pub struct track_name(());
    }
}

/// Builder for constructing an instance of this type.
pub struct PlayBuilder<St: play_state::State, S: BosStr = DefaultStr> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<Vec<S>>,
        Option<Vec<S>>,
        Option<Vec<Artist<S>>>,
        Option<i64>,
        Option<S>,
        Option<S>,
        Option<S>,
        Option<Datetime>,
        Option<UriValue<S>>,
        Option<S>,
        Option<UriValue<S>>,
        Option<S>,
        Option<S>,
        Option<S>,
        Option<UriValue<S>>,
        Option<S>,
    ),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> Play<S> {
    /// Create a new builder for this type
    pub fn builder() -> PlayBuilder<play_state::Empty, S> {
        PlayBuilder::builder()
    }
}

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

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

impl<St: play_state::State, S: BosStr> PlayBuilder<St, S> {
    /// Set the `artistMbIds` field (optional)
    pub fn artist_mb_ids(mut self, value: impl Into<Option<Vec<S>>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `artistMbIds` field to an Option value (optional)
    pub fn maybe_artist_mb_ids(mut self, value: Option<Vec<S>>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<St: play_state::State, S: BosStr> PlayBuilder<St, S> {
    /// Set the `artistNames` field (optional)
    pub fn artist_names(mut self, value: impl Into<Option<Vec<S>>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `artistNames` field to an Option value (optional)
    pub fn maybe_artist_names(mut self, value: Option<Vec<S>>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<St: play_state::State, S: BosStr> PlayBuilder<St, S> {
    /// Set the `artists` field (optional)
    pub fn artists(mut self, value: impl Into<Option<Vec<Artist<S>>>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `artists` field to an Option value (optional)
    pub fn maybe_artists(mut self, value: Option<Vec<Artist<S>>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<St: play_state::State, S: BosStr> PlayBuilder<St, S> {
    /// Set the `duration` field (optional)
    pub fn duration(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `duration` field to an Option value (optional)
    pub fn maybe_duration(mut self, value: Option<i64>) -> Self {
        self._fields.3 = value;
        self
    }
}

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

impl<St: play_state::State, S: BosStr> PlayBuilder<St, S> {
    /// Set the `musicServiceBaseDomain` field (optional)
    pub fn music_service_base_domain(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.5 = value.into();
        self
    }
    /// Set the `musicServiceBaseDomain` field to an Option value (optional)
    pub fn maybe_music_service_base_domain(mut self, value: Option<S>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<St: play_state::State, S: BosStr> PlayBuilder<St, S> {
    /// Set the `originUrl` field (optional)
    pub fn origin_url(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `originUrl` field to an Option value (optional)
    pub fn maybe_origin_url(mut self, value: Option<S>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<St: play_state::State, S: BosStr> PlayBuilder<St, S> {
    /// Set the `playedTime` field (optional)
    pub fn played_time(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.7 = value.into();
        self
    }
    /// Set the `playedTime` field to an Option value (optional)
    pub fn maybe_played_time(mut self, value: Option<Datetime>) -> Self {
        self._fields.7 = value;
        self
    }
}

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

impl<St: play_state::State, S: BosStr> PlayBuilder<St, S> {
    /// Set the `releaseDiscriminant` field (optional)
    pub fn release_discriminant(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.9 = value.into();
        self
    }
    /// Set the `releaseDiscriminant` field to an Option value (optional)
    pub fn maybe_release_discriminant(mut self, value: Option<S>) -> Self {
        self._fields.9 = value;
        self
    }
}

impl<St: play_state::State, S: BosStr> PlayBuilder<St, S> {
    /// Set the `releaseMbId` field (optional)
    pub fn release_mb_id(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
        self._fields.10 = value.into();
        self
    }
    /// Set the `releaseMbId` field to an Option value (optional)
    pub fn maybe_release_mb_id(mut self, value: Option<UriValue<S>>) -> Self {
        self._fields.10 = value;
        self
    }
}

impl<St: play_state::State, S: BosStr> PlayBuilder<St, S> {
    /// Set the `releaseName` field (optional)
    pub fn release_name(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.11 = value.into();
        self
    }
    /// Set the `releaseName` field to an Option value (optional)
    pub fn maybe_release_name(mut self, value: Option<S>) -> Self {
        self._fields.11 = value;
        self
    }
}

impl<St: play_state::State, S: BosStr> PlayBuilder<St, S> {
    /// Set the `submissionClientAgent` field (optional)
    pub fn submission_client_agent(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.12 = value.into();
        self
    }
    /// Set the `submissionClientAgent` field to an Option value (optional)
    pub fn maybe_submission_client_agent(mut self, value: Option<S>) -> Self {
        self._fields.12 = value;
        self
    }
}

impl<St: play_state::State, S: BosStr> PlayBuilder<St, S> {
    /// Set the `trackDiscriminant` field (optional)
    pub fn track_discriminant(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.13 = value.into();
        self
    }
    /// Set the `trackDiscriminant` field to an Option value (optional)
    pub fn maybe_track_discriminant(mut self, value: Option<S>) -> Self {
        self._fields.13 = value;
        self
    }
}

impl<St: play_state::State, S: BosStr> PlayBuilder<St, S> {
    /// Set the `trackMbId` field (optional)
    pub fn track_mb_id(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
        self._fields.14 = value.into();
        self
    }
    /// Set the `trackMbId` field to an Option value (optional)
    pub fn maybe_track_mb_id(mut self, value: Option<UriValue<S>>) -> Self {
        self._fields.14 = value;
        self
    }
}

impl<St, S: BosStr> PlayBuilder<St, S>
where
    St: play_state::State,
    St::TrackName: play_state::IsUnset,
{
    /// Set the `trackName` field (required)
    pub fn track_name(
        mut self,
        value: impl Into<S>,
    ) -> PlayBuilder<play_state::SetTrackName<St>, S> {
        self._fields.15 = Option::Some(value.into());
        PlayBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> PlayBuilder<St, S>
where
    St: play_state::State,
    St::TrackName: play_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> Play<S> {
        Play {
            artist_mb_ids: self._fields.0,
            artist_names: self._fields.1,
            artists: self._fields.2,
            duration: self._fields.3,
            isrc: self._fields.4,
            music_service_base_domain: self._fields.5,
            origin_url: self._fields.6,
            played_time: self._fields.7,
            recording_mb_id: self._fields.8,
            release_discriminant: self._fields.9,
            release_mb_id: self._fields.10,
            release_name: self._fields.11,
            submission_client_agent: self._fields.12,
            track_discriminant: self._fields.13,
            track_mb_id: self._fields.14,
            track_name: self._fields.15.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>>) -> Play<S> {
        Play {
            artist_mb_ids: self._fields.0,
            artist_names: self._fields.1,
            artists: self._fields.2,
            duration: self._fields.3,
            isrc: self._fields.4,
            music_service_base_domain: self._fields.5,
            origin_url: self._fields.6,
            played_time: self._fields.7,
            recording_mb_id: self._fields.8,
            release_discriminant: self._fields.9,
            release_mb_id: self._fields.10,
            release_name: self._fields.11,
            submission_client_agent: self._fields.12,
            track_discriminant: self._fields.13,
            track_mb_id: self._fields.14,
            track_name: self._fields.15.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

fn lexicon_doc_fm_teal_alpha_feed_play() -> 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("fm.teal.alpha.feed.play"),
        defs: {
            let mut map = BTreeMap::new();
            map.insert(
                SmolStr::new_static("main"),
                LexUserType::Record(LexRecord {
                    key: Some(CowStr::new_static("tid")),
                    record: LexRecordRecord::Object(LexObject {
                        required: Some(vec![SmolStr::new_static("trackName")]),
                        properties: {
                            #[allow(unused_mut)]
                            let mut map = BTreeMap::new();
                            map.insert(
                                SmolStr::new_static("artistMbIds"),
                                LexObjectProperty::Array(LexArray {
                                    description: Some(
                                        CowStr::new_static(
                                            "DEPRECATED: USE 'artists' INSTEAD. Array of Musicbrainz artist IDs.",
                                        ),
                                    ),
                                    items: LexArrayItem::String(LexString {
                                        ..Default::default()
                                    }),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("artistNames"),
                                LexObjectProperty::Array(LexArray {
                                    description: Some(
                                        CowStr::new_static(
                                            "DEPRECATED: USE 'artists' INSTEAD. Array of artist names in order of original appearance.",
                                        ),
                                    ),
                                    items: LexArrayItem::String(LexString {
                                        min_length: Some(1usize),
                                        max_length: Some(256usize),
                                        max_graphemes: Some(2560usize),
                                        ..Default::default()
                                    }),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("artists"),
                                LexObjectProperty::Array(LexArray {
                                    description: Some(
                                        CowStr::new_static(
                                            "Array of artists in order of original appearance.",
                                        ),
                                    ),
                                    items: LexArrayItem::Ref(LexRef {
                                        r#ref: CowStr::new_static("fm.teal.alpha.feed.defs#artist"),
                                        ..Default::default()
                                    }),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("duration"),
                                LexObjectProperty::Integer(LexInteger {
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("isrc"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "The ISRC code associated with the recording",
                                        ),
                                    ),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("musicServiceBaseDomain"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "The base domain of the music service. e.g. music.apple.com, tidal.com, spotify.com. Defaults to 'local' if unavailable or not provided.",
                                        ),
                                    ),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("originUrl"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static("The URL associated with this track"),
                                    ),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("playedTime"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "The unix timestamp of when the track was played",
                                        ),
                                    ),
                                    format: Some(LexStringFormat::Datetime),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("recordingMbId"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "The MusicBrainz recording ID URI of the track, formatted as mbid:<uuid>",
                                        ),
                                    ),
                                    format: Some(LexStringFormat::Uri),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("releaseDiscriminant"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "Distinguishing information for release variants (e.g. 'Deluxe Edition', 'Remastered', '2023 Remaster', 'Special Edition'). Used to differentiate between different versions of the same base release while maintaining grouping capabilities.",
                                        ),
                                    ),
                                    max_length: Some(128usize),
                                    max_graphemes: Some(1280usize),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("releaseMbId"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "The MusicBrainz release ID URI, formatted as mbid:<uuid>",
                                        ),
                                    ),
                                    format: Some(LexStringFormat::Uri),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("releaseName"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static("The name of the release/album"),
                                    ),
                                    max_length: Some(256usize),
                                    max_graphemes: Some(2560usize),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("submissionClientAgent"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "A metadata string specifying the user agent where the format is `<app-identifier>/<version> (<kernel/OS-base>; <platform/OS-version>; <device-model>)`. If string is provided, only `app-identifier` and `version` are required. `app-identifier` is recommended to be in reverse dns format. Defaults to 'manual/unknown' if unavailable or not provided.",
                                        ),
                                    ),
                                    max_length: Some(256usize),
                                    max_graphemes: Some(2560usize),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("trackDiscriminant"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "Distinguishing information for track variants (e.g. 'Acoustic Version', 'Live at Wembley', 'Radio Edit', 'Demo'). Used to differentiate between different versions of the same base track while maintaining grouping capabilities.",
                                        ),
                                    ),
                                    max_length: Some(128usize),
                                    max_graphemes: Some(1280usize),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("trackMbId"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "The MusicBrainz ID URI of the track, formatted as mbid:<uuid>",
                                        ),
                                    ),
                                    format: Some(LexStringFormat::Uri),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("trackName"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static("The name of the track"),
                                    ),
                                    min_length: Some(1usize),
                                    max_length: Some(256usize),
                                    max_graphemes: Some(2560usize),
                                    ..Default::default()
                                }),
                            );
                            map
                        },
                        ..Default::default()
                    }),
                    ..Default::default()
                }),
            );
            map
        },
        ..Default::default()
    }
}