@scaleway/sdk 0.1.0-beta.20 → 0.1.0-beta.21

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.
@@ -3,7 +3,7 @@ import { API } from '../../../scw/api.js';
3
3
  import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
4
4
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
5
  import { SERVER_TRANSIENT_STATUSES } from './content.gen.js';
6
- import { unmarshalListServersResponse, unmarshalServer, marshalCreateServerRequest, marshalUpdateServerRequest, marshalInstallServerRequest, unmarshalGetServerMetricsResponse, marshalRebootServerRequest, marshalStartServerRequest, unmarshalListServerEventsResponse, marshalStartBMCAccessRequest, unmarshalBMCAccess, marshalUpdateIPRequest, unmarshalIP, marshalAddOptionServerRequest, unmarshalListOffersResponse, unmarshalOffer, unmarshalOption, unmarshalListOptionsResponse, unmarshalListSettingsResponse, marshalUpdateSettingRequest, unmarshalSetting, unmarshalListOSResponse, unmarshalOS, marshalAddServerPrivateNetworkRequest, unmarshalServerPrivateNetwork, marshalSetServerPrivateNetworksRequest, unmarshalSetServerPrivateNetworksResponse, unmarshalListServerPrivateNetworksResponse } from './marshalling.gen.js';
6
+ import { unmarshalListServersResponse, unmarshalServer, marshalCreateServerRequest, marshalUpdateServerRequest, marshalInstallServerRequest, unmarshalGetServerMetricsResponse, marshalRebootServerRequest, marshalStartServerRequest, unmarshalListServerEventsResponse, marshalStartBMCAccessRequest, unmarshalBMCAccess, marshalUpdateIPRequest, unmarshalIP, marshalAddOptionServerRequest, unmarshalListOffersResponse, unmarshalOffer, unmarshalOption, unmarshalListOptionsResponse, unmarshalListSettingsResponse, marshalUpdateSettingRequest, unmarshalSetting, unmarshalListOSResponse, unmarshalOS, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, unmarshalServerPrivateNetwork, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalSetServerPrivateNetworksResponse, unmarshalListServerPrivateNetworksResponse } from './marshalling.gen.js';
7
7
 
8
8
  // This file was automatically generated. DO NOT EDIT.
9
9
  const jsonContentHeaders = {
@@ -203,14 +203,24 @@ class BaremetalV1GenAPI extends API {
203
203
  method: 'GET',
204
204
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
205
205
  }, unmarshalOS);
