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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
use super::super::client;
use super::epp_proto;
fn i32_from_eurid_contact_type(from: client::eurid::ContactType) -> i32 {
match from {
client::eurid::ContactType::Registrant => epp_proto::eurid::ContactType::Registrant.into(),
client::eurid::ContactType::Tech => epp_proto::eurid::ContactType::Tech.into(),
client::eurid::ContactType::Billing => epp_proto::eurid::ContactType::Billing.into(),
client::eurid::ContactType::OnSite => epp_proto::eurid::ContactType::OnSite.into(),
client::eurid::ContactType::Reseller => epp_proto::eurid::ContactType::Reseller.into(),
}
}
fn eurid_contact_type_from_i32(from: i32) -> client::eurid::ContactType {
match epp_proto::eurid::ContactType::from_i32(from) {
Some(e) => match e {
epp_proto::eurid::ContactType::Registrant => client::eurid::ContactType::Registrant,
epp_proto::eurid::ContactType::Tech => client::eurid::ContactType::Tech,
epp_proto::eurid::ContactType::Billing => client::eurid::ContactType::Billing,
epp_proto::eurid::ContactType::OnSite => client::eurid::ContactType::OnSite,
epp_proto::eurid::ContactType::Reseller => client::eurid::ContactType::Reseller,
},
None => client::eurid::ContactType::Registrant,
}
}
impl From<client::eurid::Idn> for epp_proto::eurid::Idn {
fn from(from: client::eurid::Idn) -> Self {
epp_proto::eurid::Idn {
ace: from.ace,
unicode: from.unicode,
}
}
}
impl From<client::eurid::ContactExtension> for epp_proto::eurid::ContactExtension {
fn from(from: client::eurid::ContactExtension) -> Self {
epp_proto::eurid::ContactExtension {
contact_type: i32_from_eurid_contact_type(from.contact_type),
citizenship_country: from.citizenship_country,
vat: from.vat,
language: from.language,
whois_email: from.whois_email,
}
}
}
impl From<epp_proto::eurid::ContactExtension> for client::eurid::ContactExtension {
fn from(from: epp_proto::eurid::ContactExtension) -> Self {
client::eurid::ContactExtension {
contact_type: eurid_contact_type_from_i32(from.contact_type),
citizenship_country: from.citizenship_country,
vat: from.vat,
language: from.language,
whois_email: from.whois_email,
}
}
}
impl From<epp_proto::eurid::ContactUpdateExtension> for client::eurid::ContactExtensionUpdate {
fn from(from: epp_proto::eurid::ContactUpdateExtension) -> Self {
client::eurid::ContactExtensionUpdate {
citizenship_country: from.new_citizenship_country,
vat: from.new_vat,
language: from.new_language,
whois_email: from.new_whois_email,
}
}
}
impl From<epp_proto::eurid::DomainCreateExtension> for client::eurid::DomainCreate {
fn from(from: epp_proto::eurid::DomainCreateExtension) -> Self {
client::eurid::DomainCreate {
on_site: from.on_site,
reseller: from.reseller,
}
}
}
impl From<epp_proto::eurid::DomainUpdateExtension> for client::eurid::DomainUpdate {
fn from(from: epp_proto::eurid::DomainUpdateExtension) -> Self {
client::eurid::DomainUpdate {
remove_on_site: from.remove_on_site,
remove_reseller: from.remove_reseller,
add_on_site: from.add_on_site,
add_reseller: from.add_reseller,
}
}
}
impl From<epp_proto::eurid::DomainTransferExtension> for client::eurid::DomainTransfer {
fn from(from: epp_proto::eurid::DomainTransferExtension) -> Self {
client::eurid::DomainTransfer {
on_site: from.on_site,
reseller: from.reseller,
technical: from.technical,
billing: from.billing,
registrant: from.registrant,
}
}
}
impl From<epp_proto::eurid::DomainDeleteExtension> for Option<client::eurid::DomainDelete> {
fn from(from: epp_proto::eurid::DomainDeleteExtension) -> Self {
match from.delete {
Some(epp_proto::eurid::domain_delete_extension::Delete::Schedule(t)) => {
super::utils::proto_to_chrono(Some(t)).map(client::eurid::DomainDelete::Schedule)
}
Some(epp_proto::eurid::domain_delete_extension::Delete::Cancel(_)) => {
Some(client::eurid::DomainDelete::Cancel)
}
None => None,
}
}
}
impl From<epp_proto::eurid::DomainInfoRequest> for client::eurid::DomainInfoRequest {
fn from(from: epp_proto::eurid::DomainInfoRequest) -> Self {
client::eurid::DomainInfoRequest {
auth_info: match from.auth_info {
None => None,
Some(epp_proto::eurid::domain_info_request::AuthInfo::Request(_)) => {
Some(client::eurid::DomainAuthInfo::Request)
}
Some(epp_proto::eurid::domain_info_request::AuthInfo::Cancel(_)) => {
Some(client::eurid::DomainAuthInfo::Cancel)
}
},
}
}
}
impl From<client::eurid::PollResponse> for epp_proto::eurid::PollReply {
fn from(from: client::eurid::PollResponse) -> Self {
epp_proto::eurid::PollReply {
context: from.context,
object_type: from.object_type,
object: from.object,
object_unicode: from.object_unicode,
action: from.action,
code: from.code,
detail: from.detail,
registrar: from.registrar,
}
}
}