@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.
@@ -1,4 +1,4 @@
1
- import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalMoney, unmarshalDate, unmarshalTimeSeries } from "@scaleway/sdk-client";
1
+ import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalDate, unmarshalTimeSeries, unmarshalMoney } from "@scaleway/sdk-client";
2
2
  const unmarshalSchemaPartition = (data) => {
3
3
  if (!isJSONObject(data)) {
4
4
  throw new TypeError(
@@ -105,40 +105,6 @@ const unmarshalIP = (data) => {
105
105
  version: data.version
106
106
  };
107
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
108
  const unmarshalCertificationOption = (data) => {
143
109
  if (!isJSONObject(data)) {
144
110
  throw new TypeError(
@@ -185,6 +151,116 @@ const unmarshalRemoteAccessOption = (data) => {
185
151
  }
186
152
  return {};
187
153
  };
154
+ const unmarshalServerInstall = (data) => {
155
+ if (!isJSONObject(data)) {
156
+ throw new TypeError(
157
+ `Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`
158
+ );
159
+ }
160
+ return {
161
+ hostname: data.hostname,
162
+ osId: data.os_id,
163
+ partitioningSchema: data.partitioning_schema ? unmarshalSchema(data.partitioning_schema) : void 0,
164
+ serviceUrl: data.service_url,
165
+ serviceUser: data.service_user,
166
+ sshKeyIds: data.ssh_key_ids,
167
+ status: data.status,
168
+ user: data.user
169
+ };
170
+ };
171
+ const unmarshalServerOption = (data) => {
172
+ if (!isJSONObject(data)) {
173
+ throw new TypeError(
174
+ `Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.`
175
+ );
176
+ }
177
+ return {
178
+ certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
179
+ expiresAt: unmarshalDate(data.expires_at),
180
+ id: data.id,
181
+ license: data.license ? unmarshalLicenseOption(data.license) : void 0,
182
+ manageable: data.manageable,
183
+ name: data.name,
184
+ privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
185
+ publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
186
+ remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0,
187
+ status: data.status
188
+ };
189
+ };
190
+ const unmarshalServerRescueServer = (data) => {
191
+ if (!isJSONObject(data)) {
192
+ throw new TypeError(
193
+ `Unmarshalling the type 'ServerRescueServer' failed as data isn't a dictionary.`
194
+ );
195
+ }
196
+ return {
197
+ password: data.password,
198
+ user: data.user
199
+ };
200
+ };
201
+ const unmarshalServer = (data) => {
202
+ if (!isJSONObject(data)) {
203
+ throw new TypeError(
204
+ `Unmarshalling the type 'Server' failed as data isn't a dictionary.`
205
+ );
206
+ }
207
+ return {
208
+ bootType: data.boot_type,
209
+ createdAt: unmarshalDate(data.created_at),
210
+ description: data.description,
211
+ domain: data.domain,
212
+ id: data.id,
213
+ install: data.install ? unmarshalServerInstall(data.install) : void 0,
214
+ ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
215
+ name: data.name,
216
+ offerId: data.offer_id,
217
+ offerName: data.offer_name,
218
+ options: unmarshalArrayOfObject(data.options, unmarshalServerOption),
219
+ organizationId: data.organization_id,
220
+ pingStatus: data.ping_status,
221
+ projectId: data.project_id,
222
+ protected: data.protected,
223
+ rescueServer: data.rescue_server ? unmarshalServerRescueServer(data.rescue_server) : void 0,
224
+ status: data.status,
225
+ tags: data.tags,
226
+ updatedAt: unmarshalDate(data.updated_at),
227
+ zone: data.zone
228
+ };
229
+ };
230
+ const unmarshalOSOSField = (data) => {
231
+ if (!isJSONObject(data)) {
232
+ throw new TypeError(
233
+ `Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.`
234
+ );
235
+ }
236
+ return {
237
+ defaultValue: data.default_value,
238
+ editable: data.editable,
239
+ required: data.required
240
+ };
241
+ };
242
+ const unmarshalOS = (data) => {
243
+ if (!isJSONObject(data)) {
244
+ throw new TypeError(
245
+ `Unmarshalling the type 'OS' failed as data isn't a dictionary.`
246
+ );
247
+ }
248
+ return {
249
+ allowed: data.allowed,
250
+ customPartitioningSupported: data.custom_partitioning_supported,
251
+ enabled: data.enabled,
252
+ id: data.id,
253
+ licenseRequired: data.license_required,
254
+ logoUrl: data.logo_url,
255
+ name: data.name,
256
+ password: data.password ? unmarshalOSOSField(data.password) : void 0,
257
+ servicePassword: data.service_password ? unmarshalOSOSField(data.service_password) : void 0,
258
+ serviceUser: data.service_user ? unmarshalOSOSField(data.service_user) : void 0,
259
+ ssh: data.ssh ? unmarshalOSOSField(data.ssh) : void 0,
260
+ user: data.user ? unmarshalOSOSField(data.user) : void 0,
261
+ version: data.version
262
+ };
263
+ };
188
264
  const unmarshalCPU = (data) => {
189
265
  if (!isJSONObject(data)) {
190
266
  throw new TypeError(
@@ -352,81 +428,6 @@ const unmarshalServerPrivateNetwork = (data) => {
352
428
  vlan: data.vlan
353
429
  };
354
430
  };
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
431
  const unmarshalSetting = (data) => {
431
432
  if (!isJSONObject(data)) {
432
433
  throw new TypeError(
@@ -569,9 +570,6 @@ const unmarshalSetServerPrivateNetworksResponse = (data) => {
569
570
  )
570
571
  };
571
572
  };
572
- const marshalAddOptionServerRequest = (request, defaults) => ({
573
- expires_at: request.expiresAt
574
- });
575
573
  const marshalSchemaPartition = (request, defaults) => ({
576
574
  label: request.label,
577
575
  number: request.number,
@@ -628,6 +626,7 @@ const marshalCreateServerRequest = (request, defaults) => ({
628
626
  name: request.name,
629
627
  offer_id: request.offerId,
630
628
  option_ids: request.optionIds,
629
+ protected: request.protected,
631
630
  tags: request.tags,
632
631
  ...resolveOneOf([
633
632
  {
@@ -642,6 +641,9 @@ const marshalCreateServerRequest = (request, defaults) => ({
642
641
  }
643
642
  ])
644
643
  });
644
+ const marshalAddOptionServerRequest = (request, defaults) => ({
645
+ expires_at: request.expiresAt
646
+ });
645
647
  const marshalInstallServerRequest = (request, defaults) => ({
646
648
  hostname: request.hostname,
647
649
  os_id: request.osId,
@@ -659,13 +661,15 @@ const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaul
659
661
  private_network_ids: request.privateNetworkIds
660
662
  });
661
663
  const marshalRebootServerRequest = (request, defaults) => ({
662
- boot_type: request.bootType
664
+ boot_type: request.bootType,
665
+ ssh_key_ids: request.sshKeyIds
663
666
  });
664
667
  const marshalStartBMCAccessRequest = (request, defaults) => ({
665
668
  ip: request.ip
666
669
  });
667
670
  const marshalStartServerRequest = (request, defaults) => ({
668
- boot_type: request.bootType
671
+ boot_type: request.bootType,
672
+ ssh_key_ids: request.sshKeyIds
669
673
  });
670
674
  const marshalUpdateIPRequest = (request, defaults) => ({
671
675
  reverse: request.reverse
@@ -673,6 +677,7 @@ const marshalUpdateIPRequest = (request, defaults) => ({
673
677
  const marshalUpdateServerRequest = (request, defaults) => ({
674
678
  description: request.description,
675
679
  name: request.name,
680
+ protected: request.protected,
676
681
  tags: request.tags
677
682
  });
678
683
  const marshalUpdateSettingRequest = (request, defaults) => ({