pub mod generator;
pub mod get_feed;
pub mod get_feed_generator;
pub mod get_feed_generators;
pub mod get_feed_skeleton;
pub mod get_now_playings;
pub mod get_stories;
pub mod search;
use jacquard_common::CowStr;
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::types::ident::AtIdentifier;
use jacquard_common::types::string::{AtUri, UriValue};
use jacquard_derive::{IntoStatic, lexicon, open_union};
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::app_rocksky::actor::ProfileViewBasic;
use crate::app_rocksky::album::AlbumViewBasic;
use crate::app_rocksky::artist::ArtistViewBasic;
use crate::app_rocksky::playlist::PlaylistViewBasic;
use crate::app_rocksky::scrobble::ScrobbleViewBasic;
use crate::app_rocksky::song::SongViewBasic;
use crate::app_rocksky::feed;
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct FeedGeneratorView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub avatar: Option<UriValue<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub creator: Option<ProfileViewBasic<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub description: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub id: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub name: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub uri: Option<AtUri<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct FeedGeneratorsView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub feeds: Option<Vec<feed::FeedGeneratorView<'a>>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct FeedItemView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub scrobble: Option<ScrobbleViewBasic<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct FeedUriView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub uri: Option<AtUri<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct FeedView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub cursor: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub feed: Option<Vec<feed::FeedItemView<'a>>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct NowPlayingView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub album: Option<CowStr<'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 album_artist: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub album_uri: Option<AtUri<'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 avatar: Option<UriValue<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub created_at: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub did: Option<AtIdentifier<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub handle: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub id: Option<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 track_id: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub track_uri: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub uri: Option<AtUri<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct NowPlayingsView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub now_playings: Option<Vec<feed::NowPlayingView<'a>>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct SearchResultsView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_total_hits: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub hits: Option<Vec<SearchResultsViewHitsItem<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub offset: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub processing_time_ms: Option<i64>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum SearchResultsViewHitsItem<'a> {
#[serde(rename = "app.rocksky.song.defs#songViewBasic")]
SongViewBasic(Box<SongViewBasic<'a>>),
#[serde(rename = "app.rocksky.album.defs#albumViewBasic")]
AlbumViewBasic(Box<AlbumViewBasic<'a>>),
#[serde(rename = "app.rocksky.artist.defs#artistViewBasic")]
ArtistViewBasic(Box<ArtistViewBasic<'a>>),
#[serde(rename = "app.rocksky.playlist.defs#playlistViewBasic")]
PlaylistViewBasic(Box<PlaylistViewBasic<'a>>),
#[serde(rename = "app.rocksky.actor.defs#profileViewBasic")]
ProfileViewBasic(Box<ProfileViewBasic<'a>>),
}
impl<'a> LexiconSchema for FeedGeneratorView<'a> {
fn nsid() -> &'static str {
"app.rocksky.feed.defs"
}
fn def_name() -> &'static str {
"feedGeneratorView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<'a> LexiconSchema for FeedGeneratorsView<'a> {
fn nsid() -> &'static str {
"app.rocksky.feed.defs"
}
fn def_name() -> &'static str {
"feedGeneratorsView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<'a> LexiconSchema for FeedItemView<'a> {
fn nsid() -> &'static str {
"app.rocksky.feed.defs"
}
fn def_name() -> &'static str {
"feedItemView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<'a> LexiconSchema for FeedUriView<'a> {
fn nsid() -> &'static str {
"app.rocksky.feed.defs"
}
fn def_name() -> &'static str {
"feedUriView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<'a> LexiconSchema for FeedView<'a> {
fn nsid() -> &'static str {
"app.rocksky.feed.defs"
}
fn def_name() -> &'static str {
"feedView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<'a> LexiconSchema for NowPlayingView<'a> {
fn nsid() -> &'static str {
"app.rocksky.feed.defs"
}
fn def_name() -> &'static str {
"nowPlayingView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<'a> LexiconSchema for NowPlayingsView<'a> {
fn nsid() -> &'static str {
"app.rocksky.feed.defs"
}
fn def_name() -> &'static str {
"nowPlayingsView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<'a> LexiconSchema for SearchResultsView<'a> {
fn nsid() -> &'static str {
"app.rocksky.feed.defs"
}
fn def_name() -> &'static str {
"searchResultsView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_rocksky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
fn lexicon_doc_app_rocksky_feed_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.feed.defs"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("feedGeneratorView"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("avatar"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("creator"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.rocksky.actor.defs#profileViewBasic",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("description"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("feedGeneratorsView"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("feeds"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static(
"app.rocksky.feed.defs#feedGeneratorView",
),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("feedItemView"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("scrobble"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.rocksky.scrobble.defs#scrobbleViewBasic",
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("feedUriView"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("The feed URI.")),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("feedView"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("cursor"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The pagination cursor for the next set of results.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("feed"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static(
"app.rocksky.feed.defs#feedItemView",
),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("nowPlayingView"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("album"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("albumArt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("albumArtist"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("albumUri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("artist"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("artistUri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("avatar"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtIdentifier),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("handle"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("title"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("trackId"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("trackUri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("nowPlayingsView"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("nowPlayings"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static(
"app.rocksky.feed.defs#nowPlayingView",
),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("searchResultsView"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("estimatedTotalHits"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hits"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Union(LexRefUnion {
refs: vec![
CowStr::new_static("app.rocksky.song.defs#songViewBasic"),
CowStr::new_static("app.rocksky.album.defs#albumViewBasic"),
CowStr::new_static("app.rocksky.artist.defs#artistViewBasic"),
CowStr::new_static("app.rocksky.playlist.defs#playlistViewBasic"),
CowStr::new_static("app.rocksky.actor.defs#profileViewBasic")
],
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("limit"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("offset"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("processingTimeMs"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}