206
+ }
207
+ }
208
+
209
+ /** Elastic Metal Private Network API. */
210
+ BaremetalV1GenAPI.LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1'];
211
+ class BaremetalPrivateNetworkV1GenAPI extends API {
212
+ constructor() {
213
+ var _this2;
214
+ super(...arguments);
215
+ _this2 = this;
206
216
  this.addServerPrivateNetwork = request => this.client.fetch({
207
- body: JSON.stringify(marshalAddServerPrivateNetworkRequest(request, this.client.settings)),
217
+ body: JSON.stringify(marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)),
208
218
  headers: jsonContentHeaders,
209
219
  method: 'POST',
210
220
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`
211
221
  }, unmarshalServerPrivateNetwork);
212
222
  this.setServerPrivateNetworks = request => this.client.fetch({
213
- body: JSON.stringify(marshalSetServerPrivateNetworksRequest(request, this.client.settings)),
223
+ body: JSON.stringify(marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)),
214
224
  headers: jsonContentHeaders,
215
225
  method: 'PUT',
216
226
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`
@@ -219,17 +229,17 @@ class BaremetalV1GenAPI extends API {
219
229
  if (request === void 0) {
220
230
  request = {};
221
231
  }
222
- return _this.client.fetch({
232
+ return _this2.client.fetch({
223
233
  method: 'GET',
224
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/server-private-networks`,
225
- urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId], ['server_id', request.serverId])
234
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this2.client.settings.defaultZone)}/server-private-networks`,
235
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this2.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId ?? _this2.client.settings.defaultProjectId], ['server_id', request.serverId])
226
236
  }, unmarshalListServerPrivateNetworksResponse);
227
237
  };
228
238
  this.listServerPrivateNetworks = function (request) {
229
239
  if (request === void 0) {
230
240
  request = {};
231
241
  }
232
- return enrichForPagination('serverPrivateNetworks', _this.pageOfListServerPrivateNetworks, request);
242
+ return enrichForPagination('serverPrivateNetworks', _this2.pageOfListServerPrivateNetworks, request);
233
243
  };
234
244
  this.deleteServerPrivateNetwork = request => this.client.fetch({
235
245
  method: 'DELETE',
@@ -237,6 +247,6 @@ class BaremetalV1GenAPI extends API {
237
247
  });
238
248
  }
239
249
  }
240
- BaremetalV1GenAPI.LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1'];
250
+ BaremetalPrivateNetworkV1GenAPI.LOCALITIES = ['fr-par-2'];
241
251
 
242
- export { BaremetalV1GenAPI };
252
+ export { BaremetalPrivateNetworkV1GenAPI, BaremetalV1GenAPI };
@@ -343,9 +343,6 @@ const marshalCreateServerRequestInstall = (request, defaults) => ({
343
343
  const marshalAddOptionServerRequest = (request, defaults) => ({
344
344
  expires_at: request.expiresAt
345
345
  });
346
- const marshalAddServerPrivateNetworkRequest = (request, defaults) => ({
347
- private_network_id: request.privateNetworkId
348
- });
349
346
  const marshalCreateServerRequest = (request, defaults) => ({
350
347
  description: request.description,
351
348
  install: request.install ? marshalCreateServerRequestInstall(request.install) : undefined,
@@ -372,12 +369,15 @@ const marshalInstallServerRequest = (request, defaults) => ({
372
369
  ssh_key_ids: request.sshKeyIds,
373
370
  user: request.user
374
371
  });
375
- const marshalRebootServerRequest = (request, defaults) => ({
376
- boot_type: request.bootType
372
+ const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
373
+ private_network_id: request.privateNetworkId
377
374
  });
378
- const marshalSetServerPrivateNetworksRequest = (request, defaults) => ({
375
+ const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({
379
376
  private_network_ids: request.privateNetworkIds
380
377
  });
378
+ const marshalRebootServerRequest = (request, defaults) => ({
379
+ boot_type: request.bootType
380
+ });
381
381
  const marshalStartBMCAccessRequest = (request, defaults) => ({
382
382
  ip: request.ip
383
383
  });
@@ -396,4 +396,4 @@ const marshalUpdateSettingRequest = (request, defaults) => ({
396
396
  enabled: request.enabled
397
397
  });
398
398
 
399
- export { marshalAddOptionServerRequest, marshalAddServerPrivateNetworkRequest, marshalCreateServerRequest, marshalInstallServerRequest, marshalRebootServerRequest, marshalSetServerPrivateNetworksRequest, marshalStartBMCAccessRequest, marshalStartServerRequest, marshalUpdateIPRequest, marshalUpdateServerRequest, marshalUpdateSettingRequest, unmarshalBMCAccess, unmarshalGetServerMetricsResponse, unmarshalIP, unmarshalListOSResponse, unmarshalListOffersResponse, unmarshalListOptionsResponse, unmarshalListServerEventsResponse, unmarshalListServerPrivateNetworksResponse, unmarshalListServersResponse, unmarshalListSettingsResponse, unmarshalOS, unmarshalOffer, unmarshalOption, unmarshalServer, unmarshalServerPrivateNetwork, unmarshalSetServerPrivateNetworksResponse, unmarshalSetting };
399
+ export { marshalAddOptionServerRequest, marshalCreateServerRequest, marshalInstallServerRequest, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, marshalRebootServerRequest, marshalStartBMCAccessRequest, marshalStartServerRequest, marshalUpdateIPRequest, marshalUpdateServerRequest, marshalUpdateSettingRequest, unmarshalBMCAccess, unmarshalGetServerMetricsResponse, unmarshalIP, unmarshalListOSResponse, unmarshalListOffersResponse, unmarshalListOptionsResponse, unmarshalListServerEventsResponse, unmarshalListServerPrivateNetworksResponse, unmarshalListServersResponse, unmarshalListSettingsResponse, unmarshalOS, unmarshalOffer, unmarshalOption, unmarshalServer, unmarshalServerPrivateNetwork, unmarshalSetServerPrivateNetworksResponse, unmarshalSetting };
package/dist/index.cjs CHANGED
@@ -346,7 +346,7 @@ const assertValidSettings = obj => {
346
346
 
347
347
  // API URL.
348
348
  if (!isURL(obj.apiURL)) throw new Error(`Invalid URL ${obj.apiURL}`);
349
- if (obj.apiURL.substr(-1) === '/') throw new Error(`Invalid URL ${obj.apiURL}: it should not have a trailing slash`);
349
+ if (obj.apiURL.slice(-1) === '/') throw new Error(`Invalid URL ${obj.apiURL}: it should not have a trailing slash`);
350
350
 
351
351
  // HTTP Client.
352
352
  if (typeof obj.httpClient !== typeof fetch) throw new Error(`Invalid HTTP Client`);
@@ -358,7 +358,7 @@ const assertValidSettings = obj => {
358
358
  if (typeof obj.userAgent !== 'string') throw new Error(`Invalid User-Agent`);
359
359
  };
360
360
 
361
- const version = 'v0.1.0-beta.19';
361
+ const version = 'v0.1.0-beta.20';
362
362
  const userAgent = `scaleway-sdk-js/${version}`;
363
363
 
364
364
  const isBrowser = () => typeof window !== 'undefined' && typeof window.document !== 'undefined';
@@ -2773,21 +2773,6 @@ const unmarshalServerEvent = data => {
2773
2773
  updatedAt: unmarshalDate(data.updated_at)
2774
2774
  };
2775
2775
  };
2776
- const unmarshalServerPrivateNetwork = data => {
2777
- if (!isJSONObject(data)) {
2778
- throw new TypeError(`Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`);
2779
- }
2780
- return {
2781
- createdAt: unmarshalDate(data.created_at),
2782
- id: data.id,
2783
- privateNetworkId: data.private_network_id,
2784
- projectId: data.project_id,
2785
- serverId: data.server_id,
2786
- status: data.status,
2787
- updatedAt: unmarshalDate(data.updated_at),
2788
- vlan: data.vlan
2789
- };
2790
- };
2791
2776
  const unmarshalSetting = data => {
2792
2777
  if (!isJSONObject(data)) {
2793
2778
  throw new TypeError(`Unmarshalling the type 'Setting' failed as data isn't a dictionary.`);
@@ -2854,15 +2839,6 @@ const unmarshalListServerEventsResponse = data => {
2854
2839
  totalCount: data.total_count
2855
2840
  };
2856
2841
  };
2857
- const unmarshalListServerPrivateNetworksResponse = data => {
2858
- if (!isJSONObject(data)) {
2859
- throw new TypeError(`Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`);
2860
- }
2861
- return {
2862
- serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork),
2863
- totalCount: data.total_count
2864
- };
2865
- };
2866
2842
  const unmarshalListServersResponse$1 = data => {
2867
2843
  if (!isJSONObject(data)) {
2868
2844
  throw new TypeError(`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`);
@@ -2881,14 +2857,6 @@ const unmarshalListSettingsResponse = data => {
2881
2857
  totalCount: data.total_count
2882
2858
  };
2883
2859
  };
2884
- const unmarshalSetServerPrivateNetworksResponse = data => {
2885
- if (!isJSONObject(data)) {
2886
- throw new TypeError(`Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`);
2887
- }
2888
- return {
2889
- serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork)
2890
- };
2891
- };
2892
2860
  const marshalCreateServerRequestInstall = (request, defaults) => ({
2893
2861
  hostname: request.hostname,
2894
2862
  os_id: request.osId,
@@ -2901,9 +2869,6 @@ const marshalCreateServerRequestInstall = (request, defaults) => ({
2901
2869
  const marshalAddOptionServerRequest = (request, defaults) => ({
2902
2870
  expires_at: request.expiresAt
2903
2871
  });
2904
- const marshalAddServerPrivateNetworkRequest = (request, defaults) => ({
2905
- private_network_id: request.privateNetworkId
2906
- });
2907
2872
  const marshalCreateServerRequest$1 = (request, defaults) => ({
2908
2873
  description: request.description,
2909
2874
  install: request.install ? marshalCreateServerRequestInstall(request.install) : undefined,
@@ -2933,9 +2898,6 @@ const marshalInstallServerRequest = (request, defaults) => ({
2933
2898
  const marshalRebootServerRequest = (request, defaults) => ({
2934
2899
  boot_type: request.bootType
2935
2900
  });
2936
- const marshalSetServerPrivateNetworksRequest = (request, defaults) => ({
2937
- private_network_ids: request.privateNetworkIds
2938
- });
2939
2901
  const marshalStartBMCAccessRequest = (request, defaults) => ({
2940
2902
  ip: request.ip
2941
2903
  });
@@ -3297,55 +3259,6 @@ class BaremetalV1GenAPI extends API {
3297
3259
  method: 'GET',
3298
3260
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
3299
3261
  }, unmarshalOS);
3300
-
3301
- /**
3302
- * Add a server to a private network
3303
- *
3304
- * @param request - The request {@link AddServerPrivateNetworkRequest}
3305
- * @returns A Promise of ServerPrivateNetwork
3306
- */
3307
- addServerPrivateNetwork = request => this.client.fetch({
3308
- body: JSON.stringify(marshalAddServerPrivateNetworkRequest(request, this.client.settings)),
3309
- headers: jsonContentHeaders$i,
3310
- method: 'POST',
3311
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`
3312
- }, unmarshalServerPrivateNetwork);
3313
-
3314
- /**
3315
- * Set multiple private networks on a server
3316
- *
3317
- * @param request - The request {@link SetServerPrivateNetworksRequest}
3318
- * @returns A Promise of SetServerPrivateNetworksResponse
3319
- */
3320
- setServerPrivateNetworks = request => this.client.fetch({
3321
- body: JSON.stringify(marshalSetServerPrivateNetworksRequest(request, this.client.settings)),
3322
- headers: jsonContentHeaders$i,
3323
- method: 'PUT',
3324
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`
3325
- }, unmarshalSetServerPrivateNetworksResponse);
3326
- pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch({
3327
- method: 'GET',
3328
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,
3329
- urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId ?? this.client.settings.defaultProjectId], ['server_id', request.serverId])
3330
- }, unmarshalListServerPrivateNetworksResponse);
3331
-
3332
- /**
3333
- * List the private networks of a server
3334
- *
3335
- * @param request - The request {@link ListServerPrivateNetworksRequest}
3336
- * @returns A Promise of ListServerPrivateNetworksResponse
3337
- */
3338
- listServerPrivateNetworks = (request = {}) => enrichForPagination('serverPrivateNetworks', this.pageOfListServerPrivateNetworks, request);
3339
-
3340
- /**
3341
- * Delete a private network
3342
- *
3343
- * @param request - The request {@link DeleteServerPrivateNetworkRequest}
3344
- */
3345
- deleteServerPrivateNetwork = request => this.client.fetch({
3346
- method: 'DELETE',
3347
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
3348
- });
3349
3262
  }
3350
3263
 
3351
3264
  class BaremetalV1UtilsAPI extends BaremetalV1GenAPI {
package/dist/index.d.ts CHANGED
@@ -2157,7 +2157,7 @@ declare type GetOSRequest = {
2157
2157
  /** ID of the OS */
2158
2158
  osId: string;
2159
2159
  };
2160
- declare type AddServerPrivateNetworkRequest = {
2160
+ declare type PrivateNetworkApiAddServerPrivateNetworkRequest = {
2161
2161
  /** Zone to target. If none is passed will use default zone from the config */
2162
2162
  zone?: Zone;
2163
2163
  /** The ID of the server */
@@ -2165,7 +2165,7 @@ declare type AddServerPrivateNetworkRequest = {
2165
2165
  /** The ID of the private network */
2166
2166
  privateNetworkId: string;
2167
2167
  };
2168
- declare type SetServerPrivateNetworksRequest = {
2168
+ declare type PrivateNetworkApiSetServerPrivateNetworksRequest = {
2169
2169
  /** Zone to target. If none is passed will use default zone from the config */
2170
2170
  zone?: Zone;
2171
2171
  /** The ID of the server */
@@ -2173,7 +2173,7 @@ declare type SetServerPrivateNetworksRequest = {
2173
2173
  /** The IDs of the private networks */
2174
2174
  privateNetworkIds: Array<string>;
2175
2175
  };
2176
- declare type ListServerPrivateNetworksRequest = {
2176
+ declare type PrivateNetworkApiListServerPrivateNetworksRequest = {
2177
2177
  /** Zone to target. If none is passed will use default zone from the config */
2178
2178
  zone?: Zone;
2179
2179
  /** The sort order for the returned private networks */
@@ -2191,7 +2191,7 @@ declare type ListServerPrivateNetworksRequest = {
2191
2191
  /** Filter private networks by project ID */
2192
2192
  projectId?: string;
2193
2193
  };
2194
- declare type DeleteServerPrivateNetworkRequest = {
2194
+ declare type PrivateNetworkApiDeleteServerPrivateNetworkRequest = {
2195
2195
  /** Zone to target. If none is passed will use default zone from the config */
2196
2196
  zone?: Zone;
2197
2197
  /** The ID of the server */
@@ -2429,37 +2429,6 @@ declare class BaremetalV1GenAPI extends API {
2429
2429
  * @returns A Promise of OS
2430
2430
  */
2431
2431
  getOS: (request: Readonly<GetOSRequest>) => Promise<OS>;
2432
- /**
2433
- * Add a server to a private network
2434
- *
2435
- * @param request - The request {@link AddServerPrivateNetworkRequest}
2436
- * @returns A Promise of ServerPrivateNetwork
2437
- */
2438
- addServerPrivateNetwork: (request: Readonly<AddServerPrivateNetworkRequest>) => Promise<ServerPrivateNetwork>;
2439
- /**
2440
- * Set multiple private networks on a server
2441
- *
2442
- * @param request - The request {@link SetServerPrivateNetworksRequest}
2443
- * @returns A Promise of SetServerPrivateNetworksResponse
2444
- */
2445
- setServerPrivateNetworks: (request: Readonly<SetServerPrivateNetworksRequest>) => Promise<SetServerPrivateNetworksResponse>;
2446
- protected pageOfListServerPrivateNetworks: (request?: Readonly<ListServerPrivateNetworksRequest>) => Promise<ListServerPrivateNetworksResponse>;
2447
- /**
2448
- * List the private networks of a server
2449
- *
2450
- * @param request - The request {@link ListServerPrivateNetworksRequest}
2451
- * @returns A Promise of ListServerPrivateNetworksResponse
2452
- */
2453
- listServerPrivateNetworks: (request?: Readonly<ListServerPrivateNetworksRequest>) => Promise<ListServerPrivateNetworksResponse> & {
2454
- all: () => Promise<ServerPrivateNetwork[]>;
2455
- [Symbol.asyncIterator]: () => AsyncGenerator<ServerPrivateNetwork[], void, void>;
2456
- };
2457
- /**
2458
- * Delete a private network
2459
- *
2460
- * @param request - The request {@link DeleteServerPrivateNetworkRequest}
2461
- */
2462
- deleteServerPrivateNetwork: (request: Readonly<DeleteServerPrivateNetworkRequest>) => Promise<void>;
2463
2432
  }
2464
2433
 
2465
2434
  declare class BaremetalV1UtilsAPI extends BaremetalV1GenAPI {
@@ -2542,10 +2511,10 @@ type index$C_ListSettingsRequest = ListSettingsRequest;
2542
2511
  type index$C_UpdateSettingRequest = UpdateSettingRequest;
2543
2512
  type index$C_ListOSRequest = ListOSRequest;
2544
2513
  type index$C_GetOSRequest = GetOSRequest;
2545
- type index$C_AddServerPrivateNetworkRequest = AddServerPrivateNetworkRequest;
2546
- type index$C_SetServerPrivateNetworksRequest = SetServerPrivateNetworksRequest;
2547
- type index$C_ListServerPrivateNetworksRequest = ListServerPrivateNetworksRequest;
2548
- type index$C_DeleteServerPrivateNetworkRequest = DeleteServerPrivateNetworkRequest;
2514
+ type index$C_PrivateNetworkApiAddServerPrivateNetworkRequest = PrivateNetworkApiAddServerPrivateNetworkRequest;
2515
+ type index$C_PrivateNetworkApiSetServerPrivateNetworksRequest = PrivateNetworkApiSetServerPrivateNetworksRequest;
2516
+ type index$C_PrivateNetworkApiListServerPrivateNetworksRequest = PrivateNetworkApiListServerPrivateNetworksRequest;
2517
+ type index$C_PrivateNetworkApiDeleteServerPrivateNetworkRequest = PrivateNetworkApiDeleteServerPrivateNetworkRequest;
2549
2518
  declare namespace index$C {
2550
2519
  export {
2551
2520
  BaremetalV1UtilsAPI as API,
@@ -2621,10 +2590,10 @@ declare namespace index$C {
2621
2590
  index$C_UpdateSettingRequest as UpdateSettingRequest,
2622
2591
  index$C_ListOSRequest as ListOSRequest,
2623
2592
  index$C_GetOSRequest as GetOSRequest,
2624
- index$C_AddServerPrivateNetworkRequest as AddServerPrivateNetworkRequest,
2625
- index$C_SetServerPrivateNetworksRequest as SetServerPrivateNetworksRequest,
2626
- index$C_ListServerPrivateNetworksRequest as ListServerPrivateNetworksRequest,
2627
- index$C_DeleteServerPrivateNetworkRequest as DeleteServerPrivateNetworkRequest,
2593
+ index$C_PrivateNetworkApiAddServerPrivateNetworkRequest as PrivateNetworkApiAddServerPrivateNetworkRequest,
2594
+ index$C_PrivateNetworkApiSetServerPrivateNetworksRequest as PrivateNetworkApiSetServerPrivateNetworksRequest,
2595
+ index$C_PrivateNetworkApiListServerPrivateNetworksRequest as PrivateNetworkApiListServerPrivateNetworksRequest,
2596
+ index$C_PrivateNetworkApiDeleteServerPrivateNetworkRequest as PrivateNetworkApiDeleteServerPrivateNetworkRequest,
2628
2597
  };
2629
2598
  }
2630
2599
 
@@ -37,7 +37,7 @@ const assertValidSettings = obj => {
37
37
 
38
38
  // API URL.
39
39
  if (!isURL(obj.apiURL)) throw new Error(`Invalid URL ${obj.apiURL}`);
40
- if (obj.apiURL.substr(-1) === '/') throw new Error(`Invalid URL ${obj.apiURL}: it should not have a trailing slash`);
40
+ if (obj.apiURL.slice(-1) === '/') throw new Error(`Invalid URL ${obj.apiURL}: it should not have a trailing slash`);
41
41
 
42
42
  // HTTP Client.
43
43
  if (typeof obj.httpClient !== typeof fetch) throw new Error(`Invalid HTTP Client`);
@@ -1,4 +1,4 @@
1
- const version = 'v0.1.0-beta.19';
1
+ const version = 'v0.1.0-beta.20';
2
2
  const userAgent = `scaleway-sdk-js/${version}`;
3
3
 
4
4
  export { userAgent, version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk",
3
- "version": "0.1.0-beta.20",
3
+ "version": "0.1.0-beta.21",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Scaleway SDK.",
6
6
  "keywords": [
@@ -36,5 +36,5 @@
36
36
  "bundledDependencies": [
37
37
  "@scaleway/random-name"
38
38
  ],
39
- "gitHead": "f2ea92d645fa8f03508bd1a98e3426f2dd1c9a86"
39
+ "gitHead": "3a524c526779830f3d1387073b857c9220e2c159"
40
40
  }