@scaleway/sdk-baremetal 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,718 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const sdkClient = require("@scaleway/sdk-client");
4
+ const unmarshalSchemaPartition = (data) => {
5
+ if (!sdkClient.isJSONObject(data)) {
6
+ throw new TypeError(
7
+ `Unmarshalling the type 'SchemaPartition' failed as data isn't a dictionary.`
8
+ );
9
+ }
10
+ return {
11
+ label: data.label,
12
+ number: data.number,
13
+ size: data.size,
14
+ useAllAvailableSpace: data.use_all_available_space
15
+ };
16
+ };
17
+ const unmarshalSchemaPool = (data) => {
18
+ if (!sdkClient.isJSONObject(data)) {
19
+ throw new TypeError(
20
+ `Unmarshalling the type 'SchemaPool' failed as data isn't a dictionary.`
21
+ );
22
+ }
23
+ return {
24
+ devices: data.devices,
25
+ filesystemOptions: data.filesystem_options,
26
+ name: data.name,
27
+ options: data.options,
28
+ type: data.type
29
+ };
30
+ };
31
+ const unmarshalSchemaDisk = (data) => {
32
+ if (!sdkClient.isJSONObject(data)) {
33
+ throw new TypeError(
34
+ `Unmarshalling the type 'SchemaDisk' failed as data isn't a dictionary.`
35
+ );
36
+ }
37
+ return {
38
+ device: data.device,
39
+ partitions: sdkClient.unmarshalArrayOfObject(
40
+ data.partitions,
41
+ unmarshalSchemaPartition
42
+ )
43
+ };
44
+ };
45
+ const unmarshalSchemaFilesystem = (data) => {
46
+ if (!sdkClient.isJSONObject(data)) {
47
+ throw new TypeError(
48
+ `Unmarshalling the type 'SchemaFilesystem' failed as data isn't a dictionary.`
49
+ );
50
+ }
51
+ return {
52
+ device: data.device,
53
+ format: data.format,
54
+ mountpoint: data.mountpoint
55
+ };
56
+ };
57
+ const unmarshalSchemaRAID = (data) => {
58
+ if (!sdkClient.isJSONObject(data)) {
59
+ throw new TypeError(
60
+ `Unmarshalling the type 'SchemaRAID' failed as data isn't a dictionary.`
61
+ );
62
+ }
63
+ return {
64
+ devices: data.devices,
65
+ level: data.level,
66
+ name: data.name
67
+ };
68
+ };
69
+ const unmarshalSchemaZFS = (data) => {
70
+ if (!sdkClient.isJSONObject(data)) {
71
+ throw new TypeError(
72
+ `Unmarshalling the type 'SchemaZFS' failed as data isn't a dictionary.`
73
+ );
74
+ }
75
+ return {
76
+ pools: sdkClient.unmarshalArrayOfObject(data.pools, unmarshalSchemaPool)
77
+ };
78
+ };
79
+ const unmarshalSchema = (data) => {
80
+ if (!sdkClient.isJSONObject(data)) {
81
+ throw new TypeError(
82
+ `Unmarshalling the type 'Schema' failed as data isn't a dictionary.`
83
+ );
84
+ }
85
+ return {
86
+ disks: sdkClient.unmarshalArrayOfObject(data.disks, unmarshalSchemaDisk),
87
+ filesystems: sdkClient.unmarshalArrayOfObject(
88
+ data.filesystems,
89
+ unmarshalSchemaFilesystem
90
+ ),
91
+ raids: sdkClient.unmarshalArrayOfObject(data.raids, unmarshalSchemaRAID),
92
+ zfs: data.zfs ? unmarshalSchemaZFS(data.zfs) : void 0
93
+ };
94
+ };
95
+ const unmarshalIP = (data) => {
96
+ if (!sdkClient.isJSONObject(data)) {
97
+ throw new TypeError(
98
+ `Unmarshalling the type 'IP' failed as data isn't a dictionary.`
99
+ );
100
+ }
101
+ return {
102
+ address: data.address,
103
+ id: data.id,
104
+ reverse: data.reverse,
105
+ reverseStatus: data.reverse_status,
106
+ reverseStatusMessage: data.reverse_status_message,
107
+ version: data.version
108
+ };
109
+ };
110
+ const unmarshalOSOSField = (data) => {
111
+ if (!sdkClient.isJSONObject(data)) {
112
+ throw new TypeError(
113
+ `Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.`
114
+ );
115
+ }
116
+ return {
117
+ defaultValue: data.default_value,
118
+ editable: data.editable,
119
+ required: data.required
120
+ };
121
+ };
122
+ const unmarshalOS = (data) => {
123
+ if (!sdkClient.isJSONObject(data)) {
124
+ throw new TypeError(
125
+ `Unmarshalling the type 'OS' failed as data isn't a dictionary.`
126
+ );
127
+ }
128
+ return {
129
+ allowed: data.allowed,
130
+ customPartitioningSupported: data.custom_partitioning_supported,
131
+ enabled: data.enabled,
132
+ id: data.id,
133
+ licenseRequired: data.license_required,
134
+ logoUrl: data.logo_url,
135
+ name: data.name,
136
+ password: data.password ? unmarshalOSOSField(data.password) : void 0,
137
+ servicePassword: data.service_password ? unmarshalOSOSField(data.service_password) : void 0,
138
+ serviceUser: data.service_user ? unmarshalOSOSField(data.service_user) : void 0,
139
+ ssh: data.ssh ? unmarshalOSOSField(data.ssh) : void 0,
140
+ user: data.user ? unmarshalOSOSField(data.user) : void 0,
141
+ version: data.version
142
+ };
143
+ };
144
+ const unmarshalCertificationOption = (data) => {
145
+ if (!sdkClient.isJSONObject(data)) {
146
+ throw new TypeError(
147
+ `Unmarshalling the type 'CertificationOption' failed as data isn't a dictionary.`
148
+ );
149
+ }
150
+ return {};
151
+ };
152
+ const unmarshalLicenseOption = (data) => {
153
+ if (!sdkClient.isJSONObject(data)) {
154
+ throw new TypeError(
155
+ `Unmarshalling the type 'LicenseOption' failed as data isn't a dictionary.`
156
+ );
157
+ }
158
+ return {
159
+ osId: data.os_id
160
+ };
161
+ };
162
+ const unmarshalPrivateNetworkOption = (data) => {
163
+ if (!sdkClient.isJSONObject(data)) {
164
+ throw new TypeError(
165
+ `Unmarshalling the type 'PrivateNetworkOption' failed as data isn't a dictionary.`
166
+ );
167
+ }
168
+ return {
169
+ bandwidthInBps: data.bandwidth_in_bps
170
+ };
171
+ };
172
+ const unmarshalPublicBandwidthOption = (data) => {
173
+ if (!sdkClient.isJSONObject(data)) {
174
+ throw new TypeError(
175
+ `Unmarshalling the type 'PublicBandwidthOption' failed as data isn't a dictionary.`
176
+ );
177
+ }
178
+ return {
179
+ bandwidthInBps: data.bandwidth_in_bps
180
+ };
181
+ };
182
+ const unmarshalRemoteAccessOption = (data) => {
183
+ if (!sdkClient.isJSONObject(data)) {
184
+ throw new TypeError(
185
+ `Unmarshalling the type 'RemoteAccessOption' failed as data isn't a dictionary.`
186
+ );
187
+ }
188
+ return {};
189
+ };
190
+ const unmarshalCPU = (data) => {
191
+ if (!sdkClient.isJSONObject(data)) {
192
+ throw new TypeError(
193
+ `Unmarshalling the type 'CPU' failed as data isn't a dictionary.`
194
+ );
195
+ }
196
+ return {
197
+ benchmark: data.benchmark,
198
+ coreCount: data.core_count,
199
+ frequency: data.frequency,
200
+ name: data.name,
201
+ threadCount: data.thread_count
202
+ };
203
+ };
204
+ const unmarshalDisk = (data) => {
205
+ if (!sdkClient.isJSONObject(data)) {
206
+ throw new TypeError(
207
+ `Unmarshalling the type 'Disk' failed as data isn't a dictionary.`
208
+ );
209
+ }
210
+ return {
211
+ capacity: data.capacity,
212
+ type: data.type
213
+ };
214
+ };
215
+ const unmarshalGPU = (data) => {
216
+ if (!sdkClient.isJSONObject(data)) {
217
+ throw new TypeError(
218
+ `Unmarshalling the type 'GPU' failed as data isn't a dictionary.`
219
+ );
220
+ }
221
+ return {
222
+ name: data.name,
223
+ vram: data.vram
224
+ };
225
+ };
226
+ const unmarshalMemory = (data) => {
227
+ if (!sdkClient.isJSONObject(data)) {
228
+ throw new TypeError(
229
+ `Unmarshalling the type 'Memory' failed as data isn't a dictionary.`
230
+ );
231
+ }
232
+ return {
233
+ capacity: data.capacity,
234
+ frequency: data.frequency,
235
+ isEcc: data.is_ecc,
236
+ type: data.type
237
+ };
238
+ };
239
+ const unmarshalOfferOptionOffer = (data) => {
240
+ if (!sdkClient.isJSONObject(data)) {
241
+ throw new TypeError(
242
+ `Unmarshalling the type 'OfferOptionOffer' failed as data isn't a dictionary.`
243
+ );
244
+ }
245
+ return {
246
+ certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
247
+ enabled: data.enabled,
248
+ id: data.id,
249
+ license: data.license ? unmarshalLicenseOption(data.license) : void 0,
250
+ manageable: data.manageable,
251
+ name: data.name,
252
+ osId: data.os_id,
253
+ price: data.price ? sdkClient.unmarshalMoney(data.price) : void 0,
254
+ privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
255
+ publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
256
+ remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0,
257
+ subscriptionPeriod: data.subscription_period
258
+ };
259
+ };
260
+ const unmarshalPersistentMemory = (data) => {
261
+ if (!sdkClient.isJSONObject(data)) {
262
+ throw new TypeError(
263
+ `Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.`
264
+ );
265
+ }
266
+ return {
267
+ capacity: data.capacity,
268
+ frequency: data.frequency,
269
+ type: data.type
270
+ };
271
+ };
272
+ const unmarshalRaidController = (data) => {
273
+ if (!sdkClient.isJSONObject(data)) {
274
+ throw new TypeError(
275
+ `Unmarshalling the type 'RaidController' failed as data isn't a dictionary.`
276
+ );
277
+ }
278
+ return {
279
+ model: data.model,
280
+ raidLevel: data.raid_level
281
+ };
282
+ };
283
+ const unmarshalOffer = (data) => {
284
+ if (!sdkClient.isJSONObject(data)) {
285
+ throw new TypeError(
286
+ `Unmarshalling the type 'Offer' failed as data isn't a dictionary.`
287
+ );
288
+ }
289
+ return {
290
+ bandwidth: data.bandwidth,
291
+ commercialRange: data.commercial_range,
292
+ cpus: sdkClient.unmarshalArrayOfObject(data.cpus, unmarshalCPU),
293
+ disks: sdkClient.unmarshalArrayOfObject(data.disks, unmarshalDisk),
294
+ enable: data.enable,
295
+ fee: data.fee ? sdkClient.unmarshalMoney(data.fee) : void 0,
296
+ gpus: sdkClient.unmarshalArrayOfObject(data.gpus, unmarshalGPU),
297
+ id: data.id,
298
+ incompatibleOsIds: data.incompatible_os_ids,
299
+ maxBandwidth: data.max_bandwidth,
300
+ memories: sdkClient.unmarshalArrayOfObject(data.memories, unmarshalMemory),
301
+ monthlyOfferId: data.monthly_offer_id,
302
+ name: data.name,
303
+ operationPath: data.operation_path,
304
+ options: sdkClient.unmarshalArrayOfObject(data.options, unmarshalOfferOptionOffer),
305
+ persistentMemories: sdkClient.unmarshalArrayOfObject(
306
+ data.persistent_memories,
307
+ unmarshalPersistentMemory
308
+ ),
309
+ pricePerHour: data.price_per_hour ? sdkClient.unmarshalMoney(data.price_per_hour) : void 0,
310
+ pricePerMonth: data.price_per_month ? sdkClient.unmarshalMoney(data.price_per_month) : void 0,
311
+ privateBandwidth: data.private_bandwidth,
312
+ quotaName: data.quota_name,
313
+ raidControllers: sdkClient.unmarshalArrayOfObject(
314
+ data.raid_controllers,
315
+ unmarshalRaidController
316
+ ),
317
+ sharedBandwidth: data.shared_bandwidth,
318
+ stock: data.stock,
319
+ subscriptionPeriod: data.subscription_period,
320
+ tags: data.tags
321
+ };
322
+ };
323
+ const unmarshalOption = (data) => {
324
+ if (!sdkClient.isJSONObject(data)) {
325
+ throw new TypeError(
326
+ `Unmarshalling the type 'Option' failed as data isn't a dictionary.`
327
+ );
328
+ }
329
+ return {
330
+ certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
331
+ id: data.id,
332
+ license: data.license ? unmarshalLicenseOption(data.license) : void 0,
333
+ manageable: data.manageable,
334
+ name: data.name,
335
+ privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
336
+ publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
337
+ remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0
338
+ };
339
+ };
340
+ const unmarshalServerPrivateNetwork = (data) => {
341
+ if (!sdkClient.isJSONObject(data)) {
342
+ throw new TypeError(
343
+ `Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`
344
+ );
345
+ }
346
+ return {
347
+ createdAt: sdkClient.unmarshalDate(data.created_at),
348
+ id: data.id,
349
+ privateNetworkId: data.private_network_id,
350
+ projectId: data.project_id,
351
+ serverId: data.server_id,
352
+ status: data.status,
353
+ updatedAt: sdkClient.unmarshalDate(data.updated_at),
354
+ vlan: data.vlan
355
+ };
356
+ };
357
+ const unmarshalServerInstall = (data) => {
358
+ if (!sdkClient.isJSONObject(data)) {
359
+ throw new TypeError(
360
+ `Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`
361
+ );
362
+ }
363
+ return {
364
+ hostname: data.hostname,
365
+ osId: data.os_id,
366
+ partitioningSchema: data.partitioning_schema ? unmarshalSchema(data.partitioning_schema) : void 0,
367
+ serviceUrl: data.service_url,
368
+ serviceUser: data.service_user,
369
+ sshKeyIds: data.ssh_key_ids,
370
+ status: data.status,
371
+ user: data.user
372
+ };
373
+ };
374
+ const unmarshalServerOption = (data) => {
375
+ if (!sdkClient.isJSONObject(data)) {
376
+ throw new TypeError(
377
+ `Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.`
378
+ );
379
+ }
380
+ return {
381
+ certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
382
+ expiresAt: sdkClient.unmarshalDate(data.expires_at),
383
+ id: data.id,
384
+ license: data.license ? unmarshalLicenseOption(data.license) : void 0,
385
+ manageable: data.manageable,
386
+ name: data.name,
387
+ privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
388
+ publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
389
+ remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0,
390
+ status: data.status
391
+ };
392
+ };
393
+ const unmarshalServerRescueServer = (data) => {
394
+ if (!sdkClient.isJSONObject(data)) {
395
+ throw new TypeError(
396
+ `Unmarshalling the type 'ServerRescueServer' failed as data isn't a dictionary.`
397
+ );
398
+ }
399
+ return {
400
+ password: data.password,
401
+ user: data.user
402
+ };
403
+ };
404
+ const unmarshalServer = (data) => {
405
+ if (!sdkClient.isJSONObject(data)) {
406
+ throw new TypeError(
407
+ `Unmarshalling the type 'Server' failed as data isn't a dictionary.`
408
+ );
409
+ }
410
+ return {
411
+ bootType: data.boot_type,
412
+ createdAt: sdkClient.unmarshalDate(data.created_at),
413
+ description: data.description,
414
+ domain: data.domain,
415
+ id: data.id,
416
+ install: data.install ? unmarshalServerInstall(data.install) : void 0,
417
+ ips: sdkClient.unmarshalArrayOfObject(data.ips, unmarshalIP),
418
+ name: data.name,
419
+ offerId: data.offer_id,
420
+ offerName: data.offer_name,
421
+ options: sdkClient.unmarshalArrayOfObject(data.options, unmarshalServerOption),
422
+ organizationId: data.organization_id,
423
+ pingStatus: data.ping_status,
424
+ projectId: data.project_id,
425
+ rescueServer: data.rescue_server ? unmarshalServerRescueServer(data.rescue_server) : void 0,
426
+ status: data.status,
427
+ tags: data.tags,
428
+ updatedAt: sdkClient.unmarshalDate(data.updated_at),
429
+ zone: data.zone
430
+ };
431
+ };
432
+ const unmarshalSetting = (data) => {
433
+ if (!sdkClient.isJSONObject(data)) {
434
+ throw new TypeError(
435
+ `Unmarshalling the type 'Setting' failed as data isn't a dictionary.`
436
+ );
437
+ }
438
+ return {
439
+ enabled: data.enabled,
440
+ id: data.id,
441
+ projectId: data.project_id,
442
+ type: data.type
443
+ };
444
+ };
445
+ const unmarshalBMCAccess = (data) => {
446
+ if (!sdkClient.isJSONObject(data)) {
447
+ throw new TypeError(
448
+ `Unmarshalling the type 'BMCAccess' failed as data isn't a dictionary.`
449
+ );
450
+ }
451
+ return {
452
+ expiresAt: sdkClient.unmarshalDate(data.expires_at),
453
+ login: data.login,
454
+ password: data.password,
455
+ url: data.url
456
+ };
457
+ };
458
+ const unmarshalGetServerMetricsResponse = (data) => {
459
+ if (!sdkClient.isJSONObject(data)) {
460
+ throw new TypeError(
461
+ `Unmarshalling the type 'GetServerMetricsResponse' failed as data isn't a dictionary.`
462
+ );
463
+ }
464
+ return {
465
+ pings: data.pings ? sdkClient.unmarshalTimeSeries(data.pings) : void 0
466
+ };
467
+ };
468
+ const unmarshalListOSResponse = (data) => {
469
+ if (!sdkClient.isJSONObject(data)) {
470
+ throw new TypeError(
471
+ `Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`
472
+ );
473
+ }
474
+ return {
475
+ os: sdkClient.unmarshalArrayOfObject(data.os, unmarshalOS),
476
+ totalCount: data.total_count
477
+ };
478
+ };
479
+ const unmarshalListOffersResponse = (data) => {
480
+ if (!sdkClient.isJSONObject(data)) {
481
+ throw new TypeError(
482
+ `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`
483
+ );
484
+ }
485
+ return {
486
+ offers: sdkClient.unmarshalArrayOfObject(data.offers, unmarshalOffer),
487
+ totalCount: data.total_count
488
+ };
489
+ };
490
+ const unmarshalListOptionsResponse = (data) => {
491
+ if (!sdkClient.isJSONObject(data)) {
492
+ throw new TypeError(
493
+ `Unmarshalling the type 'ListOptionsResponse' failed as data isn't a dictionary.`
494
+ );
495
+ }
496
+ return {
497
+ options: sdkClient.unmarshalArrayOfObject(data.options, unmarshalOption),
498
+ totalCount: data.total_count
499
+ };
500
+ };
501
+ const unmarshalServerEvent = (data) => {
502
+ if (!sdkClient.isJSONObject(data)) {
503
+ throw new TypeError(
504
+ `Unmarshalling the type 'ServerEvent' failed as data isn't a dictionary.`
505
+ );
506
+ }
507
+ return {
508
+ action: data.action,
509
+ createdAt: sdkClient.unmarshalDate(data.created_at),
510
+ id: data.id,
511
+ updatedAt: sdkClient.unmarshalDate(data.updated_at)
512
+ };
513
+ };
514
+ const unmarshalListServerEventsResponse = (data) => {
515
+ if (!sdkClient.isJSONObject(data)) {
516
+ throw new TypeError(
517
+ `Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.`
518
+ );
519
+ }
520
+ return {
521
+ events: sdkClient.unmarshalArrayOfObject(data.events, unmarshalServerEvent),
522
+ totalCount: data.total_count
523
+ };
524
+ };
525
+ const unmarshalListServerPrivateNetworksResponse = (data) => {
526
+ if (!sdkClient.isJSONObject(data)) {
527
+ throw new TypeError(
528
+ `Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`
529
+ );
530
+ }
531
+ return {
532
+ serverPrivateNetworks: sdkClient.unmarshalArrayOfObject(
533
+ data.server_private_networks,
534
+ unmarshalServerPrivateNetwork
535
+ ),
536
+ totalCount: data.total_count
537
+ };
538
+ };
539
+ const unmarshalListServersResponse = (data) => {
540
+ if (!sdkClient.isJSONObject(data)) {
541
+ throw new TypeError(
542
+ `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`
543
+ );
544
+ }
545
+ return {
546
+ servers: sdkClient.unmarshalArrayOfObject(data.servers, unmarshalServer),
547
+ totalCount: data.total_count
548
+ };
549
+ };
550
+ const unmarshalListSettingsResponse = (data) => {
551
+ if (!sdkClient.isJSONObject(data)) {
552
+ throw new TypeError(
553
+ `Unmarshalling the type 'ListSettingsResponse' failed as data isn't a dictionary.`
554
+ );
555
+ }
556
+ return {
557
+ settings: sdkClient.unmarshalArrayOfObject(data.settings, unmarshalSetting),
558
+ totalCount: data.total_count
559
+ };
560
+ };
561
+ const unmarshalSetServerPrivateNetworksResponse = (data) => {
562
+ if (!sdkClient.isJSONObject(data)) {
563
+ throw new TypeError(
564
+ `Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`
565
+ );
566
+ }
567
+ return {
568
+ serverPrivateNetworks: sdkClient.unmarshalArrayOfObject(
569
+ data.server_private_networks,
570
+ unmarshalServerPrivateNetwork
571
+ )
572
+ };
573
+ };
574
+ const marshalAddOptionServerRequest = (request, defaults) => ({
575
+ expires_at: request.expiresAt
576
+ });
577
+ const marshalSchemaPartition = (request, defaults) => ({
578
+ label: request.label,
579
+ number: request.number,
580
+ size: request.size,
581
+ use_all_available_space: request.useAllAvailableSpace
582
+ });
583
+ const marshalSchemaPool = (request, defaults) => ({
584
+ devices: request.devices,
585
+ filesystem_options: request.filesystemOptions,
586
+ name: request.name,
587
+ options: request.options,
588
+ type: request.type
589
+ });
590
+ const marshalSchemaDisk = (request, defaults) => ({
591
+ device: request.device,
592
+ partitions: request.partitions.map(
593
+ (elt) => marshalSchemaPartition(elt)
594
+ )
595
+ });
596
+ const marshalSchemaFilesystem = (request, defaults) => ({
597
+ device: request.device,
598
+ format: request.format,
599
+ mountpoint: request.mountpoint
600
+ });
601
+ const marshalSchemaRAID = (request, defaults) => ({
602
+ devices: request.devices,
603
+ level: request.level,
604
+ name: request.name
605
+ });
606
+ const marshalSchemaZFS = (request, defaults) => ({
607
+ pools: request.pools.map((elt) => marshalSchemaPool(elt))
608
+ });
609
+ const marshalSchema = (request, defaults) => ({
610
+ disks: request.disks.map((elt) => marshalSchemaDisk(elt)),
611
+ filesystems: request.filesystems.map(
612
+ (elt) => marshalSchemaFilesystem(elt)
613
+ ),
614
+ raids: request.raids.map((elt) => marshalSchemaRAID(elt)),
615
+ zfs: request.zfs !== void 0 ? marshalSchemaZFS(request.zfs) : void 0
616
+ });
617
+ const marshalCreateServerRequestInstall = (request, defaults) => ({
618
+ hostname: request.hostname,
619
+ os_id: request.osId,
620
+ partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0,
621
+ password: request.password,
622
+ service_password: request.servicePassword,
623
+ service_user: request.serviceUser,
624
+ ssh_key_ids: request.sshKeyIds,
625
+ user: request.user
626
+ });
627
+ const marshalCreateServerRequest = (request, defaults) => ({
628
+ description: request.description,
629
+ install: request.install !== void 0 ? marshalCreateServerRequestInstall(request.install) : void 0,
630
+ name: request.name,
631
+ offer_id: request.offerId,
632
+ option_ids: request.optionIds,
633
+ tags: request.tags,
634
+ ...sdkClient.resolveOneOf([
635
+ {
636
+ default: defaults.defaultProjectId,
637
+ param: "project_id",
638
+ value: request.projectId
639
+ },
640
+ {
641
+ default: defaults.defaultOrganizationId,
642
+ param: "organization_id",
643
+ value: request.organizationId
644
+ }
645
+ ])
646
+ });
647
+ const marshalInstallServerRequest = (request, defaults) => ({
648
+ hostname: request.hostname,
649
+ os_id: request.osId,
650
+ partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0,
651
+ password: request.password,
652
+ service_password: request.servicePassword,
653
+ service_user: request.serviceUser,
654
+ ssh_key_ids: request.sshKeyIds,
655
+ user: request.user
656
+ });
657
+ const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
658
+ private_network_id: request.privateNetworkId
659
+ });
660
+ const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({
661
+ private_network_ids: request.privateNetworkIds
662
+ });
663
+ const marshalRebootServerRequest = (request, defaults) => ({
664
+ boot_type: request.bootType
665
+ });
666
+ const marshalStartBMCAccessRequest = (request, defaults) => ({
667
+ ip: request.ip
668
+ });
669
+ const marshalStartServerRequest = (request, defaults) => ({
670
+ boot_type: request.bootType
671
+ });
672
+ const marshalUpdateIPRequest = (request, defaults) => ({
673
+ reverse: request.reverse
674
+ });
675
+ const marshalUpdateServerRequest = (request, defaults) => ({
676
+ description: request.description,
677
+ name: request.name,
678
+ tags: request.tags
679
+ });
680
+ const marshalUpdateSettingRequest = (request, defaults) => ({
681
+ enabled: request.enabled
682
+ });
683
+ const marshalValidatePartitioningSchemaRequest = (request, defaults) => ({
684
+ offer_id: request.offerId,
685
+ os_id: request.osId,
686
+ partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0
687
+ });
688
+ exports.marshalAddOptionServerRequest = marshalAddOptionServerRequest;
689
+ exports.marshalCreateServerRequest = marshalCreateServerRequest;
690
+ exports.marshalInstallServerRequest = marshalInstallServerRequest;
691
+ exports.marshalPrivateNetworkApiAddServerPrivateNetworkRequest = marshalPrivateNetworkApiAddServerPrivateNetworkRequest;
692
+ exports.marshalPrivateNetworkApiSetServerPrivateNetworksRequest = marshalPrivateNetworkApiSetServerPrivateNetworksRequest;
693
+ exports.marshalRebootServerRequest = marshalRebootServerRequest;
694
+ exports.marshalSchema = marshalSchema;
695
+ exports.marshalStartBMCAccessRequest = marshalStartBMCAccessRequest;
696
+ exports.marshalStartServerRequest = marshalStartServerRequest;
697
+ exports.marshalUpdateIPRequest = marshalUpdateIPRequest;
698
+ exports.marshalUpdateServerRequest = marshalUpdateServerRequest;
699
+ exports.marshalUpdateSettingRequest = marshalUpdateSettingRequest;
700
+ exports.marshalValidatePartitioningSchemaRequest = marshalValidatePartitioningSchemaRequest;
701
+ exports.unmarshalBMCAccess = unmarshalBMCAccess;
702
+ exports.unmarshalGetServerMetricsResponse = unmarshalGetServerMetricsResponse;
703
+ exports.unmarshalIP = unmarshalIP;
704
+ exports.unmarshalListOSResponse = unmarshalListOSResponse;
705
+ exports.unmarshalListOffersResponse = unmarshalListOffersResponse;
706
+ exports.unmarshalListOptionsResponse = unmarshalListOptionsResponse;
707
+ exports.unmarshalListServerEventsResponse = unmarshalListServerEventsResponse;
708
+ exports.unmarshalListServerPrivateNetworksResponse = unmarshalListServerPrivateNetworksResponse;
709
+ exports.unmarshalListServersResponse = unmarshalListServersResponse;
710
+ exports.unmarshalListSettingsResponse = unmarshalListSettingsResponse;
711
+ exports.unmarshalOS = unmarshalOS;
712
+ exports.unmarshalOffer = unmarshalOffer;
713
+ exports.unmarshalOption = unmarshalOption;
714
+ exports.unmarshalSchema = unmarshalSchema;
715
+ exports.unmarshalServer = unmarshalServer;
716
+ exports.unmarshalServerPrivateNetwork = unmarshalServerPrivateNetwork;
717
+ exports.unmarshalSetServerPrivateNetworksResponse = unmarshalSetServerPrivateNetworksResponse;
718
+ exports.unmarshalSetting = unmarshalSetting;