use serde::{Deserialize, Serialize}; use crate::{CopyrightType, DatePrecision, EpisodeId, Image, Page, ShowId}; /// Copyright object #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct Copyright { pub text: String, #[serde(rename = "type")] pub _type: CopyrightType, } /// Simplified show object #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct SimplifiedShow { pub available_markets: Vec, pub copyrights: Vec, pub description: String, pub explicit: bool, pub href: String, pub id: ShowId<'static>, pub images: Vec, pub is_externally_hosted: Option, pub languages: Vec, pub media_type: String, pub name: String, pub publisher: String, } /// [`SimplifiedShow`] wrapped by [`Vec`] #[derive(Deserialize)] pub struct SimplifiedShows { pub shows: Vec, } /// Saved show object #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct Show { pub added_at: String, pub show: SimplifiedShow, } /// Full show object #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct FullShow { pub available_markets: Vec, pub copyrights: Vec, pub description: String, pub explicit: bool, pub episodes: Page, pub href: String, pub id: ShowId<'static>, pub images: Vec, pub is_externally_hosted: Option, pub languages: Vec, pub media_type: String, pub name: String, pub publisher: String, } /// Simplified episode object #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct SimplifiedEpisode { pub audio_preview_url: Option, pub description: String, pub duration_ms: u32, pub explicit: bool, pub href: String, pub id: EpisodeId<'static>, pub images: Vec, pub is_externally_hosted: bool, pub is_playable: bool, #[deprecated(note = "This `language` field is deprecated and might be \ removed in the future by Spotify. Please use the languages field \ instead")] pub language: String, pub languages: Vec, pub name: String, pub release_date: String, pub release_date_precision: DatePrecision, pub resume_point: Option, } /// Full episode object #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct FullEpisode { pub audio_preview_url: Option, pub description: String, pub duration_ms: u32, pub explicit: bool, pub href: String, pub id: EpisodeId<'static>, pub images: Vec, pub is_externally_hosted: bool, pub is_playable: bool, #[deprecated(note = "This `language` field is deprecated and might be \ removed in the future by Spotify. Please use the languages field \ instead")] pub language: String, pub languages: Vec, pub name: String, pub release_date: String, pub release_date_precision: DatePrecision, pub resume_point: Option, pub show: SimplifiedShow, } /// Intermediate episodes feature object wrapped by `Vec` #[derive(Deserialize)] pub struct EpisodesPayload { pub episodes: Vec, } /// Resume point object #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct ResumePoint { pub fully_played: bool, pub resume_position_ms: u32, }