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