pub mod get_album;
pub mod get_album_tracks;
pub mod get_albums;
#[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, 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};
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Album<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub album_art: Option<BlobRef<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub album_art_url: Option<UriValue<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub apple_music_link: Option<UriValue<'a>>,
#[serde(borrow)]
pub artist: CowStr<'a>,
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub duration: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub genre: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub release_date: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub spotify_link: Option<UriValue<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub tags: Option<Vec<CowStr<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub tidal_link: Option<UriValue<'a>>,
#[serde(borrow)]
pub title: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
pub year: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub youtube_link: Option<UriValue<'a>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct AlbumGetRecordOutput<'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: Album<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct AlbumViewBasic<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub album_art: Option<UriValue<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub artist: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub artist_uri: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub id: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub play_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub release_date: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub sha256: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub title: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub unique_listeners: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub uri: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub year: Option<i64>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct AlbumViewDetailed<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub album_art: Option<UriValue<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub artist: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub artist_uri: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub id: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub play_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub release_date: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub sha256: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub tags: Option<Vec<CowStr<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub title: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub tracks: Option<Vec<Data<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub unique_listeners: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub uri: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub year: Option<i64>,
}
impl<'a> Album<'a> {
pub fn uri(
uri: impl Into<CowStr<'a>>,
) -> Result<RecordUri<'a, AlbumRecord>, UriError> {
RecordUri::try_from_uri(AtUri::new_cow(uri.into())?)
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AlbumRecord;
impl XrpcResp for AlbumRecord {
const NSID: &'static str = "app.rocksky.album";
const ENCODING: &'static str = "application/json";
type Output<'de> = AlbumGetRecordOutput<'de>;
type Err<'de> = RecordError<'de>;
}
impl From<AlbumGetRecordOutput<'_>> for Album<'_> {
fn from(output: AlbumGetRecordOutput<'_>) -> Self {
use jacquard_common::IntoStatic;
output.value.into_static()
}
}
impl Collection for Album<'_> {
const NSID: &'static str = "app.rocksky.album";
type Record = AlbumRecord;
}
impl Collection for AlbumRecord {
const NSID: &'static str = "app.rocksky.album";
type Record = AlbumRecord;
}
impl<'a> LexiconSchema for Album<'a> {
fn nsid() -> &'static str {
"app.rocksky.album"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_album()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.album_art {
{
let size = value.blob().size;
if size > 2000000usize {
return Err(ConstraintError::BlobTooLarge {
path: ValidationPath::from_field("album_art"),
max: 2000000usize,
actual: size,
});
}
}
}
if let Some(ref value) = self.album_art {
{
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("album_art"),
accepted: vec![
"image/png".to_string(), "image/jpeg".to_string()
],
actual: mime.to_string(),
});
}
}
}
{
let value = &self.artist;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 256usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("artist"),
max: 256usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.artist;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) < 1usize {
return Err(ConstraintError::MinLength {
path: ValidationPath::from_field("artist"),
min: 1usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.genre {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 256usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("genre"),
max: 256usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.title;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 512usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("title"),
max: 512usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.title;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) < 1usize {
return Err(ConstraintError::MinLength {
path: ValidationPath::from_field("title"),
min: 1usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<'a> LexiconSchema for AlbumViewBasic<'a> {
fn nsid() -> &'static str {
"app.rocksky.album.defs"
}
fn def_name() -> &'static str {
"albumViewBasic"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_album_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.play_count {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("play_count"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.unique_listeners {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("unique_listeners"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<'a> LexiconSchema for AlbumViewDetailed<'a> {
fn nsid() -> &'static str {
"app.rocksky.album.defs"
}
fn def_name() -> &'static str {
"albumViewDetailed"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_album_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.play_count {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("play_count"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.unique_listeners {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("unique_listeners"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
pub mod album_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Artist;
type Title;
type CreatedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Artist = Unset;
type Title = Unset;
type CreatedAt = Unset;
}
pub struct SetArtist<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetArtist<S> {}
impl<S: State> State for SetArtist<S> {
type Artist = Set<members::artist>;
type Title = S::Title;
type CreatedAt = S::CreatedAt;
}
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 Artist = S::Artist;
type Title = Set<members::title>;
type CreatedAt = S::CreatedAt;
}
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 Artist = S::Artist;
type Title = S::Title;
type CreatedAt = Set<members::created_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct artist(());
pub struct title(());
pub struct created_at(());
}
}
pub struct AlbumBuilder<'a, S: album_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<BlobRef<'a>>,
Option<UriValue<'a>>,
Option<UriValue<'a>>,
Option<CowStr<'a>>,
Option<Datetime>,
Option<i64>,
Option<CowStr<'a>>,
Option<Datetime>,
Option<UriValue<'a>>,
Option<Vec<CowStr<'a>>>,
Option<UriValue<'a>>,
Option<CowStr<'a>>,
Option<i64>,
Option<UriValue<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> Album<'a> {
pub fn new() -> AlbumBuilder<'a, album_state::Empty> {
AlbumBuilder::new()
}
}
impl<'a> AlbumBuilder<'a, album_state::Empty> {
pub fn new() -> Self {
AlbumBuilder {
_state: PhantomData,
_fields: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_lifetime: PhantomData,
}
}
}
impl<'a, S: album_state::State> AlbumBuilder<'a, S> {
pub fn album_art(mut self, value: impl Into<Option<BlobRef<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_album_art(mut self, value: Option<BlobRef<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S: album_state::State> AlbumBuilder<'a, S> {
pub fn album_art_url(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_album_art_url(mut self, value: Option<UriValue<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S: album_state::State> AlbumBuilder<'a, S> {
pub fn apple_music_link(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_apple_music_link(mut self, value: Option<UriValue<'a>>) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S> AlbumBuilder<'a, S>
where
S: album_state::State,
S::Artist: album_state::IsUnset,
{
pub fn artist(
mut self,
value: impl Into<CowStr<'a>>,
) -> AlbumBuilder<'a, album_state::SetArtist<S>> {
self._fields.3 = Option::Some(value.into());
AlbumBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> AlbumBuilder<'a, S>
where
S: album_state::State,
S::CreatedAt: album_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> AlbumBuilder<'a, album_state::SetCreatedAt<S>> {
self._fields.4 = Option::Some(value.into());
AlbumBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: album_state::State> AlbumBuilder<'a, S> {
pub fn duration(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_duration(mut self, value: Option<i64>) -> Self {
self._fields.5 = value;
self
}
}
impl<'a, S: album_state::State> AlbumBuilder<'a, S> {
pub fn genre(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_genre(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.6 = value;
self
}
}
impl<'a, S: album_state::State> AlbumBuilder<'a, S> {
pub fn release_date(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_release_date(mut self, value: Option<Datetime>) -> Self {
self._fields.7 = value;
self
}
}
impl<'a, S: album_state::State> AlbumBuilder<'a, S> {
pub fn spotify_link(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_spotify_link(mut self, value: Option<UriValue<'a>>) -> Self {
self._fields.8 = value;
self
}
}
impl<'a, S: album_state::State> AlbumBuilder<'a, S> {
pub fn tags(mut self, value: impl Into<Option<Vec<CowStr<'a>>>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_tags(mut self, value: Option<Vec<CowStr<'a>>>) -> Self {
self._fields.9 = value;
self
}
}
impl<'a, S: album_state::State> AlbumBuilder<'a, S> {
pub fn tidal_link(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_tidal_link(mut self, value: Option<UriValue<'a>>) -> Self {
self._fields.10 = value;
self
}
}
impl<'a, S> AlbumBuilder<'a, S>
where
S: album_state::State,
S::Title: album_state::IsUnset,
{
pub fn title(
mut self,
value: impl Into<CowStr<'a>>,
) -> AlbumBuilder<'a, album_state::SetTitle<S>> {
self._fields.11 = Option::Some(value.into());
AlbumBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: album_state::State> AlbumBuilder<'a, S> {
pub fn year(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_year(mut self, value: Option<i64>) -> Self {
self._fields.12 = value;
self
}
}
impl<'a, S: album_state::State> AlbumBuilder<'a, S> {
pub fn youtube_link(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
self._fields.13 = value.into();
self
}
pub fn maybe_youtube_link(mut self, value: Option<UriValue<'a>>) -> Self {
self._fields.13 = value;
self
}
}
impl<'a, S> AlbumBuilder<'a, S>
where
S: album_state::State,
S::Artist: album_state::IsSet,
S::Title: album_state::IsSet,
S::CreatedAt: album_state::IsSet,
{
pub fn build(self) -> Album<'a> {
Album {
album_art: self._fields.0,
album_art_url: self._fields.1,
apple_music_link: self._fields.2,
artist: self._fields.3.unwrap(),
created_at: self._fields.4.unwrap(),
duration: self._fields.5,
genre: self._fields.6,
release_date: self._fields.7,
spotify_link: self._fields.8,
tags: self._fields.9,
tidal_link: self._fields.10,
title: self._fields.11.unwrap(),
year: self._fields.12,
youtube_link: self._fields.13,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> Album<'a> {
Album {
album_art: self._fields.0,
album_art_url: self._fields.1,
apple_music_link: self._fields.2,
artist: self._fields.3.unwrap(),
created_at: self._fields.4.unwrap(),
duration: self._fields.5,
genre: self._fields.6,
release_date: self._fields.7,
spotify_link: self._fields.8,
tags: self._fields.9,
tidal_link: self._fields.10,
title: self._fields.11.unwrap(),
year: self._fields.12,
youtube_link: self._fields.13,
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_app_rocksky_album() -> LexiconDoc<'static> {
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
use alloc::collections::BTreeMap;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("app.rocksky.album"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("main"),
LexUserType::Record(LexRecord {
description: Some(CowStr::new_static("A declaration of an album.")),
key: Some(CowStr::new_static("tid")),
record: LexRecordRecord::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("title"), SmolStr::new_static("artist"),
SmolStr::new_static("createdAt")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("albumArt"),
LexObjectProperty::Blob(LexBlob { ..Default::default() }),
);
map.insert(
SmolStr::new_static("albumArtUrl"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The URL of the album art of the album."),
),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("appleMusicLink"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The Apple Music link of the album."),
),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("artist"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The artist of the album."),
),
min_length: Some(1usize),
max_length: Some(256usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The date and time when the album was created.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("duration"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("genre"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The genre of the album."),
),
max_length: Some(256usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("releaseDate"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The release date of the album."),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("spotifyLink"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The Spotify link of the album."),
),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tags"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static("The tags of the album."),
),
items: LexArrayItem::String(LexString {
min_length: Some(1usize),
max_length: Some(256usize),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tidalLink"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The tidal link of the album."),
),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("title"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The title of the album."),
),
min_length: Some(1usize),
max_length: Some(512usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("year"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("youtubeLink"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The YouTube link of the album."),
),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map
},
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}
}
fn lexicon_doc_app_rocksky_album_defs() -> LexiconDoc<'static> {
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
use alloc::collections::BTreeMap;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("app.rocksky.album.defs"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("albumViewBasic"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("albumArt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The URL of the album art image."),
),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("artist"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The artist of the album."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("artistUri"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The URI of the album's artist."),
),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The unique identifier of the album."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("playCount"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("releaseDate"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The release date of the album."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sha256"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The SHA256 hash of the album."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("title"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The title of the album."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uniqueListeners"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The URI of the album."),
),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("year"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("albumViewDetailed"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("albumArt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The URL of the album art image."),
),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("artist"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The artist of the album."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("artistUri"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The URI of the album's artist."),
),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The unique identifier of the album."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("playCount"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("releaseDate"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The release date of the album."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sha256"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The SHA256 hash of the album."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tags"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("title"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The title of the album."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tracks"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static(
"app.rocksky.song.defs.songViewBasic",
),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uniqueListeners"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The URI of the album."),
),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("year"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}