@scaleway/sdk-dedibox 1.4.0 → 2.1.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.
@@ -1,1486 +0,0 @@
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
- isHds: data.is_hds,
400
- isOutsourced: data.is_outsourced,
401
- isRpnv2Member: data.is_rpnv2_member,
402
- level: data.level ? unmarshalServiceLevel(data.level) : void 0,
403
- location: data.location ? unmarshalServerLocation(data.location) : void 0,
404
- offer: data.offer ? unmarshalOffer(data.offer) : void 0,
405
- options: sdkClient.unmarshalArrayOfObject(data.options, unmarshalServerOption),
406
- organizationId: data.organization_id,
407
- os: data.os ? unmarshalOS(data.os) : void 0,
408
- projectId: data.project_id,
409
- qinq: data.qinq,
410
- rebootedAt: sdkClient.unmarshalDate(data.rebooted_at),
411
- rescueOs: data.rescue_os ? unmarshalOS(data.rescue_os) : void 0,
412
- status: data.status,
413
- tags: data.tags,
414
- updatedAt: sdkClient.unmarshalDate(data.updated_at),
415
- zone: data.zone
416
- };
417
- };
418
- const unmarshalRpnV2GroupSubnet = (data) => {
419
- if (!sdkClient.isJSONObject(data)) {
420
- throw new TypeError(
421
- `Unmarshalling the type 'RpnV2GroupSubnet' failed as data isn't a dictionary.`
422
- );
423
- }
424
- return {
425
- address: data.address,
426
- cidr: data.cidr
427
- };
428
- };
429
- const unmarshalRpnV2Group = (data) => {
430
- if (!sdkClient.isJSONObject(data)) {
431
- throw new TypeError(
432
- `Unmarshalling the type 'RpnV2Group' failed as data isn't a dictionary.`
433
- );
434
- }
435
- return {
436
- compatibleRpnv1: data.compatible_rpnv1,
437
- gateway: data.gateway,
438
- id: data.id,
439
- membersCount: data.members_count,
440
- name: data.name,
441
- organizationId: data.organization_id,
442
- owner: data.owner,
443
- projectId: data.project_id,
444
- rpnv1Group: data.rpnv1_group ? unmarshalRpnGroup(data.rpnv1_group) : void 0,
445
- status: data.status,
446
- subnet: data.subnet ? unmarshalRpnV2GroupSubnet(data.subnet) : void 0,
447
- type: data.type
448
- };
449
- };
450
- const unmarshalService = (data) => {
451
- if (!sdkClient.isJSONObject(data)) {
452
- throw new TypeError(
453
- `Unmarshalling the type 'Service' failed as data isn't a dictionary.`
454
- );
455
- }
456
- return {
457
- createdAt: sdkClient.unmarshalDate(data.created_at),
458
- deliveredAt: sdkClient.unmarshalDate(data.delivered_at),
459
- expiresAt: sdkClient.unmarshalDate(data.expires_at),
460
- id: data.id,
461
- offer: data.offer ? unmarshalOffer(data.offer) : void 0,
462
- provisioningStatus: data.provisioning_status,
463
- resourceId: data.resource_id,
464
- terminatedAt: sdkClient.unmarshalDate(data.terminated_at),
465
- type: data.type
466
- };
467
- };
468
- const unmarshalFailoverBlock = (data) => {
469
- if (!sdkClient.isJSONObject(data)) {
470
- throw new TypeError(
471
- `Unmarshalling the type 'FailoverBlock' failed as data isn't a dictionary.`
472
- );
473
- }
474
- return {
475
- address: data.address,
476
- cidr: data.cidr,
477
- gatewayIp: data.gateway_ip,
478
- id: data.id,
479
- ipVersion: data.ip_version,
480
- nameservers: data.nameservers,
481
- netmask: data.netmask
482
- };
483
- };
484
- const unmarshalFailoverIP = (data) => {
485
- if (!sdkClient.isJSONObject(data)) {
486
- throw new TypeError(
487
- `Unmarshalling the type 'FailoverIP' failed as data isn't a dictionary.`
488
- );
489
- }
490
- return {
491
- address: data.address,
492
- block: data.block ? unmarshalFailoverBlock(data.block) : void 0,
493
- cidr: data.cidr,
494
- gatewayIp: data.gateway_ip,
495
- id: data.id,
496
- ipVersion: data.ip_version,
497
- mac: data.mac,
498
- netmask: data.netmask,
499
- reverse: data.reverse,
500
- serverId: data.server_id,
501
- serverZone: data.server_zone,
502
- status: data.status,
503
- type: data.type
504
- };
505
- };
506
- const unmarshalIPv6Block = (data) => {
507
- if (!sdkClient.isJSONObject(data)) {
508
- throw new TypeError(
509
- `Unmarshalling the type 'IPv6Block' failed as data isn't a dictionary.`
510
- );
511
- }
512
- return {
513
- address: data.address,
514
- cidr: data.cidr,
515
- delegationStatus: data.delegation_status,
516
- duid: data.duid,
517
- id: data.id,
518
- nameservers: data.nameservers,
519
- subnets: sdkClient.unmarshalArrayOfObject(data.subnets, unmarshalIPv6Block)
520
- };
521
- };
522
- const unmarshalBMCAccess = (data) => {
523
- if (!sdkClient.isJSONObject(data)) {
524
- throw new TypeError(
525
- `Unmarshalling the type 'BMCAccess' failed as data isn't a dictionary.`
526
- );
527
- }
528
- return {
529
- expiresAt: sdkClient.unmarshalDate(data.expires_at),
530
- login: data.login,
531
- password: data.password,
532
- status: data.status,
533
- url: data.url
534
- };
535
- };
536
- const unmarshalBackup = (data) => {
537
- if (!sdkClient.isJSONObject(data)) {
538
- throw new TypeError(
539
- `Unmarshalling the type 'Backup' failed as data isn't a dictionary.`
540
- );
541
- }
542
- return {
543
- aclEnabled: data.acl_enabled,
544
- autologin: data.autologin,
545
- id: data.id,
546
- login: data.login,
547
- quotaFiles: data.quota_files,
548
- quotaFilesUsed: data.quota_files_used,
549
- quotaSpace: data.quota_space,
550
- quotaSpaceUsed: data.quota_space_used,
551
- server: data.server,
552
- status: data.status
553
- };
554
- };
555
- const unmarshalCanOrderResponse = (data) => {
556
- if (!sdkClient.isJSONObject(data)) {
557
- throw new TypeError(
558
- `Unmarshalling the type 'CanOrderResponse' failed as data isn't a dictionary.`
559
- );
560
- }
561
- return {
562
- billingOk: data.billing_ok,
563
- canOrder: data.can_order,
564
- emailConfirmed: data.email_confirmed,
565
- message: data.message,
566
- paymentMode: data.payment_mode,
567
- phoneConfirmed: data.phone_confirmed,
568
- quotaOk: data.quota_ok,
569
- userConfirmed: data.user_confirmed
570
- };
571
- };
572
- const unmarshalCreateFailoverIPsResponse = (data) => {
573
- if (!sdkClient.isJSONObject(data)) {
574
- throw new TypeError(
575
- `Unmarshalling the type 'CreateFailoverIPsResponse' failed as data isn't a dictionary.`
576
- );
577
- }
578
- return {
579
- services: sdkClient.unmarshalArrayOfObject(data.services, unmarshalService),
580
- totalCount: data.total_count
581
- };
582
- };
583
- const unmarshalGetIPv6BlockQuotasResponseQuota = (data) => {
584
- if (!sdkClient.isJSONObject(data)) {
585
- throw new TypeError(
586
- `Unmarshalling the type 'GetIPv6BlockQuotasResponseQuota' failed as data isn't a dictionary.`
587
- );
588
- }
589
- return {
590
- cidr: data.cidr,
591
- quota: data.quota
592
- };
593
- };
594
- const unmarshalGetIPv6BlockQuotasResponse = (data) => {
595
- if (!sdkClient.isJSONObject(data)) {
596
- throw new TypeError(
597
- `Unmarshalling the type 'GetIPv6BlockQuotasResponse' failed as data isn't a dictionary.`
598
- );
599
- }
600
- return {
601
- quotas: sdkClient.unmarshalArrayOfObject(
602
- data.quotas,
603
- unmarshalGetIPv6BlockQuotasResponseQuota
604
- ),
605
- totalCount: data.total_count
606
- };
607
- };
608
- const unmarshalGetRemainingQuotaResponse = (data) => {
609
- if (!sdkClient.isJSONObject(data)) {
610
- throw new TypeError(
611
- `Unmarshalling the type 'GetRemainingQuotaResponse' failed as data isn't a dictionary.`
612
- );
613
- }
614
- return {
615
- failoverBlockQuota: data.failover_block_quota,
616
- failoverBlockRemainingQuota: data.failover_block_remaining_quota,
617
- failoverIpQuota: data.failover_ip_quota,
618
- failoverIpRemainingQuota: data.failover_ip_remaining_quota
619
- };
620
- };
621
- const unmarshalGetRpnStatusResponse = (data) => {
622
- if (!sdkClient.isJSONObject(data)) {
623
- throw new TypeError(
624
- `Unmarshalling the type 'GetRpnStatusResponse' failed as data isn't a dictionary.`
625
- );
626
- }
627
- return {
628
- operationsLeft: data.operations_left,
629
- status: data.status
630
- };
631
- };
632
- const unmarshalInvoice = (data) => {
633
- if (!sdkClient.isJSONObject(data)) {
634
- throw new TypeError(
635
- `Unmarshalling the type 'Invoice' failed as data isn't a dictionary.`
636
- );
637
- }
638
- return {
639
- content: data.content,
640
- createdAt: sdkClient.unmarshalDate(data.created_at),
641
- id: data.id,
642
- paidAt: sdkClient.unmarshalDate(data.paid_at),
643
- paymentMethod: data.payment_method,
644
- status: data.status,
645
- totalWithTaxes: data.total_with_taxes ? sdkClient.unmarshalMoney(data.total_with_taxes) : void 0,
646
- totalWithoutTaxes: data.total_without_taxes ? sdkClient.unmarshalMoney(data.total_without_taxes) : void 0,
647
- transactionId: data.transaction_id
648
- };
649
- };
650
- const unmarshalListFailoverIPsResponse = (data) => {
651
- if (!sdkClient.isJSONObject(data)) {
652
- throw new TypeError(
653
- `Unmarshalling the type 'ListFailoverIPsResponse' failed as data isn't a dictionary.`
654
- );
655
- }
656
- return {
657
- failoverIps: sdkClient.unmarshalArrayOfObject(data.failover_ips, unmarshalFailoverIP),
658
- totalCount: data.total_count
659
- };
660
- };
661
- const unmarshalListIPv6BlockSubnetsAvailableResponseSubnet = (data) => {
662
- if (!sdkClient.isJSONObject(data)) {
663
- throw new TypeError(
664
- `Unmarshalling the type 'ListIPv6BlockSubnetsAvailableResponseSubnet' failed as data isn't a dictionary.`
665
- );
666
- }
667
- return {
668
- address: data.address,
669
- cidr: data.cidr
670
- };
671
- };
672
- const unmarshalListIPv6BlockSubnetsAvailableResponse = (data) => {
673
- if (!sdkClient.isJSONObject(data)) {
674
- throw new TypeError(
675
- `Unmarshalling the type 'ListIPv6BlockSubnetsAvailableResponse' failed as data isn't a dictionary.`
676
- );
677
- }
678
- return {
679
- subnetAvailables: sdkClient.unmarshalArrayOfObject(
680
- data.subnet_availables,
681
- unmarshalListIPv6BlockSubnetsAvailableResponseSubnet
682
- ),
683
- totalCount: data.total_count
684
- };
685
- };
686
- const unmarshalListIPv6BlocksResponse = (data) => {
687
- if (!sdkClient.isJSONObject(data)) {
688
- throw new TypeError(
689
- `Unmarshalling the type 'ListIPv6BlocksResponse' failed as data isn't a dictionary.`
690
- );
691
- }
692
- return {
693
- ipv6Blocks: sdkClient.unmarshalArrayOfObject(data.ipv6_blocks, unmarshalIPv6Block),
694
- totalCount: data.total_count
695
- };
696
- };
697
- const unmarshalInvoiceSummary = (data) => {
698
- if (!sdkClient.isJSONObject(data)) {
699
- throw new TypeError(
700
- `Unmarshalling the type 'InvoiceSummary' failed as data isn't a dictionary.`
701
- );
702
- }
703
- return {
704
- createdAt: sdkClient.unmarshalDate(data.created_at),
705
- id: data.id,
706
- paidAt: sdkClient.unmarshalDate(data.paid_at),
707
- paymentMethod: data.payment_method,
708
- status: data.status,
709
- totalWithTaxes: data.total_with_taxes ? sdkClient.unmarshalMoney(data.total_with_taxes) : void 0,
710
- totalWithoutTaxes: data.total_without_taxes ? sdkClient.unmarshalMoney(data.total_without_taxes) : void 0,
711
- transactionId: data.transaction_id
712
- };
713
- };
714
- const unmarshalListInvoicesResponse = (data) => {
715
- if (!sdkClient.isJSONObject(data)) {
716
- throw new TypeError(
717
- `Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.`
718
- );
719
- }
720
- return {
721
- invoices: sdkClient.unmarshalArrayOfObject(data.invoices, unmarshalInvoiceSummary),
722
- totalCount: data.total_count
723
- };
724
- };
725
- const unmarshalRpnSanIpRpnV2Group = (data) => {
726
- if (!sdkClient.isJSONObject(data)) {
727
- throw new TypeError(
728
- `Unmarshalling the type 'RpnSanIpRpnV2Group' failed as data isn't a dictionary.`
729
- );
730
- }
731
- return {
732
- id: data.id,
733
- name: data.name
734
- };
735
- };
736
- const unmarshalRpnSanIpServer = (data) => {
737
- if (!sdkClient.isJSONObject(data)) {
738
- throw new TypeError(
739
- `Unmarshalling the type 'RpnSanIpServer' failed as data isn't a dictionary.`
740
- );
741
- }
742
- return {
743
- datacenterName: data.datacenter_name,
744
- hostname: data.hostname,
745
- id: data.id
746
- };
747
- };
748
- const unmarshalRpnSanIp = (data) => {
749
- if (!sdkClient.isJSONObject(data)) {
750
- throw new TypeError(
751
- `Unmarshalling the type 'RpnSanIp' failed as data isn't a dictionary.`
752
- );
753
- }
754
- return {
755
- ip: data.ip ? unmarshalIP(data.ip) : void 0,
756
- rpnv2Group: data.rpnv2_group ? unmarshalRpnSanIpRpnV2Group(data.rpnv2_group) : void 0,
757
- server: data.server ? unmarshalRpnSanIpServer(data.server) : void 0,
758
- type: data.type
759
- };
760
- };
761
- const unmarshalListIpsResponse = (data) => {
762
- if (!sdkClient.isJSONObject(data)) {
763
- throw new TypeError(
764
- `Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.`
765
- );
766
- }
767
- return {
768
- ips: sdkClient.unmarshalArrayOfObject(data.ips, unmarshalRpnSanIp),
769
- totalCount: data.total_count
770
- };
771
- };
772
- const unmarshalListOSResponse = (data) => {
773
- if (!sdkClient.isJSONObject(data)) {
774
- throw new TypeError(
775
- `Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`
776
- );
777
- }
778
- return {
779
- os: sdkClient.unmarshalArrayOfObject(data.os, unmarshalOS),
780
- totalCount: data.total_count
781
- };
782
- };
783
- const unmarshalListOffersResponse = (data) => {
784
- if (!sdkClient.isJSONObject(data)) {
785
- throw new TypeError(
786
- `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`
787
- );
788
- }
789
- return {
790
- offers: sdkClient.unmarshalArrayOfObject(data.offers, unmarshalOffer),
791
- totalCount: data.total_count
792
- };
793
- };
794
- const unmarshalRefundSummary = (data) => {
795
- if (!sdkClient.isJSONObject(data)) {
796
- throw new TypeError(
797
- `Unmarshalling the type 'RefundSummary' failed as data isn't a dictionary.`
798
- );
799
- }
800
- return {
801
- createdAt: sdkClient.unmarshalDate(data.created_at),
802
- id: data.id,
803
- method: data.method,
804
- refundedAt: sdkClient.unmarshalDate(data.refunded_at),
805
- status: data.status,
806
- totalWithTaxes: data.total_with_taxes ? sdkClient.unmarshalMoney(data.total_with_taxes) : void 0,
807
- totalWithoutTaxes: data.total_without_taxes ? sdkClient.unmarshalMoney(data.total_without_taxes) : void 0
808
- };
809
- };
810
- const unmarshalListRefundsResponse = (data) => {
811
- if (!sdkClient.isJSONObject(data)) {
812
- throw new TypeError(
813
- `Unmarshalling the type 'ListRefundsResponse' failed as data isn't a dictionary.`
814
- );
815
- }
816
- return {
817
- refunds: sdkClient.unmarshalArrayOfObject(data.refunds, unmarshalRefundSummary),
818
- totalCount: data.total_count
819
- };
820
- };
821
- const unmarshalRpnSanServer = (data) => {
822
- if (!sdkClient.isJSONObject(data)) {
823
- throw new TypeError(
824
- `Unmarshalling the type 'RpnSanServer' failed as data isn't a dictionary.`
825
- );
826
- }
827
- return {
828
- datacenterName: data.datacenter_name,
829
- hostname: data.hostname,
830
- id: data.id,
831
- sans: sdkClient.unmarshalArrayOfObject(data.sans, unmarshalRpnSan),
832
- zone: data.zone
833
- };
834
- };
835
- const unmarshalListRpnCapableSanServersResponse = (data) => {
836
- if (!sdkClient.isJSONObject(data)) {
837
- throw new TypeError(
838
- `Unmarshalling the type 'ListRpnCapableSanServersResponse' failed as data isn't a dictionary.`
839
- );
840
- }
841
- return {
842
- sanServers: sdkClient.unmarshalArrayOfObject(data.san_servers, unmarshalRpnSanServer),
843
- totalCount: data.total_count
844
- };
845
- };
846
- const unmarshalListRpnCapableServersResponse = (data) => {
847
- if (!sdkClient.isJSONObject(data)) {
848
- throw new TypeError(
849
- `Unmarshalling the type 'ListRpnCapableServersResponse' failed as data isn't a dictionary.`
850
- );
851
- }
852
- return {
853
- servers: sdkClient.unmarshalArrayOfObject(data.servers, unmarshalServer),
854
- totalCount: data.total_count
855
- };
856
- };
857
- const unmarshalRpnGroupMember = (data) => {
858
- if (!sdkClient.isJSONObject(data)) {
859
- throw new TypeError(
860
- `Unmarshalling the type 'RpnGroupMember' failed as data isn't a dictionary.`
861
- );
862
- }
863
- return {
864
- groupId: data.group_id,
865
- groupName: data.group_name,
866
- groupOwner: data.group_owner,
867
- id: data.id,
868
- owner: data.owner,
869
- sanServer: data.san_server ? unmarshalRpnSanServer(data.san_server) : void 0,
870
- server: data.server ? unmarshalServer(data.server) : void 0,
871
- speed: data.speed,
872
- status: data.status
873
- };
874
- };
875
- const unmarshalListRpnGroupMembersResponse = (data) => {
876
- if (!sdkClient.isJSONObject(data)) {
877
- throw new TypeError(
878
- `Unmarshalling the type 'ListRpnGroupMembersResponse' failed as data isn't a dictionary.`
879
- );
880
- }
881
- return {
882
- members: sdkClient.unmarshalArrayOfObject(data.members, unmarshalRpnGroupMember),
883
- totalCount: data.total_count
884
- };
885
- };
886
- const unmarshalListRpnGroupsResponse = (data) => {
887
- if (!sdkClient.isJSONObject(data)) {
888
- throw new TypeError(
889
- `Unmarshalling the type 'ListRpnGroupsResponse' failed as data isn't a dictionary.`
890
- );
891
- }
892
- return {
893
- rpnGroups: sdkClient.unmarshalArrayOfObject(data.rpn_groups, unmarshalRpnGroup),
894
- totalCount: data.total_count
895
- };
896
- };
897
- const unmarshalListRpnInvitesResponse = (data) => {
898
- if (!sdkClient.isJSONObject(data)) {
899
- throw new TypeError(
900
- `Unmarshalling the type 'ListRpnInvitesResponse' failed as data isn't a dictionary.`
901
- );
902
- }
903
- return {
904
- members: sdkClient.unmarshalArrayOfObject(data.members, unmarshalRpnGroupMember),
905
- totalCount: data.total_count
906
- };
907
- };
908
- const unmarshalRpnSanSummary = (data) => {
909
- if (!sdkClient.isJSONObject(data)) {
910
- throw new TypeError(
911
- `Unmarshalling the type 'RpnSanSummary' failed as data isn't a dictionary.`
912
- );
913
- }
914
- return {
915
- createdAt: sdkClient.unmarshalDate(data.created_at),
916
- datacenterName: data.datacenter_name,
917
- deliveredAt: sdkClient.unmarshalDate(data.delivered_at),
918
- expiresAt: sdkClient.unmarshalDate(data.expires_at),
919
- id: data.id,
920
- iqnSuffix: data.iqn_suffix,
921
- offerId: data.offer_id,
922
- offerName: data.offer_name,
923
- organizationId: data.organization_id,
924
- projectId: data.project_id,
925
- rpnv1Compatible: data.rpnv1_compatible,
926
- rpnv1Implicit: data.rpnv1_implicit,
927
- serverHostname: data.server_hostname,
928
- status: data.status,
929
- storageSize: data.storage_size,
930
- terminatedAt: sdkClient.unmarshalDate(data.terminated_at)
931
- };
932
- };
933
- const unmarshalListRpnSansResponse = (data) => {
934
- if (!sdkClient.isJSONObject(data)) {
935
- throw new TypeError(
936
- `Unmarshalling the type 'ListRpnSansResponse' failed as data isn't a dictionary.`
937
- );
938
- }
939
- return {
940
- rpnSans: sdkClient.unmarshalArrayOfObject(data.rpn_sans, unmarshalRpnSanSummary),
941
- totalCount: data.total_count
942
- };
943
- };
944
- const unmarshalRpnServerCapability = (data) => {
945
- if (!sdkClient.isJSONObject(data)) {
946
- throw new TypeError(
947
- `Unmarshalling the type 'RpnServerCapability' failed as data isn't a dictionary.`
948
- );
949
- }
950
- return {
951
- canJoinQinqGroup: data.can_join_qinq_group,
952
- canJoinRpnv2Group: data.can_join_rpnv2_group,
953
- compatibleQinq: data.compatible_qinq,
954
- datacenterName: data.datacenter_name,
955
- hostname: data.hostname,
956
- id: data.id,
957
- ipAddress: data.ip_address,
958
- rpnVersion: data.rpn_version,
959
- rpnv1GroupCount: data.rpnv1_group_count,
960
- rpnv2GroupCount: data.rpnv2_group_count,
961
- zone: data.zone
962
- };
963
- };
964
- const unmarshalListRpnServerCapabilitiesResponse = (data) => {
965
- if (!sdkClient.isJSONObject(data)) {
966
- throw new TypeError(
967
- `Unmarshalling the type 'ListRpnServerCapabilitiesResponse' failed as data isn't a dictionary.`
968
- );
969
- }
970
- return {
971
- servers: sdkClient.unmarshalArrayOfObject(data.servers, unmarshalRpnServerCapability),
972
- totalCount: data.total_count
973
- };
974
- };
975
- const unmarshalListRpnV2CapableResourcesResponse = (data) => {
976
- if (!sdkClient.isJSONObject(data)) {
977
- throw new TypeError(
978
- `Unmarshalling the type 'ListRpnV2CapableResourcesResponse' failed as data isn't a dictionary.`
979
- );
980
- }
981
- return {
982
- servers: sdkClient.unmarshalArrayOfObject(data.servers, unmarshalServer),
983
- totalCount: data.total_count
984
- };
985
- };
986
- const unmarshalRpnV2Member = (data) => {
987
- if (!sdkClient.isJSONObject(data)) {
988
- throw new TypeError(
989
- `Unmarshalling the type 'RpnV2Member' failed as data isn't a dictionary.`
990
- );
991
- }
992
- return {
993
- id: data.id,
994
- rpnv1Group: data.rpnv1_group ? unmarshalRpnGroup(data.rpnv1_group) : void 0,
995
- server: data.server ? unmarshalServer(data.server) : void 0,
996
- speed: data.speed,
997
- status: data.status,
998
- vlan: data.vlan
999
- };
1000
- };
1001
- const unmarshalLog = (data) => {
1002
- if (!sdkClient.isJSONObject(data)) {
1003
- throw new TypeError(
1004
- `Unmarshalling the type 'Log' failed as data isn't a dictionary.`
1005
- );
1006
- }
1007
- return {
1008
- action: data.action,
1009
- createdAt: sdkClient.unmarshalDate(data.created_at),
1010
- finishedAt: sdkClient.unmarshalDate(data.finished_at),
1011
- group: data.group ? unmarshalRpnV2Group(data.group) : void 0,
1012
- id: data.id,
1013
- member: data.member ? unmarshalRpnV2Member(data.member) : void 0,
1014
- status: data.status
1015
- };
1016
- };
1017
- const unmarshalListRpnV2GroupLogsResponse = (data) => {
1018
- if (!sdkClient.isJSONObject(data)) {
1019
- throw new TypeError(
1020
- `Unmarshalling the type 'ListRpnV2GroupLogsResponse' failed as data isn't a dictionary.`
1021
- );
1022
- }
1023
- return {
1024
- logs: sdkClient.unmarshalArrayOfObject(data.logs, unmarshalLog),
1025
- totalCount: data.total_count
1026
- };
1027
- };
1028
- const unmarshalListRpnV2GroupsResponse = (data) => {
1029
- if (!sdkClient.isJSONObject(data)) {
1030
- throw new TypeError(
1031
- `Unmarshalling the type 'ListRpnV2GroupsResponse' failed as data isn't a dictionary.`
1032
- );
1033
- }
1034
- return {
1035
- rpnGroups: sdkClient.unmarshalArrayOfObject(data.rpn_groups, unmarshalRpnV2Group),
1036
- totalCount: data.total_count
1037
- };
1038
- };
1039
- const unmarshalListRpnV2MembersResponse = (data) => {
1040
- if (!sdkClient.isJSONObject(data)) {
1041
- throw new TypeError(
1042
- `Unmarshalling the type 'ListRpnV2MembersResponse' failed as data isn't a dictionary.`
1043
- );
1044
- }
1045
- return {
1046
- members: sdkClient.unmarshalArrayOfObject(data.members, unmarshalRpnV2Member),
1047
- totalCount: data.total_count
1048
- };
1049
- };
1050
- const unmarshalServerDisk = (data) => {
1051
- if (!sdkClient.isJSONObject(data)) {
1052
- throw new TypeError(
1053
- `Unmarshalling the type 'ServerDisk' failed as data isn't a dictionary.`
1054
- );
1055
- }
1056
- return {
1057
- capacity: data.capacity,
1058
- connector: data.connector,
1059
- id: data.id,
1060
- isAddon: data.is_addon,
1061
- type: data.type
1062
- };
1063
- };
1064
- const unmarshalListServerDisksResponse = (data) => {
1065
- if (!sdkClient.isJSONObject(data)) {
1066
- throw new TypeError(
1067
- `Unmarshalling the type 'ListServerDisksResponse' failed as data isn't a dictionary.`
1068
- );
1069
- }
1070
- return {
1071
- disks: sdkClient.unmarshalArrayOfObject(data.disks, unmarshalServerDisk),
1072
- totalCount: data.total_count
1073
- };
1074
- };
1075
- const unmarshalServerEvent = (data) => {
1076
- if (!sdkClient.isJSONObject(data)) {
1077
- throw new TypeError(
1078
- `Unmarshalling the type 'ServerEvent' failed as data isn't a dictionary.`
1079
- );
1080
- }
1081
- return {
1082
- date: sdkClient.unmarshalDate(data.date),
1083
- description: data.description,
1084
- eventId: data.event_id
1085
- };
1086
- };
1087
- const unmarshalListServerEventsResponse = (data) => {
1088
- if (!sdkClient.isJSONObject(data)) {
1089
- throw new TypeError(
1090
- `Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.`
1091
- );
1092
- }
1093
- return {
1094
- events: sdkClient.unmarshalArrayOfObject(data.events, unmarshalServerEvent),
1095
- totalCount: data.total_count
1096
- };
1097
- };
1098
- const unmarshalServerSummary = (data) => {
1099
- if (!sdkClient.isJSONObject(data)) {
1100
- throw new TypeError(
1101
- `Unmarshalling the type 'ServerSummary' failed as data isn't a dictionary.`
1102
- );
1103
- }
1104
- return {
1105
- createdAt: sdkClient.unmarshalDate(data.created_at),
1106
- datacenterName: data.datacenter_name,
1107
- expiredAt: sdkClient.unmarshalDate(data.expired_at),
1108
- hostname: data.hostname,
1109
- id: data.id,
1110
- interfaces: sdkClient.unmarshalArrayOfObject(
1111
- data.interfaces,
1112
- unmarshalNetworkInterface
1113
- ),
1114
- isHds: data.is_hds,
1115
- isOutsourced: data.is_outsourced,
1116
- level: data.level ? unmarshalServiceLevel(data.level) : void 0,
1117
- offerId: data.offer_id,
1118
- offerName: data.offer_name,
1119
- organizationId: data.organization_id,
1120
- osId: data.os_id,
1121
- projectId: data.project_id,
1122
- qinq: data.qinq,
1123
- rpnVersion: data.rpn_version,
1124
- status: data.status,
1125
- updatedAt: sdkClient.unmarshalDate(data.updated_at),
1126
- zone: data.zone
1127
- };
1128
- };
1129
- const unmarshalListServersResponse = (data) => {
1130
- if (!sdkClient.isJSONObject(data)) {
1131
- throw new TypeError(
1132
- `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`
1133
- );
1134
- }
1135
- return {
1136
- servers: sdkClient.unmarshalArrayOfObject(data.servers, unmarshalServerSummary),
1137
- totalCount: data.total_count
1138
- };
1139
- };
1140
- const unmarshalListServicesResponse = (data) => {
1141
- if (!sdkClient.isJSONObject(data)) {
1142
- throw new TypeError(
1143
- `Unmarshalling the type 'ListServicesResponse' failed as data isn't a dictionary.`
1144
- );
1145
- }
1146
- return {
1147
- services: sdkClient.unmarshalArrayOfObject(data.services, unmarshalService),
1148
- totalCount: data.total_count
1149
- };
1150
- };
1151
- const unmarshalListSubscribableServerOptionsResponse = (data) => {
1152
- if (!sdkClient.isJSONObject(data)) {
1153
- throw new TypeError(
1154
- `Unmarshalling the type 'ListSubscribableServerOptionsResponse' failed as data isn't a dictionary.`
1155
- );
1156
- }
1157
- return {
1158
- serverOptions: sdkClient.unmarshalArrayOfObject(data.server_options, unmarshalOffer),
1159
- totalCount: data.total_count
1160
- };
1161
- };
1162
- const unmarshalRaidArray = (data) => {
1163
- if (!sdkClient.isJSONObject(data)) {
1164
- throw new TypeError(
1165
- `Unmarshalling the type 'RaidArray' failed as data isn't a dictionary.`
1166
- );
1167
- }
1168
- return {
1169
- disks: sdkClient.unmarshalArrayOfObject(data.disks, unmarshalServerDisk),
1170
- raidLevel: data.raid_level
1171
- };
1172
- };
1173
- const unmarshalRaid = (data) => {
1174
- if (!sdkClient.isJSONObject(data)) {
1175
- throw new TypeError(
1176
- `Unmarshalling the type 'Raid' failed as data isn't a dictionary.`
1177
- );
1178
- }
1179
- return {
1180
- raidArrays: sdkClient.unmarshalArrayOfObject(data.raid_arrays, unmarshalRaidArray)
1181
- };
1182
- };
1183
- const unmarshalRefund = (data) => {
1184
- if (!sdkClient.isJSONObject(data)) {
1185
- throw new TypeError(
1186
- `Unmarshalling the type 'Refund' failed as data isn't a dictionary.`
1187
- );
1188
- }
1189
- return {
1190
- content: data.content,
1191
- createdAt: sdkClient.unmarshalDate(data.created_at),
1192
- id: data.id,
1193
- method: data.method,
1194
- refundedAt: sdkClient.unmarshalDate(data.refunded_at),
1195
- status: data.status,
1196
- totalWithTaxes: data.total_with_taxes ? sdkClient.unmarshalMoney(data.total_with_taxes) : void 0,
1197
- totalWithoutTaxes: data.total_without_taxes ? sdkClient.unmarshalMoney(data.total_without_taxes) : void 0
1198
- };
1199
- };
1200
- const unmarshalRescue = (data) => {
1201
- if (!sdkClient.isJSONObject(data)) {
1202
- throw new TypeError(
1203
- `Unmarshalling the type 'Rescue' failed as data isn't a dictionary.`
1204
- );
1205
- }
1206
- return {
1207
- login: data.login,
1208
- osId: data.os_id,
1209
- password: data.password,
1210
- protocol: data.protocol
1211
- };
1212
- };
1213
- const unmarshalPartition = (data) => {
1214
- if (!sdkClient.isJSONObject(data)) {
1215
- throw new TypeError(
1216
- `Unmarshalling the type 'Partition' failed as data isn't a dictionary.`
1217
- );
1218
- }
1219
- return {
1220
- capacity: data.capacity,
1221
- connectors: data.connectors,
1222
- fileSystem: data.file_system,
1223
- mountPoint: data.mount_point,
1224
- raidLevel: data.raid_level,
1225
- type: data.type
1226
- };
1227
- };
1228
- const unmarshalServerDefaultPartitioning = (data) => {
1229
- if (!sdkClient.isJSONObject(data)) {
1230
- throw new TypeError(
1231
- `Unmarshalling the type 'ServerDefaultPartitioning' failed as data isn't a dictionary.`
1232
- );
1233
- }
1234
- return {
1235
- partitions: sdkClient.unmarshalArrayOfObject(data.partitions, unmarshalPartition)
1236
- };
1237
- };
1238
- const unmarshalServerInstall = (data) => {
1239
- if (!sdkClient.isJSONObject(data)) {
1240
- throw new TypeError(
1241
- `Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`
1242
- );
1243
- }
1244
- return {
1245
- hostname: data.hostname,
1246
- osId: data.os_id,
1247
- panelUrl: data.panel_url,
1248
- partitions: sdkClient.unmarshalArrayOfObject(data.partitions, unmarshalPartition),
1249
- sshKeyIds: data.ssh_key_ids,
1250
- status: data.status,
1251
- userLogin: data.user_login
1252
- };
1253
- };
1254
- const unmarshalSubscribeStorageOptionsResponse = (data) => {
1255
- if (!sdkClient.isJSONObject(data)) {
1256
- throw new TypeError(
1257
- `Unmarshalling the type 'SubscribeStorageOptionsResponse' failed as data isn't a dictionary.`
1258
- );
1259
- }
1260
- return {
1261
- services: sdkClient.unmarshalArrayOfObject(data.services, unmarshalService)
1262
- };
1263
- };
1264
- const marshalAttachFailoverIPToMacAddressRequest = (request, defaults) => ({
1265
- mac: request.mac,
1266
- type: request.type
1267
- });
1268
- const marshalAttachFailoverIPsRequest = (request, defaults) => ({
1269
- fips_ids: request.fipsIds,
1270
- server_id: request.serverId
1271
- });
1272
- const marshalCreateFailoverIPsRequest = (request, defaults) => ({
1273
- offer_id: request.offerId,
1274
- project_id: request.projectId ?? defaults.defaultProjectId,
1275
- quantity: request.quantity
1276
- });
1277
- const marshalCreateServerRequest = (request, defaults) => ({
1278
- datacenter_name: request.datacenterName,
1279
- offer_id: request.offerId,
1280
- project_id: request.projectId ?? defaults.defaultProjectId,
1281
- server_option_ids: request.serverOptionIds
1282
- });
1283
- const marshalDetachFailoverIPsRequest = (request, defaults) => ({
1284
- fips_ids: request.fipsIds
1285
- });
1286
- const marshalIPv6BlockApiCreateIPv6BlockRequest = (request, defaults) => ({
1287
- project_id: request.projectId ?? defaults.defaultProjectId
1288
- });
1289
- const marshalIPv6BlockApiCreateIPv6BlockSubnetRequest = (request, defaults) => ({
1290
- address: request.address,
1291
- cidr: request.cidr
1292
- });
1293
- const marshalIPv6BlockApiUpdateIPv6BlockRequest = (request, defaults) => ({
1294
- nameservers: request.nameservers
1295
- });
1296
- const marshalInstallPartition = (request, defaults) => ({
1297
- capacity: request.capacity,
1298
- connectors: request.connectors,
1299
- file_system: request.fileSystem,
1300
- mount_point: request.mountPoint,
1301
- raid_level: request.raidLevel
1302
- });
1303
- const marshalInstallServerRequest = (request, defaults) => ({
1304
- hostname: request.hostname,
1305
- ip_id: request.ipId,
1306
- license_offer_id: request.licenseOfferId,
1307
- os_id: request.osId,
1308
- panel_password: request.panelPassword,
1309
- partitions: request.partitions !== void 0 ? request.partitions.map((elt) => marshalInstallPartition(elt)) : void 0,
1310
- root_password: request.rootPassword,
1311
- ssh_key_ids: request.sshKeyIds,
1312
- user_login: request.userLogin,
1313
- user_password: request.userPassword
1314
- });
1315
- const marshalRpnSanApiAddIpRequest = (request, defaults) => ({
1316
- ip_ids: request.ipIds
1317
- });
1318
- const marshalRpnSanApiCreateRpnSanRequest = (request, defaults) => ({
1319
- offer_id: request.offerId,
1320
- project_id: request.projectId ?? defaults.defaultProjectId
1321
- });
1322
- const marshalRpnSanApiRemoveIpRequest = (request, defaults) => ({
1323
- ip_ids: request.ipIds
1324
- });
1325
- const marshalRpnV1ApiAddRpnGroupMembersRequest = (request, defaults) => ({
1326
- san_server_ids: request.sanServerIds,
1327
- server_ids: request.serverIds
1328
- });
1329
- const marshalRpnV1ApiCreateRpnGroupRequest = (request, defaults) => ({
1330
- name: request.name,
1331
- project_id: request.projectId ?? defaults.defaultProjectId,
1332
- san_server_ids: request.sanServerIds,
1333
- server_ids: request.serverIds
1334
- });
1335
- const marshalRpnV1ApiDeleteRpnGroupMembersRequest = (request, defaults) => ({
1336
- member_ids: request.memberIds
1337
- });
1338
- const marshalRpnV1ApiLeaveRpnGroupRequest = (request, defaults) => ({
1339
- member_ids: request.memberIds
1340
- });
1341
- const marshalRpnV1ApiRpnGroupInviteRequest = (request, defaults) => ({
1342
- project_id: request.projectId ?? defaults.defaultProjectId,
1343
- server_ids: request.serverIds
1344
- });
1345
- const marshalRpnV1ApiUpdateRpnGroupNameRequest = (request, defaults) => ({
1346
- name: request.name
1347
- });
1348
- const marshalRpnV2ApiAddRpnV2MembersRequest = (request, defaults) => ({
1349
- servers: request.servers
1350
- });
1351
- const marshalRpnV2ApiCreateRpnV2GroupRequest = (request, defaults) => ({
1352
- name: request.name,
1353
- project_id: request.projectId ?? defaults.defaultProjectId,
1354
- servers: request.servers,
1355
- type: request.type
1356
- });
1357
- const marshalRpnV2ApiDeleteRpnV2MembersRequest = (request, defaults) => ({
1358
- member_ids: request.memberIds
1359
- });
1360
- const marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest = (request, defaults) => ({
1361
- rpnv1_group_id: request.rpnv1GroupId
1362
- });
1363
- const marshalRpnV2ApiUpdateRpnV2GroupNameRequest = (request, defaults) => ({
1364
- name: request.name
1365
- });
1366
- const marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest = (request, defaults) => ({
1367
- member_ids: request.memberIds,
1368
- vlan: request.vlan
1369
- });
1370
- const marshalStartBMCAccessRequest = (request, defaults) => ({
1371
- ip: request.ip
1372
- });
1373
- const marshalStartRescueRequest = (request, defaults) => ({
1374
- os_id: request.osId
1375
- });
1376
- const marshalSubscribeServerOptionRequest = (request, defaults) => ({
1377
- option_id: request.optionId
1378
- });
1379
- const marshalSubscribeStorageOptionsRequest = (request, defaults) => ({
1380
- options_ids: request.optionsIds
1381
- });
1382
- const marshalUpdatableRaidArray = (request, defaults) => ({
1383
- disk_ids: request.diskIds,
1384
- raid_level: request.raidLevel
1385
- });
1386
- const marshalUpdateRaidRequest = (request, defaults) => ({
1387
- raid_arrays: request.raidArrays.map(
1388
- (elt) => marshalUpdatableRaidArray(elt)
1389
- )
1390
- });
1391
- const marshalUpdateReverseRequest = (request, defaults) => ({
1392
- reverse: request.reverse
1393
- });
1394
- const marshalUpdateServerBackupRequest = (request, defaults) => ({
1395
- acl_enabled: request.aclEnabled,
1396
- autologin: request.autologin,
1397
- password: request.password
1398
- });
1399
- const marshalUpdateServerRequest = (request, defaults) => ({
1400
- enable_ipv6: request.enableIpv6,
1401
- hostname: request.hostname
1402
- });
1403
- const marshalUpdateServerTagsRequest = (request, defaults) => ({
1404
- tags: request.tags
1405
- });
1406
- exports.marshalAttachFailoverIPToMacAddressRequest = marshalAttachFailoverIPToMacAddressRequest;
1407
- exports.marshalAttachFailoverIPsRequest = marshalAttachFailoverIPsRequest;
1408
- exports.marshalCreateFailoverIPsRequest = marshalCreateFailoverIPsRequest;
1409
- exports.marshalCreateServerRequest = marshalCreateServerRequest;
1410
- exports.marshalDetachFailoverIPsRequest = marshalDetachFailoverIPsRequest;
1411
- exports.marshalIPv6BlockApiCreateIPv6BlockRequest = marshalIPv6BlockApiCreateIPv6BlockRequest;
1412
- exports.marshalIPv6BlockApiCreateIPv6BlockSubnetRequest = marshalIPv6BlockApiCreateIPv6BlockSubnetRequest;
1413
- exports.marshalIPv6BlockApiUpdateIPv6BlockRequest = marshalIPv6BlockApiUpdateIPv6BlockRequest;
1414
- exports.marshalInstallServerRequest = marshalInstallServerRequest;
1415
- exports.marshalRpnSanApiAddIpRequest = marshalRpnSanApiAddIpRequest;
1416
- exports.marshalRpnSanApiCreateRpnSanRequest = marshalRpnSanApiCreateRpnSanRequest;
1417
- exports.marshalRpnSanApiRemoveIpRequest = marshalRpnSanApiRemoveIpRequest;
1418
- exports.marshalRpnV1ApiAddRpnGroupMembersRequest = marshalRpnV1ApiAddRpnGroupMembersRequest;
1419
- exports.marshalRpnV1ApiCreateRpnGroupRequest = marshalRpnV1ApiCreateRpnGroupRequest;
1420
- exports.marshalRpnV1ApiDeleteRpnGroupMembersRequest = marshalRpnV1ApiDeleteRpnGroupMembersRequest;
1421
- exports.marshalRpnV1ApiLeaveRpnGroupRequest = marshalRpnV1ApiLeaveRpnGroupRequest;
1422
- exports.marshalRpnV1ApiRpnGroupInviteRequest = marshalRpnV1ApiRpnGroupInviteRequest;
1423
- exports.marshalRpnV1ApiUpdateRpnGroupNameRequest = marshalRpnV1ApiUpdateRpnGroupNameRequest;
1424
- exports.marshalRpnV2ApiAddRpnV2MembersRequest = marshalRpnV2ApiAddRpnV2MembersRequest;
1425
- exports.marshalRpnV2ApiCreateRpnV2GroupRequest = marshalRpnV2ApiCreateRpnV2GroupRequest;
1426
- exports.marshalRpnV2ApiDeleteRpnV2MembersRequest = marshalRpnV2ApiDeleteRpnV2MembersRequest;
1427
- exports.marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest = marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest;
1428
- exports.marshalRpnV2ApiUpdateRpnV2GroupNameRequest = marshalRpnV2ApiUpdateRpnV2GroupNameRequest;
1429
- exports.marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest = marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest;
1430
- exports.marshalStartBMCAccessRequest = marshalStartBMCAccessRequest;
1431
- exports.marshalStartRescueRequest = marshalStartRescueRequest;
1432
- exports.marshalSubscribeServerOptionRequest = marshalSubscribeServerOptionRequest;
1433
- exports.marshalSubscribeStorageOptionsRequest = marshalSubscribeStorageOptionsRequest;
1434
- exports.marshalUpdateRaidRequest = marshalUpdateRaidRequest;
1435
- exports.marshalUpdateReverseRequest = marshalUpdateReverseRequest;
1436
- exports.marshalUpdateServerBackupRequest = marshalUpdateServerBackupRequest;
1437
- exports.marshalUpdateServerRequest = marshalUpdateServerRequest;
1438
- exports.marshalUpdateServerTagsRequest = marshalUpdateServerTagsRequest;
1439
- exports.unmarshalBMCAccess = unmarshalBMCAccess;
1440
- exports.unmarshalBackup = unmarshalBackup;
1441
- exports.unmarshalCanOrderResponse = unmarshalCanOrderResponse;
1442
- exports.unmarshalCreateFailoverIPsResponse = unmarshalCreateFailoverIPsResponse;
1443
- exports.unmarshalFailoverIP = unmarshalFailoverIP;
1444
- exports.unmarshalGetIPv6BlockQuotasResponse = unmarshalGetIPv6BlockQuotasResponse;
1445
- exports.unmarshalGetRemainingQuotaResponse = unmarshalGetRemainingQuotaResponse;
1446
- exports.unmarshalGetRpnStatusResponse = unmarshalGetRpnStatusResponse;
1447
- exports.unmarshalIP = unmarshalIP;
1448
- exports.unmarshalIPv6Block = unmarshalIPv6Block;
1449
- exports.unmarshalInvoice = unmarshalInvoice;
1450
- exports.unmarshalListFailoverIPsResponse = unmarshalListFailoverIPsResponse;
1451
- exports.unmarshalListIPv6BlockSubnetsAvailableResponse = unmarshalListIPv6BlockSubnetsAvailableResponse;
1452
- exports.unmarshalListIPv6BlocksResponse = unmarshalListIPv6BlocksResponse;
1453
- exports.unmarshalListInvoicesResponse = unmarshalListInvoicesResponse;
1454
- exports.unmarshalListIpsResponse = unmarshalListIpsResponse;
1455
- exports.unmarshalListOSResponse = unmarshalListOSResponse;
1456
- exports.unmarshalListOffersResponse = unmarshalListOffersResponse;
1457
- exports.unmarshalListRefundsResponse = unmarshalListRefundsResponse;
1458
- exports.unmarshalListRpnCapableSanServersResponse = unmarshalListRpnCapableSanServersResponse;
1459
- exports.unmarshalListRpnCapableServersResponse = unmarshalListRpnCapableServersResponse;
1460
- exports.unmarshalListRpnGroupMembersResponse = unmarshalListRpnGroupMembersResponse;
1461
- exports.unmarshalListRpnGroupsResponse = unmarshalListRpnGroupsResponse;
1462
- exports.unmarshalListRpnInvitesResponse = unmarshalListRpnInvitesResponse;
1463
- exports.unmarshalListRpnSansResponse = unmarshalListRpnSansResponse;
1464
- exports.unmarshalListRpnServerCapabilitiesResponse = unmarshalListRpnServerCapabilitiesResponse;
1465
- exports.unmarshalListRpnV2CapableResourcesResponse = unmarshalListRpnV2CapableResourcesResponse;
1466
- exports.unmarshalListRpnV2GroupLogsResponse = unmarshalListRpnV2GroupLogsResponse;
1467
- exports.unmarshalListRpnV2GroupsResponse = unmarshalListRpnV2GroupsResponse;
1468
- exports.unmarshalListRpnV2MembersResponse = unmarshalListRpnV2MembersResponse;
1469
- exports.unmarshalListServerDisksResponse = unmarshalListServerDisksResponse;
1470
- exports.unmarshalListServerEventsResponse = unmarshalListServerEventsResponse;
1471
- exports.unmarshalListServersResponse = unmarshalListServersResponse;
1472
- exports.unmarshalListServicesResponse = unmarshalListServicesResponse;
1473
- exports.unmarshalListSubscribableServerOptionsResponse = unmarshalListSubscribableServerOptionsResponse;
1474
- exports.unmarshalOS = unmarshalOS;
1475
- exports.unmarshalOffer = unmarshalOffer;
1476
- exports.unmarshalRaid = unmarshalRaid;
1477
- exports.unmarshalRefund = unmarshalRefund;
1478
- exports.unmarshalRescue = unmarshalRescue;
1479
- exports.unmarshalRpnGroup = unmarshalRpnGroup;
1480
- exports.unmarshalRpnSan = unmarshalRpnSan;
1481
- exports.unmarshalRpnV2Group = unmarshalRpnV2Group;
1482
- exports.unmarshalServer = unmarshalServer;
1483
- exports.unmarshalServerDefaultPartitioning = unmarshalServerDefaultPartitioning;
1484
- exports.unmarshalServerInstall = unmarshalServerInstall;
1485
- exports.unmarshalService = unmarshalService;
1486
- exports.unmarshalSubscribeStorageOptionsResponse = unmarshalSubscribeStorageOptionsResponse;