ddex_core/models/graph/
header.rs1use serde::{Deserialize, Serialize};
5use chrono::{DateTime, Utc};
6use crate::models::{Extensions, Comment, AttributeMap, common::{Identifier, LocalizedString}};
7
8#[derive(Debug, Clone, Serialize, Deserialize)]
9pub struct MessageHeader {
10 pub message_id: String,
11 pub message_type: MessageType,
12 pub message_created_date_time: DateTime<Utc>,
13 pub message_sender: MessageSender,
14 pub message_recipient: MessageRecipient,
15 pub message_control_type: Option<MessageControlType>,
16 pub message_thread_id: Option<String>,
17 pub attributes: Option<AttributeMap>,
19 pub extensions: Option<Extensions>,
21 pub comments: Option<Vec<Comment>>,
23}
24
25#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
26pub enum MessageType {
27 NewReleaseMessage,
28 UpdateReleaseMessage,
29 TakedownMessage,
30}
31
32#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
33pub enum MessageControlType {
34 LiveMessage,
35 TestMessage,
36}
37
38#[derive(Debug, Clone, Serialize, Deserialize)]
39pub struct MessageSender {
40 pub party_id: Vec<Identifier>,
41 pub party_name: Vec<LocalizedString>,
42 pub trading_name: Option<String>,
43 pub attributes: Option<AttributeMap>,
45 pub extensions: Option<Extensions>,
47 pub comments: Option<Vec<Comment>>,
49}
50
51#[derive(Debug, Clone, Serialize, Deserialize)]
52pub struct MessageRecipient {
53 pub party_id: Vec<Identifier>,
54 pub party_name: Vec<LocalizedString>,
55 pub trading_name: Option<String>,
56 pub attributes: Option<AttributeMap>,
58 pub extensions: Option<Extensions>,
60 pub comments: Option<Vec<Comment>>,
62}