@scaleway/sdk-dedibox 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,1473 @@
1
+ import { isJSONObject, unmarshalMoney, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
2
+ const unmarshalIP = (data) => {
3
+ if (!isJSONObject(data)) {
4
+ throw new TypeError(
5
+ `Unmarshalling the type 'IP' failed as data isn't a dictionary.`
6
+ );
7
+ }
8
+ return {
9
+ address: data.address,
10
+ cidr: data.cidr,
11
+ gateway: data.gateway,
12
+ ipId: data.ip_id,
13
+ netmask: data.netmask,
14
+ reverse: data.reverse,
15
+ semantic: data.semantic,
16
+ status: data.status,
17
+ version: data.version
18
+ };
19
+ };
20
+ const unmarshalCPU = (data) => {
21
+ if (!isJSONObject(data)) {
22
+ throw new TypeError(
23
+ `Unmarshalling the type 'CPU' failed as data isn't a dictionary.`
24
+ );
25
+ }
26
+ return {
27
+ coreCount: data.core_count,
28
+ frequency: data.frequency,
29
+ name: data.name,
30
+ threadCount: data.thread_count
31
+ };
32
+ };
33
+ const unmarshalDisk = (data) => {
34
+ if (!isJSONObject(data)) {
35
+ throw new TypeError(
36
+ `Unmarshalling the type 'Disk' failed as data isn't a dictionary.`
37
+ );
38
+ }
39
+ return {
40
+ capacity: data.capacity,
41
+ type: data.type
42
+ };
43
+ };
44
+ const unmarshalMemory = (data) => {
45
+ if (!isJSONObject(data)) {
46
+ throw new TypeError(
47
+ `Unmarshalling the type 'Memory' failed as data isn't a dictionary.`
48
+ );
49
+ }
50
+ return {
51
+ capacity: data.capacity,
52
+ frequency: data.frequency,
53
+ isEcc: data.is_ecc,
54
+ type: data.type
55
+ };
56
+ };
57
+ const unmarshalPersistentMemory = (data) => {
58
+ if (!isJSONObject(data)) {
59
+ throw new TypeError(
60
+ `Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.`
61
+ );
62
+ }
63
+ return {
64
+ capacity: data.capacity,
65
+ frequency: data.frequency,
66
+ model: data.model
67
+ };
68
+ };
69
+ const unmarshalRaidController = (data) => {
70
+ if (!isJSONObject(data)) {
71
+ throw new TypeError(
72
+ `Unmarshalling the type 'RaidController' failed as data isn't a dictionary.`
73
+ );
74
+ }
75
+ return {
76
+ model: data.model,
77
+ raidLevel: data.raid_level
78
+ };
79
+ };
80
+ const unmarshalOfferAntiDosInfo = (data) => {
81
+ if (!isJSONObject(data)) {
82
+ throw new TypeError(
83
+ `Unmarshalling the type 'OfferAntiDosInfo' failed as data isn't a dictionary.`
84
+ );
85
+ }
86
+ return {
87
+ type: data.type
88
+ };
89
+ };
90
+ const unmarshalOfferBackupInfo = (data) => {
91
+ if (!isJSONObject(data)) {
92
+ throw new TypeError(
93
+ `Unmarshalling the type 'OfferBackupInfo' failed as data isn't a dictionary.`
94
+ );
95
+ }
96
+ return {
97
+ size: data.size
98
+ };
99
+ };
100
+ const unmarshalOfferBandwidthInfo = (data) => {
101
+ if (!isJSONObject(data)) {
102
+ throw new TypeError(
103
+ `Unmarshalling the type 'OfferBandwidthInfo' failed as data isn't a dictionary.`
104
+ );
105
+ }
106
+ return {
107
+ speed: data.speed
108
+ };
109
+ };
110
+ const unmarshalOfferFailoverBlockInfo = (data) => {
111
+ if (!isJSONObject(data)) {
112
+ throw new TypeError(
113
+ `Unmarshalling the type 'OfferFailoverBlockInfo' failed as data isn't a dictionary.`
114
+ );
115
+ }
116
+ return {
117
+ onetimeFees: data.onetime_fees ? unmarshalOffer(data.onetime_fees) : void 0
118
+ };
119
+ };
120
+ const unmarshalOfferFailoverIpInfo = (data) => {
121
+ if (!isJSONObject(data)) {
122
+ throw new TypeError(
123
+ `Unmarshalling the type 'OfferFailoverIpInfo' failed as data isn't a dictionary.`
124
+ );
125
+ }
126
+ return {
127
+ onetimeFees: data.onetime_fees ? unmarshalOffer(data.onetime_fees) : void 0
128
+ };
129
+ };
130
+ const unmarshalOfferLicenseInfo = (data) => {
131
+ if (!isJSONObject(data)) {
132
+ throw new TypeError(
133
+ `Unmarshalling the type 'OfferLicenseInfo' failed as data isn't a dictionary.`
134
+ );
135
+ }
136
+ return {
137
+ boundToIp: data.bound_to_ip
138
+ };
139
+ };
140
+ const unmarshalOfferRPNInfo = (data) => {
141
+ if (!isJSONObject(data)) {
142
+ throw new TypeError(
143
+ `Unmarshalling the type 'OfferRPNInfo' failed as data isn't a dictionary.`
144
+ );
145
+ }
146
+ return {
147
+ speed: data.speed
148
+ };
149
+ };
150
+ const unmarshalOfferSANInfo = (data) => {
151
+ if (!isJSONObject(data)) {
152
+ throw new TypeError(
153
+ `Unmarshalling the type 'OfferSANInfo' failed as data isn't a dictionary.`
154
+ );
155
+ }
156
+ return {
157
+ deviceType: data.device_type,
158
+ ha: data.ha,
159
+ size: data.size
160
+ };
161
+ };
162
+ const unmarshalOfferServerInfo = (data) => {
163
+ if (!isJSONObject(data)) {
164
+ throw new TypeError(
165
+ `Unmarshalling the type 'OfferServerInfo' failed as data isn't a dictionary.`
166
+ );
167
+ }
168
+ return {
169
+ availableOptions: unmarshalArrayOfObject(
170
+ data.available_options,
171
+ unmarshalOffer
172
+ ),
173
+ bandwidth: data.bandwidth,
174
+ commercialRange: data.commercial_range,
175
+ connectivity: data.connectivity,
176
+ cpus: unmarshalArrayOfObject(data.cpus, unmarshalCPU),
177
+ disks: unmarshalArrayOfObject(data.disks, unmarshalDisk),
178
+ memories: unmarshalArrayOfObject(data.memories, unmarshalMemory),
179
+ onetimeFees: data.onetime_fees ? unmarshalOffer(data.onetime_fees) : void 0,
180
+ persistentMemories: unmarshalArrayOfObject(
181
+ data.persistent_memories,
182
+ unmarshalPersistentMemory
183
+ ),
184
+ raidControllers: unmarshalArrayOfObject(
185
+ data.raid_controllers,
186
+ unmarshalRaidController
187
+ ),
188
+ rpnVersion: data.rpn_version,
189
+ stock: data.stock,
190
+ stockByDatacenter: data.stock_by_datacenter
191
+ };
192
+ };
193
+ const unmarshalOfferServiceLevelInfo = (data) => {
194
+ if (!isJSONObject(data)) {
195
+ throw new TypeError(
196
+ `Unmarshalling the type 'OfferServiceLevelInfo' failed as data isn't a dictionary.`
197
+ );
198
+ }
199
+ return {
200
+ antidos: data.antidos,
201
+ availableOptions: unmarshalArrayOfObject(
202
+ data.available_options,
203
+ unmarshalOffer
204
+ ),
205
+ customization: data.customization,
206
+ extraFailoverQuota: data.extra_failover_quota,
207
+ git: data.git,
208
+ highRpnBandwidth: data.high_rpn_bandwidth,
209
+ prioritySupport: data.priority_support,
210
+ salesSupport: data.sales_support,
211
+ sla: data.sla,
212
+ supportPhone: data.support_phone,
213
+ supportTicket: data.support_ticket
214
+ };
215
+ };
216
+ const unmarshalOfferStorageInfo = (data) => {
217
+ if (!isJSONObject(data)) {
218
+ throw new TypeError(
219
+ `Unmarshalling the type 'OfferStorageInfo' failed as data isn't a dictionary.`
220
+ );
221
+ }
222
+ return {
223
+ maxQuota: data.max_quota,
224
+ size: data.size
225
+ };
226
+ };
227
+ const unmarshalOffer = (data) => {
228
+ if (!isJSONObject(data)) {
229
+ throw new TypeError(
230
+ `Unmarshalling the type 'Offer' failed as data isn't a dictionary.`
231
+ );
232
+ }
233
+ return {
234
+ antidosInfo: data.antidos_info ? unmarshalOfferAntiDosInfo(data.antidos_info) : void 0,
235
+ backupInfo: data.backup_info ? unmarshalOfferBackupInfo(data.backup_info) : void 0,
236
+ bandwidthInfo: data.bandwidth_info ? unmarshalOfferBandwidthInfo(data.bandwidth_info) : void 0,
237
+ catalog: data.catalog,
238
+ failoverBlockInfo: data.failover_block_info ? unmarshalOfferFailoverBlockInfo(data.failover_block_info) : void 0,
239
+ failoverIpInfo: data.failover_ip_info ? unmarshalOfferFailoverIpInfo(data.failover_ip_info) : void 0,
240
+ id: data.id,
241
+ licenseInfo: data.license_info ? unmarshalOfferLicenseInfo(data.license_info) : void 0,
242
+ name: data.name,
243
+ paymentFrequency: data.payment_frequency,
244
+ pricing: data.pricing ? unmarshalMoney(data.pricing) : void 0,
245
+ rpnInfo: data.rpn_info ? unmarshalOfferRPNInfo(data.rpn_info) : void 0,
246
+ sanInfo: data.san_info ? unmarshalOfferSANInfo(data.san_info) : void 0,
247
+ serverInfo: data.server_info ? unmarshalOfferServerInfo(data.server_info) : void 0,
248
+ serviceLevelInfo: data.service_level_info ? unmarshalOfferServiceLevelInfo(data.service_level_info) : void 0,
249
+ storageInfo: data.storage_info ? unmarshalOfferStorageInfo(data.storage_info) : void 0,
250
+ usbStorageInfo: data.usb_storage_info ? unmarshalOfferStorageInfo(data.usb_storage_info) : void 0
251
+ };
252
+ };
253
+ const unmarshalOS = (data) => {
254
+ if (!isJSONObject(data)) {
255
+ throw new TypeError(
256
+ `Unmarshalling the type 'OS' failed as data isn't a dictionary.`
257
+ );
258
+ }
259
+ return {
260
+ allowCustomPartitioning: data.allow_custom_partitioning,
261
+ allowSshKeys: data.allow_ssh_keys,
262
+ allowedFilesystems: data.allowed_filesystems,
263
+ arch: data.arch,
264
+ displayName: data.display_name,
265
+ hostnameMaxLength: data.hostname_max_length,
266
+ hostnameRegex: data.hostname_regex,
267
+ id: data.id,
268
+ licenseOffers: unmarshalArrayOfObject(data.license_offers, unmarshalOffer),
269
+ maxPartitions: data.max_partitions,
270
+ name: data.name,
271
+ panelPasswordRegex: data.panel_password_regex,
272
+ passwordRegex: data.password_regex,
273
+ releasedAt: unmarshalDate(data.released_at),
274
+ requiresAdminPassword: data.requires_admin_password,
275
+ requiresLicense: data.requires_license,
276
+ requiresPanelPassword: data.requires_panel_password,
277
+ requiresUser: data.requires_user,
278
+ requiresValidHostname: data.requires_valid_hostname,
279
+ type: data.type,
280
+ version: data.version
281
+ };
282
+ };
283
+ const unmarshalRpnSan = (data) => {
284
+ if (!isJSONObject(data)) {
285
+ throw new TypeError(
286
+ `Unmarshalling the type 'RpnSan' failed as data isn't a dictionary.`
287
+ );
288
+ }
289
+ return {
290
+ createdAt: unmarshalDate(data.created_at),
291
+ datacenterName: data.datacenter_name,
292
+ deliveredAt: unmarshalDate(data.delivered_at),
293
+ expiresAt: unmarshalDate(data.expires_at),
294
+ id: data.id,
295
+ iqn: data.iqn,
296
+ iqnSuffix: data.iqn_suffix,
297
+ offer: data.offer ? unmarshalOffer(data.offer) : void 0,
298
+ offerId: data.offer_id,
299
+ offerName: data.offer_name,
300
+ organizationId: data.organization_id,
301
+ projectId: data.project_id,
302
+ rpnv1Compatible: data.rpnv1_compatible,
303
+ rpnv1Implicit: data.rpnv1_implicit,
304
+ serverHostname: data.server_hostname,
305
+ status: data.status,
306
+ storageSize: data.storage_size,
307
+ terminatedAt: unmarshalDate(data.terminated_at)
308
+ };
309
+ };
310
+ const unmarshalRpnGroup = (data) => {
311
+ if (!isJSONObject(data)) {
312
+ throw new TypeError(
313
+ `Unmarshalling the type 'RpnGroup' failed as data isn't a dictionary.`
314
+ );
315
+ }
316
+ return {
317
+ active: data.active,
318
+ createdAt: unmarshalDate(data.created_at),
319
+ id: data.id,
320
+ membersCount: data.members_count,
321
+ name: data.name,
322
+ organizationId: data.organization_id,
323
+ owner: data.owner,
324
+ projectId: data.project_id,
325
+ type: data.type
326
+ };
327
+ };
328
+ const unmarshalNetworkInterface = (data) => {
329
+ if (!isJSONObject(data)) {
330
+ throw new TypeError(
331
+ `Unmarshalling the type 'NetworkInterface' failed as data isn't a dictionary.`
332
+ );
333
+ }
334
+ return {
335
+ cardId: data.card_id,
336
+ deviceId: data.device_id,
337
+ ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
338
+ mac: data.mac,
339
+ type: data.type
340
+ };
341
+ };
342
+ const unmarshalServerLocation = (data) => {
343
+ if (!isJSONObject(data)) {
344
+ throw new TypeError(
345
+ `Unmarshalling the type 'ServerLocation' failed as data isn't a dictionary.`
346
+ );
347
+ }
348
+ return {
349
+ datacenterName: data.datacenter_name,
350
+ rack: data.rack,
351
+ room: data.room
352
+ };
353
+ };
354
+ const unmarshalServerOption = (data) => {
355
+ if (!isJSONObject(data)) {
356
+ throw new TypeError(
357
+ `Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.`
358
+ );
359
+ }
360
+ return {
361
+ createdAt: unmarshalDate(data.created_at),
362
+ expiredAt: unmarshalDate(data.expired_at),
363
+ offer: data.offer ? unmarshalOffer(data.offer) : void 0,
364
+ options: unmarshalArrayOfObject(data.options, unmarshalServerOption),
365
+ updatedAt: unmarshalDate(data.updated_at)
366
+ };
367
+ };
368
+ const unmarshalServiceLevel = (data) => {
369
+ if (!isJSONObject(data)) {
370
+ throw new TypeError(
371
+ `Unmarshalling the type 'ServiceLevel' failed as data isn't a dictionary.`
372
+ );
373
+ }
374
+ return {
375
+ level: data.level,
376
+ offerId: data.offer_id
377
+ };
378
+ };
379
+ const unmarshalServer = (data) => {
380
+ if (!isJSONObject(data)) {
381
+ throw new TypeError(
382
+ `Unmarshalling the type 'Server' failed as data isn't a dictionary.`
383
+ );
384
+ }
385
+ return {
386
+ abuseContact: data.abuse_contact,
387
+ createdAt: unmarshalDate(data.created_at),
388
+ expiredAt: unmarshalDate(data.expired_at),
389
+ hasBmc: data.has_bmc,
390
+ hostname: data.hostname,
391
+ id: data.id,
392
+ interfaces: unmarshalArrayOfObject(
393
+ data.interfaces,
394
+ unmarshalNetworkInterface
395
+ ),
396
+ ipv6Slaac: data.ipv6_slaac,
397
+ isOutsourced: data.is_outsourced,
398
+ isRpnv2Member: data.is_rpnv2_member,
399
+ level: data.level ? unmarshalServiceLevel(data.level) : void 0,
400
+ location: data.location ? unmarshalServerLocation(data.location) : void 0,
401
+ offer: data.offer ? unmarshalOffer(data.offer) : void 0,
402
+ options: unmarshalArrayOfObject(data.options, unmarshalServerOption),
403
+ organizationId: data.organization_id,
404
+ os: data.os ? unmarshalOS(data.os) : void 0,
405
+ projectId: data.project_id,
406
+ qinq: data.qinq,
407
+ rebootedAt: unmarshalDate(data.rebooted_at),
408
+ rescueOs: data.rescue_os ? unmarshalOS(data.rescue_os) : void 0,
409
+ status: data.status,
410
+ tags: data.tags,
411
+ updatedAt: unmarshalDate(data.updated_at),
412
+ zone: data.zone
413
+ };
414
+ };
415
+ const unmarshalRpnV2GroupSubnet = (data) => {
416
+ if (!isJSONObject(data)) {
417
+ throw new TypeError(
418
+ `Unmarshalling the type 'RpnV2GroupSubnet' failed as data isn't a dictionary.`
419
+ );
420
+ }
421
+ return {
422
+ address: data.address,
423
+ cidr: data.cidr
424
+ };
425
+ };
426
+ const unmarshalRpnV2Group = (data) => {
427
+ if (!isJSONObject(data)) {
428
+ throw new TypeError(
429
+ `Unmarshalling the type 'RpnV2Group' failed as data isn't a dictionary.`
430
+ );
431
+ }
432
+ return {
433
+ compatibleRpnv1: data.compatible_rpnv1,
434
+ gateway: data.gateway,
435
+ id: data.id,
436
+ membersCount: data.members_count,
437
+ name: data.name,
438
+ organizationId: data.organization_id,
439
+ owner: data.owner,
440
+ projectId: data.project_id,
441
+ rpnv1Group: data.rpnv1_group ? unmarshalRpnGroup(data.rpnv1_group) : void 0,
442
+ status: data.status,
443
+ subnet: data.subnet ? unmarshalRpnV2GroupSubnet(data.subnet) : void 0,
444
+ type: data.type
445
+ };
446
+ };
447
+ const unmarshalService = (data) => {
448
+ if (!isJSONObject(data)) {
449
+ throw new TypeError(
450
+ `Unmarshalling the type 'Service' failed as data isn't a dictionary.`
451
+ );
452
+ }
453
+ return {
454
+ createdAt: unmarshalDate(data.created_at),
455
+ deliveredAt: unmarshalDate(data.delivered_at),
456
+ expiresAt: unmarshalDate(data.expires_at),
457
+ id: data.id,
458
+ offer: data.offer ? unmarshalOffer(data.offer) : void 0,
459
+ provisioningStatus: data.provisioning_status,
460
+ resourceId: data.resource_id,
461
+ terminatedAt: unmarshalDate(data.terminated_at),
462
+ type: data.type
463
+ };
464
+ };
465
+ const unmarshalFailoverBlock = (data) => {
466
+ if (!isJSONObject(data)) {
467
+ throw new TypeError(
468
+ `Unmarshalling the type 'FailoverBlock' failed as data isn't a dictionary.`
469
+ );
470
+ }
471
+ return {
472
+ address: data.address,
473
+ cidr: data.cidr,
474
+ gatewayIp: data.gateway_ip,
475
+ id: data.id,
476
+ ipVersion: data.ip_version,
477
+ nameservers: data.nameservers,
478
+ netmask: data.netmask
479
+ };
480
+ };
481
+ const unmarshalFailoverIP = (data) => {
482
+ if (!isJSONObject(data)) {
483
+ throw new TypeError(
484
+ `Unmarshalling the type 'FailoverIP' failed as data isn't a dictionary.`
485
+ );
486
+ }
487
+ return {
488
+ address: data.address,
489
+ block: data.block ? unmarshalFailoverBlock(data.block) : void 0,
490
+ cidr: data.cidr,
491
+ gatewayIp: data.gateway_ip,
492
+ id: data.id,
493
+ ipVersion: data.ip_version,
494
+ mac: data.mac,
495
+ netmask: data.netmask,
496
+ reverse: data.reverse,
497
+ serverId: data.server_id,
498
+ serverZone: data.server_zone,
499
+ status: data.status,
500
+ type: data.type
501
+ };
502
+ };
503
+ const unmarshalBMCAccess = (data) => {
504
+ if (!isJSONObject(data)) {
505
+ throw new TypeError(
506
+ `Unmarshalling the type 'BMCAccess' failed as data isn't a dictionary.`
507
+ );
508
+ }
509
+ return {
510
+ expiresAt: unmarshalDate(data.expires_at),
511
+ login: data.login,
512
+ password: data.password,
513
+ status: data.status,
514
+ url: data.url
515
+ };
516
+ };
517
+ const unmarshalBackup = (data) => {
518
+ if (!isJSONObject(data)) {
519
+ throw new TypeError(
520
+ `Unmarshalling the type 'Backup' failed as data isn't a dictionary.`
521
+ );
522
+ }
523
+ return {
524
+ aclEnabled: data.acl_enabled,
525
+ autologin: data.autologin,
526
+ id: data.id,
527
+ login: data.login,
528
+ quotaFiles: data.quota_files,
529
+ quotaFilesUsed: data.quota_files_used,
530
+ quotaSpace: data.quota_space,
531
+ quotaSpaceUsed: data.quota_space_used,
532
+ server: data.server,
533
+ status: data.status
534
+ };
535
+ };
536
+ const unmarshalCanOrderResponse = (data) => {
537
+ if (!isJSONObject(data)) {
538
+ throw new TypeError(
539
+ `Unmarshalling the type 'CanOrderResponse' failed as data isn't a dictionary.`
540
+ );
541
+ }
542
+ return {
543
+ billingOk: data.billing_ok,
544
+ canOrder: data.can_order,
545
+ emailConfirmed: data.email_confirmed,
546
+ message: data.message,
547
+ paymentMode: data.payment_mode,
548
+ phoneConfirmed: data.phone_confirmed,
549
+ quotaOk: data.quota_ok,
550
+ userConfirmed: data.user_confirmed
551
+ };
552
+ };
553
+ const unmarshalCreateFailoverIPsResponse = (data) => {
554
+ if (!isJSONObject(data)) {
555
+ throw new TypeError(
556
+ `Unmarshalling the type 'CreateFailoverIPsResponse' failed as data isn't a dictionary.`
557
+ );
558
+ }
559
+ return {
560
+ services: unmarshalArrayOfObject(data.services, unmarshalService),
561
+ totalCount: data.total_count
562
+ };
563
+ };
564
+ const unmarshalGetIPv6BlockQuotasResponseQuota = (data) => {
565
+ if (!isJSONObject(data)) {
566
+ throw new TypeError(
567
+ `Unmarshalling the type 'GetIPv6BlockQuotasResponseQuota' failed as data isn't a dictionary.`
568
+ );
569
+ }
570
+ return {
571
+ cidr: data.cidr,
572
+ quota: data.quota
573
+ };
574
+ };
575
+ const unmarshalGetIPv6BlockQuotasResponse = (data) => {
576
+ if (!isJSONObject(data)) {
577
+ throw new TypeError(
578
+ `Unmarshalling the type 'GetIPv6BlockQuotasResponse' failed as data isn't a dictionary.`
579
+ );
580
+ }
581
+ return {
582
+ quotas: unmarshalArrayOfObject(
583
+ data.quotas,
584
+ unmarshalGetIPv6BlockQuotasResponseQuota
585
+ ),
586
+ totalCount: data.total_count
587
+ };
588
+ };
589
+ const unmarshalGetRemainingQuotaResponse = (data) => {
590
+ if (!isJSONObject(data)) {
591
+ throw new TypeError(
592
+ `Unmarshalling the type 'GetRemainingQuotaResponse' failed as data isn't a dictionary.`
593
+ );
594
+ }
595
+ return {
596
+ failoverBlockQuota: data.failover_block_quota,
597
+ failoverBlockRemainingQuota: data.failover_block_remaining_quota,
598
+ failoverIpQuota: data.failover_ip_quota,
599
+ failoverIpRemainingQuota: data.failover_ip_remaining_quota
600
+ };
601
+ };
602
+ const unmarshalGetRpnStatusResponse = (data) => {
603
+ if (!isJSONObject(data)) {
604
+ throw new TypeError(
605
+ `Unmarshalling the type 'GetRpnStatusResponse' failed as data isn't a dictionary.`
606
+ );
607
+ }
608
+ return {
609
+ operationsLeft: data.operations_left,
610
+ status: data.status
611
+ };
612
+ };
613
+ const unmarshalIPv6Block = (data) => {
614
+ if (!isJSONObject(data)) {
615
+ throw new TypeError(
616
+ `Unmarshalling the type 'IPv6Block' failed as data isn't a dictionary.`
617
+ );
618
+ }
619
+ return {
620
+ address: data.address,
621
+ cidr: data.cidr,
622
+ delegationStatus: data.delegation_status,
623
+ duid: data.duid,
624
+ id: data.id,
625
+ nameservers: data.nameservers,
626
+ subnets: unmarshalArrayOfObject(data.subnets, unmarshalIPv6Block)
627
+ };
628
+ };
629
+ const unmarshalInvoice = (data) => {
630
+ if (!isJSONObject(data)) {
631
+ throw new TypeError(
632
+ `Unmarshalling the type 'Invoice' failed as data isn't a dictionary.`
633
+ );
634
+ }
635
+ return {
636
+ content: data.content,
637
+ createdAt: unmarshalDate(data.created_at),
638
+ id: data.id,
639
+ paidAt: unmarshalDate(data.paid_at),
640
+ paymentMethod: data.payment_method,
641
+ status: data.status,
642
+ totalWithTaxes: data.total_with_taxes ? unmarshalMoney(data.total_with_taxes) : void 0,
643
+ totalWithoutTaxes: data.total_without_taxes ? unmarshalMoney(data.total_without_taxes) : void 0,
644
+ transactionId: data.transaction_id
645
+ };
646
+ };
647
+ const unmarshalListFailoverIPsResponse = (data) => {
648
+ if (!isJSONObject(data)) {
649
+ throw new TypeError(
650
+ `Unmarshalling the type 'ListFailoverIPsResponse' failed as data isn't a dictionary.`
651
+ );
652
+ }
653
+ return {
654
+ failoverIps: unmarshalArrayOfObject(data.failover_ips, unmarshalFailoverIP),
655
+ totalCount: data.total_count
656
+ };
657
+ };
658
+ const unmarshalListIPv6BlockSubnetsAvailableResponseSubnet = (data) => {
659
+ if (!isJSONObject(data)) {
660
+ throw new TypeError(
661
+ `Unmarshalling the type 'ListIPv6BlockSubnetsAvailableResponseSubnet' failed as data isn't a dictionary.`
662
+ );
663
+ }
664
+ return {
665
+ address: data.address,
666
+ cidr: data.cidr
667
+ };
668
+ };
669
+ const unmarshalListIPv6BlockSubnetsAvailableResponse = (data) => {
670
+ if (!isJSONObject(data)) {
671
+ throw new TypeError(
672
+ `Unmarshalling the type 'ListIPv6BlockSubnetsAvailableResponse' failed as data isn't a dictionary.`
673
+ );
674
+ }
675
+ return {
676
+ subnetAvailables: unmarshalArrayOfObject(
677
+ data.subnet_availables,
678
+ unmarshalListIPv6BlockSubnetsAvailableResponseSubnet
679
+ ),
680
+ totalCount: data.total_count
681
+ };
682
+ };
683
+ const unmarshalInvoiceSummary = (data) => {
684
+ if (!isJSONObject(data)) {
685
+ throw new TypeError(
686
+ `Unmarshalling the type 'InvoiceSummary' failed as data isn't a dictionary.`
687
+ );
688
+ }
689
+ return {
690
+ createdAt: unmarshalDate(data.created_at),
691
+ id: data.id,
692
+ paidAt: unmarshalDate(data.paid_at),
693
+ paymentMethod: data.payment_method,
694
+ status: data.status,
695
+ totalWithTaxes: data.total_with_taxes ? unmarshalMoney(data.total_with_taxes) : void 0,
696
+ totalWithoutTaxes: data.total_without_taxes ? unmarshalMoney(data.total_without_taxes) : void 0,
697
+ transactionId: data.transaction_id
698
+ };
699
+ };
700
+ const unmarshalListInvoicesResponse = (data) => {
701
+ if (!isJSONObject(data)) {
702
+ throw new TypeError(
703
+ `Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.`
704
+ );
705
+ }
706
+ return {
707
+ invoices: unmarshalArrayOfObject(data.invoices, unmarshalInvoiceSummary),
708
+ totalCount: data.total_count
709
+ };
710
+ };
711
+ const unmarshalRpnSanIpRpnV2Group = (data) => {
712
+ if (!isJSONObject(data)) {
713
+ throw new TypeError(
714
+ `Unmarshalling the type 'RpnSanIpRpnV2Group' failed as data isn't a dictionary.`
715
+ );
716
+ }
717
+ return {
718
+ id: data.id,
719
+ name: data.name
720
+ };
721
+ };
722
+ const unmarshalRpnSanIpServer = (data) => {
723
+ if (!isJSONObject(data)) {
724
+ throw new TypeError(
725
+ `Unmarshalling the type 'RpnSanIpServer' failed as data isn't a dictionary.`
726
+ );
727
+ }
728
+ return {
729
+ datacenterName: data.datacenter_name,
730
+ hostname: data.hostname,
731
+ id: data.id
732
+ };
733
+ };
734
+ const unmarshalRpnSanIp = (data) => {
735
+ if (!isJSONObject(data)) {
736
+ throw new TypeError(
737
+ `Unmarshalling the type 'RpnSanIp' failed as data isn't a dictionary.`
738
+ );
739
+ }
740
+ return {
741
+ ip: data.ip ? unmarshalIP(data.ip) : void 0,
742
+ rpnv2Group: data.rpnv2_group ? unmarshalRpnSanIpRpnV2Group(data.rpnv2_group) : void 0,
743
+ server: data.server ? unmarshalRpnSanIpServer(data.server) : void 0,
744
+ type: data.type
745
+ };
746
+ };
747
+ const unmarshalListIpsResponse = (data) => {
748
+ if (!isJSONObject(data)) {
749
+ throw new TypeError(
750
+ `Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.`
751
+ );
752
+ }
753
+ return {
754
+ ips: unmarshalArrayOfObject(data.ips, unmarshalRpnSanIp),
755
+ totalCount: data.total_count
756
+ };
757
+ };
758
+ const unmarshalListOSResponse = (data) => {
759
+ if (!isJSONObject(data)) {
760
+ throw new TypeError(
761
+ `Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`
762
+ );
763
+ }
764
+ return {
765
+ os: unmarshalArrayOfObject(data.os, unmarshalOS),
766
+ totalCount: data.total_count
767
+ };
768
+ };
769
+ const unmarshalListOffersResponse = (data) => {
770
+ if (!isJSONObject(data)) {
771
+ throw new TypeError(
772
+ `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`
773
+ );
774
+ }
775
+ return {
776
+ offers: unmarshalArrayOfObject(data.offers, unmarshalOffer),
777
+ totalCount: data.total_count
778
+ };
779
+ };
780
+ const unmarshalRefundSummary = (data) => {
781
+ if (!isJSONObject(data)) {
782
+ throw new TypeError(
783
+ `Unmarshalling the type 'RefundSummary' failed as data isn't a dictionary.`
784
+ );
785
+ }
786
+ return {
787
+ createdAt: unmarshalDate(data.created_at),
788
+ id: data.id,
789
+ method: data.method,
790
+ refundedAt: unmarshalDate(data.refunded_at),
791
+ status: data.status,
792
+ totalWithTaxes: data.total_with_taxes ? unmarshalMoney(data.total_with_taxes) : void 0,
793
+ totalWithoutTaxes: data.total_without_taxes ? unmarshalMoney(data.total_without_taxes) : void 0
794
+ };
795
+ };
796
+ const unmarshalListRefundsResponse = (data) => {
797
+ if (!isJSONObject(data)) {
798
+ throw new TypeError(
799
+ `Unmarshalling the type 'ListRefundsResponse' failed as data isn't a dictionary.`
800
+ );
801
+ }
802
+ return {
803
+ refunds: unmarshalArrayOfObject(data.refunds, unmarshalRefundSummary),
804
+ totalCount: data.total_count
805
+ };
806
+ };
807
+ const unmarshalRpnSanServer = (data) => {
808
+ if (!isJSONObject(data)) {
809
+ throw new TypeError(
810
+ `Unmarshalling the type 'RpnSanServer' failed as data isn't a dictionary.`
811
+ );
812
+ }
813
+ return {
814
+ datacenterName: data.datacenter_name,
815
+ hostname: data.hostname,
816
+ id: data.id,
817
+ sans: unmarshalArrayOfObject(data.sans, unmarshalRpnSan),
818
+ zone: data.zone
819
+ };
820
+ };
821
+ const unmarshalListRpnCapableSanServersResponse = (data) => {
822
+ if (!isJSONObject(data)) {
823
+ throw new TypeError(
824
+ `Unmarshalling the type 'ListRpnCapableSanServersResponse' failed as data isn't a dictionary.`
825
+ );
826
+ }
827
+ return {
828
+ sanServers: unmarshalArrayOfObject(data.san_servers, unmarshalRpnSanServer),
829
+ totalCount: data.total_count
830
+ };
831
+ };
832
+ const unmarshalListRpnCapableServersResponse = (data) => {
833
+ if (!isJSONObject(data)) {
834
+ throw new TypeError(
835
+ `Unmarshalling the type 'ListRpnCapableServersResponse' failed as data isn't a dictionary.`
836
+ );
837
+ }
838
+ return {
839
+ servers: unmarshalArrayOfObject(data.servers, unmarshalServer),
840
+ totalCount: data.total_count
841
+ };
842
+ };
843
+ const unmarshalRpnGroupMember = (data) => {
844
+ if (!isJSONObject(data)) {
845
+ throw new TypeError(
846
+ `Unmarshalling the type 'RpnGroupMember' failed as data isn't a dictionary.`
847
+ );
848
+ }
849
+ return {
850
+ groupId: data.group_id,
851
+ groupName: data.group_name,
852
+ groupOwner: data.group_owner,
853
+ id: data.id,
854
+ owner: data.owner,
855
+ sanServer: data.san_server ? unmarshalRpnSanServer(data.san_server) : void 0,
856
+ server: data.server ? unmarshalServer(data.server) : void 0,
857
+ speed: data.speed,
858
+ status: data.status
859
+ };
860
+ };
861
+ const unmarshalListRpnGroupMembersResponse = (data) => {
862
+ if (!isJSONObject(data)) {
863
+ throw new TypeError(
864
+ `Unmarshalling the type 'ListRpnGroupMembersResponse' failed as data isn't a dictionary.`
865
+ );
866
+ }
867
+ return {
868
+ members: unmarshalArrayOfObject(data.members, unmarshalRpnGroupMember),
869
+ totalCount: data.total_count
870
+ };
871
+ };
872
+ const unmarshalListRpnGroupsResponse = (data) => {
873
+ if (!isJSONObject(data)) {
874
+ throw new TypeError(
875
+ `Unmarshalling the type 'ListRpnGroupsResponse' failed as data isn't a dictionary.`
876
+ );
877
+ }
878
+ return {
879
+ rpnGroups: unmarshalArrayOfObject(data.rpn_groups, unmarshalRpnGroup),
880
+ totalCount: data.total_count
881
+ };
882
+ };
883
+ const unmarshalListRpnInvitesResponse = (data) => {
884
+ if (!isJSONObject(data)) {
885
+ throw new TypeError(
886
+ `Unmarshalling the type 'ListRpnInvitesResponse' failed as data isn't a dictionary.`
887
+ );
888
+ }
889
+ return {
890
+ members: unmarshalArrayOfObject(data.members, unmarshalRpnGroupMember),
891
+ totalCount: data.total_count
892
+ };
893
+ };
894
+ const unmarshalRpnSanSummary = (data) => {
895
+ if (!isJSONObject(data)) {
896
+ throw new TypeError(
897
+ `Unmarshalling the type 'RpnSanSummary' failed as data isn't a dictionary.`
898
+ );
899
+ }
900
+ return {
901
+ createdAt: unmarshalDate(data.created_at),
902
+ datacenterName: data.datacenter_name,
903
+ deliveredAt: unmarshalDate(data.delivered_at),
904
+ expiresAt: unmarshalDate(data.expires_at),
905
+ id: data.id,
906
+ iqnSuffix: data.iqn_suffix,
907
+ offerId: data.offer_id,
908
+ offerName: data.offer_name,
909
+ organizationId: data.organization_id,
910
+ projectId: data.project_id,
911
+ rpnv1Compatible: data.rpnv1_compatible,
912
+ rpnv1Implicit: data.rpnv1_implicit,
913
+ serverHostname: data.server_hostname,
914
+ status: data.status,
915
+ storageSize: data.storage_size,
916
+ terminatedAt: unmarshalDate(data.terminated_at)
917
+ };
918
+ };
919
+ const unmarshalListRpnSansResponse = (data) => {
920
+ if (!isJSONObject(data)) {
921
+ throw new TypeError(
922
+ `Unmarshalling the type 'ListRpnSansResponse' failed as data isn't a dictionary.`
923
+ );
924
+ }
925
+ return {
926
+ rpnSans: unmarshalArrayOfObject(data.rpn_sans, unmarshalRpnSanSummary),
927
+ totalCount: data.total_count
928
+ };
929
+ };
930
+ const unmarshalRpnServerCapability = (data) => {
931
+ if (!isJSONObject(data)) {
932
+ throw new TypeError(
933
+ `Unmarshalling the type 'RpnServerCapability' failed as data isn't a dictionary.`
934
+ );
935
+ }
936
+ return {
937
+ canJoinQinqGroup: data.can_join_qinq_group,
938
+ canJoinRpnv2Group: data.can_join_rpnv2_group,
939
+ compatibleQinq: data.compatible_qinq,
940
+ datacenterName: data.datacenter_name,
941
+ hostname: data.hostname,
942
+ id: data.id,
943
+ ipAddress: data.ip_address,
944
+ rpnVersion: data.rpn_version,
945
+ rpnv1GroupCount: data.rpnv1_group_count,
946
+ rpnv2GroupCount: data.rpnv2_group_count,
947
+ zone: data.zone
948
+ };
949
+ };
950
+ const unmarshalListRpnServerCapabilitiesResponse = (data) => {
951
+ if (!isJSONObject(data)) {
952
+ throw new TypeError(
953
+ `Unmarshalling the type 'ListRpnServerCapabilitiesResponse' failed as data isn't a dictionary.`
954
+ );
955
+ }
956
+ return {
957
+ servers: unmarshalArrayOfObject(data.servers, unmarshalRpnServerCapability),
958
+ totalCount: data.total_count
959
+ };
960
+ };
961
+ const unmarshalListRpnV2CapableResourcesResponse = (data) => {
962
+ if (!isJSONObject(data)) {
963
+ throw new TypeError(
964
+ `Unmarshalling the type 'ListRpnV2CapableResourcesResponse' failed as data isn't a dictionary.`
965
+ );
966
+ }
967
+ return {
968
+ servers: unmarshalArrayOfObject(data.servers, unmarshalServer),
969
+ totalCount: data.total_count
970
+ };
971
+ };
972
+ const unmarshalRpnV2Member = (data) => {
973
+ if (!isJSONObject(data)) {
974
+ throw new TypeError(
975
+ `Unmarshalling the type 'RpnV2Member' failed as data isn't a dictionary.`
976
+ );
977
+ }
978
+ return {
979
+ id: data.id,
980
+ rpnv1Group: data.rpnv1_group ? unmarshalRpnGroup(data.rpnv1_group) : void 0,
981
+ server: data.server ? unmarshalServer(data.server) : void 0,
982
+ speed: data.speed,
983
+ status: data.status,
984
+ vlan: data.vlan
985
+ };
986
+ };
987
+ const unmarshalLog = (data) => {
988
+ if (!isJSONObject(data)) {
989
+ throw new TypeError(
990
+ `Unmarshalling the type 'Log' failed as data isn't a dictionary.`
991
+ );
992
+ }
993
+ return {
994
+ action: data.action,
995
+ createdAt: unmarshalDate(data.created_at),
996
+ finishedAt: unmarshalDate(data.finished_at),
997
+ group: data.group ? unmarshalRpnV2Group(data.group) : void 0,
998
+ id: data.id,
999
+ member: data.member ? unmarshalRpnV2Member(data.member) : void 0,
1000
+ status: data.status
1001
+ };
1002
+ };
1003
+ const unmarshalListRpnV2GroupLogsResponse = (data) => {
1004
+ if (!isJSONObject(data)) {
1005
+ throw new TypeError(
1006
+ `Unmarshalling the type 'ListRpnV2GroupLogsResponse' failed as data isn't a dictionary.`
1007
+ );
1008
+ }
1009
+ return {
1010
+ logs: unmarshalArrayOfObject(data.logs, unmarshalLog),
1011
+ totalCount: data.total_count
1012
+ };
1013
+ };
1014
+ const unmarshalListRpnV2GroupsResponse = (data) => {
1015
+ if (!isJSONObject(data)) {
1016
+ throw new TypeError(
1017
+ `Unmarshalling the type 'ListRpnV2GroupsResponse' failed as data isn't a dictionary.`
1018
+ );
1019
+ }
1020
+ return {
1021
+ rpnGroups: unmarshalArrayOfObject(data.rpn_groups, unmarshalRpnV2Group),
1022
+ totalCount: data.total_count
1023
+ };
1024
+ };
1025
+ const unmarshalListRpnV2MembersResponse = (data) => {
1026
+ if (!isJSONObject(data)) {
1027
+ throw new TypeError(
1028
+ `Unmarshalling the type 'ListRpnV2MembersResponse' failed as data isn't a dictionary.`
1029
+ );
1030
+ }
1031
+ return {
1032
+ members: unmarshalArrayOfObject(data.members, unmarshalRpnV2Member),
1033
+ totalCount: data.total_count
1034
+ };
1035
+ };
1036
+ const unmarshalServerDisk = (data) => {
1037
+ if (!isJSONObject(data)) {
1038
+ throw new TypeError(
1039
+ `Unmarshalling the type 'ServerDisk' failed as data isn't a dictionary.`
1040
+ );
1041
+ }
1042
+ return {
1043
+ capacity: data.capacity,
1044
+ connector: data.connector,
1045
+ id: data.id,
1046
+ isAddon: data.is_addon,
1047
+ type: data.type
1048
+ };
1049
+ };
1050
+ const unmarshalListServerDisksResponse = (data) => {
1051
+ if (!isJSONObject(data)) {
1052
+ throw new TypeError(
1053
+ `Unmarshalling the type 'ListServerDisksResponse' failed as data isn't a dictionary.`
1054
+ );
1055
+ }
1056
+ return {
1057
+ disks: unmarshalArrayOfObject(data.disks, unmarshalServerDisk),
1058
+ totalCount: data.total_count
1059
+ };
1060
+ };
1061
+ const unmarshalServerEvent = (data) => {
1062
+ if (!isJSONObject(data)) {
1063
+ throw new TypeError(
1064
+ `Unmarshalling the type 'ServerEvent' failed as data isn't a dictionary.`
1065
+ );
1066
+ }
1067
+ return {
1068
+ date: unmarshalDate(data.date),
1069
+ description: data.description,
1070
+ eventId: data.event_id
1071
+ };
1072
+ };
1073
+ const unmarshalListServerEventsResponse = (data) => {
1074
+ if (!isJSONObject(data)) {
1075
+ throw new TypeError(
1076
+ `Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.`
1077
+ );
1078
+ }
1079
+ return {
1080
+ events: unmarshalArrayOfObject(data.events, unmarshalServerEvent),
1081
+ totalCount: data.total_count
1082
+ };
1083
+ };
1084
+ const unmarshalServerSummary = (data) => {
1085
+ if (!isJSONObject(data)) {
1086
+ throw new TypeError(
1087
+ `Unmarshalling the type 'ServerSummary' failed as data isn't a dictionary.`
1088
+ );
1089
+ }
1090
+ return {
1091
+ createdAt: unmarshalDate(data.created_at),
1092
+ datacenterName: data.datacenter_name,
1093
+ expiredAt: unmarshalDate(data.expired_at),
1094
+ hostname: data.hostname,
1095
+ id: data.id,
1096
+ interfaces: unmarshalArrayOfObject(
1097
+ data.interfaces,
1098
+ unmarshalNetworkInterface
1099
+ ),
1100
+ isOutsourced: data.is_outsourced,
1101
+ level: data.level ? unmarshalServiceLevel(data.level) : void 0,
1102
+ offerId: data.offer_id,
1103
+ offerName: data.offer_name,
1104
+ organizationId: data.organization_id,
1105
+ osId: data.os_id,
1106
+ projectId: data.project_id,
1107
+ qinq: data.qinq,
1108
+ rpnVersion: data.rpn_version,
1109
+ status: data.status,
1110
+ updatedAt: unmarshalDate(data.updated_at),
1111
+ zone: data.zone
1112
+ };
1113
+ };
1114
+ const unmarshalListServersResponse = (data) => {
1115
+ if (!isJSONObject(data)) {
1116
+ throw new TypeError(
1117
+ `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`
1118
+ );
1119
+ }
1120
+ return {
1121
+ servers: unmarshalArrayOfObject(data.servers, unmarshalServerSummary),
1122
+ totalCount: data.total_count
1123
+ };
1124
+ };
1125
+ const unmarshalListServicesResponse = (data) => {
1126
+ if (!isJSONObject(data)) {
1127
+ throw new TypeError(
1128
+ `Unmarshalling the type 'ListServicesResponse' failed as data isn't a dictionary.`
1129
+ );
1130
+ }
1131
+ return {
1132
+ services: unmarshalArrayOfObject(data.services, unmarshalService),
1133
+ totalCount: data.total_count
1134
+ };
1135
+ };
1136
+ const unmarshalListSubscribableServerOptionsResponse = (data) => {
1137
+ if (!isJSONObject(data)) {
1138
+ throw new TypeError(
1139
+ `Unmarshalling the type 'ListSubscribableServerOptionsResponse' failed as data isn't a dictionary.`
1140
+ );
1141
+ }
1142
+ return {
1143
+ serverOptions: unmarshalArrayOfObject(data.server_options, unmarshalOffer),
1144
+ totalCount: data.total_count
1145
+ };
1146
+ };
1147
+ const unmarshalRaidArray = (data) => {
1148
+ if (!isJSONObject(data)) {
1149
+ throw new TypeError(
1150
+ `Unmarshalling the type 'RaidArray' failed as data isn't a dictionary.`
1151
+ );
1152
+ }
1153
+ return {
1154
+ disks: unmarshalArrayOfObject(data.disks, unmarshalServerDisk),
1155
+ raidLevel: data.raid_level
1156
+ };
1157
+ };
1158
+ const unmarshalRaid = (data) => {
1159
+ if (!isJSONObject(data)) {
1160
+ throw new TypeError(
1161
+ `Unmarshalling the type 'Raid' failed as data isn't a dictionary.`
1162
+ );
1163
+ }
1164
+ return {
1165
+ raidArrays: unmarshalArrayOfObject(data.raid_arrays, unmarshalRaidArray)
1166
+ };
1167
+ };
1168
+ const unmarshalRefund = (data) => {
1169
+ if (!isJSONObject(data)) {
1170
+ throw new TypeError(
1171
+ `Unmarshalling the type 'Refund' failed as data isn't a dictionary.`
1172
+ );
1173
+ }
1174
+ return {
1175
+ content: data.content,
1176
+ createdAt: unmarshalDate(data.created_at),
1177
+ id: data.id,
1178
+ method: data.method,
1179
+ refundedAt: unmarshalDate(data.refunded_at),
1180
+ status: data.status,
1181
+ totalWithTaxes: data.total_with_taxes ? unmarshalMoney(data.total_with_taxes) : void 0,
1182
+ totalWithoutTaxes: data.total_without_taxes ? unmarshalMoney(data.total_without_taxes) : void 0
1183
+ };
1184
+ };
1185
+ const unmarshalRescue = (data) => {
1186
+ if (!isJSONObject(data)) {
1187
+ throw new TypeError(
1188
+ `Unmarshalling the type 'Rescue' failed as data isn't a dictionary.`
1189
+ );
1190
+ }
1191
+ return {
1192
+ login: data.login,
1193
+ osId: data.os_id,
1194
+ password: data.password,
1195
+ protocol: data.protocol
1196
+ };
1197
+ };
1198
+ const unmarshalPartition = (data) => {
1199
+ if (!isJSONObject(data)) {
1200
+ throw new TypeError(
1201
+ `Unmarshalling the type 'Partition' failed as data isn't a dictionary.`
1202
+ );
1203
+ }
1204
+ return {
1205
+ capacity: data.capacity,
1206
+ connectors: data.connectors,
1207
+ fileSystem: data.file_system,
1208
+ mountPoint: data.mount_point,
1209
+ raidLevel: data.raid_level,
1210
+ type: data.type
1211
+ };
1212
+ };
1213
+ const unmarshalServerDefaultPartitioning = (data) => {
1214
+ if (!isJSONObject(data)) {
1215
+ throw new TypeError(
1216
+ `Unmarshalling the type 'ServerDefaultPartitioning' failed as data isn't a dictionary.`
1217
+ );
1218
+ }
1219
+ return {
1220
+ partitions: unmarshalArrayOfObject(data.partitions, unmarshalPartition)
1221
+ };
1222
+ };
1223
+ const unmarshalServerInstall = (data) => {
1224
+ if (!isJSONObject(data)) {
1225
+ throw new TypeError(
1226
+ `Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`
1227
+ );
1228
+ }
1229
+ return {
1230
+ hostname: data.hostname,
1231
+ osId: data.os_id,
1232
+ panelUrl: data.panel_url,
1233
+ partitions: unmarshalArrayOfObject(data.partitions, unmarshalPartition),
1234
+ sshKeyIds: data.ssh_key_ids,
1235
+ status: data.status,
1236
+ userLogin: data.user_login
1237
+ };
1238
+ };
1239
+ const unmarshalSubscribeStorageOptionsResponse = (data) => {
1240
+ if (!isJSONObject(data)) {
1241
+ throw new TypeError(
1242
+ `Unmarshalling the type 'SubscribeStorageOptionsResponse' failed as data isn't a dictionary.`
1243
+ );
1244
+ }
1245
+ return {
1246
+ services: unmarshalArrayOfObject(data.services, unmarshalService)
1247
+ };
1248
+ };
1249
+ const marshalAttachFailoverIPToMacAddressRequest = (request, defaults) => ({
1250
+ mac: request.mac,
1251
+ type: request.type
1252
+ });
1253
+ const marshalAttachFailoverIPsRequest = (request, defaults) => ({
1254
+ fips_ids: request.fipsIds,
1255
+ server_id: request.serverId
1256
+ });
1257
+ const marshalCreateFailoverIPsRequest = (request, defaults) => ({
1258
+ offer_id: request.offerId,
1259
+ project_id: request.projectId ?? defaults.defaultProjectId,
1260
+ quantity: request.quantity
1261
+ });
1262
+ const marshalCreateServerRequest = (request, defaults) => ({
1263
+ datacenter_name: request.datacenterName,
1264
+ offer_id: request.offerId,
1265
+ project_id: request.projectId ?? defaults.defaultProjectId,
1266
+ server_option_ids: request.serverOptionIds
1267
+ });
1268
+ const marshalDetachFailoverIPsRequest = (request, defaults) => ({
1269
+ fips_ids: request.fipsIds
1270
+ });
1271
+ const marshalIPv6BlockApiCreateIPv6BlockRequest = (request, defaults) => ({
1272
+ project_id: request.projectId ?? defaults.defaultProjectId
1273
+ });
1274
+ const marshalIPv6BlockApiCreateIPv6BlockSubnetRequest = (request, defaults) => ({
1275
+ address: request.address,
1276
+ cidr: request.cidr
1277
+ });
1278
+ const marshalIPv6BlockApiUpdateIPv6BlockRequest = (request, defaults) => ({
1279
+ nameservers: request.nameservers
1280
+ });
1281
+ const marshalInstallPartition = (request, defaults) => ({
1282
+ capacity: request.capacity,
1283
+ connectors: request.connectors,
1284
+ file_system: request.fileSystem,
1285
+ mount_point: request.mountPoint,
1286
+ raid_level: request.raidLevel
1287
+ });
1288
+ const marshalInstallServerRequest = (request, defaults) => ({
1289
+ hostname: request.hostname,
1290
+ ip_id: request.ipId,
1291
+ license_offer_id: request.licenseOfferId,
1292
+ os_id: request.osId,
1293
+ panel_password: request.panelPassword,
1294
+ partitions: request.partitions !== void 0 ? request.partitions.map((elt) => marshalInstallPartition(elt)) : void 0,
1295
+ root_password: request.rootPassword,
1296
+ ssh_key_ids: request.sshKeyIds,
1297
+ user_login: request.userLogin,
1298
+ user_password: request.userPassword
1299
+ });
1300
+ const marshalRpnSanApiAddIpRequest = (request, defaults) => ({
1301
+ ip_ids: request.ipIds
1302
+ });
1303
+ const marshalRpnSanApiCreateRpnSanRequest = (request, defaults) => ({
1304
+ offer_id: request.offerId,
1305
+ project_id: request.projectId ?? defaults.defaultProjectId
1306
+ });
1307
+ const marshalRpnSanApiRemoveIpRequest = (request, defaults) => ({
1308
+ ip_ids: request.ipIds
1309
+ });
1310
+ const marshalRpnV1ApiAddRpnGroupMembersRequest = (request, defaults) => ({
1311
+ san_server_ids: request.sanServerIds,
1312
+ server_ids: request.serverIds
1313
+ });
1314
+ const marshalRpnV1ApiCreateRpnGroupRequest = (request, defaults) => ({
1315
+ name: request.name,
1316
+ project_id: request.projectId ?? defaults.defaultProjectId,
1317
+ san_server_ids: request.sanServerIds,
1318
+ server_ids: request.serverIds
1319
+ });
1320
+ const marshalRpnV1ApiDeleteRpnGroupMembersRequest = (request, defaults) => ({
1321
+ member_ids: request.memberIds
1322
+ });
1323
+ const marshalRpnV1ApiLeaveRpnGroupRequest = (request, defaults) => ({
1324
+ member_ids: request.memberIds,
1325
+ project_id: request.projectId ?? defaults.defaultProjectId
1326
+ });
1327
+ const marshalRpnV1ApiRpnGroupInviteRequest = (request, defaults) => ({
1328
+ project_id: request.projectId ?? defaults.defaultProjectId,
1329
+ server_ids: request.serverIds
1330
+ });
1331
+ const marshalRpnV1ApiUpdateRpnGroupNameRequest = (request, defaults) => ({
1332
+ name: request.name
1333
+ });
1334
+ const marshalRpnV2ApiAddRpnV2MembersRequest = (request, defaults) => ({
1335
+ servers: request.servers
1336
+ });
1337
+ const marshalRpnV2ApiCreateRpnV2GroupRequest = (request, defaults) => ({
1338
+ name: request.name,
1339
+ project_id: request.projectId ?? defaults.defaultProjectId,
1340
+ servers: request.servers,
1341
+ type: request.type
1342
+ });
1343
+ const marshalRpnV2ApiDeleteRpnV2MembersRequest = (request, defaults) => ({
1344
+ member_ids: request.memberIds
1345
+ });
1346
+ const marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest = (request, defaults) => ({
1347
+ rpnv1_group_id: request.rpnv1GroupId
1348
+ });
1349
+ const marshalRpnV2ApiUpdateRpnV2GroupNameRequest = (request, defaults) => ({
1350
+ name: request.name
1351
+ });
1352
+ const marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest = (request, defaults) => ({
1353
+ member_ids: request.memberIds,
1354
+ vlan: request.vlan
1355
+ });
1356
+ const marshalStartBMCAccessRequest = (request, defaults) => ({
1357
+ ip: request.ip
1358
+ });
1359
+ const marshalStartRescueRequest = (request, defaults) => ({
1360
+ os_id: request.osId
1361
+ });
1362
+ const marshalSubscribeServerOptionRequest = (request, defaults) => ({
1363
+ option_id: request.optionId
1364
+ });
1365
+ const marshalSubscribeStorageOptionsRequest = (request, defaults) => ({
1366
+ options_ids: request.optionsIds
1367
+ });
1368
+ const marshalUpdatableRaidArray = (request, defaults) => ({
1369
+ disk_ids: request.diskIds,
1370
+ raid_level: request.raidLevel
1371
+ });
1372
+ const marshalUpdateRaidRequest = (request, defaults) => ({
1373
+ raid_arrays: request.raidArrays.map(
1374
+ (elt) => marshalUpdatableRaidArray(elt)
1375
+ )
1376
+ });
1377
+ const marshalUpdateReverseRequest = (request, defaults) => ({
1378
+ reverse: request.reverse
1379
+ });
1380
+ const marshalUpdateServerBackupRequest = (request, defaults) => ({
1381
+ acl_enabled: request.aclEnabled,
1382
+ autologin: request.autologin,
1383
+ password: request.password
1384
+ });
1385
+ const marshalUpdateServerRequest = (request, defaults) => ({
1386
+ enable_ipv6: request.enableIpv6,
1387
+ hostname: request.hostname
1388
+ });
1389
+ const marshalUpdateServerTagsRequest = (request, defaults) => ({
1390
+ tags: request.tags
1391
+ });
1392
+ export {
1393
+ marshalAttachFailoverIPToMacAddressRequest,
1394
+ marshalAttachFailoverIPsRequest,
1395
+ marshalCreateFailoverIPsRequest,
1396
+ marshalCreateServerRequest,
1397
+ marshalDetachFailoverIPsRequest,
1398
+ marshalIPv6BlockApiCreateIPv6BlockRequest,
1399
+ marshalIPv6BlockApiCreateIPv6BlockSubnetRequest,
1400
+ marshalIPv6BlockApiUpdateIPv6BlockRequest,
1401
+ marshalInstallServerRequest,
1402
+ marshalRpnSanApiAddIpRequest,
1403
+ marshalRpnSanApiCreateRpnSanRequest,
1404
+ marshalRpnSanApiRemoveIpRequest,
1405
+ marshalRpnV1ApiAddRpnGroupMembersRequest,
1406
+ marshalRpnV1ApiCreateRpnGroupRequest,
1407
+ marshalRpnV1ApiDeleteRpnGroupMembersRequest,
1408
+ marshalRpnV1ApiLeaveRpnGroupRequest,
1409
+ marshalRpnV1ApiRpnGroupInviteRequest,
1410
+ marshalRpnV1ApiUpdateRpnGroupNameRequest,
1411
+ marshalRpnV2ApiAddRpnV2MembersRequest,
1412
+ marshalRpnV2ApiCreateRpnV2GroupRequest,
1413
+ marshalRpnV2ApiDeleteRpnV2MembersRequest,
1414
+ marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest,
1415
+ marshalRpnV2ApiUpdateRpnV2GroupNameRequest,
1416
+ marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest,
1417
+ marshalStartBMCAccessRequest,
1418
+ marshalStartRescueRequest,
1419
+ marshalSubscribeServerOptionRequest,
1420
+ marshalSubscribeStorageOptionsRequest,
1421
+ marshalUpdateRaidRequest,
1422
+ marshalUpdateReverseRequest,
1423
+ marshalUpdateServerBackupRequest,
1424
+ marshalUpdateServerRequest,
1425
+ marshalUpdateServerTagsRequest,
1426
+ unmarshalBMCAccess,
1427
+ unmarshalBackup,
1428
+ unmarshalCanOrderResponse,
1429
+ unmarshalCreateFailoverIPsResponse,
1430
+ unmarshalFailoverIP,
1431
+ unmarshalGetIPv6BlockQuotasResponse,
1432
+ unmarshalGetRemainingQuotaResponse,
1433
+ unmarshalGetRpnStatusResponse,
1434
+ unmarshalIP,
1435
+ unmarshalIPv6Block,
1436
+ unmarshalInvoice,
1437
+ unmarshalListFailoverIPsResponse,
1438
+ unmarshalListIPv6BlockSubnetsAvailableResponse,
1439
+ unmarshalListInvoicesResponse,
1440
+ unmarshalListIpsResponse,
1441
+ unmarshalListOSResponse,
1442
+ unmarshalListOffersResponse,
1443
+ unmarshalListRefundsResponse,
1444
+ unmarshalListRpnCapableSanServersResponse,
1445
+ unmarshalListRpnCapableServersResponse,
1446
+ unmarshalListRpnGroupMembersResponse,
1447
+ unmarshalListRpnGroupsResponse,
1448
+ unmarshalListRpnInvitesResponse,
1449
+ unmarshalListRpnSansResponse,
1450
+ unmarshalListRpnServerCapabilitiesResponse,
1451
+ unmarshalListRpnV2CapableResourcesResponse,
1452
+ unmarshalListRpnV2GroupLogsResponse,
1453
+ unmarshalListRpnV2GroupsResponse,
1454
+ unmarshalListRpnV2MembersResponse,
1455
+ unmarshalListServerDisksResponse,
1456
+ unmarshalListServerEventsResponse,
1457
+ unmarshalListServersResponse,
1458
+ unmarshalListServicesResponse,
1459
+ unmarshalListSubscribableServerOptionsResponse,
1460
+ unmarshalOS,
1461
+ unmarshalOffer,
1462
+ unmarshalRaid,
1463
+ unmarshalRefund,
1464
+ unmarshalRescue,
1465
+ unmarshalRpnGroup,
1466
+ unmarshalRpnSan,
1467
+ unmarshalRpnV2Group,
1468
+ unmarshalServer,
1469
+ unmarshalServerDefaultPartitioning,
1470
+ unmarshalServerInstall,
1471
+ unmarshalService,
1472
+ unmarshalSubscribeStorageOptionsResponse
1473
+ };