1use chrono::{DateTime, Utc};
2use serde::Deserialize;
3use spotify_rs_macros::docs;
4
5use super::*;
6
7#[derive(Clone, Debug, Deserialize, PartialEq)]
9#[docs]
10pub struct Show {
11 #[serde(default)]
12 pub available_markets: Vec<String>,
13 pub copyrights: Vec<String>,
14 pub description: String,
15 pub html_description: String,
16 pub explicit: bool,
17 pub external_urls: ExternalUrls,
18 pub href: String,
19 pub id: String,
20 pub images: Vec<Image>,
21 pub is_externally_hosted: Option<bool>,
24 pub languages: Vec<String>,
25 pub media_type: String,
26 pub name: String,
27 pub publisher: String,
28 pub r#type: String,
29 pub uri: String,
30 pub total_episodes: u32,
32 pub episodes: Page<SimplifiedEpisode>,
34}
35
36#[derive(Clone, Debug, Deserialize, PartialEq)]
40#[docs(name = "show")]
41pub struct SimplifiedShow {
42 #[serde(default)]
43 pub available_markets: Vec<String>,
44 pub copyrights: Vec<String>,
45 pub description: String,
46 pub html_description: String,
47 pub explicit: bool,
48 pub external_urls: ExternalUrls,
49 pub href: String,
50 pub id: String,
51 pub images: Vec<Image>,
52 pub is_externally_hosted: Option<bool>,
55 pub languages: Vec<String>,
56 pub media_type: String,
57 pub name: String,
58 pub publisher: String,
59 pub r#type: String,
60 pub uri: String,
61 pub total_episodes: u32,
63}
64
65#[derive(Clone, Debug, Deserialize, PartialEq)]
67pub struct SavedShow {
68 pub added_at: DateTime<Utc>,
70 pub show: SimplifiedShow,
72}
73
74#[derive(Clone, Debug, Deserialize, PartialEq)]
76pub(crate) struct Shows {
77 pub(crate) shows: Vec<Option<SimplifiedShow>>,
78}
79
80#[derive(Clone, Debug, Deserialize, PartialEq)]
82#[docs]
83pub struct Episode {
84 pub audio_preview_url: Option<String>,
91 pub description: String,
92 pub html_description: String,
93 pub duration_ms: u32,
94 pub explicit: bool,
95 pub external_urls: ExternalUrls,
96 pub href: String,
97 pub id: String,
98 pub images: Vec<Image>,
99 pub is_externally_hosted: bool,
101 pub is_playable: bool,
102 pub languages: Vec<String>,
103 pub name: String,
104 pub release_date: String,
105 pub release_date_precision: DatePrecision,
106 pub resume_point: Option<ResumePoint>,
107 pub r#type: String,
108 pub uri: String,
109 pub restrictions: Option<Restriction>,
111 pub show: SimplifiedShow,
113}
114
115#[derive(Clone, Debug, Deserialize, PartialEq)]
119#[docs(name = "episode")]
120pub struct SimplifiedEpisode {
121 pub audio_preview_url: Option<String>,
128 pub description: String,
129 pub html_description: String,
130 pub duration_ms: u32,
131 pub explicit: bool,
132 pub external_urls: ExternalUrls,
133 pub href: String,
134 pub id: String,
135 pub images: Vec<Image>,
136 pub is_externally_hosted: bool,
138 pub is_playable: bool,
139 pub languages: Vec<String>,
140 pub name: String,
141 pub release_date: String,
142 pub release_date_precision: DatePrecision,
143 pub resume_point: Option<ResumePoint>,
144 pub r#type: String,
145 pub uri: String,
146 pub restrictions: Option<Restriction>,
148}
149
150#[derive(Clone, Debug, Deserialize, PartialEq)]
152pub struct SavedEpisode {
153 pub added_at: DateTime<Utc>,
155 pub episode: Episode,
157}
158
159#[derive(Clone, Debug, Deserialize, PartialEq)]
161pub(crate) struct Episodes {
162 pub(crate) episodes: Vec<Option<Episode>>,
163}