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