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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
use chrono::prelude::*;

/// domain-ext-2.4

#[derive(Debug, Deserialize)]
pub struct EURIDDomainCheckData {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain")]
    pub domains: Vec<EURIDDomainCheckDatum>,
}

#[derive(Debug, Deserialize, Clone)]
pub struct EURIDDomainCheckDatum {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}name")]
    pub name: String,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}availableDate",
        deserialize_with = "super::deserialize_datetime_opt",
        default
    )]
    pub available_date: Option<DateTime<Utc>>,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}status", default)]
    pub status: Vec<super::domain::EPPDomainStatus>,
}

#[derive(Debug, Serialize)]
pub struct EURIDDomainCreate {
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:contact",
        skip_serializing_if = "Vec::is_empty"
    )]
    pub contacts: Vec<EURIDDomainContact>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:nsgroup",
        skip_serializing_if = "Vec::is_empty"
    )]
    pub nsgroups: Vec<String>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:keygroup",
        skip_serializing_if = "Option::is_none"
    )]
    pub keygroup: Option<String>,
}

#[derive(Debug, Deserialize)]
pub struct EURIDDomainInfo {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}onHold")]
    pub on_hold: bool,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}quarantined")]
    pub quarantined: bool,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}suspended")]
    pub suspended: bool,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}delayed")]
    pub delayed: bool,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}seized")]
    pub seized: bool,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}deletionDate",
        deserialize_with = "super::deserialize_datetime_opt",
        default
    )]
    pub deletion_date: Option<DateTime<Utc>>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}contact",
        default
    )]
    pub contacts: Vec<EURIDDomainContact>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}nsgroup",
        default
    )]
    pub nsgroups: Vec<String>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}keygroup",
        default
    )]
    pub keygroup: Option<String>,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}maxExtensionPeriod")]
    pub max_extension_period: u32,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}registrantCountry")]
    pub registrant_country: String,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}registrantCountryOfCitizenship",
        default
    )]
    pub registrant_country_of_citizenship: Option<String>,
}

#[derive(Debug, Serialize)]
pub struct EURIDDomainUpdate {
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:add",
        skip_serializing_if = "Option::is_none"
    )]
    pub add: Option<EURIDDomainUpdateAddRemove>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:rem",
        skip_serializing_if = "Option::is_none"
    )]
    pub remove: Option<EURIDDomainUpdateAddRemove>,
}

#[derive(Debug, Serialize)]
pub struct EURIDDomainUpdateAddRemove {
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:contact",
        skip_serializing_if = "Vec::is_empty"
    )]
    pub contacts: Vec<EURIDDomainContact>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:nsgroup",
        skip_serializing_if = "Vec::is_empty"
    )]
    pub nsgroups: Vec<String>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:keygroup",
        skip_serializing_if = "Option::is_none"
    )]
    pub keygroup: Option<String>,
}

#[derive(Debug, Deserialize, Serialize)]
pub struct EURIDDomainContact {
    #[serde(rename = "$attr:type")]
    pub contact_type: EURIDContactType,
    #[serde(rename = "$value")]
    pub contact_id: String,
}

#[derive(Debug, Deserialize)]
pub struct EURIDDomainRenewData {
    #[serde(rename = "$value", default)]
    pub data: Vec<EURIDDomainRenewDataType>,
}

#[derive(Debug, Deserialize, PartialEq, Eq)]
pub enum EURIDDomainRenewDataType {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}removedDeletionDate")]
    RemovedDeletionDate,
}

#[derive(Debug, Serialize)]
pub struct EURIDDomainTransfer {
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:request",
        skip_serializing_if = "Option::is_none"
    )]
    pub transfer_request: Option<EURIDDomainTransferRequest>,
}

#[derive(Debug, Serialize)]
pub struct EURIDDomainTransferRequest {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:registrant")]
    pub registrant: String,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:contact",
        skip_serializing_if = "Vec::is_empty"
    )]
    pub contacts: Vec<EURIDDomainContact>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:ns",
        skip_serializing_if = "Option::is_none"
    )]
    pub nameservers: Option<super::domain::EPPDomainInfoNameservers>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:nsgroup",
        skip_serializing_if = "Vec::is_empty"
    )]
    pub nsgroups: Vec<String>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:keygroup",
        skip_serializing_if = "Option::is_none"
    )]
    pub keygroup: Option<String>,
}

