ddex_core/models/graph/
release.rs1use serde::{Deserialize, Serialize};
5use chrono::{DateTime, Utc};
6use crate::models::{Extensions, Comment, AttributeMap, common::{Identifier, LocalizedString}};
7use super::Artist;
8
9#[derive(Debug, Clone, Serialize, Deserialize)]
10pub struct Release {
11 pub release_reference: String,
12 pub release_id: Vec<Identifier>,
13 pub release_title: Vec<LocalizedString>,
14 pub release_subtitle: Option<Vec<LocalizedString>>,
15 pub release_type: Option<ReleaseType>,
16 pub genre: Vec<Genre>,
17 pub release_resource_reference_list: Vec<ReleaseResourceReference>,
18 pub display_artist: Vec<Artist>,
19 pub party_list: Vec<ReleaseParty>,
20 pub release_date: Vec<ReleaseEvent>,
21 pub territory_code: Vec<String>,
22 pub excluded_territory_code: Vec<String>,
23 pub attributes: Option<AttributeMap>,
25 pub extensions: Option<Extensions>,
27 pub comments: Option<Vec<Comment>>,
29}
30
31#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
32pub enum ReleaseType {
33 Album,
34 Single,
35 EP,
36 Compilation,
37 Other(String),
38}
39
40#[derive(Debug, Clone, Serialize, Deserialize)]
41pub struct Genre {
42 pub genre_text: String,
43 pub sub_genre: Option<String>,
44 pub attributes: Option<AttributeMap>,
46 pub extensions: Option<Extensions>,
48 pub comments: Option<Vec<Comment>>,
50}
51
52#[derive(Debug, Clone, Serialize, Deserialize)]
53pub struct ReleaseResourceReference {
54 pub resource_reference: String,
55 pub sequence_number: Option<i32>,
56 pub disc_number: Option<i32>,
57 pub track_number: Option<i32>,
58 pub side: Option<String>,
59 pub is_hidden: bool,
60 pub is_bonus: bool,
61 pub extensions: Option<Extensions>,
63 pub comments: Option<Vec<Comment>>,
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
68pub struct ReleaseParty {
69 pub party_reference: String,
70 pub role: Vec<String>,
71 pub extensions: Option<Extensions>,
73 pub comments: Option<Vec<Comment>>,
75}
76
77#[derive(Debug, Clone, Serialize, Deserialize)]
78pub struct ReleaseEvent {
79 pub release_event_type: String,
80 pub event_date: Option<DateTime<Utc>>,
81 pub territory: Option<String>,
82 pub extensions: Option<Extensions>,
84 pub comments: Option<Vec<Comment>>,
86}