qobuz_api_rust/models/
album.rs

1use {
2    serde::{Deserialize, Serialize},
3    serde_json::Value,
4};
5
6use crate::models::{
7    AlbumsSameArtist, Area, Article, Artist, Award, Focus, Genre, Goody, Image, ItemSearchResult,
8    Label, Period, Track,
9};
10
11/// Album model representing an album on the Qobuz platform
12///
13/// This struct contains comprehensive information about an album including its
14/// identification, title, artists, label, genre, image, and various metadata.
15///
16/// # Examples
17///
18/// ```
19/// use qobuz_api_rust::models::Album;
20///
21/// let album = Album {
22///     id: Some("123456".to_string()),
23///     title: Some("Example Album".to_string()),
24///     ..Default::default()
25/// };
26/// ```
27#[derive(Serialize, Deserialize, Debug, Clone, Default)]
28pub struct Album {
29    /// Unique identifier for the album
30    #[serde(rename = "id")]
31    pub id: Option<String>,
32
33    /// Title of the album
34    #[serde(rename = "title")]
35    pub title: Option<String>,
36
37    /// Subtitle of the album (if any)
38    #[serde(rename = "subtitle")]
39    pub subtitle: Option<String>,
40
41    /// Version information for the album (e.g., "Deluxe Edition")
42    #[serde(rename = "version")]
43    pub version: Option<String>,
44
45    /// Universal Product Code for the album
46    #[serde(rename = "upc")]
47    pub upc: Option<String>,
48
49    /// URL to the album on Qobuz
50    #[serde(rename = "url")]
51    pub url: Option<String>,
52
53    /// URL to the product page for the album
54    #[serde(rename = "product_url")]
55    pub product_url: Option<String>,
56
57    /// Relative URL to the album
58    #[serde(rename = "relative_url")]
59    pub relative_url: Option<String>,
60
61    /// Main artist associated with the album (boxed to handle recursive structures)
62    #[serde(rename = "artist")]
63    pub artist: Option<Box<Artist>>,
64
65    /// List of all artists associated with the album (boxed to handle recursive structures)
66    #[serde(rename = "artists")]
67    pub artists: Option<Vec<Box<Artist>>>,
68
69    /// Composer of the album (boxed to handle recursive structures)
70    #[serde(rename = "composer")]
71    pub composer: Option<Box<Artist>>,
72
73    /// Label information for the album
74    #[serde(rename = "label")]
75    pub label: Option<Label>,
76
77    /// Genre information for the album
78    #[serde(rename = "genre")]
79    pub genre: Option<Genre>,
80
81    /// List of genre names associated with the album
82    #[serde(rename = "genres_list")]
83    pub genres_list: Option<Vec<String>>,
84
85    /// Image information for the album artwork
86    #[serde(rename = "image")]
87    pub image: Option<Image>,
88
89    /// Duration of the album in seconds
90    #[serde(rename = "duration")]
91    pub duration: Option<i64>,
92
93    /// Total number of tracks in the album
94    #[serde(rename = "tracks_count")]
95    pub tracks_count: Option<i32>,
96
97    /// Number of media (disks) in the album
98    #[serde(rename = "media_count")]
99    pub media_count: Option<i32>,
100
101    /// Unix timestamp of when the album was released
102    #[serde(rename = "released_at")]
103    pub released_at: Option<i64>,
104
105    /// Date when the album became available for download
106    #[serde(rename = "release_date_download")]
107    pub release_date_download: Option<String>,
108
109    /// Original release date of the album
110    #[serde(rename = "release_date_original")]
111    pub release_date_original: Option<String>,
112
113    /// Date when the album became available for streaming
114    #[serde(rename = "release_date_stream")]
115    pub release_date_stream: Option<String>,
116
117    /// Unix timestamp of when the album was created in the system
118    #[serde(rename = "created_at")]
119    pub created_at: Option<i64>,
120
121    /// Unix timestamp of when the album became purchasable
122    #[serde(rename = "purchasable_at")]
123    pub purchasable_at: Option<i64>,
124
125    /// Unix timestamp of when the album became streamable
126    #[serde(rename = "streamable_at")]
127    pub streamable_at: Option<i64>,
128
129    /// Copyright information for the album
130    #[serde(rename = "copyright")]
131    pub copyright: Option<String>,
132
133    /// Description of the album
134    #[serde(rename = "description")]
135    pub description: Option<String>,
136
137    /// Catchline or tagline for the album
138    #[serde(rename = "catchline")]
139    pub catchline: Option<String>,
140
141    /// Recording information for the album
142    #[serde(rename = "recording_information")]
143    pub recording_information: Option<String>,
144
145    /// Maximum bit depth of the album's audio files
146    #[serde(rename = "maximum_bit_depth")]
147    pub maximum_bit_depth: Option<f64>,
148
149    /// Maximum number of audio channels in the album's files
150    #[serde(rename = "maximum_channel_count")]
151    pub maximum_channel_count: Option<f64>,
152
153    /// Maximum sampling rate of the album's audio files
154    #[serde(rename = "maximum_sampling_rate")]
155    pub maximum_sampling_rate: Option<f64>,
156
157    /// Maximum technical specifications for the album
158    #[serde(rename = "maximum_technical_specifications")]
159    pub maximum_technical_specifications: Option<String>,
160
161    /// Whether the album is available in high-resolution format
162    #[serde(rename = "hires")]
163    pub hires: Option<bool>,
164
165    /// Whether the album is streamable in high-resolution format
166    #[serde(rename = "hires_streamable")]
167    pub hires_streamable: Option<bool>,
168
169    /// Whether the album is displayable to users
170    #[serde(rename = "displayable")]
171    pub displayable: Option<bool>,
172
173    /// Whether the album is available for download
174    #[serde(rename = "downloadable")]
175    pub downloadable: Option<bool>,
176
177    /// Whether the album is available for purchase
178    #[serde(rename = "purchasable")]
179    pub purchasable: Option<bool>,
180
181    /// Whether the album is available for streaming
182    #[serde(rename = "streamable")]
183    pub streamable: Option<bool>,
184
185    /// Whether the album has preview tracks available
186    #[serde(rename = "previewable")]
187    pub previewable: Option<bool>,
188
189    /// Whether the album has sample tracks available
190    #[serde(rename = "sampleable")]
191    pub sampleable: Option<bool>,
192
193    /// Whether the album has parental content warnings
194    #[serde(rename = "parental_warning")]
195    pub parental_warning: Option<bool>,
196
197    /// Whether the album is an official release
198    #[serde(rename = "is_official")]
199    pub is_official: Option<bool>,
200
201    /// Type of product (e.g., "album", "single", "compilation")
202    #[serde(rename = "product_type")]
203    pub product_type: Option<String>,
204
205    /// Type of release (e.g., "album", "single", "ep")
206    #[serde(rename = "release_type")]
207    pub release_type: Option<String>,
208
209    /// Popularity score for the album
210    #[serde(rename = "popularity")]
211    pub popularity: Option<i32>,
212
213    /// Search results for tracks in the album
214    #[serde(rename = "tracks")]
215    pub tracks: Option<ItemSearchResult<Box<Track>>>,
216
217    /// Albums by the same artist
218    #[serde(rename = "albums_same_artist")]
219    pub albums_same_artist: Option<AlbumsSameArtist>,
220
221    /// Area information for the album
222    #[serde(rename = "area")]
223    pub area: Option<Area>,
224
225    /// Articles related to the album
226    #[serde(rename = "articles")]
227    pub articles: Option<Vec<Article>>,
228
229    /// Awards received by the album
230    #[serde(rename = "awards")]
231    pub awards: Option<Vec<Award>>,
232
233    /// Goodies or bonus content related to the album
234    #[serde(rename = "goodies")]
235    pub goodies: Option<Vec<Goody>>,
236
237    /// Focus items related to the album
238    #[serde(rename = "items_focus")]
239    pub items_focus: Option<Vec<Focus>>,
240
241    /// Period information for the album
242    #[serde(rename = "period")]
243    pub period: Option<Period>,
244
245    /// Monthly product sales factor for the album
246    #[serde(rename = "product_sales_factors_monthly")]
247    pub product_sales_factors_monthly: Option<f64>,
248
249    /// Weekly product sales factor for the album
250    #[serde(rename = "product_sales_factors_weekly")]
251    pub product_sales_factors_weekly: Option<f64>,
252
253    /// Yearly product sales factor for the album
254    #[serde(rename = "product_sales_factors_yearly")]
255    pub product_sales_factors_yearly: Option<f64>,
256
257    /// Qobuz-specific ID for the album
258    #[serde(rename = "qobuz_id")]
259    pub qobuz_id: Option<i32>,
260
261    /// Release tags associated with the album
262    #[serde(rename = "release_tags")]
263    pub release_tags: Option<Vec<Value>>,
264
265    /// List of track IDs included in the album
266    #[serde(rename = "track_ids")]
267    pub track_ids: Option<Vec<i32>>,
268}