#[derive(Debug, Deserialize)]
pub struct EURIDDomainTransferData {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}onHold")]
    pub on_hold: bool,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}quarantined")]
    pub quarantined: bool,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}delayed")]
    pub delayed: bool,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}reason")]
    pub reason: String,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}registrant")]
    pub registrant: String,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}contact",
        default
    )]
    pub contacts: Vec<EURIDDomainContact>,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}ns", default)]
    pub nameservers: Option<super::domain::EPPDomainInfoNameservers>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}nsgroup",
        default
    )]
    pub nsgroups: Vec<String>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}keygroup",
        default
    )]
    pub keygroup: Option<String>,
}

#[derive(Debug, Serialize)]
pub enum EURIDDomainDelete {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:delete")]
    Schedule(EURIDDomainDeleteSchedule),
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:cancel")]
    Cancel {},
}

#[derive(Debug, Serialize)]
pub struct EURIDDomainDeleteSchedule {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/domain-ext-2.4}domain-ext:delDate")]
    pub delete_date: DateTime<Utc>,
}

/// contact-ext-1.3

#[derive(Debug, Serialize, Deserialize)]
pub struct EURIDContactInfo {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/contact-ext-1.3}contact-ext:type")]
    pub contact_type: EURIDContactType,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/contact-ext-1.3}contact-ext:whoisEmial",
        skip_serializing_if = "Option::is_none",
        default
    )]
    pub whois_email: Option<String>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/contact-ext-1.3}contact-ext:vat",
        skip_serializing_if = "Option::is_none",
        default
    )]
    pub vat: Option<String>,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/contact-ext-1.3}contact-ext:lang")]
    pub language: String,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/contact-ext-1.3}contact-ext:naturalPerson")]
    pub natural_person: bool,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/contact-ext-1.3}contact-ext:countryOfCitizenship",
        skip_serializing_if = "Option::is_none",
        default
    )]
    pub country_of_citizenship: Option<String>,
}

#[derive(Debug, Serialize)]
pub struct EURIDContactUpdate {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/contact-ext-1.3}contact-ext:chg")]
    pub change: EURIDContactUpdateInfo,
}

#[derive(Debug, Serialize)]
pub struct EURIDContactUpdateInfo {
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/contact-ext-1.3}contact-ext:whoisEmial",
        skip_serializing_if = "Option::is_none"
    )]
    pub whois_email: Option<String>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/contact-ext-1.3}contact-ext:vat",
        skip_serializing_if = "Option::is_none"
    )]
    pub vat: Option<String>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/contact-ext-1.3}contact-ext:lang",
        skip_serializing_if = "Option::is_none"
    )]
    pub language: Option<String>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/contact-ext-1.3}contact-ext:naturalPerson",
        skip_serializing_if = "Option::is_none"
    )]
    pub natural_person: Option<bool>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/contact-ext-1.3}contact-ext:countryOfCitizenship",
        skip_serializing_if = "Option::is_none"
    )]
    pub country_of_citizenship: Option<String>,
}

#[derive(Debug, Serialize, Deserialize)]
pub enum EURIDContactType {
    #[serde(rename = "billing")]
    Billing,
    #[serde(rename = "tech")]
    Tech,
    #[serde(rename = "registrant")]
    Registrant,
    #[serde(rename = "onsite")]
    OnSite,
    #[serde(rename = "reseller")]
    Reseller,
}

/// dnsQuality-2.0

#[derive(Debug, Serialize)]
pub struct EURIDDNSQualityInfo {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/dnsQuality-2.0}dnsQuality:name")]
    pub name: String,
}

#[derive(Debug, Deserialize)]
pub struct EURIDDNSQualityInfoData {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/dnsQuality-2.0}name")]
    pub name: String,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/dnsQuality-2.0}checkTime",
        deserialize_with = "super::deserialize_datetime_opt",
        default
    )]
    pub check_time: Option<DateTime<Utc>>,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/dnsQuality-2.0}score")]
    pub score: String,
}

/// dnssecEligibility-1.0

#[derive(Debug, Serialize)]
pub struct EURIDDNSSECEligibilityInfo {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/dnssecEligibility-1.0}dnssecEligibility:name")]
    pub name: String,
}

#[derive(Debug, Deserialize)]
pub struct EURIDDNSSECEligibilityInfoData {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/dnssecEligibility-1.0}name")]
    pub name: String,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/dnssecEligibility-1.0}eligible")]
    pub eligible: bool,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/dnssecEligibility-1.0}msg")]
    pub msg: String,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/dnssecEligibility-1.0}code")]
    pub code: u32,
}

