@scaleway/sdk-baremetal 2.5.0 → 2.6.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.
@@ -1,10 +1,10 @@
1
1
  //#region src/v1/content.gen.ts
2
2
  /** Lists transient statutes of the enum {@link ServerInstallStatus}. */
3
- var SERVER_INSTALL_TRANSIENT_STATUSES = ["to_install", "installing"];
3
+ const SERVER_INSTALL_TRANSIENT_STATUSES = ["to_install", "installing"];
4
4
  /** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */
5
- var SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ["attaching", "detaching"];
5
+ const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ["attaching", "detaching"];
6
6
  /** Lists transient statutes of the enum {@link ServerStatus}. */
7
- var SERVER_TRANSIENT_STATUSES = [
7
+ const SERVER_TRANSIENT_STATUSES = [
8
8
  "delivering",
9
9
  "stopping",
10
10
  "starting",
@@ -1,6 +1,6 @@
1
1
  import { isJSONObject, marshalBlobToScwFile, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMoney, unmarshalTimeSeries } from "@scaleway/sdk-client";
2
2
  //#region src/v1/marshalling.gen.ts
3
- var unmarshalSchemaPartition = (data) => {
3
+ const unmarshalSchemaPartition = (data) => {
4
4
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SchemaPartition' failed as data isn't a dictionary.`);
5
5
  return {
6
6
  label: data.label,
@@ -9,7 +9,7 @@ var unmarshalSchemaPartition = (data) => {
9
9
  useAllAvailableSpace: data.use_all_available_space
10
10
  };
11
11
  };
12
- var unmarshalSchemaPool = (data) => {
12
+ const unmarshalSchemaPool = (data) => {
13
13
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SchemaPool' failed as data isn't a dictionary.`);
14
14
  return {
15
15
  devices: data.devices,
@@ -19,14 +19,14 @@ var unmarshalSchemaPool = (data) => {
19
19
  type: data.type
20
20
  };
21
21
  };
22
- var unmarshalSchemaDisk = (data) => {
22
+ const unmarshalSchemaDisk = (data) => {
23
23
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SchemaDisk' failed as data isn't a dictionary.`);
24
24
  return {
25
25
  device: data.device,
26
26
  partitions: unmarshalArrayOfObject(data.partitions, unmarshalSchemaPartition)
27
27
  };
28
28
  };
29
- var unmarshalSchemaFilesystem = (data) => {
29
+ const unmarshalSchemaFilesystem = (data) => {
30
30
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SchemaFilesystem' failed as data isn't a dictionary.`);
31
31
  return {
32
32
  device: data.device,
@@ -34,7 +34,7 @@ var unmarshalSchemaFilesystem = (data) => {
34
34
  mountpoint: data.mountpoint
35
35
  };
36
36
  };
37
- var unmarshalSchemaRAID = (data) => {
37
+ const unmarshalSchemaRAID = (data) => {
38
38
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SchemaRAID' failed as data isn't a dictionary.`);
39
39
  return {
40
40
  devices: data.devices,
@@ -42,11 +42,11 @@ var unmarshalSchemaRAID = (data) => {
42
42
  name: data.name
43
43
  };
44
44
  };
45
- var unmarshalSchemaZFS = (data) => {
45
+ const unmarshalSchemaZFS = (data) => {
46
46
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SchemaZFS' failed as data isn't a dictionary.`);
47
47
  return { pools: unmarshalArrayOfObject(data.pools, unmarshalSchemaPool) };
48
48
  };
49
- var unmarshalSchema = (data) => {
49
+ const unmarshalSchema = (data) => {
50
50
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Schema' failed as data isn't a dictionary.`);
51
51
  return {
52
52
  disks: unmarshalArrayOfObject(data.disks, unmarshalSchemaDisk),
@@ -55,7 +55,7 @@ var unmarshalSchema = (data) => {
55
55
  zfs: data.zfs ? unmarshalSchemaZFS(data.zfs) : void 0
56
56
  };
57
57
  };
58
- var unmarshalIP = (data) => {
58
+ const unmarshalIP = (data) => {
59
59
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'IP' failed as data isn't a dictionary.`);
60
60
  return {
61
61
  address: data.address,
@@ -66,27 +66,27 @@ var unmarshalIP = (data) => {
66
66
  version: data.version
67
67
  };
68
68
  };
69
- var unmarshalCertificationOption = (data) => {
69
+ const unmarshalCertificationOption = (data) => {
70
70
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CertificationOption' failed as data isn't a dictionary.`);
71
71
  return {};
72
72
  };
73
- var unmarshalLicenseOption = (data) => {
73
+ const unmarshalLicenseOption = (data) => {
74
74
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'LicenseOption' failed as data isn't a dictionary.`);
75
75
  return { osId: data.os_id };
76
76
  };
77
- var unmarshalPrivateNetworkOption = (data) => {
77
+ const unmarshalPrivateNetworkOption = (data) => {
78
78
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PrivateNetworkOption' failed as data isn't a dictionary.`);
79
79
  return { bandwidthInBps: data.bandwidth_in_bps };
80
80
  };
81
- var unmarshalPublicBandwidthOption = (data) => {
81
+ const unmarshalPublicBandwidthOption = (data) => {
82
82
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PublicBandwidthOption' failed as data isn't a dictionary.`);
83
83
  return { bandwidthInBps: data.bandwidth_in_bps };
84
84
  };
85
- var unmarshalRemoteAccessOption = (data) => {
85
+ const unmarshalRemoteAccessOption = (data) => {
86
86
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RemoteAccessOption' failed as data isn't a dictionary.`);
87
87
  return {};
88
88
  };
89
- var unmarshalServerInstall = (data) => {
89
+ const unmarshalServerInstall = (data) => {
90
90
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`);
91
91
  return {
92
92
  hostname: data.hostname,
@@ -99,7 +99,7 @@ var unmarshalServerInstall = (data) => {
99
99
  user: data.user
100
100
  };
101
101
  };
102
- var unmarshalServerOption = (data) => {
102
+ const unmarshalServerOption = (data) => {
103
103
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.`);
104
104
  return {
105
105
  certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
@@ -114,14 +114,14 @@ var unmarshalServerOption = (data) => {
114
114
  status: data.status
115
115
  };
116
116
  };
117
- var unmarshalServerRescueServer = (data) => {
117
+ const unmarshalServerRescueServer = (data) => {
118
118
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerRescueServer' failed as data isn't a dictionary.`);
119
119
  return {
120
120
  password: data.password,
121
121
  user: data.user
122
122
  };
123
123
  };
124
- var unmarshalServer = (data) => {
124
+ const unmarshalServer = (data) => {
125
125
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Server' failed as data isn't a dictionary.`);
126
126
  return {
127
127
  bootType: data.boot_type,
@@ -147,7 +147,7 @@ var unmarshalServer = (data) => {
147
147
  zone: data.zone
148
148
  };
149
149
  };
150
- var unmarshalOSOSField = (data) => {
150
+ const unmarshalOSOSField = (data) => {
151
151
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.`);
152
152
  return {
153
153
  defaultValue: data.default_value,
@@ -155,7 +155,7 @@ var unmarshalOSOSField = (data) => {
155
155
  required: data.required
156
156
  };
157
157
  };
158
- var unmarshalOS = (data) => {
158
+ const unmarshalOS = (data) => {
159
159
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'OS' failed as data isn't a dictionary.`);
160
160
  return {
161
161
  allowed: data.allowed,
@@ -176,7 +176,7 @@ var unmarshalOS = (data) => {
176
176
  zone: data.zone
177
177
  };
178
178
  };
179
- var unmarshalCPU = (data) => {
179
+ const unmarshalCPU = (data) => {
180
180
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CPU' failed as data isn't a dictionary.`);
181
181
  return {
182
182
  benchmark: data.benchmark,
@@ -186,21 +186,21 @@ var unmarshalCPU = (data) => {
186
186
  threadCount: data.thread_count
187
187
  };
188
188
  };
189
- var unmarshalDisk = (data) => {
189
+ const unmarshalDisk = (data) => {
190
190
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Disk' failed as data isn't a dictionary.`);
191
191
  return {
192
192
  capacity: data.capacity,
193
193
  type: data.type
194
194
  };
195
195
  };
196
- var unmarshalGPU = (data) => {
196
+ const unmarshalGPU = (data) => {
197
197
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GPU' failed as data isn't a dictionary.`);
198
198
  return {
199
199
  name: data.name,
200
200
  vram: data.vram
201
201
  };
202
202
  };
203
- var unmarshalMemory = (data) => {
203
+ const unmarshalMemory = (data) => {
204
204
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Memory' failed as data isn't a dictionary.`);
205
205
  return {
206
206
  capacity: data.capacity,
@@ -209,7 +209,7 @@ var unmarshalMemory = (data) => {
209
209
  type: data.type
210
210
  };
211
211
  };
212
- var unmarshalOfferOptionOffer = (data) => {
212
+ const unmarshalOfferOptionOffer = (data) => {
213
213
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'OfferOptionOffer' failed as data isn't a dictionary.`);
214
214
  return {
215
215
  certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
@@ -226,7 +226,7 @@ var unmarshalOfferOptionOffer = (data) => {
226
226
  subscriptionPeriod: data.subscription_period
227
227
  };
228
228
  };
229
- var unmarshalPersistentMemory = (data) => {
229
+ const unmarshalPersistentMemory = (data) => {
230
230
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.`);
231
231
  return {
232
232
  capacity: data.capacity,
@@ -234,14 +234,14 @@ var unmarshalPersistentMemory = (data) => {
234
234
  type: data.type
235
235
  };
236
236
  };
237
- var unmarshalRaidController = (data) => {
237
+ const unmarshalRaidController = (data) => {
238
238
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RaidController' failed as data isn't a dictionary.`);
239
239
  return {
240
240
  model: data.model,
241
241
  raidLevel: data.raid_level
242
242
  };
243
243
  };
244
- var unmarshalOffer = (data) => {
244
+ const unmarshalOffer = (data) => {
245
245
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`);
246
246
  return {
247
247
  bandwidth: data.bandwidth,
@@ -272,7 +272,7 @@ var unmarshalOffer = (data) => {
272
272
  zone: data.zone
273
273
  };
274
274
  };
275
- var unmarshalOption = (data) => {
275
+ const unmarshalOption = (data) => {
276
276
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Option' failed as data isn't a dictionary.`);
277
277
  return {
278
278
  certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
@@ -285,7 +285,7 @@ var unmarshalOption = (data) => {
285
285
  remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0
286
286
  };
287
287
  };
288
- var unmarshalServerPrivateNetwork = (data) => {
288
+ const unmarshalServerPrivateNetwork = (data) => {
289
289
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`);
290
290
  return {
291
291
  createdAt: unmarshalDate(data.created_at),
@@ -298,7 +298,7 @@ var unmarshalServerPrivateNetwork = (data) => {
298
298
  vlan: data.vlan
299
299
  };
300
300
  };
301
- var unmarshalSetting = (data) => {
301
+ const unmarshalSetting = (data) => {
302
302
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Setting' failed as data isn't a dictionary.`);
303
303
  return {
304
304
  enabled: data.enabled,
@@ -307,7 +307,7 @@ var unmarshalSetting = (data) => {
307
307
  type: data.type
308
308
  };
309
309
  };
310
- var unmarshalBMCAccess = (data) => {
310
+ const unmarshalBMCAccess = (data) => {
311
311
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BMCAccess' failed as data isn't a dictionary.`);
312
312
  return {
313
313
  expiresAt: unmarshalDate(data.expires_at),
@@ -316,36 +316,36 @@ var unmarshalBMCAccess = (data) => {
316
316
  url: data.url
317
317
  };
318
318
  };
319
- var unmarshalBatchCreateServersResponse = (data) => {
319
+ const unmarshalBatchCreateServersResponse = (data) => {
320
320
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BatchCreateServersResponse' failed as data isn't a dictionary.`);
321
321
  return { servers: unmarshalArrayOfObject(data.servers, unmarshalServer) };
322
322
  };
323
- var unmarshalGetServerMetricsResponse = (data) => {
323
+ const unmarshalGetServerMetricsResponse = (data) => {
324
324
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetServerMetricsResponse' failed as data isn't a dictionary.`);
325
325
  return { pings: data.pings ? unmarshalTimeSeries(data.pings) : void 0 };
326
326
  };
327
- var unmarshalListOSResponse = (data) => {
327
+ const unmarshalListOSResponse = (data) => {
328
328
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`);
329
329
  return {
330
330
  os: unmarshalArrayOfObject(data.os, unmarshalOS),
331
331
  totalCount: data.total_count
332
332
  };
333
333
  };
334
- var unmarshalListOffersResponse = (data) => {
334
+ const unmarshalListOffersResponse = (data) => {
335
335
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`);
336
336
  return {
337
337
  offers: unmarshalArrayOfObject(data.offers, unmarshalOffer),
338
338
  totalCount: data.total_count
339
339
  };
340
340
  };
341
- var unmarshalListOptionsResponse = (data) => {
341
+ const unmarshalListOptionsResponse = (data) => {
342
342
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListOptionsResponse' failed as data isn't a dictionary.`);
343
343
  return {
344
344
  options: unmarshalArrayOfObject(data.options, unmarshalOption),
345
345
  totalCount: data.total_count
346
346
  };
347
347
  };
348
- var unmarshalServerEvent = (data) => {
348
+ const unmarshalServerEvent = (data) => {
349
349
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerEvent' failed as data isn't a dictionary.`);
350
350
  return {
351
351
  action: data.action,
@@ -354,73 +354,73 @@ var unmarshalServerEvent = (data) => {
354
354
  updatedAt: unmarshalDate(data.updated_at)
355
355
  };
356
356
  };
357
- var unmarshalListServerEventsResponse = (data) => {
357
+ const unmarshalListServerEventsResponse = (data) => {
358
358
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.`);
359
359
  return {
360
360
  events: unmarshalArrayOfObject(data.events, unmarshalServerEvent),
361
361
  totalCount: data.total_count
362
362
  };
363
363
  };
364
- var unmarshalListServerPrivateNetworksResponse = (data) => {
364
+ const unmarshalListServerPrivateNetworksResponse = (data) => {
365
365
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`);
366
366
  return {
367
367
  serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork),
368
368
  totalCount: data.total_count
369
369
  };
370
370
  };
371
- var unmarshalListServersResponse = (data) => {
371
+ const unmarshalListServersResponse = (data) => {
372
372
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`);
373
373
  return {
374
374
  servers: unmarshalArrayOfObject(data.servers, unmarshalServer),
375
375
  totalCount: data.total_count
376
376
  };
377
377
  };
378
- var unmarshalListSettingsResponse = (data) => {
378
+ const unmarshalListSettingsResponse = (data) => {
379
379
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSettingsResponse' failed as data isn't a dictionary.`);
380
380
  return {
381
381
  settings: unmarshalArrayOfObject(data.settings, unmarshalSetting),
382
382
  totalCount: data.total_count
383
383
  };
384
384
  };
385
- var unmarshalSetServerPrivateNetworksResponse = (data) => {
385
+ const unmarshalSetServerPrivateNetworksResponse = (data) => {
386
386
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`);
387
387
  return { serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork) };
388
388
  };
389
- var marshalSchemaPartition = (request, defaults) => ({
389
+ const marshalSchemaPartition = (request, defaults) => ({
390
390
  label: request.label,
391
391
  number: request.number,
392
392
  size: request.size,
393
393
  use_all_available_space: request.useAllAvailableSpace
394
394
  });
395
- var marshalSchemaPool = (request, defaults) => ({
395
+ const marshalSchemaPool = (request, defaults) => ({
396
396
  devices: request.devices,
397
397
  filesystem_options: request.filesystemOptions,
398
398
  name: request.name,
399
399
  options: request.options,
400
400
  type: request.type
401
401
  });
402
- var marshalSchemaDisk = (request, defaults) => ({
402
+ const marshalSchemaDisk = (request, defaults) => ({
403
403
  device: request.device,
404
404
  partitions: request.partitions.map((elt) => marshalSchemaPartition(elt, defaults))
405
405
  });
406
- var marshalSchemaFilesystem = (request, defaults) => ({
406
+ const marshalSchemaFilesystem = (request, defaults) => ({
407
407
  device: request.device,
408
408
  format: request.format,
409
409
  mountpoint: request.mountpoint
410
410
  });
411
- var marshalSchemaRAID = (request, defaults) => ({
411
+ const marshalSchemaRAID = (request, defaults) => ({
412
412
  devices: request.devices,
413
413
  level: request.level,
414
414
  name: request.name
415
415
  });
416
- var marshalSchemaZFS = (request, defaults) => ({ pools: request.pools.map((elt) => marshalSchemaPool(elt, defaults)) });
417
- var marshalSchema = (request, defaults) => ({
416
+ const marshalSchemaZFS = (request, defaults) => ({ pools: request.pools.map((elt) => marshalSchemaPool(elt, defaults)) });
417
+ const marshalSchema = (request, defaults) => ({
418
418
  disks: request.disks.map((elt) => marshalSchemaDisk(elt, defaults)),
419
419
  filesystems: request.filesystems.map((elt) => marshalSchemaFilesystem(elt, defaults)),
420
420
  raids: request.raids.map((elt) => marshalSchemaRAID(elt, defaults)),
421
421
  zfs: request.zfs !== void 0 ? marshalSchemaZFS(request.zfs, defaults) : void 0
422
422
  });
423
- var marshalCreateServerRequestInstall = (request, defaults) => ({
423
+ const marshalCreateServerRequestInstall = (request, defaults) => ({
424
424
  hostname: request.hostname,
425
425
  os_id: request.osId,
426
426
  partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema, defaults) : void 0,
@@ -430,7 +430,7 @@ var marshalCreateServerRequestInstall = (request, defaults) => ({
430
430
  ssh_key_ids: request.sshKeyIds,
431
431
  user: request.user
432
432
  });
433
- var marshalCreateServerRequest = (request, defaults) => ({
433
+ const marshalCreateServerRequest = (request, defaults) => ({
434
434
  description: request.description,
435
435
  install: request.install !== void 0 ? marshalCreateServerRequestInstall(request.install, defaults) : void 0,
436
436
  name: request.name,
@@ -449,17 +449,17 @@ var marshalCreateServerRequest = (request, defaults) => ({
449
449
  value: request.organizationId
450
450
  }])
451
451
  });
452
- var marshalAddOptionServerRequest = (request, defaults) => ({ expires_at: request.expiresAt });
453
- var marshalBatchCreateServersRequestServerConfig = (request, defaults) => ({
452
+ const marshalAddOptionServerRequest = (request, defaults) => ({ expires_at: request.expiresAt });
453
+ const marshalBatchCreateServersRequestServerConfig = (request, defaults) => ({
454
454
  description: request.description,
455
455
  hostname: request.hostname,
456
456
  tags: request.tags
457
457
  });
458
- var marshalBatchCreateServersRequest = (request, defaults) => ({
458
+ const marshalBatchCreateServersRequest = (request, defaults) => ({
459
459
  common_configuration: request.commonConfiguration !== void 0 ? marshalCreateServerRequest(request.commonConfiguration, defaults) : void 0,
460
460
  servers: request.servers !== void 0 ? request.servers.map((elt) => marshalBatchCreateServersRequestServerConfig(elt, defaults)) : void 0
461
461
  });
462
- var marshalInstallServerRequest = async (request, defaults) => ({
462
+ const marshalInstallServerRequest = async (request, defaults) => ({
463
463
  hostname: request.hostname,
464
464
  os_id: request.osId,
465
465
  partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema, defaults) : void 0,
@@ -470,27 +470,27 @@ var marshalInstallServerRequest = async (request, defaults) => ({
470
470
  user: request.user,
471
471
  user_data: request.userData !== void 0 ? await marshalBlobToScwFile(request.userData) : void 0
472
472
  });
473
- var marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({ private_network_id: request.privateNetworkId });
474
- var marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({ private_network_ids: request.privateNetworkIds });
475
- var marshalRebootServerRequest = (request, defaults) => ({
473
+ const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({ private_network_id: request.privateNetworkId });
474
+ const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({ private_network_ids: request.privateNetworkIds });
475
+ const marshalRebootServerRequest = (request, defaults) => ({
476
476
  boot_type: request.bootType,
477
477
  ssh_key_ids: request.sshKeyIds
478
478
  });
479
- var marshalStartBMCAccessRequest = (request, defaults) => ({ ip: request.ip });
480
- var marshalStartServerRequest = (request, defaults) => ({
479
+ const marshalStartBMCAccessRequest = (request, defaults) => ({ ip: request.ip });
480
+ const marshalStartServerRequest = (request, defaults) => ({
481
481
  boot_type: request.bootType,
482
482
  ssh_key_ids: request.sshKeyIds
483
483
  });
484
- var marshalUpdateIPRequest = (request, defaults) => ({ reverse: request.reverse });
485
- var marshalUpdateServerRequest = (request, defaults) => ({
484
+ const marshalUpdateIPRequest = (request, defaults) => ({ reverse: request.reverse });
485
+ const marshalUpdateServerRequest = (request, defaults) => ({
486
486
  description: request.description,
487
487
  name: request.name,
488
488
  protected: request.protected,
489
489
  tags: request.tags,
490
490
  user_data: request.userData
491
491
  });
492
- var marshalUpdateSettingRequest = (request, defaults) => ({ enabled: request.enabled });
493
- var marshalValidatePartitioningSchemaRequest = (request, defaults) => ({
492
+ const marshalUpdateSettingRequest = (request, defaults) => ({ enabled: request.enabled });
493
+ const marshalValidatePartitioningSchemaRequest = (request, defaults) => ({
494
494
  offer_id: request.offerId,
495
495
  os_id: request.osId,
496
496
  partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema, defaults) : void 0
@@ -1,5 +1,5 @@
1
1
  //#region src/v1/metadata.gen.ts
2
- var queriesMetadata = {
2
+ const queriesMetadata = {
3
3
  namespace: "baremetal",
4
4
  version: "v1",
5
5
  folderName: "baremetalv1",
@@ -13,71 +13,71 @@ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
13
13
  ListSettingsRequest: () => ListSettingsRequest,
14
14
  UpdateServerRequest: () => UpdateServerRequest
15
15
  });
16
- var BatchCreateServersRequestServerConfig = {
16
+ const BatchCreateServersRequestServerConfig = {
17
17
  description: { maxLength: 255 },
18
18
  hostname: { minLength: 1 }
19
19
  };
20
- var CreateServerRequest = {
20
+ const CreateServerRequest = {
21
21
  description: { maxLength: 255 },
22
22
  name: { minLength: 1 }
23
23
  };
24
- var CreateServerRequestInstall = {
24
+ const CreateServerRequestInstall = {
25
25
  hostname: { maxLength: 255 },
26
26
  password: { maxLength: 255 },
27
27
  servicePassword: { maxLength: 255 },
28
28
  serviceUser: { maxLength: 255 },
29
29
  user: { maxLength: 255 }
30
30
  };
31
- var InstallServerRequest = {
31
+ const InstallServerRequest = {
32
32
  hostname: { maxLength: 255 },
33
33
  password: { maxLength: 255 },
34
34
  servicePassword: { maxLength: 255 },
35
35
  serviceUser: { maxLength: 255 },
36
36
  user: { maxLength: 255 }
37
37
  };
38
- var ListOSRequest = {
38
+ const ListOSRequest = {
39
39
  page: { greaterThan: 0 },
40
40
  pageSize: {
41
41
  greaterThan: 0,
42
42
  lessThanOrEqual: 100
43
43
  }
44
44
  };
45
- var ListOffersRequest = {
45
+ const ListOffersRequest = {
46
46
  page: { greaterThan: 0 },
47
47
  pageSize: {
48
48
  greaterThan: 0,
49
49
  lessThanOrEqual: 100
50
50
  }
51
51
  };
52
- var ListOptionsRequest = {
52
+ const ListOptionsRequest = {
53
53
  page: { greaterThan: 0 },
54
54
  pageSize: {
55
55
  greaterThan: 0,
56
56
  lessThanOrEqual: 100
57
57
  }
58
58
  };
59
- var ListServerEventsRequest = {
59
+ const ListServerEventsRequest = {
60
60
  page: { greaterThan: 0 },
61
61
  pageSize: {
62
62
  greaterThan: 0,
63
63
  lessThanOrEqual: 100
64
64
  }
65
65
  };
66
- var ListServersRequest = {
66
+ const ListServersRequest = {
67
67
  page: { greaterThan: 0 },
68
68
  pageSize: {
69
69
  greaterThan: 0,
70
70
  lessThanOrEqual: 100
71
71
  }
72
72
  };
73
- var ListSettingsRequest = {
73
+ const ListSettingsRequest = {
74
74
  page: { greaterThan: 0 },
75
75
  pageSize: {
76
76
  greaterThan: 0,
77
77
  lessThanOrEqual: 100
78
78
  }
79
79
  };
80
- var UpdateServerRequest = {
80
+ const UpdateServerRequest = {
81
81
  description: { maxLength: 255 },
82
82
  name: { maxLength: 255 }
83
83
  };
@@ -1,68 +1,46 @@
1
1
  import { marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalListServerPrivateNetworksResponse, unmarshalServerPrivateNetwork, unmarshalSetServerPrivateNetworksResponse } from "./marshalling.gen.js";
2
2
  import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
3
3
  //#region src/v3/api.gen.ts
4
- var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
4
+ const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
5
  /**
6
6
  * Elastic Metal - Private Networks API.
7
7
  */
8
8
  var PrivateNetworkAPI = class extends API {
9
- /**
10
- * Locality of this API.
11
- * type {'zone','region','global','unspecified'}
12
- */
13
- static LOCALITY = toApiLocality({ zones: [
14
- "fr-par-1",
15
- "fr-par-2",
16
- "nl-ams-1",
17
- "nl-ams-2",
18
- "pl-waw-2",
19
- "pl-waw-3"
20
- ] });
21
- /**
22
- * Add a server to a Private Network. Add an Elastic Metal server to a Private Network.
23
- *
24
- * @param request - The request {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
25
- * @returns A Promise of ServerPrivateNetwork
26
- */
27
- addServerPrivateNetwork = (request) => this.client.fetch({
28
- body: JSON.stringify(marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)),
29
- headers: jsonContentHeaders,
30
- method: "POST",
31
- path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
32
- }, unmarshalServerPrivateNetwork);
33
- /**
34
- * Set multiple Private Networks on a server. Configure multiple Private Networks on an Elastic Metal server.
35
- *
36
- * @param request - The request {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
37
- * @returns A Promise of SetServerPrivateNetworksResponse
38
- */
39
- setServerPrivateNetworks = (request) => this.client.fetch({
40
- body: JSON.stringify(marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)),
41
- headers: jsonContentHeaders,
42
- method: "PUT",
43
- path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
44
- }, unmarshalSetServerPrivateNetworksResponse);
45
- pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch({
46
- method: "GET",
47
- path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,
48
- urlParams: urlParams(["ipam_ip_ids", request.ipamIpIds], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_network_id", request.privateNetworkId], ["project_id", request.projectId], ["server_id", request.serverId])
49
- }, unmarshalListServerPrivateNetworksResponse);
50
- /**
51
- * List the Private Networks of a server. List the Private Networks of an Elastic Metal server.
52
- *
53
- * @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
54
- * @returns A Promise of ListServerPrivateNetworksResponse
55
- */
56
- listServerPrivateNetworks = (request = {}) => enrichForPagination("serverPrivateNetworks", this.pageOfListServerPrivateNetworks, request);
57
- /**
58
- * Delete a Private Network.
59
- *
60
- * @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
61
- */
62
- deleteServerPrivateNetwork = (request) => this.client.fetch({
63
- method: "DELETE",
64
- path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
65
- });
9
+ constructor(..._args) {
10
+ super(..._args);
11
+ this.addServerPrivateNetwork = (request) => this.client.fetch({
12
+ body: JSON.stringify(marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)),
13
+ headers: jsonContentHeaders,
14
+ method: "POST",
15
+ path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
16
+ }, unmarshalServerPrivateNetwork);
17
+ this.setServerPrivateNetworks = (request) => this.client.fetch({
18
+ body: JSON.stringify(marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)),
19
+ headers: jsonContentHeaders,
20
+ method: "PUT",
21
+ path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
22
+ }, unmarshalSetServerPrivateNetworksResponse);
23
+ this.pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch({
24
+ method: "GET",
25
+ path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,
26
+ urlParams: urlParams(["ipam_ip_ids", request.ipamIpIds], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_network_id", request.privateNetworkId], ["project_id", request.projectId], ["server_id", request.serverId])
27
+ }, unmarshalListServerPrivateNetworksResponse);
28
+ this.listServerPrivateNetworks = (request = {}) => enrichForPagination("serverPrivateNetworks", this.pageOfListServerPrivateNetworks, request);
29
+ this.deleteServerPrivateNetwork = (request) => this.client.fetch({
30
+ method: "DELETE",
31
+ path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
32
+ });
33
+ }
34
+ static {
35
+ this.LOCALITY = toApiLocality({ zones: [
36
+ "fr-par-1",
37
+ "fr-par-2",
38
+ "nl-ams-1",
39
+ "nl-ams-2",
40
+ "pl-waw-2",
41
+ "pl-waw-3"
42
+ ] });
43
+ }
66
44
  };
67
45
  //#endregion
68
46
  export { PrivateNetworkAPI };
@@ -1,5 +1,5 @@
1
1
  //#region src/v3/content.gen.ts
2
2
  /** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */
3
- var SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ["attaching", "detaching"];
3
+ const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ["attaching", "detaching"];
4
4
  //#endregion
5
5
  export { SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES };