@scaleway/sdk 2.48.0 → 2.49.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/api/baremetal/index.gen.cjs +2 -0
  2. package/dist/api/baremetal/index.gen.d.ts +1 -0
  3. package/dist/api/baremetal/index.gen.js +3 -1
  4. package/dist/api/baremetal/v1/index.gen.d.ts +1 -1
  5. package/dist/api/baremetal/v1/marshalling.gen.cjs +42 -102
  6. package/dist/api/baremetal/v1/marshalling.gen.d.ts +1 -1
  7. package/dist/api/baremetal/v1/marshalling.gen.js +42 -102
  8. package/dist/api/baremetal/v1/types.gen.d.ts +8 -19
  9. package/dist/api/baremetal/v3/api.gen.cjs +109 -0
  10. package/dist/api/baremetal/v3/api.gen.d.ts +46 -0
  11. package/dist/api/baremetal/v3/api.gen.js +109 -0
  12. package/dist/api/baremetal/v3/content.gen.cjs +4 -0
  13. package/dist/api/baremetal/v3/content.gen.d.ts +3 -0
  14. package/dist/api/baremetal/v3/content.gen.js +4 -0
  15. package/dist/api/baremetal/v3/index.gen.cjs +6 -0
  16. package/dist/api/baremetal/v3/index.gen.d.ts +3 -0
  17. package/dist/api/baremetal/v3/index.gen.js +6 -0
  18. package/dist/api/baremetal/v3/marshalling.gen.cjs +62 -0
  19. package/dist/api/baremetal/v3/marshalling.gen.d.ts +7 -0
  20. package/dist/api/baremetal/v3/marshalling.gen.js +62 -0
  21. package/dist/api/baremetal/v3/types.gen.d.ts +82 -0
  22. package/dist/api/edge_services/v1alpha1/api.gen.cjs +2 -10
  23. package/dist/api/edge_services/v1alpha1/api.gen.js +2 -10
  24. package/dist/api/iam/v1alpha1/validation-rules.gen.cjs +3 -0
  25. package/dist/api/iam/v1alpha1/validation-rules.gen.d.ts +3 -0
  26. package/dist/api/iam/v1alpha1/validation-rules.gen.js +3 -0
  27. package/dist/api/instance/v1/api.gen.cjs +7 -8
  28. package/dist/api/instance/v1/api.gen.d.ts +8 -9
  29. package/dist/api/instance/v1/api.gen.js +7 -8
  30. package/dist/scw/constants.cjs +1 -1
  31. package/dist/scw/constants.d.ts +2 -2
  32. package/dist/scw/constants.js +1 -1
  33. package/dist/scw/custom-marshalling.cjs +19 -4
  34. package/dist/scw/custom-marshalling.d.ts +4 -2
  35. package/dist/scw/custom-marshalling.js +19 -4
  36. package/dist/scw/custom-types.cjs +1 -0
  37. package/dist/scw/custom-types.d.ts +1 -0
  38. package/dist/scw/custom-types.js +1 -0
  39. package/package.json +2 -2