/// homoglyph-1.0

#[derive(Debug, Deserialize)]
pub struct EURIDHomoglyphData {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/homoglyph-1.0}domain")]
    pub domains: Vec<EURIDHomoglyphDomainData>,
}

#[derive(Debug, Deserialize)]
pub struct EURIDHomoglyphDomainData {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/homoglyph-1.0}name")]
    pub unicode: String,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/homoglyph-1.0}blockedBy")]
    pub blocked_by: Vec<String>,
}

/// authInfo-1.1

#[derive(Debug, Serialize)]
pub enum EURIDAuthInfo {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/authInfo-1.1}authInfo:request")]
    Request {},
    #[serde(rename = "{http://www.eurid.eu/xml/epp/authInfo-1.1}authInfo:cancel")]
    Cancel {},
}

#[derive(Debug, Deserialize)]
pub struct EURIDAuthInfoData {
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/authInfo-1.1}validUntil",
        deserialize_with = "super::deserialize_datetime"
    )]
    pub valid_until: DateTime<Utc>,
}

/// idn-1.0

#[derive(Debug, Deserialize)]
pub struct EURIDIDNMapping {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/idn-1.0}name")]
    pub names: Vec<EURIDIDNNameMapping>,
}

#[derive(Debug, Deserialize)]
pub struct EURIDIDNNameMapping {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/idn-1.0}ace")]
    pub ace: String,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/idn-1.0}unicode")]
    pub unicode: String,
}

/// registrarFinance-1.0

#[derive(Debug, Deserialize)]
pub struct EURIDRegistrarFinanceInfoData {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/registrarFinance-1.0}paymentMode")]
    pub payment_mode: EURIDRegistrarFinancePaymentMode,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/registrarFinance-1.0}accountBalance")]
    pub account_balance: String,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/registrarFinance-1.0}availableAmount")]
    pub available_amount: Option<String>,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/registrarFinance-1.0}dueAmount")]
    pub due_amount: Option<String>,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/registrarFinance-1.0}overdueAmount")]
    pub overdue_amount: Option<String>,
}

#[derive(Debug, Deserialize)]
pub enum EURIDRegistrarFinancePaymentMode {
    #[serde(rename = "PRE_PAYMENT")]
    PrePayment,
    #[serde(rename = "POST_PAYMENT")]
    PostPayment,
}

/// registrarHitPoints-1.0

#[derive(Debug, Deserialize)]
pub struct EURIDRegistrarHitPointsInfoData {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/registrarHitPoints-1.0}nbrHitPoints")]
    pub hit_points: u64,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/registrarHitPoints-1.0}maxNbrHitPoints")]
    pub max_hit_points: u64,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/registrarHitPoints-1.0}blockedUntil",
        deserialize_with = "super::deserialize_datetime_opt",
        default
    )]
    pub blocked_until: Option<DateTime<Utc>>,
}

/// registrationLimit-1.1

#[derive(Debug, Deserialize)]
pub struct EURIDRegistrationLimitInfoData {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/registrationLimit-1.1}monthlyRegistrations")]
    pub monthly_registrations: u64,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/registrationLimit-1.1}maxMonthlyRegistrations",
        default
    )]
    pub max_monthly_registrations: Option<u64>,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/registrationLimit-1.1}limitedUntil",
        deserialize_with = "super::deserialize_datetime_opt",
        default
    )]
    pub limited_until: Option<DateTime<Utc>>,
}

/// poll-1.2

#[derive(Debug, Deserialize)]
pub struct EURIDPollData {
    #[serde(rename = "{http://www.eurid.eu/xml/epp/poll-1.2}context")]
    pub context: String,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/poll-1.2}objectType")]
    pub object_type: String,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/poll-1.2}object")]
    pub object: String,
    #[serde(
        rename = "{http://www.eurid.eu/xml/epp/poll-1.2}objectUnicode",
        default
    )]
    pub object_unicode: Option<String>,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/poll-1.2}action")]
    pub action: String,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/poll-1.2}code")]
    pub code: u32,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/poll-1.2}detail", default)]
    pub detail: Option<String>,
    #[serde(rename = "{http://www.eurid.eu/xml/epp/poll-1.2}registrar", default)]
    pub registrar: Option<String>,
}