1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
use chrono::prelude::*;
#[derive(Debug, Deserialize)]
pub struct EPPChangeData {
#[serde(rename = "$attr:state", default)]
pub state: EPPChangeState,
#[serde(rename = "{urn:ietf:params:xml:ns:changePoll-1.0}operation")]
pub operation: EPPChangeOperation,
#[serde(
rename = "{urn:ietf:params:xml:ns:changePoll-1.0}date",
deserialize_with = "super::deserialize_datetime"
)]
pub date: DateTime<Utc>,
#[serde(rename = "{urn:ietf:params:xml:ns:changePoll-1.0}svTRID")]
pub server_transaction_id: String,
#[serde(rename = "{urn:ietf:params:xml:ns:changePoll-1.0}who")]
pub who: String,
#[serde(rename = "{urn:ietf:params:xml:ns:changePoll-1.0}caseId", default)]
pub case_id: Option<EPPChangeCaseId>,
#[serde(rename = "{urn:ietf:params:xml:ns:changePoll-1.0}reason", default)]
pub reason: Option<String>,
}
#[derive(Debug, Deserialize)]
pub enum EPPChangeState {
#[serde(rename = "before")]
Before,
#[serde(rename = "after")]
After,
}
impl Default for EPPChangeState {
fn default() -> Self {
EPPChangeState::After
}
}
#[derive(Debug, Deserialize)]
pub struct EPPChangeOperation {
#[serde(rename = "$attr:op", default)]
pub operation: Option<String>,
#[serde(rename = "$value")]
pub op_type: EPPChangeOperationType,
}
#[derive(Debug, Deserialize)]
pub enum EPPChangeOperationType {
#[serde(rename = "create")]
Create,
#[serde(rename = "delete")]
Delete,
#[serde(rename = "renew")]
Renew,
#[serde(rename = "transfer")]
Transfer,
#[serde(rename = "update")]
Update,
#[serde(rename = "restore")]
Restore,
#[serde(rename = "autoRenew")]
AutoRenew,
#[serde(rename = "autoDelete")]
AutoDelete,
#[serde(rename = "autoPurge")]
AutoPurge,
#[serde(rename = "custom")]
Custom,
}
#[derive(Debug, Deserialize)]
pub struct EPPChangeCaseId {
#[serde(rename = "$attr:type")]
pub case_type: EPPChangeCaseIdType,
#[serde(rename = "$attr:name")]
pub name: Option<String>,
#[serde(rename = "$value")]
pub case_id: String,
}
#[derive(Debug, Deserialize)]
pub enum EPPChangeCaseIdType {
#[serde(rename = "udrp")]
Udrp,
#[serde(rename = "urs")]
Urs,
#[serde(rename = "custom")]
Custom,
}