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