qobuz_api_rust/models/
metadata.rs

1use serde::{Deserialize, Serialize};
2
3/// Image model containing URLs for different sizes of an image
4///
5/// This struct provides URLs for various sizes of an image, commonly used for
6/// album artwork or artist photos.
7///
8/// # Examples
9///
10/// ```
11/// use qobuz_api_rust::models::Image;
12///
13/// let image = Image {
14///     small: Some("https://example.com/small.jpg".to_string()),
15///     large: Some("https://example.com/large.jpg".to_string()),
16///     ..Default::default()
17/// };
18/// ```
19#[derive(Serialize, Deserialize, Debug, Clone, Default)]
20pub struct Image {
21    /// URL for the small version of the image
22    #[serde(rename = "small")]
23    pub small: Option<String>,
24
25    /// URL for the thumbnail version of the image
26    #[serde(rename = "thumbnail")]
27    pub thumbnail: Option<String>,
28
29    /// URL for the medium version of the image
30    #[serde(rename = "medium")]
31    pub medium: Option<String>,
32
33    /// URL for the large version of the image
34    #[serde(rename = "large")]
35    pub large: Option<String>,
36
37    /// URL for the extra-large version of the image
38    #[serde(rename = "extralarge")]
39    pub extralarge: Option<String>,
40
41    /// URL for the mega version of the image
42    #[serde(rename = "mega")]
43    pub mega: Option<String>,
44
45    /// URL for the back cover version of the image
46    #[serde(rename = "back")]
47    pub back: Option<String>,
48}
49
50/// Audio information model containing replay gain data
51///
52/// This struct contains audio-specific information such as replay gain values
53/// that help normalize playback volume across different tracks.
54///
55/// # Examples
56///
57/// ```
58/// use qobuz_api_rust::models::AudioInfo;
59///
60/// let audio_info = AudioInfo {
61///     replaygain_track_peak: Some(0.98),
62///     replaygain_track_gain: Some(-2.5),
63/// };
64/// ```
65#[derive(Serialize, Deserialize, Debug, Clone, Default)]
66pub struct AudioInfo {
67    /// Peak amplitude value for replay gain normalization
68    #[serde(rename = "replaygain_track_peak")]
69    pub replaygain_track_peak: Option<f64>,
70
71    /// Gain value in dB for replay gain normalization
72    #[serde(rename = "replaygain_track_gain")]
73    pub replaygain_track_gain: Option<f64>,
74}
75
76/// Genre model containing information about a musical genre
77///
78/// This struct represents a musical genre with its identification, name, slug,
79/// path in the genre hierarchy, and color coding.
80///
81/// # Examples
82///
83/// ```
84/// use qobuz_api_rust::models::Genre;
85///
86/// let genre = Genre {
87///     id: Some(123),
88///     name: Some("Classical".to_string()),
89///     slug: Some("classical".to_string()),
90///     ..Default::default()
91/// };
92/// ```
93#[derive(Serialize, Deserialize, Debug, Clone, Default)]
94pub struct Genre {
95    /// Unique identifier for the genre
96    #[serde(rename = "id")]
97    pub id: Option<i32>,
98
99    /// Name of the genre
100    #[serde(rename = "name")]
101    pub name: Option<String>,
102
103    /// URL-friendly slug for the genre
104    #[serde(rename = "slug")]
105    pub slug: Option<String>,
106
107    /// Path in the genre hierarchy as a list of genre IDs
108    #[serde(rename = "path")]
109    pub path: Option<Vec<i32>>,
110
111    /// Color associated with the genre for UI purposes
112    #[serde(rename = "color")]
113    pub color: Option<String>,
114}
115
116/// Label model containing information about a record label
117///
118/// This struct represents a record label with its identification, name, and slug.
119///
120/// # Examples
121///
122/// ```
123/// use qobuz_api_rust::models::Label;
124///
125/// let label = Label {
126///     id: Some(456),
127///     name: Some("Example Records".to_string()),
128///     slug: Some("example-records".to_string()),
129/// };
130/// ```
131#[derive(Serialize, Deserialize, Debug, Clone, Default)]
132pub struct Label {
133    /// Unique identifier for the label
134    #[serde(rename = "id")]
135    pub id: Option<i32>,
136
137    /// Name of the label
138    #[serde(rename = "name")]
139    pub name: Option<String>,
140
141    /// URL-friendly slug for the label
142    #[serde(rename = "slug")]
143    pub slug: Option<String>,
144}
145
146/// Tag model containing information about a tag
147///
148/// This struct represents a tag with its identification, name, slug, color,
149/// and various properties related to discovery and genre classification.
150///
151/// # Examples
152///
153/// ```
154/// use qobuz_api_rust::models::Tag;
155///
156/// let tag = Tag {
157///     id: Some(123),
158///     name: Some("Jazz".to_string()),
159///     slug: Some("jazz".to_string()),
160///     ..Default::default()
161/// };
162/// ```
163#[derive(Serialize, Deserialize, Debug, Clone, Default)]
164pub struct Tag {
165    /// Unique identifier for the tag
166    #[serde(rename = "id")]
167    pub id: Option<i32>,
168
169    /// Name of the tag
170    #[serde(rename = "name")]
171    pub name: Option<String>,
172
173    /// Name of the tag in JSON format
174    #[serde(rename = "name_json")]
175    pub name_json: Option<String>,
176
177    /// URL-friendly slug for the tag
178    #[serde(rename = "slug")]
179    pub slug: Option<String>,
180
181    /// Color associated with the tag for UI purposes
182    #[serde(rename = "color")]
183    pub color: Option<String>,
184
185    /// Whether the tag is a discovery tag
186    #[serde(rename = "is_discover")]
187    pub is_discover: Option<bool>,
188
189    /// ID of the featured tag
190    #[serde(rename = "featured_tag_id")]
191    pub featured_tag_id: Option<String>,
192
193    /// Genre tag information for the tag
194    #[serde(rename = "genre_tag")]
195    pub genre_tag: Option<GenreTag>,
196}
197
198/// Genre tag model containing information about a genre tag
199///
200/// This struct represents a genre tag with its genre ID, name, and slug.
201///
202/// # Examples
203///
204/// ```
205/// use qobuz_api_rust::models::GenreTag;
206///
207/// let genre_tag = GenreTag {
208///     genre_id: Some("123".to_string()),
209///     name: Some("Rock".to_string()),
210///     slug: Some("rock".to_string()),
211/// };
212/// ```
213#[derive(Serialize, Deserialize, Debug, Clone)]
214pub struct GenreTag {
215    /// ID of the associated genre
216    #[serde(rename = "genre_id")]
217    pub genre_id: Option<String>,
218
219    /// Name of the genre tag
220    #[serde(rename = "name")]
221    pub name: Option<String>,
222
223    /// URL-friendly slug for the genre tag
224    #[serde(rename = "slug")]
225    pub slug: Option<String>,
226}
227
228/// Area model containing information about a geographical area
229///
230/// This struct represents a geographical area with its identification, name, and slug.
231///
232/// # Examples
233///
234/// ```
235/// use qobuz_api_rust::models::Area;
236///
237/// let area = Area {
238///     id: Some(123),
239///     name: Some("United States".to_string()),
240///     slug: Some("united-states".to_string()),
241/// };
242/// ```
243#[derive(Serialize, Deserialize, Debug, Clone, Default)]
244pub struct Area {
245    /// Unique identifier for the area
246    #[serde(rename = "id")]
247    pub id: Option<i32>,
248
249    /// Name of the area
250    #[serde(rename = "name")]
251    pub name: Option<String>,
252
253    /// URL-friendly slug for the area
254    #[serde(rename = "slug")]
255    pub slug: Option<String>,
256}
257
258/// Award model containing information about an award
259///
260/// This struct represents an award with its identification, name, year, and description.
261///
262/// # Examples
263///
264/// ```
265/// use qobuz_api_rust::models::Award;
266///
267/// let award = Award {
268///     id: Some(456),
269///     name: Some("Best Album".to_string()),
270///     year: Some(2023),
271///     description: Some("Award for the best album of the year".to_string()),
272/// };
273/// ```
274#[derive(Serialize, Deserialize, Debug, Clone, Default)]
275pub struct Award {
276    /// Unique identifier for the award
277    #[serde(rename = "id")]
278    pub id: Option<i32>,
279
280    /// Name of the award
281    #[serde(rename = "name")]
282    pub name: Option<String>,
283
284    /// Year when the award was given
285    #[serde(rename = "year")]
286    pub year: Option<i32>,
287
288    /// Description of the award
289    #[serde(rename = "description")]
290    pub description: Option<String>,
291}
292
293/// Goody model containing information about bonus content
294///
295/// This struct represents additional content or "goodies" associated with an album,
296/// such as booklets, photos, or other bonus materials.
297///
298/// # Examples
299///
300/// ```
301/// use qobuz_api_rust::models::Goody;
302///
303/// let goody = Goody {
304///     id: Some(789),
305///     title: Some("Digital Booklet".to_string()),
306///     type_field: Some("booklet".to_string()),
307///     ..Default::default()
308/// };
309/// ```
310#[derive(Serialize, Deserialize, Debug, Clone, Default)]
311pub struct Goody {
312    /// Unique identifier for the goody
313    #[serde(rename = "id")]
314    pub id: Option<i32>,
315
316    /// Title of the goody
317    #[serde(rename = "title")]
318    pub title: Option<String>,
319
320    /// URL to access the goody
321    #[serde(rename = "url")]
322    pub url: Option<String>,
323
324    /// Type of the goody (e.g., "booklet", "photo", "video")
325    #[serde(rename = "type")]
326    pub type_field: Option<String>,
327
328    /// URL to the goody's image
329    #[serde(rename = "image")]
330    pub image: Option<String>,
331}
332
333/// Focus model containing information about a focused item
334///
335/// This struct represents a focused item with its identification and type.
336///
337/// # Examples
338///
339/// ```
340/// use qobuz_api_rust::models::Focus;
341///
342/// let focus = Focus {
343///     id: Some("focus123".to_string()),
344///     type_field: Some("album".to_string()),
345/// };
346/// ```
347#[derive(Serialize, Deserialize, Debug, Clone, Default)]
348pub struct Focus {
349    /// Unique identifier for the focus item
350    #[serde(rename = "id")]
351    pub id: Option<String>,
352
353    /// Type of the focus item (e.g., "album", "artist", "track")
354    #[serde(rename = "type")]
355    pub type_field: Option<String>,
356}
357
358/// Period model containing information about a time period
359///
360/// This struct represents a time period with its identification, name, and slug.
361///
362/// # Examples
363///
364/// ```
365/// use qobuz_api_rust::models::Period;
366///
367/// let period = Period {
368///     id: Some(1980),
369///     name: Some("1980s".to_string()),
370///     slug: Some("1980s".to_string()),
371/// };
372/// ```
373#[derive(Serialize, Deserialize, Debug, Clone, Default)]
374pub struct Period {
375    /// Unique identifier for the period
376    #[serde(rename = "id")]
377    pub id: Option<i32>,
378
379    /// Name of the period
380    #[serde(rename = "name")]
381    pub name: Option<String>,
382
383    /// URL-friendly slug for the period
384    #[serde(rename = "slug")]
385    pub slug: Option<String>,
386}