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