@scaleway/sdk-domain 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1470 @@
1
+ import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalDate, unmarshalMapOfObject, unmarshalMoney } from "@scaleway/sdk-client";
2
+ const unmarshalContactExtensionFRAssociationInfo = (data) => {
3
+ if (!isJSONObject(data)) {
4
+ throw new TypeError(
5
+ `Unmarshalling the type 'ContactExtensionFRAssociationInfo' failed as data isn't a dictionary.`
6
+ );
7
+ }
8
+ return {
9
+ publicationJo: unmarshalDate(data.publication_jo),
10
+ publicationJoPage: data.publication_jo_page
11
+ };
12
+ };
13
+ const unmarshalContactExtensionFRCodeAuthAfnicInfo = (data) => {
14
+ if (!isJSONObject(data)) {
15
+ throw new TypeError(
16
+ `Unmarshalling the type 'ContactExtensionFRCodeAuthAfnicInfo' failed as data isn't a dictionary.`
17
+ );
18
+ }
19
+ return {
20
+ codeAuthAfnic: data.code_auth_afnic
21
+ };
22
+ };
23
+ const unmarshalContactExtensionFRDunsInfo = (data) => {
24
+ if (!isJSONObject(data)) {
25
+ throw new TypeError(
26
+ `Unmarshalling the type 'ContactExtensionFRDunsInfo' failed as data isn't a dictionary.`
27
+ );
28
+ }
29
+ return {
30
+ dunsId: data.duns_id,
31
+ localId: data.local_id
32
+ };
33
+ };
34
+ const unmarshalContactExtensionFRIndividualInfo = (data) => {
35
+ if (!isJSONObject(data)) {
36
+ throw new TypeError(
37
+ `Unmarshalling the type 'ContactExtensionFRIndividualInfo' failed as data isn't a dictionary.`
38
+ );
39
+ }
40
+ return {
41
+ whoisOptIn: data.whois_opt_in
42
+ };
43
+ };
44
+ const unmarshalContactExtensionFRTrademarkInfo = (data) => {
45
+ if (!isJSONObject(data)) {
46
+ throw new TypeError(
47
+ `Unmarshalling the type 'ContactExtensionFRTrademarkInfo' failed as data isn't a dictionary.`
48
+ );
49
+ }
50
+ return {
51
+ trademarkInpi: data.trademark_inpi
52
+ };
53
+ };
54
+ const unmarshalContactExtensionEU = (data) => {
55
+ if (!isJSONObject(data)) {
56
+ throw new TypeError(
57
+ `Unmarshalling the type 'ContactExtensionEU' failed as data isn't a dictionary.`
58
+ );
59
+ }
60
+ return {
61
+ europeanCitizenship: data.european_citizenship
62
+ };
63
+ };
64
+ const unmarshalContactExtensionFR = (data) => {
65
+ if (!isJSONObject(data)) {
66
+ throw new TypeError(
67
+ `Unmarshalling the type 'ContactExtensionFR' failed as data isn't a dictionary.`
68
+ );
69
+ }
70
+ return {
71
+ associationInfo: data.association_info ? unmarshalContactExtensionFRAssociationInfo(data.association_info) : void 0,
72
+ codeAuthAfnicInfo: data.code_auth_afnic_info ? unmarshalContactExtensionFRCodeAuthAfnicInfo(data.code_auth_afnic_info) : void 0,
73
+ dunsInfo: data.duns_info ? unmarshalContactExtensionFRDunsInfo(data.duns_info) : void 0,
74
+ individualInfo: data.individual_info ? unmarshalContactExtensionFRIndividualInfo(data.individual_info) : void 0,
75
+ mode: data.mode,
76
+ trademarkInfo: data.trademark_info ? unmarshalContactExtensionFRTrademarkInfo(data.trademark_info) : void 0
77
+ };
78
+ };
79
+ const unmarshalContactExtensionNL = (data) => {
80
+ if (!isJSONObject(data)) {
81
+ throw new TypeError(
82
+ `Unmarshalling the type 'ContactExtensionNL' failed as data isn't a dictionary.`
83
+ );
84
+ }
85
+ return {
86
+ legalForm: data.legal_form,
87
+ legalFormRegistrationNumber: data.legal_form_registration_number
88
+ };
89
+ };
90
+ const unmarshalContactQuestion = (data) => {
91
+ if (!isJSONObject(data)) {
92
+ throw new TypeError(
93
+ `Unmarshalling the type 'ContactQuestion' failed as data isn't a dictionary.`
94
+ );
95
+ }
96
+ return {
97
+ answer: data.answer,
98
+ question: data.question
99
+ };
100
+ };
101
+ const unmarshalContact = (data) => {
102
+ if (!isJSONObject(data)) {
103
+ throw new TypeError(
104
+ `Unmarshalling the type 'Contact' failed as data isn't a dictionary.`
105
+ );
106
+ }
107
+ return {
108
+ addressLine1: data.address_line_1,
109
+ addressLine2: data.address_line_2,
110
+ city: data.city,
111
+ companyIdentificationCode: data.company_identification_code,
112
+ companyName: data.company_name,
113
+ country: data.country,
114
+ email: data.email,
115
+ emailAlt: data.email_alt,
116
+ emailStatus: data.email_status,
117
+ extensionEu: data.extension_eu ? unmarshalContactExtensionEU(data.extension_eu) : void 0,
118
+ extensionFr: data.extension_fr ? unmarshalContactExtensionFR(data.extension_fr) : void 0,
119
+ extensionNl: data.extension_nl ? unmarshalContactExtensionNL(data.extension_nl) : void 0,
120
+ faxNumber: data.fax_number,
121
+ firstname: data.firstname,
122
+ id: data.id,
123
+ lang: data.lang,
124
+ lastname: data.lastname,
125
+ legalForm: data.legal_form,
126
+ phoneNumber: data.phone_number,
127
+ questions: data.questions ? unmarshalArrayOfObject(data.questions, unmarshalContactQuestion) : void 0,
128
+ resale: data.resale,
129
+ state: data.state,
130
+ status: data.status,
131
+ vatIdentificationCode: data.vat_identification_code,
132
+ whoisOptIn: data.whois_opt_in,
133
+ zip: data.zip
134
+ };
135
+ };
136
+ const unmarshalDNSZone = (data) => {
137
+ if (!isJSONObject(data)) {
138
+ throw new TypeError(
139
+ `Unmarshalling the type 'DNSZone' failed as data isn't a dictionary.`
140
+ );
141
+ }
142
+ return {
143
+ domain: data.domain,
144
+ linkedProducts: data.linked_products,
145
+ message: data.message,
146
+ ns: data.ns,
147
+ nsDefault: data.ns_default,
148
+ nsMaster: data.ns_master,
149
+ projectId: data.project_id,
150
+ status: data.status,
151
+ subdomain: data.subdomain,
152
+ updatedAt: unmarshalDate(data.updated_at)
153
+ };
154
+ };
155
+ const unmarshalHost = (data) => {
156
+ if (!isJSONObject(data)) {
157
+ throw new TypeError(
158
+ `Unmarshalling the type 'Host' failed as data isn't a dictionary.`
159
+ );
160
+ }
161
+ return {
162
+ domain: data.domain,
163
+ ips: data.ips,
164
+ name: data.name,
165
+ status: data.status
166
+ };
167
+ };
168
+ const unmarshalSSLCertificate = (data) => {
169
+ if (!isJSONObject(data)) {
170
+ throw new TypeError(
171
+ `Unmarshalling the type 'SSLCertificate' failed as data isn't a dictionary.`
172
+ );
173
+ }
174
+ return {
175
+ alternativeDnsZones: data.alternative_dns_zones,
176
+ certificateChain: data.certificate_chain,
177
+ createdAt: unmarshalDate(data.created_at),
178
+ dnsZone: data.dns_zone,
179
+ expiredAt: unmarshalDate(data.expired_at),
180
+ privateKey: data.private_key,
181
+ status: data.status
182
+ };
183
+ };
184
+ const unmarshalCheckContactsCompatibilityResponseContactCheckResult = (data) => {
185
+ if (!isJSONObject(data)) {
186
+ throw new TypeError(
187
+ `Unmarshalling the type 'CheckContactsCompatibilityResponseContactCheckResult' failed as data isn't a dictionary.`
188
+ );
189
+ }
190
+ return {
191
+ compatible: data.compatible,
192
+ errorMessage: data.error_message
193
+ };
194
+ };
195
+ const unmarshalCheckContactsCompatibilityResponse = (data) => {
196
+ if (!isJSONObject(data)) {
197
+ throw new TypeError(
198
+ `Unmarshalling the type 'CheckContactsCompatibilityResponse' failed as data isn't a dictionary.`
199
+ );
200
+ }
201
+ return {
202
+ administrativeCheckResult: data.administrative_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(
203
+ data.administrative_check_result
204
+ ) : void 0,
205
+ compatible: data.compatible,
206
+ ownerCheckResult: data.owner_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(
207
+ data.owner_check_result
208
+ ) : void 0,
209
+ technicalCheckResult: data.technical_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(
210
+ data.technical_check_result
211
+ ) : void 0
212
+ };
213
+ };
214
+ const unmarshalClearDNSZoneRecordsResponse = (data) => {
215
+ if (!isJSONObject(data)) {
216
+ throw new TypeError(
217
+ `Unmarshalling the type 'ClearDNSZoneRecordsResponse' failed as data isn't a dictionary.`
218
+ );
219
+ }
220
+ return {};
221
+ };
222
+ const unmarshalDeleteDNSZoneResponse = (data) => {
223
+ if (!isJSONObject(data)) {
224
+ throw new TypeError(
225
+ `Unmarshalling the type 'DeleteDNSZoneResponse' failed as data isn't a dictionary.`
226
+ );
227
+ }
228
+ return {};
229
+ };
230
+ const unmarshalDeleteExternalDomainResponse = (data) => {
231
+ if (!isJSONObject(data)) {
232
+ throw new TypeError(
233
+ `Unmarshalling the type 'DeleteExternalDomainResponse' failed as data isn't a dictionary.`
234
+ );
235
+ }
236
+ return {};
237
+ };
238
+ const unmarshalDeleteSSLCertificateResponse = (data) => {
239
+ if (!isJSONObject(data)) {
240
+ throw new TypeError(
241
+ `Unmarshalling the type 'DeleteSSLCertificateResponse' failed as data isn't a dictionary.`
242
+ );
243
+ }
244
+ return {};
245
+ };
246
+ const unmarshalDSRecordPublicKey = (data) => {
247
+ if (!isJSONObject(data)) {
248
+ throw new TypeError(
249
+ `Unmarshalling the type 'DSRecordPublicKey' failed as data isn't a dictionary.`
250
+ );
251
+ }
252
+ return {
253
+ key: data.key
254
+ };
255
+ };
256
+ const unmarshalDSRecordDigest = (data) => {
257
+ if (!isJSONObject(data)) {
258
+ throw new TypeError(
259
+ `Unmarshalling the type 'DSRecordDigest' failed as data isn't a dictionary.`
260
+ );
261
+ }
262
+ return {
263
+ digest: data.digest,
264
+ publicKey: data.public_key ? unmarshalDSRecordPublicKey(data.public_key) : void 0,
265
+ type: data.type
266
+ };
267
+ };
268
+ const unmarshalDSRecord = (data) => {
269
+ if (!isJSONObject(data)) {
270
+ throw new TypeError(
271
+ `Unmarshalling the type 'DSRecord' failed as data isn't a dictionary.`
272
+ );
273
+ }
274
+ return {
275
+ algorithm: data.algorithm,
276
+ digest: data.digest ? unmarshalDSRecordDigest(data.digest) : void 0,
277
+ keyId: data.key_id,
278
+ publicKey: data.public_key ? unmarshalDSRecordPublicKey(data.public_key) : void 0
279
+ };
280
+ };
281
+ const unmarshalTldOffer = (data) => {
282
+ if (!isJSONObject(data)) {
283
+ throw new TypeError(
284
+ `Unmarshalling the type 'TldOffer' failed as data isn't a dictionary.`
285
+ );
286
+ }
287
+ return {
288
+ action: data.action,
289
+ operationPath: data.operation_path,
290
+ price: data.price ? unmarshalMoney(data.price) : void 0
291
+ };
292
+ };
293
+ const unmarshalDomainDNSSEC = (data) => {
294
+ if (!isJSONObject(data)) {
295
+ throw new TypeError(
296
+ `Unmarshalling the type 'DomainDNSSEC' failed as data isn't a dictionary.`
297
+ );
298
+ }
299
+ return {
300
+ dsRecords: unmarshalArrayOfObject(data.ds_records, unmarshalDSRecord),
301
+ status: data.status
302
+ };
303
+ };
304
+ const unmarshalDomainRegistrationStatusExternalDomain = (data) => {
305
+ if (!isJSONObject(data)) {
306
+ throw new TypeError(
307
+ `Unmarshalling the type 'DomainRegistrationStatusExternalDomain' failed as data isn't a dictionary.`
308
+ );
309
+ }
310
+ return {
311
+ validationToken: data.validation_token
312
+ };
313
+ };
314
+ const unmarshalDomainRegistrationStatusTransfer = (data) => {
315
+ if (!isJSONObject(data)) {
316
+ throw new TypeError(
317
+ `Unmarshalling the type 'DomainRegistrationStatusTransfer' failed as data isn't a dictionary.`
318
+ );
319
+ }
320
+ return {
321
+ status: data.status,
322
+ voteCurrentOwner: data.vote_current_owner,
323
+ voteNewOwner: data.vote_new_owner
324
+ };
325
+ };
326
+ const unmarshalTld = (data) => {
327
+ if (!isJSONObject(data)) {
328
+ throw new TypeError(
329
+ `Unmarshalling the type 'Tld' failed as data isn't a dictionary.`
330
+ );
331
+ }
332
+ return {
333
+ dnssecSupport: data.dnssec_support,
334
+ durationInYearsMax: data.duration_in_years_max,
335
+ durationInYearsMin: data.duration_in_years_min,
336
+ idnSupport: data.idn_support,
337
+ name: data.name,
338
+ offers: unmarshalMapOfObject(data.offers, unmarshalTldOffer),
339
+ specifications: data.specifications
340
+ };
341
+ };
342
+ const unmarshalDomain = (data) => {
343
+ if (!isJSONObject(data)) {
344
+ throw new TypeError(
345
+ `Unmarshalling the type 'Domain' failed as data isn't a dictionary.`
346
+ );
347
+ }
348
+ return {
349
+ administrativeContact: data.administrative_contact ? unmarshalContact(data.administrative_contact) : void 0,
350
+ autoRenewStatus: data.auto_renew_status,
351
+ dnsZones: unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone),
352
+ dnssec: data.dnssec ? unmarshalDomainDNSSEC(data.dnssec) : void 0,
353
+ domain: data.domain,
354
+ eppCode: data.epp_code,
355
+ expiredAt: unmarshalDate(data.expired_at),
356
+ externalDomainRegistrationStatus: data.external_domain_registration_status ? unmarshalDomainRegistrationStatusExternalDomain(
357
+ data.external_domain_registration_status
358
+ ) : void 0,
359
+ isExternal: data.is_external,
360
+ linkedProducts: data.linked_products,
361
+ organizationId: data.organization_id,
362
+ ownerContact: data.owner_contact ? unmarshalContact(data.owner_contact) : void 0,
363
+ pendingTrade: data.pending_trade,
364
+ projectId: data.project_id,
365
+ registrar: data.registrar,
366
+ status: data.status,
367
+ technicalContact: data.technical_contact ? unmarshalContact(data.technical_contact) : void 0,
368
+ tld: data.tld ? unmarshalTld(data.tld) : void 0,
369
+ transferRegistrationStatus: data.transfer_registration_status ? unmarshalDomainRegistrationStatusTransfer(
370
+ data.transfer_registration_status
371
+ ) : void 0,
372
+ updatedAt: unmarshalDate(data.updated_at)
373
+ };
374
+ };
375
+ const unmarshalGetDNSZoneTsigKeyResponse = (data) => {
376
+ if (!isJSONObject(data)) {
377
+ throw new TypeError(
378
+ `Unmarshalling the type 'GetDNSZoneTsigKeyResponse' failed as data isn't a dictionary.`
379
+ );
380
+ }
381
+ return {
382
+ algorithm: data.algorithm,
383
+ key: data.key,
384
+ name: data.name
385
+ };
386
+ };
387
+ const unmarshalDomainRecordGeoIPConfigMatch = (data) => {
388
+ if (!isJSONObject(data)) {
389
+ throw new TypeError(
390
+ `Unmarshalling the type 'DomainRecordGeoIPConfigMatch' failed as data isn't a dictionary.`
391
+ );
392
+ }
393
+ return {
394
+ continents: data.continents,
395
+ countries: data.countries,
396
+ data: data.data
397
+ };
398
+ };
399
+ const unmarshalDomainRecordViewConfigView = (data) => {
400
+ if (!isJSONObject(data)) {
401
+ throw new TypeError(
402
+ `Unmarshalling the type 'DomainRecordViewConfigView' failed as data isn't a dictionary.`
403
+ );
404
+ }
405
+ return {
406
+ data: data.data,
407
+ subnet: data.subnet
408
+ };
409
+ };
410
+ const unmarshalDomainRecordWeightedConfigWeightedIP = (data) => {
411
+ if (!isJSONObject(data)) {
412
+ throw new TypeError(
413
+ `Unmarshalling the type 'DomainRecordWeightedConfigWeightedIP' failed as data isn't a dictionary.`
414
+ );
415
+ }
416
+ return {
417
+ ip: data.ip,
418
+ weight: data.weight
419
+ };
420
+ };
421
+ const unmarshalDomainRecordGeoIPConfig = (data) => {
422
+ if (!isJSONObject(data)) {
423
+ throw new TypeError(
424
+ `Unmarshalling the type 'DomainRecordGeoIPConfig' failed as data isn't a dictionary.`
425
+ );
426
+ }
427
+ return {
428
+ default: data.default,
429
+ matches: unmarshalArrayOfObject(
430
+ data.matches,
431
+ unmarshalDomainRecordGeoIPConfigMatch
432
+ )
433
+ };
434
+ };
435
+ const unmarshalDomainRecordHTTPServiceConfig = (data) => {
436
+ if (!isJSONObject(data)) {
437
+ throw new TypeError(
438
+ `Unmarshalling the type 'DomainRecordHTTPServiceConfig' failed as data isn't a dictionary.`
439
+ );
440
+ }
441
+ return {
442
+ ips: data.ips,
443
+ mustContain: data.must_contain,
444
+ strategy: data.strategy,
445
+ url: data.url,
446
+ userAgent: data.user_agent
447
+ };
448
+ };
449
+ const unmarshalDomainRecordViewConfig = (data) => {
450
+ if (!isJSONObject(data)) {
451
+ throw new TypeError(
452
+ `Unmarshalling the type 'DomainRecordViewConfig' failed as data isn't a dictionary.`
453
+ );
454
+ }
455
+ return {
456
+ views: unmarshalArrayOfObject(
457
+ data.views,
458
+ unmarshalDomainRecordViewConfigView
459
+ )
460
+ };
461
+ };
462
+ const unmarshalDomainRecordWeightedConfig = (data) => {
463
+ if (!isJSONObject(data)) {
464
+ throw new TypeError(
465
+ `Unmarshalling the type 'DomainRecordWeightedConfig' failed as data isn't a dictionary.`
466
+ );
467
+ }
468
+ return {
469
+ weightedIps: unmarshalArrayOfObject(
470
+ data.weighted_ips,
471
+ unmarshalDomainRecordWeightedConfigWeightedIP
472
+ )
473
+ };
474
+ };
475
+ const unmarshalDomainRecord = (data) => {
476
+ if (!isJSONObject(data)) {
477
+ throw new TypeError(
478
+ `Unmarshalling the type 'DomainRecord' failed as data isn't a dictionary.`
479
+ );
480
+ }
481
+ return {
482
+ comment: data.comment,
483
+ data: data.data,
484
+ geoIpConfig: data.geo_ip_config ? unmarshalDomainRecordGeoIPConfig(data.geo_ip_config) : void 0,
485
+ httpServiceConfig: data.http_service_config ? unmarshalDomainRecordHTTPServiceConfig(data.http_service_config) : void 0,
486
+ id: data.id,
487
+ name: data.name,
488
+ priority: data.priority,
489
+ ttl: data.ttl,
490
+ type: data.type,
491
+ viewConfig: data.view_config ? unmarshalDomainRecordViewConfig(data.view_config) : void 0,
492
+ weightedConfig: data.weighted_config ? unmarshalDomainRecordWeightedConfig(data.weighted_config) : void 0
493
+ };
494
+ };
495
+ const unmarshalRecordIdentifier = (data) => {
496
+ if (!isJSONObject(data)) {
497
+ throw new TypeError(
498
+ `Unmarshalling the type 'RecordIdentifier' failed as data isn't a dictionary.`
499
+ );
500
+ }
501
+ return {
502
+ data: data.data,
503
+ name: data.name,
504
+ ttl: data.ttl,
505
+ type: data.type
506
+ };
507
+ };
508
+ const unmarshalRecordChangeAdd = (data) => {
509
+ if (!isJSONObject(data)) {
510
+ throw new TypeError(
511
+ `Unmarshalling the type 'RecordChangeAdd' failed as data isn't a dictionary.`
512
+ );
513
+ }
514
+ return {
515
+ records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord)
516
+ };
517
+ };
518
+ const unmarshalRecordChangeClear = (data) => {
519
+ if (!isJSONObject(data)) {
520
+ throw new TypeError(
521
+ `Unmarshalling the type 'RecordChangeClear' failed as data isn't a dictionary.`
522
+ );
523
+ }
524
+ return {};
525
+ };
526
+ const unmarshalRecordChangeDelete = (data) => {
527
+ if (!isJSONObject(data)) {
528
+ throw new TypeError(
529
+ `Unmarshalling the type 'RecordChangeDelete' failed as data isn't a dictionary.`
530
+ );
531
+ }
532
+ return {
533
+ id: data.id,
534
+ idFields: data.id_fields ? unmarshalRecordIdentifier(data.id_fields) : void 0
535
+ };
536
+ };
537
+ const unmarshalRecordChangeSet = (data) => {
538
+ if (!isJSONObject(data)) {
539
+ throw new TypeError(
540
+ `Unmarshalling the type 'RecordChangeSet' failed as data isn't a dictionary.`
541
+ );
542
+ }
543
+ return {
544
+ id: data.id,
545
+ idFields: data.id_fields ? unmarshalRecordIdentifier(data.id_fields) : void 0,
546
+ records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord)
547
+ };
548
+ };
549
+ const unmarshalRecordChange = (data) => {
550
+ if (!isJSONObject(data)) {
551
+ throw new TypeError(
552
+ `Unmarshalling the type 'RecordChange' failed as data isn't a dictionary.`
553
+ );
554
+ }
555
+ return {
556
+ add: data.add ? unmarshalRecordChangeAdd(data.add) : void 0,
557
+ clear: data.clear ? unmarshalRecordChangeClear(data.clear) : void 0,
558
+ delete: data.delete ? unmarshalRecordChangeDelete(data.delete) : void 0,
559
+ set: data.set ? unmarshalRecordChangeSet(data.set) : void 0
560
+ };
561
+ };
562
+ const unmarshalGetDNSZoneVersionDiffResponse = (data) => {
563
+ if (!isJSONObject(data)) {
564
+ throw new TypeError(
565
+ `Unmarshalling the type 'GetDNSZoneVersionDiffResponse' failed as data isn't a dictionary.`
566
+ );
567
+ }
568
+ return {
569
+ changes: unmarshalArrayOfObject(data.changes, unmarshalRecordChange)
570
+ };
571
+ };
572
+ const unmarshalGetDomainAuthCodeResponse = (data) => {
573
+ if (!isJSONObject(data)) {
574
+ throw new TypeError(
575
+ `Unmarshalling the type 'GetDomainAuthCodeResponse' failed as data isn't a dictionary.`
576
+ );
577
+ }
578
+ return {
579
+ authCode: data.auth_code
580
+ };
581
+ };
582
+ const unmarshalImportProviderDNSZoneResponse = (data) => {
583
+ if (!isJSONObject(data)) {
584
+ throw new TypeError(
585
+ `Unmarshalling the type 'ImportProviderDNSZoneResponse' failed as data isn't a dictionary.`
586
+ );
587
+ }
588
+ return {
589
+ records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord)
590
+ };
591
+ };
592
+ const unmarshalImportRawDNSZoneResponse = (data) => {
593
+ if (!isJSONObject(data)) {
594
+ throw new TypeError(
595
+ `Unmarshalling the type 'ImportRawDNSZoneResponse' failed as data isn't a dictionary.`
596
+ );
597
+ }
598
+ return {
599
+ records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord)
600
+ };
601
+ };
602
+ const unmarshalContactRolesRoles = (data) => {
603
+ if (!isJSONObject(data)) {
604
+ throw new TypeError(
605
+ `Unmarshalling the type 'ContactRolesRoles' failed as data isn't a dictionary.`
606
+ );
607
+ }
608
+ return {
609
+ isAdministrative: data.is_administrative,
610
+ isOwner: data.is_owner,
611
+ isTechnical: data.is_technical
612
+ };
613
+ };
614
+ const unmarshalContactRoles = (data) => {
615
+ if (!isJSONObject(data)) {
616
+ throw new TypeError(
617
+ `Unmarshalling the type 'ContactRoles' failed as data isn't a dictionary.`
618
+ );
619
+ }
620
+ return {
621
+ contact: data.contact ? unmarshalContact(data.contact) : void 0,
622
+ roles: unmarshalMapOfObject(data.roles, unmarshalContactRolesRoles)
623
+ };
624
+ };
625
+ const unmarshalListContactsResponse = (data) => {
626
+ if (!isJSONObject(data)) {
627
+ throw new TypeError(
628
+ `Unmarshalling the type 'ListContactsResponse' failed as data isn't a dictionary.`
629
+ );
630
+ }
631
+ return {
632
+ contacts: unmarshalArrayOfObject(data.contacts, unmarshalContactRoles),
633
+ totalCount: data.total_count
634
+ };
635
+ };
636
+ const unmarshalNameserver = (data) => {
637
+ if (!isJSONObject(data)) {
638
+ throw new TypeError(
639
+ `Unmarshalling the type 'Nameserver' failed as data isn't a dictionary.`
640
+ );
641
+ }
642
+ return {
643
+ ip: data.ip,
644
+ name: data.name
645
+ };
646
+ };
647
+ const unmarshalListDNSZoneNameserversResponse = (data) => {
648
+ if (!isJSONObject(data)) {
649
+ throw new TypeError(
650
+ `Unmarshalling the type 'ListDNSZoneNameserversResponse' failed as data isn't a dictionary.`
651
+ );
652
+ }
653
+ return {
654
+ ns: unmarshalArrayOfObject(data.ns, unmarshalNameserver)
655
+ };
656
+ };
657
+ const unmarshalListDNSZoneRecordsResponse = (data) => {
658
+ if (!isJSONObject(data)) {
659
+ throw new TypeError(
660
+ `Unmarshalling the type 'ListDNSZoneRecordsResponse' failed as data isn't a dictionary.`
661
+ );
662
+ }
663
+ return {
664
+ records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord),
665
+ totalCount: data.total_count
666
+ };
667
+ };
668
+ const unmarshalListDNSZoneVersionRecordsResponse = (data) => {
669
+ if (!isJSONObject(data)) {
670
+ throw new TypeError(
671
+ `Unmarshalling the type 'ListDNSZoneVersionRecordsResponse' failed as data isn't a dictionary.`
672
+ );
673
+ }
674
+ return {
675
+ records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord),
676
+ totalCount: data.total_count
677
+ };
678
+ };
679
+ const unmarshalDNSZoneVersion = (data) => {
680
+ if (!isJSONObject(data)) {
681
+ throw new TypeError(
682
+ `Unmarshalling the type 'DNSZoneVersion' failed as data isn't a dictionary.`
683
+ );
684
+ }
685
+ return {
686
+ createdAt: unmarshalDate(data.created_at),
687
+ id: data.id
688
+ };
689
+ };
690
+ const unmarshalListDNSZoneVersionsResponse = (data) => {
691
+ if (!isJSONObject(data)) {
692
+ throw new TypeError(
693
+ `Unmarshalling the type 'ListDNSZoneVersionsResponse' failed as data isn't a dictionary.`
694
+ );
695
+ }
696
+ return {
697
+ totalCount: data.total_count,
698
+ versions: unmarshalArrayOfObject(data.versions, unmarshalDNSZoneVersion)
699
+ };
700
+ };
701
+ const unmarshalListDNSZonesResponse = (data) => {
702
+ if (!isJSONObject(data)) {
703
+ throw new TypeError(
704
+ `Unmarshalling the type 'ListDNSZonesResponse' failed as data isn't a dictionary.`
705
+ );
706
+ }
707
+ return {
708
+ dnsZones: unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone),
709
+ totalCount: data.total_count
710
+ };
711
+ };
712
+ const unmarshalListDomainHostsResponse = (data) => {
713
+ if (!isJSONObject(data)) {
714
+ throw new TypeError(
715
+ `Unmarshalling the type 'ListDomainHostsResponse' failed as data isn't a dictionary.`
716
+ );
717
+ }
718
+ return {
719
+ hosts: unmarshalArrayOfObject(data.hosts, unmarshalHost),
720
+ totalCount: data.total_count
721
+ };
722
+ };
723
+ const unmarshalDomainSummary = (data) => {
724
+ if (!isJSONObject(data)) {
725
+ throw new TypeError(
726
+ `Unmarshalling the type 'DomainSummary' failed as data isn't a dictionary.`
727
+ );
728
+ }
729
+ return {
730
+ autoRenewStatus: data.auto_renew_status,
731
+ createdAt: unmarshalDate(data.created_at),
732
+ dnssecStatus: data.dnssec_status,
733
+ domain: data.domain,
734
+ eppCode: data.epp_code,
735
+ expiredAt: unmarshalDate(data.expired_at),
736
+ externalDomainRegistrationStatus: data.external_domain_registration_status ? unmarshalDomainRegistrationStatusExternalDomain(
737
+ data.external_domain_registration_status
738
+ ) : void 0,
739
+ isExternal: data.is_external,
740
+ organizationId: data.organization_id,
741
+ pendingTrade: data.pending_trade,
742
+ projectId: data.project_id,
743
+ registrar: data.registrar,
744
+ status: data.status,
745
+ transferRegistrationStatus: data.transfer_registration_status ? unmarshalDomainRegistrationStatusTransfer(
746
+ data.transfer_registration_status
747
+ ) : void 0,
748
+ updatedAt: unmarshalDate(data.updated_at)
749
+ };
750
+ };
751
+ const unmarshalListDomainsResponse = (data) => {
752
+ if (!isJSONObject(data)) {
753
+ throw new TypeError(
754
+ `Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`
755
+ );
756
+ }
757
+ return {
758
+ domains: unmarshalArrayOfObject(data.domains, unmarshalDomainSummary),
759
+ totalCount: data.total_count
760
+ };
761
+ };
762
+ const unmarshalRenewableDomain = (data) => {
763
+ if (!isJSONObject(data)) {
764
+ throw new TypeError(
765
+ `Unmarshalling the type 'RenewableDomain' failed as data isn't a dictionary.`
766
+ );
767
+ }
768
+ return {
769
+ domain: data.domain,
770
+ estimatedDeleteAt: unmarshalDate(data.estimated_delete_at),
771
+ expiredAt: unmarshalDate(data.expired_at),
772
+ limitRedemptionAt: unmarshalDate(data.limit_redemption_at),
773
+ limitRenewAt: unmarshalDate(data.limit_renew_at),
774
+ organizationId: data.organization_id,
775
+ projectId: data.project_id,
776
+ renewableDurationInYears: data.renewable_duration_in_years,
777
+ status: data.status,
778
+ tld: data.tld ? unmarshalTld(data.tld) : void 0
779
+ };
780
+ };
781
+ const unmarshalListRenewableDomainsResponse = (data) => {
782
+ if (!isJSONObject(data)) {
783
+ throw new TypeError(
784
+ `Unmarshalling the type 'ListRenewableDomainsResponse' failed as data isn't a dictionary.`
785
+ );
786
+ }
787
+ return {
788
+ domains: unmarshalArrayOfObject(data.domains, unmarshalRenewableDomain),
789
+ totalCount: data.total_count
790
+ };
791
+ };
792
+ const unmarshalListSSLCertificatesResponse = (data) => {
793
+ if (!isJSONObject(data)) {
794
+ throw new TypeError(
795
+ `Unmarshalling the type 'ListSSLCertificatesResponse' failed as data isn't a dictionary.`
796
+ );
797
+ }
798
+ return {
799
+ certificates: unmarshalArrayOfObject(
800
+ data.certificates,
801
+ unmarshalSSLCertificate
802
+ ),
803
+ totalCount: data.total_count
804
+ };
805
+ };
806
+ const unmarshalTask = (data) => {
807
+ if (!isJSONObject(data)) {
808
+ throw new TypeError(
809
+ `Unmarshalling the type 'Task' failed as data isn't a dictionary.`
810
+ );
811
+ }
812
+ return {
813
+ contactIdentifier: data.contact_identifier,
814
+ domain: data.domain,
815
+ id: data.id,
816
+ message: data.message,
817
+ organizationId: data.organization_id,
818
+ projectId: data.project_id,
819
+ startedAt: unmarshalDate(data.started_at),
820
+ status: data.status,
821
+ type: data.type,
822
+ updatedAt: unmarshalDate(data.updated_at)
823
+ };
824
+ };
825
+ const unmarshalListTasksResponse = (data) => {
826
+ if (!isJSONObject(data)) {
827
+ throw new TypeError(
828
+ `Unmarshalling the type 'ListTasksResponse' failed as data isn't a dictionary.`
829
+ );
830
+ }
831
+ return {
832
+ tasks: unmarshalArrayOfObject(data.tasks, unmarshalTask),
833
+ totalCount: data.total_count
834
+ };
835
+ };
836
+ const unmarshalListTldsResponse = (data) => {
837
+ if (!isJSONObject(data)) {
838
+ throw new TypeError(
839
+ `Unmarshalling the type 'ListTldsResponse' failed as data isn't a dictionary.`
840
+ );
841
+ }
842
+ return {
843
+ tlds: unmarshalArrayOfObject(data.tlds, unmarshalTld),
844
+ totalCount: data.total_count
845
+ };
846
+ };
847
+ const unmarshalOrderResponse = (data) => {
848
+ if (!isJSONObject(data)) {
849
+ throw new TypeError(
850
+ `Unmarshalling the type 'OrderResponse' failed as data isn't a dictionary.`
851
+ );
852
+ }
853
+ return {
854
+ createdAt: unmarshalDate(data.created_at),
855
+ domains: data.domains,
856
+ organizationId: data.organization_id,
857
+ projectId: data.project_id,
858
+ taskId: data.task_id
859
+ };
860
+ };
861
+ const unmarshalRefreshDNSZoneResponse = (data) => {
862
+ if (!isJSONObject(data)) {
863
+ throw new TypeError(
864
+ `Unmarshalling the type 'RefreshDNSZoneResponse' failed as data isn't a dictionary.`
865
+ );
866
+ }
867
+ return {
868
+ dnsZones: unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone)
869
+ };
870
+ };
871
+ const unmarshalRegisterExternalDomainResponse = (data) => {
872
+ if (!isJSONObject(data)) {
873
+ throw new TypeError(
874
+ `Unmarshalling the type 'RegisterExternalDomainResponse' failed as data isn't a dictionary.`
875
+ );
876
+ }
877
+ return {
878
+ createdAt: unmarshalDate(data.created_at),
879
+ domain: data.domain,
880
+ organizationId: data.organization_id,
881
+ projectId: data.project_id,
882
+ validationToken: data.validation_token
883
+ };
884
+ };
885
+ const unmarshalRestoreDNSZoneVersionResponse = (data) => {
886
+ if (!isJSONObject(data)) {
887
+ throw new TypeError(
888
+ `Unmarshalling the type 'RestoreDNSZoneVersionResponse' failed as data isn't a dictionary.`
889
+ );
890
+ }
891
+ return {};
892
+ };
893
+ const unmarshalAvailableDomain = (data) => {
894
+ if (!isJSONObject(data)) {
895
+ throw new TypeError(
896
+ `Unmarshalling the type 'AvailableDomain' failed as data isn't a dictionary.`
897
+ );
898
+ }
899
+ return {
900
+ available: data.available,
901
+ domain: data.domain,
902
+ tld: data.tld ? unmarshalTld(data.tld) : void 0
903
+ };
904
+ };
905
+ const unmarshalSearchAvailableDomainsResponse = (data) => {
906
+ if (!isJSONObject(data)) {
907
+ throw new TypeError(
908
+ `Unmarshalling the type 'SearchAvailableDomainsResponse' failed as data isn't a dictionary.`
909
+ );
910
+ }
911
+ return {
912
+ availableDomains: unmarshalArrayOfObject(
913
+ data.available_domains,
914
+ unmarshalAvailableDomain
915
+ )
916
+ };
917
+ };
918
+ const unmarshalUpdateDNSZoneNameserversResponse = (data) => {
919
+ if (!isJSONObject(data)) {
920
+ throw new TypeError(
921
+ `Unmarshalling the type 'UpdateDNSZoneNameserversResponse' failed as data isn't a dictionary.`
922
+ );
923
+ }
924
+ return {
925
+ ns: unmarshalArrayOfObject(data.ns, unmarshalNameserver)
926
+ };
927
+ };
928
+ const unmarshalUpdateDNSZoneRecordsResponse = (data) => {
929
+ if (!isJSONObject(data)) {
930
+ throw new TypeError(
931
+ `Unmarshalling the type 'UpdateDNSZoneRecordsResponse' failed as data isn't a dictionary.`
932
+ );
933
+ }
934
+ return {
935
+ records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord)
936
+ };
937
+ };
938
+ const marshalCloneDNSZoneRequest = (request, defaults) => ({
939
+ dest_dns_zone: request.destDnsZone,
940
+ overwrite: request.overwrite,
941
+ project_id: request.projectId ?? defaults.defaultProjectId
942
+ });
943
+ const marshalCreateDNSZoneRequest = (request, defaults) => ({
944
+ domain: request.domain,
945
+ project_id: request.projectId ?? defaults.defaultProjectId,
946
+ subdomain: request.subdomain
947
+ });
948
+ const marshalCreateSSLCertificateRequest = (request, defaults) => ({
949
+ alternative_dns_zones: request.alternativeDnsZones,
950
+ dns_zone: request.dnsZone
951
+ });
952
+ const marshalImportProviderDNSZoneRequestOnlineV1 = (request, defaults) => ({
953
+ token: request.token
954
+ });
955
+ const marshalImportProviderDNSZoneRequest = (request, defaults) => ({
956
+ ...resolveOneOf([
957
+ {
958
+ param: "online_v1",
959
+ value: request.onlineV1 !== void 0 ? marshalImportProviderDNSZoneRequestOnlineV1(
960
+ request.onlineV1
961
+ ) : void 0
962
+ }
963
+ ])
964
+ });
965
+ const marshalImportRawDNSZoneRequestTsigKey = (request, defaults) => ({
966
+ algorithm: request.algorithm,
967
+ key: request.key,
968
+ name: request.name
969
+ });
970
+ const marshalImportRawDNSZoneRequestAXFRSource = (request, defaults) => ({
971
+ name_server: request.nameServer,
972
+ tsig_key: request.tsigKey !== void 0 ? marshalImportRawDNSZoneRequestTsigKey(request.tsigKey) : void 0
973
+ });
974
+ const marshalImportRawDNSZoneRequestBindSource = (request, defaults) => ({
975
+ content: request.content
976
+ });
977
+ const marshalImportRawDNSZoneRequest = (request, defaults) => ({
978
+ content: request.content,
979
+ format: request.format,
980
+ project_id: request.projectId ?? defaults.defaultProjectId,
981
+ ...resolveOneOf([
982
+ {
983
+ param: "bind_source",
984
+ value: request.bindSource !== void 0 ? marshalImportRawDNSZoneRequestBindSource(
985
+ request.bindSource
986
+ ) : void 0
987
+ },
988
+ {
989
+ param: "axfr_source",
990
+ value: request.axfrSource !== void 0 ? marshalImportRawDNSZoneRequestAXFRSource(
991
+ request.axfrSource
992
+ ) : void 0
993
+ }
994
+ ])
995
+ });
996
+ const marshalRefreshDNSZoneRequest = (request, defaults) => ({
997
+ recreate_dns_zone: request.recreateDnsZone,
998
+ recreate_sub_dns_zone: request.recreateSubDnsZone
999
+ });
1000
+ const marshalContactExtensionFRAssociationInfo = (request, defaults) => ({
1001
+ publication_jo: request.publicationJo,
1002
+ publication_jo_page: request.publicationJoPage
1003
+ });
1004
+ const marshalContactExtensionFRCodeAuthAfnicInfo = (request, defaults) => ({
1005
+ code_auth_afnic: request.codeAuthAfnic
1006
+ });
1007
+ const marshalContactExtensionFRDunsInfo = (request, defaults) => ({
1008
+ duns_id: request.dunsId,
1009
+ local_id: request.localId
1010
+ });
1011
+ const marshalContactExtensionFRIndividualInfo = (request, defaults) => ({
1012
+ whois_opt_in: request.whoisOptIn
1013
+ });
1014
+ const marshalContactExtensionFRTrademarkInfo = (request, defaults) => ({
1015
+ trademark_inpi: request.trademarkInpi
1016
+ });
1017
+ const marshalContactExtensionEU = (request, defaults) => ({
1018
+ european_citizenship: request.europeanCitizenship
1019
+ });
1020
+ const marshalContactExtensionFR = (request, defaults) => ({
1021
+ mode: request.mode,
1022
+ ...resolveOneOf([
1023
+ {
1024
+ param: "individual_info",
1025
+ value: request.individualInfo !== void 0 ? marshalContactExtensionFRIndividualInfo(
1026
+ request.individualInfo
1027
+ ) : void 0
1028
+ },
1029
+ {
1030
+ param: "duns_info",
1031
+ value: request.dunsInfo !== void 0 ? marshalContactExtensionFRDunsInfo(request.dunsInfo) : void 0
1032
+ },
1033
+ {
1034
+ param: "association_info",
1035
+ value: request.associationInfo !== void 0 ? marshalContactExtensionFRAssociationInfo(
1036
+ request.associationInfo
1037
+ ) : void 0
1038
+ },
1039
+ {
1040
+ param: "trademark_info",
1041
+ value: request.trademarkInfo !== void 0 ? marshalContactExtensionFRTrademarkInfo(
1042
+ request.trademarkInfo
1043
+ ) : void 0
1044
+ },
1045
+ {
1046
+ param: "code_auth_afnic_info",
1047
+ value: request.codeAuthAfnicInfo !== void 0 ? marshalContactExtensionFRCodeAuthAfnicInfo(
1048
+ request.codeAuthAfnicInfo
1049
+ ) : void 0
1050
+ }
1051
+ ])
1052
+ });
1053
+ const marshalContactExtensionNL = (request, defaults) => ({
1054
+ legal_form: request.legalForm,
1055
+ legal_form_registration_number: request.legalFormRegistrationNumber
1056
+ });
1057
+ const marshalContactQuestion = (request, defaults) => ({
1058
+ answer: request.answer,
1059
+ question: request.question
1060
+ });
1061
+ const marshalNewContact = (request, defaults) => ({
1062
+ address_line_1: request.addressLine1,
1063
+ address_line_2: request.addressLine2,
1064
+ city: request.city,
1065
+ company_identification_code: request.companyIdentificationCode,
1066
+ company_name: request.companyName,
1067
+ country: request.country,
1068
+ email: request.email,
1069
+ email_alt: request.emailAlt,
1070
+ extension_eu: request.extensionEu !== void 0 ? marshalContactExtensionEU(request.extensionEu) : void 0,
1071
+ extension_fr: request.extensionFr !== void 0 ? marshalContactExtensionFR(request.extensionFr) : void 0,
1072
+ extension_nl: request.extensionNl !== void 0 ? marshalContactExtensionNL(request.extensionNl) : void 0,
1073
+ fax_number: request.faxNumber,
1074
+ firstname: request.firstname,
1075
+ lang: request.lang,
1076
+ lastname: request.lastname,
1077
+ legal_form: request.legalForm,
1078
+ phone_number: request.phoneNumber,
1079
+ questions: request.questions !== void 0 ? request.questions.map((elt) => marshalContactQuestion(elt)) : void 0,
1080
+ resale: request.resale,
1081
+ state: request.state,
1082
+ vat_identification_code: request.vatIdentificationCode,
1083
+ whois_opt_in: request.whoisOptIn,
1084
+ zip: request.zip
1085
+ });
1086
+ const marshalRegistrarApiBuyDomainsRequest = (request, defaults) => ({
1087
+ domains: request.domains,
1088
+ duration_in_years: request.durationInYears,
1089
+ project_id: request.projectId ?? defaults.defaultProjectId,
1090
+ ...resolveOneOf([
1091
+ { param: "owner_contact_id", value: request.ownerContactId },
1092
+ {
1093
+ param: "owner_contact",
1094
+ value: request.ownerContact !== void 0 ? marshalNewContact(request.ownerContact) : void 0
1095
+ }
1096
+ ]),
1097
+ ...resolveOneOf([
1098
+ {
1099
+ param: "administrative_contact_id",
1100
+ value: request.administrativeContactId
1101
+ },
1102
+ {
1103
+ param: "administrative_contact",
1104
+ value: request.administrativeContact !== void 0 ? marshalNewContact(request.administrativeContact) : void 0
1105
+ }
1106
+ ]),
1107
+ ...resolveOneOf([
1108
+ { param: "technical_contact_id", value: request.technicalContactId },
1109
+ {
1110
+ param: "technical_contact",
1111
+ value: request.technicalContact !== void 0 ? marshalNewContact(request.technicalContact) : void 0
1112
+ }
1113
+ ])
1114
+ });
1115
+ const marshalRegistrarApiCheckContactsCompatibilityRequest = (request, defaults) => ({
1116
+ domains: request.domains,
1117
+ tlds: request.tlds,
1118
+ ...resolveOneOf([
1119
+ { param: "owner_contact_id", value: request.ownerContactId },
1120
+ {
1121
+ param: "owner_contact",
1122
+ value: request.ownerContact !== void 0 ? marshalNewContact(request.ownerContact) : void 0
1123
+ }
1124
+ ]),
1125
+ ...resolveOneOf([
1126
+ {
1127
+ param: "administrative_contact_id",
1128
+ value: request.administrativeContactId
1129
+ },
1130
+ {
1131
+ param: "administrative_contact",
1132
+ value: request.administrativeContact !== void 0 ? marshalNewContact(request.administrativeContact) : void 0
1133
+ }
1134
+ ]),
1135
+ ...resolveOneOf([
1136
+ { param: "technical_contact_id", value: request.technicalContactId },
1137
+ {
1138
+ param: "technical_contact",
1139
+ value: request.technicalContact !== void 0 ? marshalNewContact(request.technicalContact) : void 0
1140
+ }
1141
+ ])
1142
+ });
1143
+ const marshalRegistrarApiCreateDomainHostRequest = (request, defaults) => ({
1144
+ ips: request.ips,
1145
+ name: request.name
1146
+ });
1147
+ const marshalDSRecordPublicKey = (request, defaults) => ({
1148
+ key: request.key
1149
+ });
1150
+ const marshalDSRecordDigest = (request, defaults) => ({
1151
+ digest: request.digest,
1152
+ public_key: request.publicKey !== void 0 ? marshalDSRecordPublicKey(request.publicKey) : void 0,
1153
+ type: request.type
1154
+ });
1155
+ const marshalDSRecord = (request, defaults) => ({
1156
+ algorithm: request.algorithm,
1157
+ key_id: request.keyId,
1158
+ ...resolveOneOf([
1159
+ {
1160
+ param: "digest",
1161
+ value: request.digest !== void 0 ? marshalDSRecordDigest(request.digest) : void 0
1162
+ },
1163
+ {
1164
+ param: "public_key",
1165
+ value: request.publicKey !== void 0 ? marshalDSRecordPublicKey(request.publicKey) : void 0
1166
+ }
1167
+ ])
1168
+ });
1169
+ const marshalRegistrarApiEnableDomainDNSSECRequest = (request, defaults) => ({
1170
+ ds_record: request.dsRecord !== void 0 ? marshalDSRecord(request.dsRecord) : void 0
1171
+ });
1172
+ const marshalRegistrarApiRegisterExternalDomainRequest = (request, defaults) => ({
1173
+ domain: request.domain,
1174
+ project_id: request.projectId ?? defaults.defaultProjectId
1175
+ });
1176
+ const marshalRegistrarApiRenewDomainsRequest = (request, defaults) => ({
1177
+ domains: request.domains,
1178
+ duration_in_years: request.durationInYears,
1179
+ force_late_renewal: request.forceLateRenewal
1180
+ });
1181
+ const marshalRegistrarApiTradeDomainRequest = (request, defaults) => ({
1182
+ project_id: request.projectId ?? defaults.defaultProjectId,
1183
+ ...resolveOneOf([
1184
+ { param: "new_owner_contact_id", value: request.newOwnerContactId },
1185
+ {
1186
+ param: "new_owner_contact",
1187
+ value: request.newOwnerContact !== void 0 ? marshalNewContact(request.newOwnerContact) : void 0
1188
+ }
1189
+ ])
1190
+ });
1191
+ const marshalTransferInDomainRequestTransferRequest = (request, defaults) => ({
1192
+ auth_code: request.authCode,
1193
+ domain: request.domain
1194
+ });
1195
+ const marshalRegistrarApiTransferInDomainRequest = (request, defaults) => ({
1196
+ domains: request.domains.map(
1197
+ (elt) => marshalTransferInDomainRequestTransferRequest(elt)
1198
+ ),
1199
+ project_id: request.projectId ?? defaults.defaultProjectId,
1200
+ ...resolveOneOf([
1201
+ { param: "owner_contact_id", value: request.ownerContactId },
1202
+ {
1203
+ param: "owner_contact",
1204
+ value: request.ownerContact !== void 0 ? marshalNewContact(request.ownerContact) : void 0
1205
+ }
1206
+ ]),
1207
+ ...resolveOneOf([
1208
+ {
1209
+ param: "administrative_contact_id",
1210
+ value: request.administrativeContactId
1211
+ },
1212
+ {
1213
+ param: "administrative_contact",
1214
+ value: request.administrativeContact !== void 0 ? marshalNewContact(request.administrativeContact) : void 0
1215
+ }
1216
+ ]),
1217
+ ...resolveOneOf([
1218
+ { param: "technical_contact_id", value: request.technicalContactId },
1219
+ {
1220
+ param: "technical_contact",
1221
+ value: request.technicalContact !== void 0 ? marshalNewContact(request.technicalContact) : void 0
1222
+ }
1223
+ ])
1224
+ });
1225
+ const marshalUpdateContactRequestQuestion = (request, defaults) => ({
1226
+ answer: request.answer,
1227
+ question: request.question
1228
+ });
1229
+ const marshalRegistrarApiUpdateContactRequest = (request, defaults) => ({
1230
+ address_line_1: request.addressLine1,
1231
+ address_line_2: request.addressLine2,
1232
+ city: request.city,
1233
+ company_identification_code: request.companyIdentificationCode,
1234
+ country: request.country,
1235
+ email: request.email,
1236
+ email_alt: request.emailAlt,
1237
+ extension_eu: request.extensionEu !== void 0 ? marshalContactExtensionEU(request.extensionEu) : void 0,
1238
+ extension_fr: request.extensionFr !== void 0 ? marshalContactExtensionFR(request.extensionFr) : void 0,
1239
+ extension_nl: request.extensionNl !== void 0 ? marshalContactExtensionNL(request.extensionNl) : void 0,
1240
+ fax_number: request.faxNumber,
1241
+ lang: request.lang,
1242
+ phone_number: request.phoneNumber,
1243
+ questions: request.questions !== void 0 ? request.questions.map(
1244
+ (elt) => marshalUpdateContactRequestQuestion(elt)
1245
+ ) : void 0,
1246
+ resale: request.resale,
1247
+ state: request.state,
1248
+ vat_identification_code: request.vatIdentificationCode,
1249
+ whois_opt_in: request.whoisOptIn,
1250
+ zip: request.zip
1251
+ });
1252
+ const marshalRegistrarApiUpdateDomainHostRequest = (request, defaults) => ({
1253
+ ips: request.ips
1254
+ });
1255
+ const marshalRegistrarApiUpdateDomainRequest = (request, defaults) => ({
1256
+ ...resolveOneOf([
1257
+ { param: "technical_contact_id", value: request.technicalContactId },
1258
+ {
1259
+ param: "technical_contact",
1260
+ value: request.technicalContact !== void 0 ? marshalNewContact(request.technicalContact) : void 0
1261
+ }
1262
+ ]),
1263
+ ...resolveOneOf([
1264
+ { param: "owner_contact_id", value: request.ownerContactId },
1265
+ {
1266
+ param: "owner_contact",
1267
+ value: request.ownerContact !== void 0 ? marshalNewContact(request.ownerContact) : void 0
1268
+ }
1269
+ ]),
1270
+ ...resolveOneOf([
1271
+ {
1272
+ param: "administrative_contact_id",
1273
+ value: request.administrativeContactId
1274
+ },
1275
+ {
1276
+ param: "administrative_contact",
1277
+ value: request.administrativeContact !== void 0 ? marshalNewContact(request.administrativeContact) : void 0
1278
+ }
1279
+ ])
1280
+ });
1281
+ const marshalNameserver = (request, defaults) => ({
1282
+ ip: request.ip,
1283
+ name: request.name
1284
+ });
1285
+ const marshalUpdateDNSZoneNameserversRequest = (request, defaults) => ({
1286
+ ns: request.ns.map((elt) => marshalNameserver(elt))
1287
+ });
1288
+ const marshalDomainRecordGeoIPConfigMatch = (request, defaults) => ({
1289
+ continents: request.continents,
1290
+ countries: request.countries,
1291
+ data: request.data
1292
+ });
1293
+ const marshalDomainRecordViewConfigView = (request, defaults) => ({
1294
+ data: request.data,
1295
+ subnet: request.subnet
1296
+ });
1297
+ const marshalDomainRecordWeightedConfigWeightedIP = (request, defaults) => ({
1298
+ ip: request.ip,
1299
+ weight: request.weight
1300
+ });
1301
+ const marshalDomainRecordGeoIPConfig = (request, defaults) => ({
1302
+ default: request.default,
1303
+ matches: request.matches.map(
1304
+ (elt) => marshalDomainRecordGeoIPConfigMatch(elt)
1305
+ )
1306
+ });
1307
+ const marshalDomainRecordHTTPServiceConfig = (request, defaults) => ({
1308
+ ips: request.ips,
1309
+ must_contain: request.mustContain,
1310
+ strategy: request.strategy,
1311
+ url: request.url,
1312
+ user_agent: request.userAgent
1313
+ });
1314
+ const marshalDomainRecordViewConfig = (request, defaults) => ({
1315
+ views: request.views.map(
1316
+ (elt) => marshalDomainRecordViewConfigView(elt)
1317
+ )
1318
+ });
1319
+ const marshalDomainRecordWeightedConfig = (request, defaults) => ({
1320
+ weighted_ips: request.weightedIps.map(
1321
+ (elt) => marshalDomainRecordWeightedConfigWeightedIP(elt)
1322
+ )
1323
+ });
1324
+ const marshalDomainRecord = (request, defaults) => ({
1325
+ comment: request.comment,
1326
+ data: request.data,
1327
+ id: request.id,
1328
+ name: request.name,
1329
+ priority: request.priority,
1330
+ ttl: request.ttl,
1331
+ type: request.type,
1332
+ ...resolveOneOf([
1333
+ {
1334
+ param: "geo_ip_config",
1335
+ value: request.geoIpConfig !== void 0 ? marshalDomainRecordGeoIPConfig(request.geoIpConfig) : void 0
1336
+ },
1337
+ {
1338
+ param: "http_service_config",
1339
+ value: request.httpServiceConfig !== void 0 ? marshalDomainRecordHTTPServiceConfig(
1340
+ request.httpServiceConfig
1341
+ ) : void 0
1342
+ },
1343
+ {
1344
+ param: "weighted_config",
1345
+ value: request.weightedConfig !== void 0 ? marshalDomainRecordWeightedConfig(request.weightedConfig) : void 0
1346
+ },
1347
+ {
1348
+ param: "view_config",
1349
+ value: request.viewConfig !== void 0 ? marshalDomainRecordViewConfig(request.viewConfig) : void 0
1350
+ }
1351
+ ])
1352
+ });
1353
+ const marshalRecordIdentifier = (request, defaults) => ({
1354
+ data: request.data,
1355
+ name: request.name,
1356
+ ttl: request.ttl,
1357
+ type: request.type
1358
+ });
1359
+ const marshalRecordChangeAdd = (request, defaults) => ({
1360
+ records: request.records.map((elt) => marshalDomainRecord(elt))
1361
+ });
1362
+ const marshalRecordChangeClear = (request, defaults) => ({});
1363
+ const marshalRecordChangeDelete = (request, defaults) => ({
1364
+ ...resolveOneOf([
1365
+ { param: "id", value: request.id },
1366
+ {
1367
+ param: "id_fields",
1368
+ value: request.idFields !== void 0 ? marshalRecordIdentifier(request.idFields) : void 0
1369
+ }
1370
+ ])
1371
+ });
1372
+ const marshalRecordChangeSet = (request, defaults) => ({
1373
+ records: request.records.map((elt) => marshalDomainRecord(elt)),
1374
+ ...resolveOneOf([
1375
+ { param: "id", value: request.id },
1376
+ {
1377
+ param: "id_fields",
1378
+ value: request.idFields !== void 0 ? marshalRecordIdentifier(request.idFields) : void 0
1379
+ }
1380
+ ])
1381
+ });
1382
+ const marshalRecordChange = (request, defaults) => ({
1383
+ ...resolveOneOf([
1384
+ {
1385
+ param: "add",
1386
+ value: request.add !== void 0 ? marshalRecordChangeAdd(request.add) : void 0
1387
+ },
1388
+ {
1389
+ param: "set",
1390
+ value: request.set !== void 0 ? marshalRecordChangeSet(request.set) : void 0
1391
+ },
1392
+ {
1393
+ param: "delete",
1394
+ value: request.delete !== void 0 ? marshalRecordChangeDelete(request.delete) : void 0
1395
+ },
1396
+ {
1397
+ param: "clear",
1398
+ value: request.clear !== void 0 ? marshalRecordChangeClear(request.clear) : void 0
1399
+ }
1400
+ ])
1401
+ });
1402
+ const marshalUpdateDNSZoneRecordsRequest = (request, defaults) => ({
1403
+ changes: request.changes.map((elt) => marshalRecordChange(elt)),
1404
+ disallow_new_zone_creation: request.disallowNewZoneCreation,
1405
+ return_all_records: request.returnAllRecords,
1406
+ serial: request.serial
1407
+ });
1408
+ const marshalUpdateDNSZoneRequest = (request, defaults) => ({
1409
+ new_dns_zone: request.newDnsZone,
1410
+ project_id: request.projectId ?? defaults.defaultProjectId
1411
+ });
1412
+ export {
1413
+ marshalCloneDNSZoneRequest,
1414
+ marshalCreateDNSZoneRequest,
1415
+ marshalCreateSSLCertificateRequest,
1416
+ marshalDSRecord,
1417
+ marshalImportProviderDNSZoneRequest,
1418
+ marshalImportRawDNSZoneRequest,
1419
+ marshalRefreshDNSZoneRequest,
1420
+ marshalRegistrarApiBuyDomainsRequest,
1421
+ marshalRegistrarApiCheckContactsCompatibilityRequest,
1422
+ marshalRegistrarApiCreateDomainHostRequest,
1423
+ marshalRegistrarApiEnableDomainDNSSECRequest,
1424
+ marshalRegistrarApiRegisterExternalDomainRequest,
1425
+ marshalRegistrarApiRenewDomainsRequest,
1426
+ marshalRegistrarApiTradeDomainRequest,
1427
+ marshalRegistrarApiTransferInDomainRequest,
1428
+ marshalRegistrarApiUpdateContactRequest,
1429
+ marshalRegistrarApiUpdateDomainHostRequest,
1430
+ marshalRegistrarApiUpdateDomainRequest,
1431
+ marshalUpdateDNSZoneNameserversRequest,
1432
+ marshalUpdateDNSZoneRecordsRequest,
1433
+ marshalUpdateDNSZoneRequest,
1434
+ unmarshalCheckContactsCompatibilityResponse,
1435
+ unmarshalClearDNSZoneRecordsResponse,
1436
+ unmarshalContact,
1437
+ unmarshalDNSZone,
1438
+ unmarshalDSRecord,
1439
+ unmarshalDeleteDNSZoneResponse,
1440
+ unmarshalDeleteExternalDomainResponse,
1441
+ unmarshalDeleteSSLCertificateResponse,
1442
+ unmarshalDomain,
1443
+ unmarshalGetDNSZoneTsigKeyResponse,
1444
+ unmarshalGetDNSZoneVersionDiffResponse,
1445
+ unmarshalGetDomainAuthCodeResponse,
1446
+ unmarshalHost,
1447
+ unmarshalImportProviderDNSZoneResponse,
1448
+ unmarshalImportRawDNSZoneResponse,
1449
+ unmarshalListContactsResponse,
1450
+ unmarshalListDNSZoneNameserversResponse,
1451
+ unmarshalListDNSZoneRecordsResponse,
1452
+ unmarshalListDNSZoneVersionRecordsResponse,
1453
+ unmarshalListDNSZoneVersionsResponse,
1454
+ unmarshalListDNSZonesResponse,
1455
+ unmarshalListDomainHostsResponse,
1456
+ unmarshalListDomainsResponse,
1457
+ unmarshalListRenewableDomainsResponse,
1458
+ unmarshalListSSLCertificatesResponse,
1459
+ unmarshalListTasksResponse,
1460
+ unmarshalListTldsResponse,
1461
+ unmarshalOrderResponse,
1462
+ unmarshalRefreshDNSZoneResponse,
1463
+ unmarshalRegisterExternalDomainResponse,
1464
+ unmarshalRestoreDNSZoneVersionResponse,
1465
+ unmarshalSSLCertificate,
1466
+ unmarshalSearchAvailableDomainsResponse,
1467
+ unmarshalTask,
1468
+ unmarshalUpdateDNSZoneNameserversResponse,
1469
+ unmarshalUpdateDNSZoneRecordsResponse
1470
+ };