pub mod get_artist;
pub mod get_artist_albums;
pub mod get_artist_tracks;
pub mod get_artists;
#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{BosStr, CowStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::blob::BlobRef;
use jacquard_common::types::collection::{Collection, RecordError};
use jacquard_common::types::string::{AtUri, Cid, Datetime, 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;
use crate::app_rocksky::artist;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
rename = "app.rocksky.artist",
tag = "$type",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Artist<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub bio: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub born: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub born_in: Option<S>,
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub died: Option<Datetime>,
pub name: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub picture: Option<BlobRef<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub picture_url: Option<UriValue<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ArtistGetRecordOutput<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<Cid<S>>,
pub uri: AtUri<S>,
pub value: Artist<S>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ArtistMbid<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub mbid: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ArtistViewBasic<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub picture: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub play_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sha256: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub unique_listeners: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub uri: Option<AtUri<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ArtistViewDetailed<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub picture: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub play_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sha256: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub unique_listeners: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub uri: Option<AtUri<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ListenerViewBasic<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar: Option<UriValue<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub did: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub handle: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub most_listened_song: Option<artist::SongViewBasic<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub rank: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub total_plays: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct SongViewBasic<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub play_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub uri: Option<AtUri<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> Artist<S> {
pub fn uri(uri: S) -> Result<RecordUri<S, ArtistRecord>, UriError> {
RecordUri::try_from_uri(AtUri::new(uri)?)
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ArtistRecord;
impl XrpcResp for ArtistRecord {
const NSID: &'static str = "app.rocksky.artist";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = ArtistGetRecordOutput<S>;
type Err = RecordError;
}
impl<S: BosStr> From<ArtistGetRecordOutput<S>> for Artist<S> {
fn from(output: ArtistGetRecordOutput<S>) -> Self {
output.value
}
}
impl<S: BosStr> Collection for Artist<S> {
const NSID: &'static str = "app.rocksky.artist";
type Record = ArtistRecord;
}
impl Collection for ArtistRecord {
const NSID: &'static str = "app.rocksky.artist";
type Record = ArtistRecord;
}
impl<S: BosStr> LexiconSchema for Artist<S> {
fn nsid() -> &'static str {
"app.rocksky.artist"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_artist()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.bio {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 1000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("bio"),
max: 1000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.born_in {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 256usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("born_in"),
max: 256usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 512usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("name"),
max: 512usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) < 1usize {
return Err(ConstraintError::MinLength {
path: ValidationPath::from_field("name"),
min: 1usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.picture {
{
let size = value.blob().size;
if size > 2000000usize {
return Err(ConstraintError::BlobTooLarge {
path: ValidationPath::from_field("picture"),
max: 2000000usize,
actual: size,
});
}
}
}
if let Some(ref value) = self.picture {
{
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("picture"),
accepted: vec!["image/png".to_string(), "image/jpeg".to_string()],
actual: mime.to_string(),
});
}
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ArtistMbid<S> {
fn nsid() -> &'static str {
"app.rocksky.artist.defs"
}
fn def_name() -> &'static str {
"artistMbid"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_artist_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.name {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 256usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("name"),
max: 256usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.name {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) < 1usize {
return Err(ConstraintError::MinLength {
path: ValidationPath::from_field("name"),
min: 1usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ArtistViewBasic<S> {
fn nsid() -> &'static str {
"app.rocksky.artist.defs"
}
fn def_name() -> &'static str {
"artistViewBasic"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_artist_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<S: BosStr> LexiconSchema for ArtistViewDetailed<S> {
fn nsid() -> &'static str {
"app.rocksky.artist.defs"
}
fn def_name() -> &'static str {
"artistViewDetailed"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_artist_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<S: BosStr> LexiconSchema for ListenerViewBasic<S> {
fn nsid() -> &'static str {
"app.rocksky.artist.defs"
}
fn def_name() -> &'static str {
"listenerViewBasic"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_artist_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.rank {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("rank"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.total_plays {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("total_plays"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SongViewBasic<S> {
fn nsid() -> &'static str {
"app.rocksky.artist.defs"
}
fn def_name() -> &'static str {
"songViewBasic"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_artist_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,
});
}
}
Ok(())
}
}
pub mod artist_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Name;
type CreatedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Name = Unset;
type CreatedAt = Unset;
}
pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetName<St> {}
impl<St: State> State for SetName<St> {
type Name = Set<members::name>;
type CreatedAt = St::CreatedAt;
}
pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
impl<St: State> State for SetCreatedAt<St> {
type Name = St::Name;
type CreatedAt = Set<members::created_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct name(());
pub struct created_at(());
}
}
pub struct ArtistBuilder<S: BosStr, St: artist_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<S>,
Option<Datetime>,
Option<S>,
Option<Datetime>,
Option<Datetime>,
Option<S>,
Option<BlobRef<S>>,
Option<UriValue<S>>,
Option<Vec<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Artist<S> {
pub fn new() -> ArtistBuilder<S, artist_state::Empty> {
ArtistBuilder::new()
}
}
impl<S: BosStr> ArtistBuilder<S, artist_state::Empty> {
pub fn new() -> Self {
ArtistBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: artist_state::State> ArtistBuilder<S, St> {
pub fn bio(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_bio(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: artist_state::State> ArtistBuilder<S, St> {
pub fn born(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_born(mut self, value: Option<Datetime>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: artist_state::State> ArtistBuilder<S, St> {
pub fn born_in(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_born_in(mut self, value: Option<S>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> ArtistBuilder<S, St>
where
St: artist_state::State,
St::CreatedAt: artist_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> ArtistBuilder<S, artist_state::SetCreatedAt<St>> {
self._fields.3 = Option::Some(value.into());
ArtistBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: artist_state::State> ArtistBuilder<S, St> {
pub fn died(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_died(mut self, value: Option<Datetime>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> ArtistBuilder<S, St>
where
St: artist_state::State,
St::Name: artist_state::IsUnset,
{
pub fn name(mut self, value: impl Into<S>) -> ArtistBuilder<S, artist_state::SetName<St>> {
self._fields.5 = Option::Some(value.into());
ArtistBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: artist_state::State> ArtistBuilder<S, St> {
pub fn picture(mut self, value: impl Into<Option<BlobRef<S>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_picture(mut self, value: Option<BlobRef<S>>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St: artist_state::State> ArtistBuilder<S, St> {
pub fn picture_url(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_picture_url(mut self, value: Option<UriValue<S>>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St: artist_state::State> ArtistBuilder<S, St> {
pub fn tags(mut self, value: impl Into<Option<Vec<S>>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_tags(mut self, value: Option<Vec<S>>) -> Self {
self._fields.8 = value;
self
}
}
impl<S: BosStr, St> ArtistBuilder<S, St>
where
St: artist_state::State,
St::Name: artist_state::IsSet,
St::CreatedAt: artist_state::IsSet,
{
pub fn build(self) -> Artist<S> {
Artist {
bio: self._fields.0,
born: self._fields.1,
born_in: self._fields.2,
created_at: self._fields.3.unwrap(),
died: self._fields.4,
name: self._fields.5.unwrap(),
picture: self._fields.6,
picture_url: self._fields.7,
tags: self._fields.8,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Artist<S> {
Artist {
bio: self._fields.0,
born: self._fields.1,
born_in: self._fields.2,
created_at: self._fields.3.unwrap(),
died: self._fields.4,
name: self._fields.5.unwrap(),
picture: self._fields.6,
picture_url: self._fields.7,
tags: self._fields.8,
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_app_rocksky_artist() -> LexiconDoc<'static> {
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("app.rocksky.artist"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("main"),
LexUserType::Record(LexRecord {
description: Some(CowStr::new_static("A declaration of an artist.")),
key: Some(CowStr::new_static("tid")),
record: LexRecordRecord::Object(LexObject {
required: Some(vec![
SmolStr::new_static("name"),
SmolStr::new_static("createdAt"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("bio"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The biography of the artist.",
)),
max_length: Some(1000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("born"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The birth date of the artist.",
)),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("bornIn"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The birth place of the artist.",
)),
max_length: Some(256usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The date when the artist was created.",
)),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("died"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The death date of the artist.",
)),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The name of the artist.",
)),
min_length: Some(1usize),
max_length: Some(512usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("picture"),
LexObjectProperty::Blob(LexBlob {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pictureUrl"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The URL of the picture of the artist.",
)),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tags"),
LexObjectProperty::Array(LexArray {
description: Some(CowStr::new_static(
"The tags of the artist.",
)),
items: LexArrayItem::String(LexString {
min_length: Some(1usize),
max_length: Some(256usize),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}
}
fn lexicon_doc_app_rocksky_artist_defs() -> LexiconDoc<'static> {
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("app.rocksky.artist.defs"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("artistMbid"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("mbid"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The MusicBrainz Identifier (MBID) of the artist.",
)),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("The name of the artist.")),
min_length: Some(1usize),
max_length: Some(256usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("artistViewBasic"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The unique identifier of the artist.",
)),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("The name of the artist.")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("picture"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("The picture of the artist.")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("playCount"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sha256"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The SHA256 hash of the artist.",
)),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tags"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
..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 artist.")),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("artistViewDetailed"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The unique identifier of the artist.",
)),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("The name of the artist.")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("picture"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("The picture of the artist.")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("playCount"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sha256"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The SHA256 hash of the artist.",
)),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tags"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
..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 artist.")),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("listenerViewBasic"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("avatar"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The URL of the listener's avatar image.",
)),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("The DID of the listener.")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("displayName"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The display name of the listener.",
)),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("handle"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The handle of the listener.",
)),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"The unique identifier of the actor.",
)),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("mostListenedSong"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("app.rocksky.artist.defs#songViewBasic"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("rank"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("totalPlays"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("songViewBasic"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("playCount"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("title"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("The title of the song.")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("The URI of the song.")),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}