@@ -0,0 +1,46 @@
1
+ import { API as ParentAPI } from '../../../bridge';
2
+ import type { Zone } from '../../../bridge';
3
+ import type { ListServerPrivateNetworksResponse, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, ServerPrivateNetwork, SetServerPrivateNetworksResponse } from './types.gen';
4
+ /** Elastic Metal - Private Networks API. */
5
+ export declare class PrivateNetworkAPI extends ParentAPI {
6
+ /** Lists the available zones of the API. */
7
+ static readonly LOCALITIES: Zone[];
8
+ /**
9
+ * Add a server to a Private Network. Add an Elastic Metal server to a Private
10
+ * Network.
11
+ *
12
+ * @param request - The request
13
+ * {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
14
+ * @returns A Promise of ServerPrivateNetwork
15
+ */
16
+ addServerPrivateNetwork: (request: Readonly<PrivateNetworkApiAddServerPrivateNetworkRequest>) => Promise<ServerPrivateNetwork>;
17
+ /**
18
+ * Set multiple Private Networks on a server. Configure multiple Private
19
+ * Networks on an Elastic Metal server.
20
+ *
21
+ * @param request - The request
22
+ * {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
23
+ * @returns A Promise of SetServerPrivateNetworksResponse
24
+ */
25
+ setServerPrivateNetworks: (request: Readonly<PrivateNetworkApiSetServerPrivateNetworksRequest>) => Promise<SetServerPrivateNetworksResponse>;
26
+ protected pageOfListServerPrivateNetworks: (request?: Readonly<PrivateNetworkApiListServerPrivateNetworksRequest>) => Promise<ListServerPrivateNetworksResponse>;
27
+ /**
28
+ * List the Private Networks of a server. List the Private Networks of an
29
+ * Elastic Metal server.
30
+ *
31
+ * @param request - The request
32
+ * {@link PrivateNetworkApiListServerPrivateNetworksRequest}
33
+ * @returns A Promise of ListServerPrivateNetworksResponse
34
+ */
35
+ listServerPrivateNetworks: (request?: Readonly<PrivateNetworkApiListServerPrivateNetworksRequest>) => Promise<ListServerPrivateNetworksResponse> & {
36
+ all: () => Promise<ServerPrivateNetwork[]>;
37
+ [Symbol.asyncIterator]: () => AsyncGenerator<ServerPrivateNetwork[], void, void>;
38
+ };
39
+ /**
40
+ * Delete a Private Network.
41
+ *
42
+ * @param request - The request
43
+ * {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
44
+ */
45
+ deleteServerPrivateNetwork: (request: Readonly<PrivateNetworkApiDeleteServerPrivateNetworkRequest>) => Promise<void>;
46
+ }
@@ -0,0 +1,109 @@
1
+ import { API as API$1 } from "../../../scw/api.js";
2
+ import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
3
+ import "../../../vendor/base64/index.js";
4
+ import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
5
+ import { marshalPrivateNetworkApiAddServerPrivateNetworkRequest, unmarshalServerPrivateNetwork, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalSetServerPrivateNetworksResponse, unmarshalListServerPrivateNetworksResponse } from "./marshalling.gen.js";
6
+ const jsonContentHeaders = {
7
+ "Content-Type": "application/json; charset=utf-8"
8
+ };
9
+ class PrivateNetworkAPI extends API$1 {
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
+ ];
19
+ /**
20
+ * Add a server to a Private Network. Add an Elastic Metal server to a Private
21
+ * Network.
22
+ *
23
+ * @param request - The request
24
+ * {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
25
+ * @returns A Promise of ServerPrivateNetwork
26
+ */
27
+ addServerPrivateNetwork = (request) => this.client.fetch(
28
+ {
29
+ body: JSON.stringify(
30
+ marshalPrivateNetworkApiAddServerPrivateNetworkRequest(
31
+ request,
32
+ this.client.settings
33
+ )
34
+ ),
35
+ headers: jsonContentHeaders,
36
+ method: "POST",
37
+ path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
38
+ },
39
+ unmarshalServerPrivateNetwork
40
+ );
41
+ /**
42
+ * Set multiple Private Networks on a server. Configure multiple Private
43
+ * Networks on an Elastic Metal server.
44
+ *
45
+ * @param request - The request
46
+ * {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
47
+ * @returns A Promise of SetServerPrivateNetworksResponse
48
+ */
49
+ setServerPrivateNetworks = (request) => this.client.fetch(
50
+ {
51
+ body: JSON.stringify(
52
+ marshalPrivateNetworkApiSetServerPrivateNetworksRequest(
53
+ request,
54
+ this.client.settings
55
+ )
56
+ ),
57
+ headers: jsonContentHeaders,
58
+ method: "PUT",
59
+ path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
60
+ },
61
+ unmarshalSetServerPrivateNetworksResponse
62
+ );
63
+ pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch(
64
+ {
65
+ method: "GET",
66
+ path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,
67
+ urlParams: urlParams(
68
+ ["ipam_ip_ids", request.ipamIpIds],
69
+ ["order_by", request.orderBy],
70
+ ["organization_id", request.organizationId],
71
+ ["page", request.page],
72
+ [
73
+ "page_size",
74
+ request.pageSize ?? this.client.settings.defaultPageSize
75
+ ],
76
+ ["private_network_id", request.privateNetworkId],
77
+ ["project_id", request.projectId],
78
+ ["server_id", request.serverId]
79
+ )
80
+ },
81
+ unmarshalListServerPrivateNetworksResponse
82
+ );
83
+ /**
84
+ * List the Private Networks of a server. List the Private Networks of an
85
+ * Elastic Metal server.
86
+ *
87
+ * @param request - The request
88
+ * {@link PrivateNetworkApiListServerPrivateNetworksRequest}
89
+ * @returns A Promise of ListServerPrivateNetworksResponse
90
+ */
91
+ listServerPrivateNetworks = (request = {}) => enrichForPagination(
92
+ "serverPrivateNetworks",
93
+ this.pageOfListServerPrivateNetworks,
94
+ request
95
+ );
96
+ /**
97
+ * Delete a Private Network.
98
+ *
99
+ * @param request - The request
100
+ * {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
101
+ */
102
+ deleteServerPrivateNetwork = (request) => this.client.fetch({
103
+ method: "DELETE",
104
+ path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
105
+ });
106
+ }
107
+ export {
108
+ PrivateNetworkAPI
109
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ["attaching", "detaching"];
4
+ exports.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES;
@@ -0,0 +1,3 @@
1
+ import type { ServerPrivateNetworkStatus } from './types.gen';
2
+ /** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */
3
+ export declare const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: ServerPrivateNetworkStatus[];
@@ -0,0 +1,4 @@
1
+ const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ["attaching", "detaching"];
2
+ export {
3
+ SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES
4
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const api_gen = require("./api.gen.cjs");
4
+ const content_gen = require("./content.gen.cjs");
5
+ exports.PrivateNetworkAPI = api_gen.PrivateNetworkAPI;
6
+ exports.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = content_gen.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES;
@@ -0,0 +1,3 @@
1
+ export { PrivateNetworkAPI } from './api.gen';
2
+ export * from './content.gen';
3
+ export type { ListServerPrivateNetworksRequestOrderBy, ListServerPrivateNetworksResponse, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, ServerPrivateNetwork, ServerPrivateNetworkStatus, SetServerPrivateNetworksResponse, } from './types.gen';
@@ -0,0 +1,6 @@
1
+ import { PrivateNetworkAPI } from "./api.gen.js";
2
+ import { SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES } from "./content.gen.js";
3
+ export {
4
+ PrivateNetworkAPI,
5
+ SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES
6
+ };
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const json = require("../../../helpers/json.cjs");
4
+ const marshalling = require("../../../helpers/marshalling.cjs");
5
+ require("../../../vendor/base64/index.cjs");
6
+ const unmarshalServerPrivateNetwork = (data) => {
7
+ if (!json.isJSONObject(data)) {
8
+ throw new TypeError(
9
+ `Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`
10
+ );
11
+ }
12
+ return {
13
+ createdAt: marshalling.unmarshalDate(data.created_at),
14
+ id: data.id,
15
+ ipamIpIds: data.ipam_ip_ids,
16
+ privateNetworkId: data.private_network_id,
17
+ projectId: data.project_id,
18
+ serverId: data.server_id,
19
+ status: data.status,
20
+ updatedAt: marshalling.unmarshalDate(data.updated_at),
21
+ vlan: data.vlan
22
+ };
23
+ };
24
+ const unmarshalListServerPrivateNetworksResponse = (data) => {
25
+ if (!json.isJSONObject(data)) {
26
+ throw new TypeError(
27
+ `Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`
28
+ );
29
+ }
30
+ return {
31
+ serverPrivateNetworks: marshalling.unmarshalArrayOfObject(
32
+ data.server_private_networks,
33
+ unmarshalServerPrivateNetwork
34
+ ),
35
+ totalCount: data.total_count
36
+ };
37
+ };
38
+ const unmarshalSetServerPrivateNetworksResponse = (data) => {
39
+ if (!json.isJSONObject(data)) {
40
+ throw new TypeError(
41
+ `Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`
42
+ );
43
+ }
44
+ return {
45
+ serverPrivateNetworks: marshalling.unmarshalArrayOfObject(
46
+ data.server_private_networks,
47
+ unmarshalServerPrivateNetwork
48
+ )
49
+ };
50
+ };
51
+ const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
52
+ ipam_ip_ids: request.ipamIpIds,
53
+ private_network_id: request.privateNetworkId
54
+ });
55
+ const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({
56
+ per_private_network_ipam_ip_ids: request.perPrivateNetworkIpamIpIds
57
+ });
58
+ exports.marshalPrivateNetworkApiAddServerPrivateNetworkRequest = marshalPrivateNetworkApiAddServerPrivateNetworkRequest;
59
+ exports.marshalPrivateNetworkApiSetServerPrivateNetworksRequest = marshalPrivateNetworkApiSetServerPrivateNetworksRequest;
60
+ exports.unmarshalListServerPrivateNetworksResponse = unmarshalListServerPrivateNetworksResponse;
61
+ exports.unmarshalServerPrivateNetwork = unmarshalServerPrivateNetwork;
62
+ exports.unmarshalSetServerPrivateNetworksResponse = unmarshalSetServerPrivateNetworksResponse;
@@ -0,0 +1,7 @@
1
+ import type { DefaultValues } from '../../../bridge';
2
+ import type { ListServerPrivateNetworksResponse, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, ServerPrivateNetwork, SetServerPrivateNetworksResponse } from './types.gen';
3
+ export declare const unmarshalServerPrivateNetwork: (data: unknown) => ServerPrivateNetwork;
4
+ export declare const unmarshalListServerPrivateNetworksResponse: (data: unknown) => ListServerPrivateNetworksResponse;
5
+ export declare const unmarshalSetServerPrivateNetworksResponse: (data: unknown) => SetServerPrivateNetworksResponse;
6
+ export declare const marshalPrivateNetworkApiAddServerPrivateNetworkRequest: (request: PrivateNetworkApiAddServerPrivateNetworkRequest, defaults: DefaultValues) => Record<string, unknown>;
7
+ export declare const marshalPrivateNetworkApiSetServerPrivateNetworksRequest: (request: PrivateNetworkApiSetServerPrivateNetworksRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -0,0 +1,62 @@
1
+ import { isJSONObject } from "../../../helpers/json.js";
2
+ import { unmarshalDate, unmarshalArrayOfObject } from "../../../helpers/marshalling.js";
3
+ import "../../../vendor/base64/index.js";
4
+ const unmarshalServerPrivateNetwork = (data) => {
5
+ if (!isJSONObject(data)) {
6
+ throw new TypeError(
7
+ `Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`
8
+ );
9
+ }
10
+ return {
11
+ createdAt: unmarshalDate(data.created_at),
12
+ id: data.id,
13
+ ipamIpIds: data.ipam_ip_ids,
14
+ privateNetworkId: data.private_network_id,
15
+ projectId: data.project_id,
16
+ serverId: data.server_id,
17
+ status: data.status,
18
+ updatedAt: unmarshalDate(data.updated_at),
19
+ vlan: data.vlan
20
+ };
21
+ };
22
+ const unmarshalListServerPrivateNetworksResponse = (data) => {
23
+ if (!isJSONObject(data)) {
24
+ throw new TypeError(
25
+ `Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`
26
+ );
27
+ }
28
+ return {
29
+ serverPrivateNetworks: unmarshalArrayOfObject(
30
+ data.server_private_networks,
31
+ unmarshalServerPrivateNetwork
32
+ ),
33
+ totalCount: data.total_count
34
+ };
35
+ };
36
+ const unmarshalSetServerPrivateNetworksResponse = (data) => {
37
+ if (!isJSONObject(data)) {
38
+ throw new TypeError(
39
+ `Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`
40
+ );
41
+ }
42
+ return {
43
+ serverPrivateNetworks: unmarshalArrayOfObject(
44
+ data.server_private_networks,
45
+ unmarshalServerPrivateNetwork
46
+ )
47
+ };
48
+ };
49
+ const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
50
+ ipam_ip_ids: request.ipamIpIds,
51
+ private_network_id: request.privateNetworkId
52
+ });
53
+ const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({
54
+ per_private_network_ipam_ip_ids: request.perPrivateNetworkIpamIpIds
55
+ });
56
+ export {
57
+ marshalPrivateNetworkApiAddServerPrivateNetworkRequest,
58
+ marshalPrivateNetworkApiSetServerPrivateNetworksRequest,
59
+ unmarshalListServerPrivateNetworksResponse,
60
+ unmarshalServerPrivateNetwork,
61
+ unmarshalSetServerPrivateNetworksResponse
62
+ };
@@ -0,0 +1,82 @@
1
+ import type { Zone } from '../../../bridge';
2
+ export type ListServerPrivateNetworksRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'updated_at_asc' | 'updated_at_desc';
3
+ export type ServerPrivateNetworkStatus = 'unknown_status' | 'attaching' | 'attached' | 'error' | 'detaching' | 'locked';
4
+ export interface ServerPrivateNetwork {
5
+ /** UUID of the Server-to-Private Network mapping. */
6
+ id: string;
7
+ /** Private Network Project UUID. */
8
+ projectId: string;
9
+ /** Server UUID. */
10
+ serverId: string;
11
+ /** Private Network UUID. */
12
+ privateNetworkId: string;
13
+ /** VLAN UUID associated with the Private Network. */
14
+ vlan?: number;
15
+ /** Configuration status of the Private Network. */
16
+ status: ServerPrivateNetworkStatus;
17
+ /** Private Network creation date. */
18
+ createdAt?: Date;
19
+ /** Date the Private Network was last modified. */
20
+ updatedAt?: Date;
21
+ /** IPAM IP IDs of the server, if it has any. */
22
+ ipamIpIds: string[];
23
+ }
24
+ export interface ListServerPrivateNetworksResponse {
25
+ serverPrivateNetworks: ServerPrivateNetwork[];
26
+ totalCount: number;
27
+ }
28
+ export type PrivateNetworkApiAddServerPrivateNetworkRequest = {
29
+ /** Zone to target. If none is passed will use default zone from the config. */
30
+ zone?: Zone;
31
+ /** UUID of the server. */
32
+ serverId: string;
33
+ /** UUID of the Private Network. */
34
+ privateNetworkId: string;
35
+ /** IPAM IDs of an IPs to attach to the server. */
36
+ ipamIpIds?: string[];
37
+ };
38
+ export type PrivateNetworkApiDeleteServerPrivateNetworkRequest = {
39
+ /** Zone to target. If none is passed will use default zone from the config. */
40
+ zone?: Zone;
41
+ /** UUID of the server. */
42
+ serverId: string;
43
+ /** UUID of the Private Network. */
44
+ privateNetworkId: string;
45
+ };
46
+ export type PrivateNetworkApiListServerPrivateNetworksRequest = {
47
+ /** Zone to target. If none is passed will use default zone from the config. */
48
+ zone?: Zone;
49
+ /** Sort order for the returned Private Networks. */
50
+ orderBy?: ListServerPrivateNetworksRequestOrderBy;
51
+ /** Page number for the returned Private Networks. */
52
+ page?: number;
53
+ /** Maximum number of Private Networks per page. */
54
+ pageSize?: number;
55
+ /** Filter Private Networks by server UUID. */
56
+ serverId?: string;
57
+ /** Filter Private Networks by Private Network UUID. */
58
+ privateNetworkId?: string;
59
+ /** Filter Private Networks by organization UUID. */
60
+ organizationId?: string;
61
+ /** Filter Private Networks by project UUID. */
62
+ projectId?: string;
63
+ /** Filter Private Networks by IPAM IP UUIDs. */
64
+ ipamIpIds?: string[];
65
+ };
66
+ export type PrivateNetworkApiSetServerPrivateNetworksRequest = {
67
+ /** Zone to target. If none is passed will use default zone from the config. */
68
+ zone?: Zone;
69
+ /** UUID of the server. */
70
+ serverId: string;
71
+ /**
72
+ * Object where the keys are the UUIDs of Private Networks and the values are
73
+ * arrays of IPAM IDs representing the IPs to assign to this Elastic Metal
74
+ * server on the Private Network. If the array supplied for a Private Network
75
+ * is empty, the next available IP from the Private Network's CIDR block will
76
+ * automatically be used for attachment.
77
+ */
78
+ perPrivateNetworkIpamIpIds: Record<string, string[]>;
79
+ };
80
+ export interface SetServerPrivateNetworksResponse {
81
+ serverPrivateNetworks: ServerPrivateNetwork[];
82
+ }
@@ -616,21 +616,13 @@ class API extends api.API {
616
616
  getCurrentPlan = (request = {}) => this.client.fetch(
617
617
  {
618
618
  method: "GET",
619
- path: `/edge-services/v1alpha1/current-plan`,
620
- urlParams: marshalling.urlParams([
621
- "project_id",
622
- request.projectId ?? this.client.settings.defaultProjectId
623
- ])
619
+ path: `/edge-services/v1alpha1/current-plan/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
624
620
  },
625
621
  marshalling_gen.unmarshalPlan
626
622
  );
627
623
  deleteCurrentPlan = (request = {}) => this.client.fetch({
628
624
  method: "DELETE",
629
- path: `/edge-services/v1alpha1/current-plan`,
630
- urlParams: marshalling.urlParams([
631
- "project_id",
632
- request.projectId ?? this.client.settings.defaultProjectId
633
- ])
625
+ path: `/edge-services/v1alpha1/current-plan/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
634
626
  });
635
627
  }
