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