@scaleway/sdk 2.22.0 → 2.23.0

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