636
628
  exports.API = API;
@@ -614,21 +614,13 @@ class API extends API$1 {
614
614
  getCurrentPlan = (request = {}) => this.client.fetch(
615
615
  {
616
616
  method: "GET",
617
- path: `/edge-services/v1alpha1/current-plan`,
618
- urlParams: urlParams([
619
- "project_id",
620
- request.projectId ?? this.client.settings.defaultProjectId
621
- ])
617
+ path: `/edge-services/v1alpha1/current-plan/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
622
618
  },
623
619
  unmarshalPlan
624
620
  );
625
621
  deleteCurrentPlan = (request = {}) => this.client.fetch({
626
622
  method: "DELETE",
627
- path: `/edge-services/v1alpha1/current-plan`,
628
- urlParams: urlParams([
629
- "project_id",
630
- request.projectId ?? this.client.settings.defaultProjectId
631
- ])
623
+ path: `/edge-services/v1alpha1/current-plan/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
632
624
  });
633
625
  }
634
626
  export {
@@ -50,6 +50,9 @@ const CreateSSHKeyRequest = {
50
50
  }
51
51
  };
52
52
  const CreateUserRequestMember = {
53
+ email: {
54
+ ignoreEmpty: true
55
+ },
53
56
  password: {
54
57
  ignoreEmpty: true,
55
58
  maxLength: 72
@@ -48,6 +48,9 @@ export declare const CreateSSHKeyRequest: {
48
48
  };
49
49
  };
50
50
  export declare const CreateUserRequestMember: {
51
+ email: {
52
+ ignoreEmpty: boolean;
53
+ };
51
54
  password: {
52
55
  ignoreEmpty: boolean;
53
56
  maxLength: number;
@@ -48,6 +48,9 @@ const CreateSSHKeyRequest = {
48
48
  }
49
49
  };
50
50
  const CreateUserRequestMember = {
51
+ email: {
52
+ ignoreEmpty: true
53
+ },
51
54
  password: {
52
55
  ignoreEmpty: true,
53
56
  maxLength: 72
@@ -190,15 +190,14 @@ class API extends api.API {
190
190
  * and release the hypervisor slot. `stop_in_place`: Stop the Instance, but
191
191
  * keep the slot on the hypervisor. `reboot`: Stop the instance and restart
192
192
  * it. `backup`: Create an image with all the volumes of an Instance.
193
- * `terminate`: Delete the Instance along with all attached volumes.
194
- * `enable_routed_ip`: Migrate the Instance to the new network stack.
193
+ * `terminate`: Delete the Instance along with its attached volumes, except
194
+ * for SBS volumes. `enable_routed_ip`: Migrate the Instance to the new
195
+ * network stack.
195
196
  *
196
- * Keep in mind that terminating an Instance will result in the deletion of
197
- * all attached volumes, including local and block storage. If you want to
198
- * preserve your local volumes, you should use the `archive` action instead of
199
- * `terminate`. Similarly, if you want to keep your block storage volumes, you
200
- * must first detach them before issuing the `terminate` command. For more
201
- * information, read the [Volumes](#path-volumes-list-volumes) documentation.
197
+ * Keep in mind that `terminate` an Instance will result in the deletion of
198
+ * `l_ssd`, `b_ssd` and `scratch` volumes types, `sbs_volume` volumes type
199
+ * will only be detached. If you want to preserve your volumes, you should
200
+ * detach them before the Instance deletion or `terminate` action.
202
201
  *
203
202
  * @param request - The request {@link ServerActionRequest}
204
203
  * @returns A Promise of ServerActionResponse
@@ -74,15 +74,14 @@ export declare class API extends ParentAPI {
74
74
  * and release the hypervisor slot. `stop_in_place`: Stop the Instance, but
75
75
  * keep the slot on the hypervisor. `reboot`: Stop the instance and restart
76
76
  * it. `backup`: Create an image with all the volumes of an Instance.
77
- * `terminate`: Delete the Instance along with all attached volumes.
78
- * `enable_routed_ip`: Migrate the Instance to the new network stack.
79
- *
80
- * Keep in mind that terminating an Instance will result in the deletion of
81
- * all attached volumes, including local and block storage. If you want to
82
- * preserve your local volumes, you should use the `archive` action instead of
83
- * `terminate`. Similarly, if you want to keep your block storage volumes, you
84
- * must first detach them before issuing the `terminate` command. For more
85
- * information, read the [Volumes](#path-volumes-list-volumes) documentation.
77
+ * `terminate`: Delete the Instance along with its attached volumes, except
78
+ * for SBS volumes. `enable_routed_ip`: Migrate the Instance to the new
79
+ * network stack.
80
+ *
81
+ * Keep in mind that `terminate` an Instance will result in the deletion of
82
+ * `l_ssd`, `b_ssd` and `scratch` volumes types, `sbs_volume` volumes type
83
+ * will only be detached. If you want to preserve your volumes, you should
84
+ * detach them before the Instance deletion or `terminate` action.
86
85
  *
87
86
  * @param request - The request {@link ServerActionRequest}
88
87
  * @returns A Promise of ServerActionResponse
@@ -188,15 +188,14 @@ class API extends API$1 {
188
188
  * and release the hypervisor slot. `stop_in_place`: Stop the Instance, but
189
189
  * keep the slot on the hypervisor. `reboot`: Stop the instance and restart
190
190
  * it. `backup`: Create an image with all the volumes of an Instance.
191
- * `terminate`: Delete the Instance along with all attached volumes.
192
- * `enable_routed_ip`: Migrate the Instance to the new network stack.
191
+ * `terminate`: Delete the Instance along with its attached volumes, except
192
+ * for SBS volumes. `enable_routed_ip`: Migrate the Instance to the new
193
+ * network stack.
193
194
  *
194
- * Keep in mind that terminating an Instance will result in the deletion of
195
- * all attached volumes, including local and block storage. If you want to
196
- * preserve your local volumes, you should use the `archive` action instead of
197
- * `terminate`. Similarly, if you want to keep your block storage volumes, you
198
- * must first detach them before issuing the `terminate` command. For more
199
- * information, read the [Volumes](#path-volumes-list-volumes) documentation.
195
+ * Keep in mind that `terminate` an Instance will result in the deletion of
196
+ * `l_ssd`, `b_ssd` and `scratch` volumes types, `sbs_volume` volumes type
197
+ * will only be detached. If you want to preserve your volumes, you should
198
+ * detach them before the Instance deletion or `terminate` action.
200
199
  *
201
200
  * @param request - The request {@link ServerActionRequest}
202
201
  * @returns A Promise of ServerActionResponse
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const version = "v2.47.0";
3
+ const version = "v2.49.0";
4
4
  const userAgent = `scaleway-sdk-js/${version}`;
5
5
  exports.userAgent = userAgent;
6
6
  exports.version = version;
@@ -1,2 +1,2 @@
1
- export declare const version = "v2.47.0";
2
- export declare const userAgent = "scaleway-sdk-js/v2.47.0";
1
+ export declare const version = "v2.49.0";
2
+ export declare const userAgent = "scaleway-sdk-js/v2.49.0";
@@ -1,4 +1,4 @@
1
- const version = "v2.47.0";
1
+ const version = "v2.49.0";
2
2
  const userAgent = `scaleway-sdk-js/${version}`;
3
3
  export {
4
4
  userAgent,
@@ -65,12 +65,25 @@ const unmarshalTimeSeries = (data) => {
65
65
  };
66
66
  };
67
67
  const unmarshalDecimal = (data) => {
68
- if (!(typeof data === "string")) {
68
+ if (!(typeof data === "object")) {
69
69
  throw new TypeError(
70
- `Unmarshalling the type 'Decimal' failed as data isn't a string.`
70
+ `Unmarshalling the type 'Decimal' failed as data isn't an object.`
71
71
  );
72
72
  }
73
- return new customTypes.Decimal(data);
73
+ if (data === null) {
74
+ return null;
75
+ }
76
+ if (!("value" in data)) {
77
+ throw new TypeError(
78
+ `Unmarshalling the type 'Decimal' failed as data object does not have a 'value' key.`
79
+ );
80
+ }
81
+ if (!(typeof data.value === "string")) {
82
+ throw new TypeError(
83
+ `Unmarshalling the type 'Decimal' failed as 'value' is not a string.`
84
+ );
85
+ }
86
+ return new customTypes.Decimal(data.value);
74
87
  };
75
88
  const marshalScwFile = (obj) => ({
76
89
  content: obj.content,
@@ -96,7 +109,9 @@ const marshalTimeSeries = (obj) => ({
96
109
  name: obj.name,
97
110
  points: obj.points.map((elt) => marshalTimeSeriesPoint(elt))
98
111
  });
99
- const marshalDecimal = (obj) => obj.toString();
112
+ const marshalDecimal = (obj) => ({
113
+ value: obj.toString()
114
+ });
100
115
  exports.marshalBlobToScwFile = marshalBlobToScwFile;
101
116
  exports.marshalDecimal = marshalDecimal;
102
117
  exports.marshalMoney = marshalMoney;
@@ -39,7 +39,7 @@ export declare const unmarshalTimeSeries: (data: unknown) => TimeSeries;
39
39
  *
40
40
  * @internal
41
41
  */
42
- export declare const unmarshalDecimal: (data: unknown) => Decimal;
42
+ export declare const unmarshalDecimal: (data: unknown) => Decimal | null;
43
43
  /**
44
44
  * Marshals {@link ScwFile}.
45
45
  *
@@ -75,4 +75,6 @@ export declare const marshalTimeSeries: (obj: TimeSeries) => Record<string, unkn
75
75
  *
76
76
  * @internal
77
77
  */
78
- export declare const marshalDecimal: (obj: Decimal) => string;
78
+ export declare const marshalDecimal: (obj: Decimal) => {
79
+ value: string;
80
+ };