@scaleway/sdk-baremetal 1.0.4 → 1.1.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.
@@ -7,15 +7,20 @@ const jsonContentHeaders = {
7
7
  "Content-Type": "application/json; charset=utf-8"
8
8
  };
9
9
  class API extends sdkClient.API {
10
- /** Lists the available zones of the API. */
11
- static LOCALITIES = [
12
- "fr-par-1",
13
- "fr-par-2",
14
- "nl-ams-1",
15
- "nl-ams-2",
16
- "pl-waw-2",
17
- "pl-waw-3"
18
- ];
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static LOCALITY = sdkClient.toApiLocality({
15
+ zones: [
16
+ "fr-par-1",
17
+ "fr-par-2",
18
+ "nl-ams-1",
19
+ "nl-ams-2",
20
+ "pl-waw-2",
21
+ "pl-waw-3"
22
+ ]
23
+ });
19
24
  pageOfListServers = (request = {}) => this.client.fetch(
20
25
  {
21
26
  method: "GET",
@@ -90,7 +95,7 @@ class API extends sdkClient.API {
90
95
  marshalling_gen.unmarshalServer
91
96
  );
92
97
  /**
93
- * Update an Elastic Metal server. Update the server associated with the ID. You can update parameters such as the server's name, tags and description. Any parameters left null in the request body are not updated.
98
+ * Update an Elastic Metal server. Update the server associated with the ID. You can update parameters such as the server's name, tags, description and protection flag. Any parameters left null in the request body are not updated.
94
99
  *
95
100
  * @param request - The request {@link UpdateServerRequest}
96
101
  * @returns A Promise of Server
@@ -504,8 +509,13 @@ class API extends sdkClient.API {
504
509
  );
505
510
  }
506
511
  class PrivateNetworkAPI extends sdkClient.API {
507
- /** Lists the available zones of the API. */
508
- static LOCALITIES = ["fr-par-2"];
512
+ /**
513
+ * Locality of this API.
514
+ * type ∈ {'zone','region','global','unspecified'}
515
+ */
516
+ static LOCALITY = sdkClient.toApiLocality({
517
+ zones: ["fr-par-2"]
518
+ });
509
519
  /**
510
520
  * Add a server to a Private Network.
511
521
  *
@@ -1,14 +1,17 @@
1
+ import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client';
1
2
  import { API as ParentAPI } from '@scaleway/sdk-client';
2
- import type { Zone as ScwZone, WaitForOptions } from '@scaleway/sdk-client';
3
- import type { AddOptionServerRequest, BMCAccess, CreateServerRequest, DeleteOptionServerRequest, DeleteServerRequest, GetBMCAccessRequest, GetDefaultPartitioningSchemaRequest, GetOSRequest, GetOfferRequest, GetOptionRequest, GetServerMetricsRequest, GetServerMetricsResponse, GetServerRequest, IP, InstallServerRequest, ListOSRequest, ListOSResponse, ListOffersRequest, ListOffersResponse, ListOptionsRequest, ListOptionsResponse, ListServerEventsRequest, ListServerEventsResponse, ListServerPrivateNetworksResponse, ListServersRequest, ListServersResponse, ListSettingsRequest, ListSettingsResponse, MigrateServerToMonthlyOfferRequest, OS, Offer, Option, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, Schema, Server, ServerPrivateNetwork, SetServerPrivateNetworksResponse, Setting, StartBMCAccessRequest, StartServerRequest, StopBMCAccessRequest, StopServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest, ValidatePartitioningSchemaRequest } from './types.gen';
3
+ import type { AddOptionServerRequest, BMCAccess, CreateServerRequest, DeleteOptionServerRequest, DeleteServerRequest, GetBMCAccessRequest, GetDefaultPartitioningSchemaRequest, GetOfferRequest, GetOptionRequest, GetOSRequest, GetServerMetricsRequest, GetServerMetricsResponse, GetServerRequest, InstallServerRequest, IP, ListOffersRequest, ListOffersResponse, ListOptionsRequest, ListOptionsResponse, ListOSRequest, ListOSResponse, ListServerEventsRequest, ListServerEventsResponse, ListServerPrivateNetworksResponse, ListServersRequest, ListServersResponse, ListSettingsRequest, ListSettingsResponse, MigrateServerToMonthlyOfferRequest, Offer, Option, OS, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, Schema, Server, ServerPrivateNetwork, SetServerPrivateNetworksResponse, Setting, StartBMCAccessRequest, StartServerRequest, StopBMCAccessRequest, StopServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest, ValidatePartitioningSchemaRequest } from './types.gen';
4
4
  /**
5
5
  * Elastic Metal API.
6
6
 
7
7
  This API allows you to manage your Elastic Metal servers.
8
8
  */
9
9
  export declare class API extends ParentAPI {
10
- /** Lists the available zones of the API. */
11
- static readonly LOCALITIES: ScwZone[];
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static readonly LOCALITY: ApiLocality;
12
15
  protected pageOfListServers: (request?: Readonly<ListServersRequest>) => Promise<ListServersResponse>;
13
16
  /**
14
17
  * List Elastic Metal servers for an Organization. List Elastic Metal servers for a specific Organization.
@@ -43,7 +46,7 @@ export declare class API extends ParentAPI {
43
46
  */
44
47
  createServer: (request: Readonly<CreateServerRequest>) => Promise<Server>;
45
48
  /**
46
- * Update an Elastic Metal server. Update the server associated with the ID. You can update parameters such as the server's name, tags and description. Any parameters left null in the request body are not updated.
49
+ * Update an Elastic Metal server. Update the server associated with the ID. You can update parameters such as the server's name, tags, description and protection flag. Any parameters left null in the request body are not updated.
47
50
  *
48
51
  * @param request - The request {@link UpdateServerRequest}
49
52
  * @returns A Promise of Server
@@ -243,8 +246,11 @@ export declare class API extends ParentAPI {
243
246
  * Elastic Metal - Private Network API.
244
247
  */
245
248
  export declare class PrivateNetworkAPI extends ParentAPI {
246
- /** Lists the available zones of the API. */
247
- static readonly LOCALITIES: ScwZone[];
249
+ /**
250
+ * Locality of this API.
251
+ * type ∈ {'zone','region','global','unspecified'}
252
+ */
253
+ static readonly LOCALITY: ApiLocality;
248
254
  /**
249
255
  * Add a server to a Private Network.
250
256
  *
@@ -1,19 +1,24 @@
1
- import { API as API$1, urlParams, validatePathParam, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
1
+ import { API as API$1, toApiLocality, urlParams, validatePathParam, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
2
2
  import { SERVER_TRANSIENT_STATUSES } from "./content.gen.js";
3
3
  import { unmarshalListServersResponse, unmarshalServer, marshalCreateServerRequest, marshalUpdateServerRequest, marshalInstallServerRequest, unmarshalGetServerMetricsResponse, marshalRebootServerRequest, marshalStartServerRequest, unmarshalListServerEventsResponse, unmarshalSchema, marshalValidatePartitioningSchemaRequest, marshalStartBMCAccessRequest, unmarshalBMCAccess, marshalUpdateIPRequest, unmarshalIP, marshalAddOptionServerRequest, unmarshalListOffersResponse, unmarshalOffer, unmarshalOption, unmarshalListOptionsResponse, unmarshalListSettingsResponse, marshalUpdateSettingRequest, unmarshalSetting, unmarshalListOSResponse, unmarshalOS, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, unmarshalServerPrivateNetwork, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalSetServerPrivateNetworksResponse, unmarshalListServerPrivateNetworksResponse } from "./marshalling.gen.js";
4
4
  const jsonContentHeaders = {
5
5
  "Content-Type": "application/json; charset=utf-8"
6
6
  };
7
7
  class API extends API$1 {
8
- /** Lists the available zones of the API. */
9
- static LOCALITIES = [
10
- "fr-par-1",
11
- "fr-par-2",
12
- "nl-ams-1",
13
- "nl-ams-2",
14
- "pl-waw-2",
15
- "pl-waw-3"
16
- ];
8
+ /**
9
+ * Locality of this API.
10
+ * type ∈ {'zone','region','global','unspecified'}
11
+ */
12
+ static LOCALITY = toApiLocality({
13
+ 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
+ });
17
22
  pageOfListServers = (request = {}) => this.client.fetch(
18
23
  {
19
24
  method: "GET",
@@ -88,7 +93,7 @@ class API extends API$1 {
88
93
  unmarshalServer
89
94
  );
90
95
  /**
91
- * Update an Elastic Metal server. Update the server associated with the ID. You can update parameters such as the server's name, tags and description. Any parameters left null in the request body are not updated.
96
+ * Update an Elastic Metal server. Update the server associated with the ID. You can update parameters such as the server's name, tags, description and protection flag. Any parameters left null in the request body are not updated.
92
97
  *
93
98
  * @param request - The request {@link UpdateServerRequest}
94
99
  * @returns A Promise of Server
@@ -502,8 +507,13 @@ class API extends API$1 {
502
507
  );
503
508
  }
504
509
  class PrivateNetworkAPI extends API$1 {
505
- /** Lists the available zones of the API. */
506
- static LOCALITIES = ["fr-par-2"];
510
+ /**
511
+ * Locality of this API.
512
+ * type ∈ {'zone','region','global','unspecified'}
513
+ */
514
+ static LOCALITY = toApiLocality({
515
+ zones: ["fr-par-2"]
516
+ });
507
517
  /**
508
518
  * Add a server to a Private Network.
509
519
  *
@@ -1,5 +1,5 @@
1
1
  export { API, PrivateNetworkAPI, } from './api.gen';
2
2
  export * from './content.gen';
3
3
  export * from './marshalling.gen';
4
- export type { AddOptionServerRequest, BMCAccess, CPU, CertificationOption, CreateServerRequest, CreateServerRequestInstall, DeleteOptionServerRequest, DeleteServerRequest, Disk, GPU, GetBMCAccessRequest, GetDefaultPartitioningSchemaRequest, GetOSRequest, GetOfferRequest, GetOptionRequest, GetServerMetricsRequest, GetServerMetricsResponse, GetServerRequest, IP, IPReverseStatus, IPVersion, InstallServerRequest, LicenseOption, ListOSRequest, ListOSResponse, ListOffersRequest, ListOffersResponse, ListOptionsRequest, ListOptionsResponse, ListServerEventsRequest, ListServerEventsRequestOrderBy, ListServerEventsResponse, ListServerPrivateNetworksRequestOrderBy, ListServerPrivateNetworksResponse, ListServersRequest, ListServersRequestOrderBy, ListServersResponse, ListSettingsRequest, ListSettingsRequestOrderBy, ListSettingsResponse, Memory, MigrateServerToMonthlyOfferRequest, OS, OSOSField, Offer, OfferOptionOffer, OfferStock, OfferSubscriptionPeriod, Option, PersistentMemory, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, PrivateNetworkOption, PublicBandwidthOption, RaidController, RebootServerRequest, RemoteAccessOption, Schema, SchemaDisk, SchemaFilesystem, SchemaFilesystemFormat, SchemaPartition, SchemaPartitionLabel, SchemaPool, SchemaPoolType, SchemaRAID, SchemaRAIDLevel, SchemaZFS, Server, ServerBootType, ServerEvent, ServerInstall, ServerInstallStatus, ServerOption, ServerOptionOptionStatus, ServerPingStatus, ServerPrivateNetwork, ServerPrivateNetworkStatus, ServerRescueServer, ServerStatus, SetServerPrivateNetworksResponse, Setting, SettingType, StartBMCAccessRequest, StartServerRequest, StopBMCAccessRequest, StopServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest, ValidatePartitioningSchemaRequest, } from './types.gen';
4
+ export type { AddOptionServerRequest, BMCAccess, CertificationOption, CPU, CreateServerRequest, CreateServerRequestInstall, DeleteOptionServerRequest, DeleteServerRequest, Disk, GetBMCAccessRequest, GetDefaultPartitioningSchemaRequest, GetOfferRequest, GetOptionRequest, GetOSRequest, GetServerMetricsRequest, GetServerMetricsResponse, GetServerRequest, GPU, InstallServerRequest, IP, IPReverseStatus, IPVersion, LicenseOption, ListOffersRequest, ListOffersResponse, ListOptionsRequest, ListOptionsResponse, ListOSRequest, ListOSResponse, ListServerEventsRequest, ListServerEventsRequestOrderBy, ListServerEventsResponse, ListServerPrivateNetworksRequestOrderBy, ListServerPrivateNetworksResponse, ListServersRequest, ListServersRequestOrderBy, ListServersResponse, ListSettingsRequest, ListSettingsRequestOrderBy, ListSettingsResponse, Memory, MigrateServerToMonthlyOfferRequest, Offer, OfferOptionOffer, OfferStock, OfferSubscriptionPeriod, Option, OS, OSOSField, PersistentMemory, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, PrivateNetworkOption, PublicBandwidthOption, RaidController, RebootServerRequest, RemoteAccessOption, Schema, SchemaDisk, SchemaFilesystem, SchemaFilesystemFormat, SchemaPartition, SchemaPartitionLabel, SchemaPool, SchemaPoolType, SchemaRAID, SchemaRAIDLevel, SchemaZFS, Server, ServerBootType, ServerEvent, ServerInstall, ServerInstallStatus, ServerOption, ServerOptionOptionStatus, ServerPingStatus, ServerPrivateNetwork, ServerPrivateNetworkStatus, ServerRescueServer, ServerStatus, SetServerPrivateNetworksResponse, Setting, SettingType, StartBMCAccessRequest, StartServerRequest, StopBMCAccessRequest, StopServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest, ValidatePartitioningSchemaRequest, } from './types.gen';
5
5
  export * as ValidationRules from './validation-rules.gen';
@@ -107,40 +107,6 @@ const unmarshalIP = (data) => {
107
107
  version: data.version
108
108
  };
109
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
110
  const unmarshalCertificationOption = (data) => {
145
111
  if (!sdkClient.isJSONObject(data)) {
146
112
  throw new TypeError(
@@ -187,6 +153,116 @@ const unmarshalRemoteAccessOption = (data) => {
187
153
  }
188
154
  return {};
189
155
  };
156
+ const unmarshalServerInstall = (data) => {
157
+ if (!sdkClient.isJSONObject(data)) {
158
+ throw new TypeError(
159
+ `Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`
160
+ );
161
+ }
162
+ return {
163
+ hostname: data.hostname,
164
+ osId: data.os_id,
165
+ partitioningSchema: data.partitioning_schema ? unmarshalSchema(data.partitioning_schema) : void 0,
166
+ serviceUrl: data.service_url,
167
+ serviceUser: data.service_user,
168
+ sshKeyIds: data.ssh_key_ids,
169
+ status: data.status,
170
+ user: data.user
171
+ };
172
+ };
173
+ const unmarshalServerOption = (data) => {
174
+ if (!sdkClient.isJSONObject(data)) {
175
+ throw new TypeError(
176
+ `Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.`
177
+ );
178
+ }
179
+ return {
180
+ certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
181
+ expiresAt: sdkClient.unmarshalDate(data.expires_at),
182
+ id: data.id,
183
+ license: data.license ? unmarshalLicenseOption(data.license) : void 0,
184
+ manageable: data.manageable,
185
+ name: data.name,
186
+ privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
187
+ publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
188
+ remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0,
189
+ status: data.status
190
+ };
191
+ };
192
+ const unmarshalServerRescueServer = (data) => {
193
+ if (!sdkClient.isJSONObject(data)) {
194
+ throw new TypeError(
195
+ `Unmarshalling the type 'ServerRescueServer' failed as data isn't a dictionary.`
196
+ );
197
+ }
198
+ return {
199
+ password: data.password,
200
+ user: data.user
201
+ };
202
+ };
203
+ const unmarshalServer = (data) => {
204
+ if (!sdkClient.isJSONObject(data)) {
205
+ throw new TypeError(
206
+ `Unmarshalling the type 'Server' failed as data isn't a dictionary.`
207
+ );
208
+ }
209
+ return {
210
+ bootType: data.boot_type,
211
+ createdAt: sdkClient.unmarshalDate(data.created_at),
212
+ description: data.description,
213
+ domain: data.domain,
214
+ id: data.id,
215
+ install: data.install ? unmarshalServerInstall(data.install) : void 0,
216
+ ips: sdkClient.unmarshalArrayOfObject(data.ips, unmarshalIP),
217
+ name: data.name,
218
+ offerId: data.offer_id,
219
+ offerName: data.offer_name,
220
+ options: sdkClient.unmarshalArrayOfObject(data.options, unmarshalServerOption),
221
+ organizationId: data.organization_id,
222
+ pingStatus: data.ping_status,
223
+ projectId: data.project_id,
224
+ protected: data.protected,
225
+ rescueServer: data.rescue_server ? unmarshalServerRescueServer(data.rescue_server) : void 0,
226
+ status: data.status,
227
+ tags: data.tags,
228
+ updatedAt: sdkClient.unmarshalDate(data.updated_at),
229
+ zone: data.zone
230
+ };
231
+ };
232
+ const unmarshalOSOSField = (data) => {
233
+ if (!sdkClient.isJSONObject(data)) {
234
+ throw new TypeError(
235
+ `Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.`
236
+ );
237
+ }
238
+ return {
239
+ defaultValue: data.default_value,
240
+ editable: data.editable,
241
+ required: data.required
242
+ };
243
+ };
244
+ const unmarshalOS = (data) => {
245
+ if (!sdkClient.isJSONObject(data)) {
246
+ throw new TypeError(
247
+ `Unmarshalling the type 'OS' failed as data isn't a dictionary.`
248
+ );
249
+ }
250
+ return {
251
+ allowed: data.allowed,
252
+ customPartitioningSupported: data.custom_partitioning_supported,
253
+ enabled: data.enabled,
254
+ id: data.id,
255
+ licenseRequired: data.license_required,
256
+ logoUrl: data.logo_url,
257
+ name: data.name,
258
+ password: data.password ? unmarshalOSOSField(data.password) : void 0,
259
+ servicePassword: data.service_password ? unmarshalOSOSField(data.service_password) : void 0,
260
+ serviceUser: data.service_user ? unmarshalOSOSField(data.service_user) : void 0,
261
+ ssh: data.ssh ? unmarshalOSOSField(data.ssh) : void 0,
262
+ user: data.user ? unmarshalOSOSField(data.user) : void 0,
263
+ version: data.version
264
+ };
265
+ };
190
266
  const unmarshalCPU = (data) => {
191
267
  if (!sdkClient.isJSONObject(data)) {
192
268
  throw new TypeError(
@@ -354,81 +430,6 @@ const unmarshalServerPrivateNetwork = (data) => {
354
430
  vlan: data.vlan
355
431
  };
356
432
  };
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
433
  const unmarshalSetting = (data) => {
433
434
  if (!sdkClient.isJSONObject(data)) {
434
435
  throw new TypeError(
@@ -571,9 +572,6 @@ const unmarshalSetServerPrivateNetworksResponse = (data) => {
571
572
  )
572
573
  };
573
574
  };
574
- const marshalAddOptionServerRequest = (request, defaults) => ({
575
- expires_at: request.expiresAt
576
- });
577
575
  const marshalSchemaPartition = (request, defaults) => ({
578
576
  label: request.label,
579
577
  number: request.number,
@@ -630,6 +628,7 @@ const marshalCreateServerRequest = (request, defaults) => ({
630
628
  name: request.name,
631
629
  offer_id: request.offerId,
632
630
  option_ids: request.optionIds,
631
+ protected: request.protected,
633
632
  tags: request.tags,
634
633
  ...sdkClient.resolveOneOf([
635
634
  {
@@ -644,6 +643,9 @@ const marshalCreateServerRequest = (request, defaults) => ({
644
643
  }
645
644
  ])
646
645
  });
646
+ const marshalAddOptionServerRequest = (request, defaults) => ({
647
+ expires_at: request.expiresAt
648
+ });
647
649
  const marshalInstallServerRequest = (request, defaults) => ({
648
650
  hostname: request.hostname,
649
651
  os_id: request.osId,
@@ -661,13 +663,15 @@ const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaul
661
663
  private_network_ids: request.privateNetworkIds
662
664
  });
663
665
  const marshalRebootServerRequest = (request, defaults) => ({
664
- boot_type: request.bootType
666
+ boot_type: request.bootType,
667
+ ssh_key_ids: request.sshKeyIds
665
668
  });
666
669
  const marshalStartBMCAccessRequest = (request, defaults) => ({
667
670
  ip: request.ip
668
671
  });
669
672
  const marshalStartServerRequest = (request, defaults) => ({
670
- boot_type: request.bootType
673
+ boot_type: request.bootType,
674
+ ssh_key_ids: request.sshKeyIds
671
675
  });
672
676
  const marshalUpdateIPRequest = (request, defaults) => ({
673
677
  reverse: request.reverse
@@ -675,6 +679,7 @@ const marshalUpdateIPRequest = (request, defaults) => ({
675
679
  const marshalUpdateServerRequest = (request, defaults) => ({
676
680
  description: request.description,
677
681
  name: request.name,
682
+ protected: request.protected,
678
683
  tags: request.tags
679
684
  });
680
685
  const marshalUpdateSettingRequest = (request, defaults) => ({
@@ -1,12 +1,12 @@
1
1
  import type { DefaultValues } from '@scaleway/sdk-client';
2
- import type { AddOptionServerRequest, BMCAccess, CreateServerRequest, GetServerMetricsResponse, IP, InstallServerRequest, ListOSResponse, ListOffersResponse, ListOptionsResponse, ListServerEventsResponse, ListServerPrivateNetworksResponse, ListServersResponse, ListSettingsResponse, OS, Offer, Option, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, Schema, Server, ServerPrivateNetwork, SetServerPrivateNetworksResponse, Setting, StartBMCAccessRequest, StartServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest, ValidatePartitioningSchemaRequest } from './types.gen';
2
+ import type { AddOptionServerRequest, BMCAccess, CreateServerRequest, GetServerMetricsResponse, InstallServerRequest, IP, ListOffersResponse, ListOptionsResponse, ListOSResponse, ListServerEventsResponse, ListServerPrivateNetworksResponse, ListServersResponse, ListSettingsResponse, Offer, Option, OS, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, Schema, Server, ServerPrivateNetwork, SetServerPrivateNetworksResponse, Setting, StartBMCAccessRequest, StartServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest, ValidatePartitioningSchemaRequest } from './types.gen';
3
3
  export declare const unmarshalSchema: (data: unknown) => Schema;
4
4
  export declare const unmarshalIP: (data: unknown) => IP;
5
+ export declare const unmarshalServer: (data: unknown) => Server;
5
6
  export declare const unmarshalOS: (data: unknown) => OS;
6
7
  export declare const unmarshalOffer: (data: unknown) => Offer;
7
8
  export declare const unmarshalOption: (data: unknown) => Option;
8
9
  export declare const unmarshalServerPrivateNetwork: (data: unknown) => ServerPrivateNetwork;
9
- export declare const unmarshalServer: (data: unknown) => Server;
10
10
  export declare const unmarshalSetting: (data: unknown) => Setting;
11
11
  export declare const unmarshalBMCAccess: (data: unknown) => BMCAccess;
12
12
  export declare const unmarshalGetServerMetricsResponse: (data: unknown) => GetServerMetricsResponse;
@@ -18,9 +18,9 @@ export declare const unmarshalListServerPrivateNetworksResponse: (data: unknown)
18
18
  export declare const unmarshalListServersResponse: (data: unknown) => ListServersResponse;
19
19
  export declare const unmarshalListSettingsResponse: (data: unknown) => ListSettingsResponse;
20
20
  export declare const unmarshalSetServerPrivateNetworksResponse: (data: unknown) => SetServerPrivateNetworksResponse;
21
- export declare const marshalAddOptionServerRequest: (request: AddOptionServerRequest, defaults: DefaultValues) => Record<string, unknown>;
22
21
  export declare const marshalSchema: (request: Schema, defaults: DefaultValues) => Record<string, unknown>;
23
22
  export declare const marshalCreateServerRequest: (request: CreateServerRequest, defaults: DefaultValues) => Record<string, unknown>;
23
+ export declare const marshalAddOptionServerRequest: (request: AddOptionServerRequest, defaults: DefaultValues) => Record<string, unknown>;
24
24
  export declare const marshalInstallServerRequest: (request: InstallServerRequest, defaults: DefaultValues) => Record<string, unknown>;
25
25
  export declare const marshalPrivateNetworkApiAddServerPrivateNetworkRequest: (request: PrivateNetworkApiAddServerPrivateNetworkRequest, defaults: DefaultValues) => Record<string, unknown>;
26
26
  export declare const marshalPrivateNetworkApiSetServerPrivateNetworksRequest: (request: PrivateNetworkApiSetServerPrivateNetworksRequest, defaults: DefaultValues) => Record<string, unknown>;