@scaleway/sdk 2.70.0 → 2.71.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.
Files changed (89) hide show
  1. package/dist/api/applesilicon/v1alpha1/api.gen.cjs +3 -1
  2. package/dist/api/applesilicon/v1alpha1/api.gen.js +3 -1
  3. package/dist/api/baremetal/v1/api.gen.cjs +3 -1
  4. package/dist/api/baremetal/v1/api.gen.js +3 -1
  5. package/dist/api/baremetal/v1/marshalling.gen.cjs +4 -2
  6. package/dist/api/baremetal/v1/marshalling.gen.js +4 -2
  7. package/dist/api/baremetal/v1/types.gen.d.ts +65 -64
  8. package/dist/api/block/v1/api.gen.cjs +6 -2
  9. package/dist/api/block/v1/api.gen.js +6 -2
  10. package/dist/api/block/v1alpha1/api.gen.cjs +6 -2
  11. package/dist/api/block/v1alpha1/api.gen.js +6 -2
  12. package/dist/api/block/v1alpha1/marshalling.gen.cjs +0 -1
  13. package/dist/api/block/v1alpha1/marshalling.gen.d.ts +1 -2
  14. package/dist/api/block/v1alpha1/marshalling.gen.js +0 -1
  15. package/dist/api/container/v1beta1/api.gen.cjs +18 -6
  16. package/dist/api/container/v1beta1/api.gen.js +18 -6
  17. package/dist/api/dedibox/v1/api.gen.cjs +9 -3
  18. package/dist/api/dedibox/v1/api.gen.js +9 -3
  19. package/dist/api/domain/v2beta1/api.gen.cjs +3 -1
  20. package/dist/api/domain/v2beta1/api.gen.js +3 -1
  21. package/dist/api/edge_services/v1beta1/api.gen.cjs +6 -2
  22. package/dist/api/edge_services/v1beta1/api.gen.js +6 -2
  23. package/dist/api/edge_services/v1beta1/types.gen.d.ts +1 -1
  24. package/dist/api/function/v1beta1/api.gen.cjs +18 -6
  25. package/dist/api/function/v1beta1/api.gen.js +18 -6
  26. package/dist/api/function/v1beta1/types.gen.d.ts +1 -1
  27. package/dist/api/iam/v1alpha1/marshalling.gen.cjs +12 -0
  28. package/dist/api/iam/v1alpha1/marshalling.gen.js +12 -0
  29. package/dist/api/iam/v1alpha1/types.gen.d.ts +24 -0
  30. package/dist/api/iam/v1alpha1/validation-rules.gen.cjs +15 -0
  31. package/dist/api/iam/v1alpha1/validation-rules.gen.d.ts +14 -0
  32. package/dist/api/iam/v1alpha1/validation-rules.gen.js +15 -0
  33. package/dist/api/inference/v1/api.gen.cjs +6 -2
  34. package/dist/api/inference/v1/api.gen.js +6 -2
  35. package/dist/api/inference/v1/marshalling.gen.cjs +4 -4
  36. package/dist/api/inference/v1/marshalling.gen.js +4 -4
  37. package/dist/api/inference/v1/types.gen.d.ts +32 -30
  38. package/dist/api/inference/v1beta1/api.gen.cjs +3 -1
  39. package/dist/api/inference/v1beta1/api.gen.js +3 -1
  40. package/dist/api/instance/v1/marshalling.gen.cjs +0 -1
  41. package/dist/api/instance/v1/marshalling.gen.js +0 -1
  42. package/dist/api/instance/v1/types.gen.d.ts +0 -2
  43. package/dist/api/k8s/v1/api.gen.cjs +3 -1
  44. package/dist/api/k8s/v1/api.gen.js +3 -1
  45. package/dist/api/k8s/v1/marshalling.gen.cjs +1 -0
  46. package/dist/api/k8s/v1/marshalling.gen.js +1 -0
  47. package/dist/api/k8s/v1/types.gen.d.ts +5 -0
  48. package/dist/api/lb/v1/types.gen.d.ts +3 -3
  49. package/dist/api/mongodb/v1alpha1/api.gen.cjs +6 -2
  50. package/dist/api/mongodb/v1alpha1/api.gen.js +6 -2
  51. package/dist/api/qaas/v1alpha1/api.gen.cjs +6 -2
  52. package/dist/api/qaas/v1alpha1/api.gen.js +6 -2
  53. package/dist/api/rdb/v1/api.gen.cjs +6 -2
  54. package/dist/api/rdb/v1/api.gen.js +6 -2
  55. package/dist/api/redis/v1/api.gen.cjs +3 -1
  56. package/dist/api/redis/v1/api.gen.js +3 -1
  57. package/dist/api/registry/v1/api.gen.cjs +9 -3
  58. package/dist/api/registry/v1/api.gen.js +9 -3
  59. package/dist/api/secret/v1beta1/api.gen.cjs +32 -0
  60. package/dist/api/secret/v1beta1/api.gen.d.ts +17 -1
  61. package/dist/api/secret/v1beta1/api.gen.js +32 -0
  62. package/dist/api/secret/v1beta1/index.gen.d.ts +1 -1
  63. package/dist/api/secret/v1beta1/types.gen.d.ts +17 -0
  64. package/dist/api/serverless_sqldb/v1alpha1/api.gen.cjs +3 -1
  65. package/dist/api/serverless_sqldb/v1alpha1/api.gen.js +3 -1
  66. package/dist/api/vpc/v2/api.gen.cjs +33 -0
  67. package/dist/api/vpc/v2/api.gen.d.ts +17 -1
  68. package/dist/api/vpc/v2/api.gen.js +34 -1
  69. package/dist/api/vpc/v2/index.gen.d.ts +1 -1
  70. package/dist/api/vpc/v2/marshalling.gen.cjs +59 -0
  71. package/dist/api/vpc/v2/marshalling.gen.d.ts +4 -1
  72. package/dist/api/vpc/v2/marshalling.gen.js +59 -0
  73. package/dist/api/vpc/v2/types.gen.d.ts +80 -0
  74. package/dist/api/vpc/v2/validation-rules.gen.cjs +18 -0
  75. package/dist/api/vpc/v2/validation-rules.gen.d.ts +17 -0
  76. package/dist/api/vpc/v2/validation-rules.gen.js +18 -0
  77. package/dist/api/vpcgw/v1/api.gen.cjs +3 -1
  78. package/dist/api/vpcgw/v1/api.gen.js +3 -1
  79. package/dist/api/vpcgw/v2/api.gen.cjs +3 -1
  80. package/dist/api/vpcgw/v2/api.gen.js +3 -1
  81. package/dist/api/webhosting/v1/api.gen.cjs +6 -2
  82. package/dist/api/webhosting/v1/api.gen.js +6 -2
  83. package/dist/api/webhosting/v1/marshalling.gen.cjs +17 -14
  84. package/dist/api/webhosting/v1/marshalling.gen.js +17 -14
  85. package/dist/api/webhosting/v1/types.gen.d.ts +13 -3
  86. package/dist/scw/constants.cjs +1 -1
  87. package/dist/scw/constants.d.ts +2 -2
  88. package/dist/scw/constants.js +1 -1
  89. package/package.json +2 -2
@@ -385,6 +385,38 @@ class API extends API$1 {
385
385
  * @returns A Promise of ListSecretTypesResponse
386
386
  */
387
387
  listSecretTypes = (request = {}) => enrichForPagination("types", this.pageOfListSecretTypes, request);
388
+ /**
389
+ * Restore a version. Restore a secret's version specified by the `region`,
390
+ * `secret_id` and `revision` parameters.
391
+ *
392
+ * @param request - The request {@link RestoreSecretVersionRequest}
393
+ * @returns A Promise of SecretVersion
394
+ */
395
+ restoreSecretVersion = (request) => this.client.fetch(
396
+ {
397
+ body: "{}",
398
+ headers: jsonContentHeaders,
399
+ method: "POST",
400
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/versions/${validatePathParam("revision", request.revision)}/restore`
401
+ },
402
+ unmarshalSecretVersion
403
+ );
404
+ /**
405
+ * Restore a secret. Restore a secret and all its versions scheduled for
406
+ * deletion specified by the `region` and `secret_id` parameters.
407
+ *
408
+ * @param request - The request {@link RestoreSecretRequest}
409
+ * @returns A Promise of Secret
410
+ */
411
+ restoreSecret = (request) => this.client.fetch(
412
+ {
413
+ body: "{}",
414
+ headers: jsonContentHeaders,
415
+ method: "POST",
416
+ path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}/restore`
417
+ },
418
+ unmarshalSecret
419
+ );
388
420
  }
389
421
  export {
390
422
  API
@@ -1,3 +1,3 @@
1
1
  export { API } from './api.gen.js';
2
- export type { AccessSecretVersionByPathRequest, AccessSecretVersionRequest, AccessSecretVersionResponse, AddSecretOwnerRequest, BasicCredentials, BrowseSecretsRequest, BrowseSecretsRequestOrderBy, BrowseSecretsResponse, BrowseSecretsResponseItem, BrowseSecretsResponseItemFolderDetails, BrowseSecretsResponseItemSecretDetails, CreateSecretRequest, CreateSecretVersionRequest, DatabaseCredentials, DeleteSecretRequest, DeleteSecretVersionRequest, DisableSecretVersionRequest, EnableSecretVersionRequest, EphemeralPolicy, EphemeralPolicyAction, EphemeralProperties, GetSecretRequest, GetSecretVersionRequest, ListSecretTypesRequest, ListSecretTypesResponse, ListSecretVersionsRequest, ListSecretVersionsResponse, ListSecretsRequest, ListSecretsRequestOrderBy, ListSecretsResponse, ListTagsRequest, ListTagsResponse, Product, ProtectSecretRequest, SSHKey, Secret, SecretStatus, SecretType, SecretVersion, SecretVersionStatus, UnprotectSecretRequest, UpdateSecretRequest, UpdateSecretVersionRequest, } from './types.gen';
2
+ export type { AccessSecretVersionByPathRequest, AccessSecretVersionRequest, AccessSecretVersionResponse, AddSecretOwnerRequest, BasicCredentials, BrowseSecretsRequest, BrowseSecretsRequestOrderBy, BrowseSecretsResponse, BrowseSecretsResponseItem, BrowseSecretsResponseItemFolderDetails, BrowseSecretsResponseItemSecretDetails, CreateSecretRequest, CreateSecretVersionRequest, DatabaseCredentials, DeleteSecretRequest, DeleteSecretVersionRequest, DisableSecretVersionRequest, EnableSecretVersionRequest, EphemeralPolicy, EphemeralPolicyAction, EphemeralProperties, GetSecretRequest, GetSecretVersionRequest, ListSecretTypesRequest, ListSecretTypesResponse, ListSecretVersionsRequest, ListSecretVersionsResponse, ListSecretsRequest, ListSecretsRequestOrderBy, ListSecretsResponse, ListTagsRequest, ListTagsResponse, Product, ProtectSecretRequest, RestoreSecretRequest, RestoreSecretVersionRequest, SSHKey, Secret, SecretStatus, SecretType, SecretVersion, SecretVersionStatus, UnprotectSecretRequest, UpdateSecretRequest, UpdateSecretVersionRequest, } from './types.gen';
3
3
  export * as ValidationRules from './validation-rules.gen.js';
@@ -485,6 +485,23 @@ export type ProtectSecretRequest = {
485
485
  /** ID of the secret to enable secret protection for. */
486
486
  secretId: string;
487
487
  };
488
+ export type RestoreSecretRequest = {
489
+ /**
490
+ * Region to target. If none is passed will use default region from the
491
+ * config.
492
+ */
493
+ region?: ScwRegion;
494
+ secretId: string;
495
+ };
496
+ export type RestoreSecretVersionRequest = {
497
+ /**
498
+ * Region to target. If none is passed will use default region from the
499
+ * config.
500
+ */
501
+ region?: ScwRegion;
502
+ secretId: string;
503
+ revision: string;
504
+ };
488
505
  export interface SSHKey {
489
506
  /** The private SSH key. */
490
507
  sshPrivateKey: string;
@@ -54,7 +54,9 @@ class API extends api.API {
54
54
  * @returns A Promise of Database
55
55
  */
56
56
  waitForDatabase = (request, options) => intervalRetrier.waitForResource(
57
- options?.stop ?? ((res) => Promise.resolve(!content_gen.DATABASE_TRANSIENT_STATUSES.includes(res.status))),
57
+ options?.stop ?? ((res) => Promise.resolve(
58
+ !content_gen.DATABASE_TRANSIENT_STATUSES.includes(res.status)
59
+ )),
58
60
  this.getDatabase,
59
61
  request,
60
62
  options
@@ -52,7 +52,9 @@ class API extends API$1 {
52
52
  * @returns A Promise of Database
53
53
  */
54
54
  waitForDatabase = (request, options) => waitForResource(
55
- options?.stop ?? ((res) => Promise.resolve(!DATABASE_TRANSIENT_STATUSES.includes(res.status))),
55
+ options?.stop ?? ((res) => Promise.resolve(
56
+ !DATABASE_TRANSIENT_STATUSES.includes(res.status)
57
+ )),
56
58
  this.getDatabase,
57
59
  request,
58
60
  options
@@ -368,5 +368,38 @@ class API extends api.API {
368
368
  method: "DELETE",
369
369
  path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam("routeId", request.routeId)}`
370
370
  });
371
+ /**
372
+ * Get Acl Rules for VPC. Retrieve a list of ACL rules for a VPC, specified by
373
+ * its VPC ID.
374
+ *
375
+ * @param request - The request {@link GetAclRequest}
376
+ * @returns A Promise of GetAclResponse
377
+ */
378
+ getAcl = (request) => this.client.fetch(
379
+ {
380
+ method: "GET",
381
+ path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${marshalling.validatePathParam("vpcId", request.vpcId)}/acl-rules`,
382
+ urlParams: marshalling.urlParams(["is_ipv6", request.isIpv6])
383
+ },
384
+ marshalling_gen.unmarshalGetAclResponse
385
+ );
386
+ /**
387
+ * Set VPC ACL rules. Set the list of ACL rules and the default routing policy
388
+ * for a VPC.
389
+ *
390
+ * @param request - The request {@link SetAclRequest}
391
+ * @returns A Promise of SetAclResponse
392
+ */
393
+ setAcl = (request) => this.client.fetch(
394
+ {
395
+ body: JSON.stringify(
396
+ marshalling_gen.marshalSetAclRequest(request, this.client.settings)
397
+ ),
398
+ headers: jsonContentHeaders,
399
+ method: "PUT",
400
+ path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${marshalling.validatePathParam("vpcId", request.vpcId)}/acl-rules`
401
+ },
402
+ marshalling_gen.unmarshalSetAclResponse
403
+ );
371
404
  }
372
405
  exports.API = API;
@@ -1,6 +1,6 @@
1
1
  import { API as ParentAPI } from '../../../bridge';
2
2
  import type { Region as ScwRegion } from '../../../bridge';
3
- import type { AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteRouteRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCRequest, EnableDHCPRequest, EnableRoutingRequest, GetPrivateNetworkRequest, GetRouteRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksResponse, ListSubnetsRequest, ListSubnetsResponse, ListVPCsRequest, ListVPCsResponse, PrivateNetwork, Route, SetSubnetsRequest, SetSubnetsResponse, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC } from './types.gen';
3
+ import type { AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteRouteRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCRequest, EnableDHCPRequest, EnableRoutingRequest, GetAclRequest, GetAclResponse, GetPrivateNetworkRequest, GetRouteRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksResponse, ListSubnetsRequest, ListSubnetsResponse, ListVPCsRequest, ListVPCsResponse, PrivateNetwork, Route, SetAclRequest, SetAclResponse, SetSubnetsRequest, SetSubnetsResponse, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC } from './types.gen';
4
4
  /**
5
5
  * VPC API.
6
6
  *
@@ -176,4 +176,20 @@ export declare class API extends ParentAPI {
176
176
  * @param request - The request {@link DeleteRouteRequest}
177
177
  */
178
178
  deleteRoute: (request: Readonly<DeleteRouteRequest>) => Promise<void>;
179
+ /**
180
+ * Get Acl Rules for VPC. Retrieve a list of ACL rules for a VPC, specified by
181
+ * its VPC ID.
182
+ *
183
+ * @param request - The request {@link GetAclRequest}
184
+ * @returns A Promise of GetAclResponse
185
+ */
186
+ getAcl: (request: Readonly<GetAclRequest>) => Promise<GetAclResponse>;
187
+ /**
188
+ * Set VPC ACL rules. Set the list of ACL rules and the default routing policy
189
+ * for a VPC.
190
+ *
191
+ * @param request - The request {@link SetAclRequest}
192
+ * @returns A Promise of SetAclResponse
193
+ */
194
+ setAcl: (request: Readonly<SetAclRequest>) => Promise<SetAclResponse>;
179
195
  }
@@ -2,7 +2,7 @@ import { API as API$1 } from "../../../scw/api.js";
2
2
  import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
3
3
  import "../../../vendor/base64/index.js";
4
4
  import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
5
- import { unmarshalListVPCsResponse, marshalCreateVPCRequest, unmarshalVPC, marshalUpdateVPCRequest, unmarshalListPrivateNetworksResponse, marshalCreatePrivateNetworkRequest, unmarshalPrivateNetwork, marshalUpdatePrivateNetworkRequest, unmarshalListSubnetsResponse, marshalSetSubnetsRequest, unmarshalSetSubnetsResponse, marshalAddSubnetsRequest, unmarshalAddSubnetsResponse, marshalDeleteSubnetsRequest, unmarshalDeleteSubnetsResponse, marshalCreateRouteRequest, unmarshalRoute, marshalUpdateRouteRequest } from "./marshalling.gen.js";
5
+ import { unmarshalListVPCsResponse, marshalCreateVPCRequest, unmarshalVPC, marshalUpdateVPCRequest, unmarshalListPrivateNetworksResponse, marshalCreatePrivateNetworkRequest, unmarshalPrivateNetwork, marshalUpdatePrivateNetworkRequest, unmarshalListSubnetsResponse, marshalSetSubnetsRequest, unmarshalSetSubnetsResponse, marshalAddSubnetsRequest, unmarshalAddSubnetsResponse, marshalDeleteSubnetsRequest, unmarshalDeleteSubnetsResponse, marshalCreateRouteRequest, unmarshalRoute, marshalUpdateRouteRequest, unmarshalGetAclResponse, marshalSetAclRequest, unmarshalSetAclResponse } from "./marshalling.gen.js";
6
6
  const jsonContentHeaders = {
7
7
  "Content-Type": "application/json; charset=utf-8"
8
8
  };
@@ -366,6 +366,39 @@ class API extends API$1 {
366
366
  method: "DELETE",
367
367
  path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
368
368
  });
369
+ /**
370
+ * Get Acl Rules for VPC. Retrieve a list of ACL rules for a VPC, specified by
371
+ * its VPC ID.
372
+ *
373
+ * @param request - The request {@link GetAclRequest}
374
+ * @returns A Promise of GetAclResponse
375
+ */
376
+ getAcl = (request) => this.client.fetch(
377
+ {
378
+ method: "GET",
379
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`,
380
+ urlParams: urlParams(["is_ipv6", request.isIpv6])
381
+ },
382
+ unmarshalGetAclResponse
383
+ );
384
+ /**
385
+ * Set VPC ACL rules. Set the list of ACL rules and the default routing policy
386
+ * for a VPC.
387
+ *
388
+ * @param request - The request {@link SetAclRequest}
389
+ * @returns A Promise of SetAclResponse
390
+ */
391
+ setAcl = (request) => this.client.fetch(
392
+ {
393
+ body: JSON.stringify(
394
+ marshalSetAclRequest(request, this.client.settings)
395
+ ),
396
+ headers: jsonContentHeaders,
397
+ method: "PUT",
398
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`
399
+ },
400
+ unmarshalSetAclResponse
401
+ );
369
402
  }
370
403
  export {
371
404
  API
@@ -1,3 +1,3 @@
1
1
  export { API } from './api.gen.js';
2
- export type { AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteRouteRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCRequest, EnableDHCPRequest, EnableRoutingRequest, GetPrivateNetworkRequest, GetRouteRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksRequestOrderBy, ListPrivateNetworksResponse, ListSubnetsRequest, ListSubnetsRequestOrderBy, ListSubnetsResponse, ListVPCsRequest, ListVPCsRequestOrderBy, ListVPCsResponse, PrivateNetwork, Route, SetSubnetsRequest, SetSubnetsResponse, Subnet, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC, } from './types.gen';
2
+ export type { AclRule, AclRuleProtocol, Action, AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteRouteRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCRequest, EnableDHCPRequest, EnableRoutingRequest, GetAclRequest, GetAclResponse, GetPrivateNetworkRequest, GetRouteRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksRequestOrderBy, ListPrivateNetworksResponse, ListSubnetsRequest, ListSubnetsRequestOrderBy, ListSubnetsResponse, ListVPCsRequest, ListVPCsRequestOrderBy, ListVPCsResponse, PrivateNetwork, Route, SetAclRequest, SetAclResponse, SetSubnetsRequest, SetSubnetsResponse, Subnet, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC, } from './types.gen';
3
3
  export * as ValidationRules from './validation-rules.gen.js';
@@ -100,6 +100,35 @@ const unmarshalDeleteSubnetsResponse = (data) => {
100
100
  subnets: data.subnets
101
101
  };
102
102
  };
103
+ const unmarshalAclRule = (data) => {
104
+ if (!json.isJSONObject(data)) {
105
+ throw new TypeError(
106
+ `Unmarshalling the type 'AclRule' failed as data isn't a dictionary.`
107
+ );
108
+ }
109
+ return {
110
+ action: data.action,
111
+ description: data.description,
112
+ destination: data.destination,
113
+ dstPortHigh: data.dst_port_high,
114
+ dstPortLow: data.dst_port_low,
115
+ protocol: data.protocol,
116
+ source: data.source,
117
+ srcPortHigh: data.src_port_high,
118
+ srcPortLow: data.src_port_low
119
+ };
120
+ };
121
+ const unmarshalGetAclResponse = (data) => {
122
+ if (!json.isJSONObject(data)) {
123
+ throw new TypeError(
124
+ `Unmarshalling the type 'GetAclResponse' failed as data isn't a dictionary.`
125
+ );
126
+ }
127
+ return {
128
+ defaultPolicy: data.default_policy,
129
+ rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalAclRule)
130
+ };
131
+ };
103
132
  const unmarshalListPrivateNetworksResponse = (data) => {
104
133
  if (!json.isJSONObject(data)) {
105
134
  throw new TypeError(
@@ -136,6 +165,17 @@ const unmarshalListVPCsResponse = (data) => {
136
165
  vpcs: marshalling.unmarshalArrayOfObject(data.vpcs, unmarshalVPC)
137
166
  };
138
167
  };
168
+ const unmarshalSetAclResponse = (data) => {
169
+ if (!json.isJSONObject(data)) {
170
+ throw new TypeError(
171
+ `Unmarshalling the type 'SetAclResponse' failed as data isn't a dictionary.`
172
+ );
173
+ }
174
+ return {
175
+ defaultPolicy: data.default_policy,
176
+ rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalAclRule)
177
+ };
178
+ };
139
179
  const unmarshalSetSubnetsResponse = (data) => {
140
180
  if (!json.isJSONObject(data)) {
141
181
  throw new TypeError(
@@ -173,6 +213,22 @@ const marshalCreateVPCRequest = (request, defaults) => ({
173
213
  const marshalDeleteSubnetsRequest = (request, defaults) => ({
174
214
  subnets: request.subnets
175
215
  });
216
+ const marshalAclRule = (request, defaults) => ({
217
+ action: request.action,
218
+ description: request.description,
219
+ destination: request.destination,
220
+ dst_port_high: request.dstPortHigh,
221
+ dst_port_low: request.dstPortLow,
222
+ protocol: request.protocol,
223
+ source: request.source,
224
+ src_port_high: request.srcPortHigh,
225
+ src_port_low: request.srcPortLow
226
+ });
227
+ const marshalSetAclRequest = (request, defaults) => ({
228
+ default_policy: request.defaultPolicy,
229
+ is_ipv6: request.isIpv6,
230
+ rules: request.rules.map((elt) => marshalAclRule(elt))
231
+ });
176
232
  const marshalSetSubnetsRequest = (request, defaults) => ({
177
233
  subnets: request.subnets
178
234
  });
@@ -196,16 +252,19 @@ exports.marshalCreatePrivateNetworkRequest = marshalCreatePrivateNetworkRequest;
196
252
  exports.marshalCreateRouteRequest = marshalCreateRouteRequest;
197
253
  exports.marshalCreateVPCRequest = marshalCreateVPCRequest;
198
254
  exports.marshalDeleteSubnetsRequest = marshalDeleteSubnetsRequest;
255
+ exports.marshalSetAclRequest = marshalSetAclRequest;
199
256
  exports.marshalSetSubnetsRequest = marshalSetSubnetsRequest;
200
257
  exports.marshalUpdatePrivateNetworkRequest = marshalUpdatePrivateNetworkRequest;
201
258
  exports.marshalUpdateRouteRequest = marshalUpdateRouteRequest;
202
259
  exports.marshalUpdateVPCRequest = marshalUpdateVPCRequest;
203
260
  exports.unmarshalAddSubnetsResponse = unmarshalAddSubnetsResponse;
204
261
  exports.unmarshalDeleteSubnetsResponse = unmarshalDeleteSubnetsResponse;
262
+ exports.unmarshalGetAclResponse = unmarshalGetAclResponse;
205
263
  exports.unmarshalListPrivateNetworksResponse = unmarshalListPrivateNetworksResponse;
206
264
  exports.unmarshalListSubnetsResponse = unmarshalListSubnetsResponse;
207
265
  exports.unmarshalListVPCsResponse = unmarshalListVPCsResponse;
208
266
  exports.unmarshalPrivateNetwork = unmarshalPrivateNetwork;
209
267
  exports.unmarshalRoute = unmarshalRoute;
268
+ exports.unmarshalSetAclResponse = unmarshalSetAclResponse;
210
269
  exports.unmarshalSetSubnetsResponse = unmarshalSetSubnetsResponse;
211
270
  exports.unmarshalVPC = unmarshalVPC;
@@ -1,19 +1,22 @@
1
1
  import type { DefaultValues } from '../../../bridge';
2
- import type { AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, ListPrivateNetworksResponse, ListSubnetsResponse, ListVPCsResponse, PrivateNetwork, Route, SetSubnetsRequest, SetSubnetsResponse, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC } from './types.gen';
2
+ import type { AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, GetAclResponse, ListPrivateNetworksResponse, ListSubnetsResponse, ListVPCsResponse, PrivateNetwork, Route, SetAclRequest, SetAclResponse, SetSubnetsRequest, SetSubnetsResponse, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC } from './types.gen';
3
3
  export declare const unmarshalPrivateNetwork: (data: unknown) => PrivateNetwork;
4
4
  export declare const unmarshalRoute: (data: unknown) => Route;
5
5
  export declare const unmarshalVPC: (data: unknown) => VPC;
6
6
  export declare const unmarshalAddSubnetsResponse: (data: unknown) => AddSubnetsResponse;
7
7
  export declare const unmarshalDeleteSubnetsResponse: (data: unknown) => DeleteSubnetsResponse;
8
+ export declare const unmarshalGetAclResponse: (data: unknown) => GetAclResponse;
8
9
  export declare const unmarshalListPrivateNetworksResponse: (data: unknown) => ListPrivateNetworksResponse;
9
10
  export declare const unmarshalListSubnetsResponse: (data: unknown) => ListSubnetsResponse;
10
11
  export declare const unmarshalListVPCsResponse: (data: unknown) => ListVPCsResponse;
12
+ export declare const unmarshalSetAclResponse: (data: unknown) => SetAclResponse;
11
13
  export declare const unmarshalSetSubnetsResponse: (data: unknown) => SetSubnetsResponse;
12
14
  export declare const marshalAddSubnetsRequest: (request: AddSubnetsRequest, defaults: DefaultValues) => Record<string, unknown>;
13
15
  export declare const marshalCreatePrivateNetworkRequest: (request: CreatePrivateNetworkRequest, defaults: DefaultValues) => Record<string, unknown>;
14
16
  export declare const marshalCreateRouteRequest: (request: CreateRouteRequest, defaults: DefaultValues) => Record<string, unknown>;
15
17
  export declare const marshalCreateVPCRequest: (request: CreateVPCRequest, defaults: DefaultValues) => Record<string, unknown>;
16
18
  export declare const marshalDeleteSubnetsRequest: (request: DeleteSubnetsRequest, defaults: DefaultValues) => Record<string, unknown>;
19
+ export declare const marshalSetAclRequest: (request: SetAclRequest, defaults: DefaultValues) => Record<string, unknown>;
17
20
  export declare const marshalSetSubnetsRequest: (request: SetSubnetsRequest, defaults: DefaultValues) => Record<string, unknown>;
18
21
  export declare const marshalUpdatePrivateNetworkRequest: (request: UpdatePrivateNetworkRequest, defaults: DefaultValues) => Record<string, unknown>;
19
22
  export declare const marshalUpdateRouteRequest: (request: UpdateRouteRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -98,6 +98,35 @@ const unmarshalDeleteSubnetsResponse = (data) => {
98
98
  subnets: data.subnets
99
99
  };
100
100
  };
101
+ const unmarshalAclRule = (data) => {
102
+ if (!isJSONObject(data)) {
103
+ throw new TypeError(
104
+ `Unmarshalling the type 'AclRule' failed as data isn't a dictionary.`
105
+ );
106
+ }
107
+ return {
108
+ action: data.action,
109
+ description: data.description,
110
+ destination: data.destination,
111
+ dstPortHigh: data.dst_port_high,
112
+ dstPortLow: data.dst_port_low,
113
+ protocol: data.protocol,
114
+ source: data.source,
115
+ srcPortHigh: data.src_port_high,
116
+ srcPortLow: data.src_port_low
117
+ };
118
+ };
119
+ const unmarshalGetAclResponse = (data) => {
120
+ if (!isJSONObject(data)) {
121
+ throw new TypeError(
122
+ `Unmarshalling the type 'GetAclResponse' failed as data isn't a dictionary.`
123
+ );
124
+ }
125
+ return {
126
+ defaultPolicy: data.default_policy,
127
+ rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
128
+ };
129
+ };
101
130
  const unmarshalListPrivateNetworksResponse = (data) => {
102
131
  if (!isJSONObject(data)) {
103
132
  throw new TypeError(
@@ -134,6 +163,17 @@ const unmarshalListVPCsResponse = (data) => {
134
163
  vpcs: unmarshalArrayOfObject(data.vpcs, unmarshalVPC)
135
164
  };
136
165
  };
166
+ const unmarshalSetAclResponse = (data) => {
167
+ if (!isJSONObject(data)) {
168
+ throw new TypeError(
169
+ `Unmarshalling the type 'SetAclResponse' failed as data isn't a dictionary.`
170
+ );
171
+ }
172
+ return {
173
+ defaultPolicy: data.default_policy,
174
+ rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
175
+ };
176
+ };
137
177
  const unmarshalSetSubnetsResponse = (data) => {
138
178
  if (!isJSONObject(data)) {
139
179
  throw new TypeError(
@@ -171,6 +211,22 @@ const marshalCreateVPCRequest = (request, defaults) => ({
171
211
  const marshalDeleteSubnetsRequest = (request, defaults) => ({
172
212
  subnets: request.subnets
173
213
  });
214
+ const marshalAclRule = (request, defaults) => ({
215
+ action: request.action,
216
+ description: request.description,
217
+ destination: request.destination,
218
+ dst_port_high: request.dstPortHigh,
219
+ dst_port_low: request.dstPortLow,
220
+ protocol: request.protocol,
221
+ source: request.source,
222
+ src_port_high: request.srcPortHigh,
223
+ src_port_low: request.srcPortLow
224
+ });
225
+ const marshalSetAclRequest = (request, defaults) => ({
226
+ default_policy: request.defaultPolicy,
227
+ is_ipv6: request.isIpv6,
228
+ rules: request.rules.map((elt) => marshalAclRule(elt))
229
+ });
174
230
  const marshalSetSubnetsRequest = (request, defaults) => ({
175
231
  subnets: request.subnets
176
232
  });
@@ -195,17 +251,20 @@ export {
195
251
  marshalCreateRouteRequest,
196
252
  marshalCreateVPCRequest,
197
253
  marshalDeleteSubnetsRequest,
254
+ marshalSetAclRequest,
198
255
  marshalSetSubnetsRequest,
199
256
  marshalUpdatePrivateNetworkRequest,
200
257
  marshalUpdateRouteRequest,
201
258
  marshalUpdateVPCRequest,
202
259
  unmarshalAddSubnetsResponse,
203
260
  unmarshalDeleteSubnetsResponse,
261
+ unmarshalGetAclResponse,
204
262
  unmarshalListPrivateNetworksResponse,
205
263
  unmarshalListSubnetsResponse,
206
264
  unmarshalListVPCsResponse,
207
265
  unmarshalPrivateNetwork,
208
266
  unmarshalRoute,
267
+ unmarshalSetAclResponse,
209
268
  unmarshalSetSubnetsResponse,
210
269
  unmarshalVPC
211
270
  };
@@ -1,4 +1,6 @@
1
1
  import type { Region as ScwRegion } from '../../../bridge';
2
+ export type AclRuleProtocol = 'ANY' | 'TCP' | 'UDP' | 'ICMP';
3
+ export type Action = 'unknown_action' | 'accept' | 'drop';
2
4
  export type ListPrivateNetworksRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
3
5
  export type ListSubnetsRequestOrderBy = 'created_at_asc' | 'created_at_desc';
4
6
  export type ListVPCsRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
@@ -66,6 +68,44 @@ export interface Route {
66
68
  /** Region of the Route. */
67
69
  region: ScwRegion;
68
70
  }
71
+ export interface AclRule {
72
+ /** Protocol to which this rule applies. */
73
+ protocol: AclRuleProtocol;
74
+ /**
75
+ * Source IP range to which this rule applies (CIDR notation with subnet
76
+ * mask).
77
+ */
78
+ source: string;
79
+ /**
80
+ * Starting port of the source port range to which this rule applies
81
+ * (inclusive).
82
+ */
83
+ srcPortLow: number;
84
+ /**
85
+ * Ending port of the source port range to which this rule applies
86
+ * (inclusive).
87
+ */
88
+ srcPortHigh: number;
89
+ /**
90
+ * Destination IP range to which this rule applies (CIDR notation with subnet
91
+ * mask).
92
+ */
93
+ destination: string;
94
+ /**
95
+ * Starting port of the destination port range to which this rule applies
96
+ * (inclusive).
97
+ */
98
+ dstPortLow: number;
99
+ /**
100
+ * Ending port of the destination port range to which this rule applies
101
+ * (inclusive).
102
+ */
103
+ dstPortHigh: number;
104
+ /** Policy to apply to the packet. */
105
+ action: Action;
106
+ /** Rule description. */
107
+ description?: string;
108
+ }
69
109
  export interface VPC {
70
110
  /** VPC ID. */
71
111
  id: string;
@@ -214,6 +254,24 @@ export type EnableRoutingRequest = {
214
254
  /** VPC ID. */
215
255
  vpcId: string;
216
256
  };
257
+ export type GetAclRequest = {
258
+ /**
259
+ * Region to target. If none is passed will use default region from the
260
+ * config.
261
+ */
262
+ region?: ScwRegion;
263
+ /** ID of the Network ACL's VPC. */
264
+ vpcId: string;
265
+ /**
266
+ * Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each
267
+ * Network ACL can have rules for only one IP type.
268
+ */
269
+ isIpv6: boolean;
270
+ };
271
+ export interface GetAclResponse {
272
+ rules: AclRule[];
273
+ defaultPolicy: Action;
274
+ }
217
275
  export type GetPrivateNetworkRequest = {
218
276
  /**
219
277
  * Region to target. If none is passed will use default region from the
@@ -374,6 +432,28 @@ export interface ListVPCsResponse {
374
432
  vpcs: VPC[];
375
433
  totalCount: number;
376
434
  }
435
+ export type SetAclRequest = {
436
+ /**
437
+ * Region to target. If none is passed will use default region from the
438
+ * config.
439
+ */
440
+ region?: ScwRegion;
441
+ /** ID of the Network ACL's VPC. */
442
+ vpcId: string;
443
+ /** List of Network ACL rules. */
444
+ rules: AclRule[];
445
+ /**
446
+ * Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each
447
+ * Network ACL can have rules for only one IP type.
448
+ */
449
+ isIpv6: boolean;
450
+ /** Action to take for packets which do not match any rules. */
451
+ defaultPolicy: Action;
452
+ };
453
+ export interface SetAclResponse {
454
+ rules: AclRule[];
455
+ defaultPolicy: Action;
456
+ }
377
457
  export type SetSubnetsRequest = {
378
458
  /**
379
459
  * Region to target. If none is passed will use default region from the
@@ -1,8 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const AclRule = {
4
+ description: {
5
+ maxLength: 200
6
+ },
7
+ dstPortHigh: {
8
+ lessThanOrEqual: 65536
9
+ },
10
+ dstPortLow: {
11
+ lessThanOrEqual: 65536
12
+ },
13
+ srcPortHigh: {
14
+ lessThanOrEqual: 65536
15
+ },
16
+ srcPortLow: {
17
+ lessThanOrEqual: 65536
18
+ }
19
+ };
3
20
  const Route = {
4
21
  description: {
5
22
  maxLength: 200
6
23
  }
7
24
  };
25
+ exports.AclRule = AclRule;
8
26
  exports.Route = Route;
@@ -1,3 +1,20 @@
1
+ export declare const AclRule: {
2
+ description: {
3
+ maxLength: number;
4
+ };
5
+ dstPortHigh: {
6
+ lessThanOrEqual: number;
7
+ };
8
+ dstPortLow: {
9
+ lessThanOrEqual: number;
10
+ };
11
+ srcPortHigh: {
12
+ lessThanOrEqual: number;
13
+ };
14
+ srcPortLow: {
15
+ lessThanOrEqual: number;
16
+ };
17
+ };
1
18
  export declare const Route: {
2
19
  description: {
3
20
  maxLength: number;
@@ -1,8 +1,26 @@
1
+ const AclRule = {
2
+ description: {
3
+ maxLength: 200
4
+ },
5
+ dstPortHigh: {
6
+ lessThanOrEqual: 65536
7
+ },
8
+ dstPortLow: {
9
+ lessThanOrEqual: 65536
10
+ },
11
+ srcPortHigh: {
12
+ lessThanOrEqual: 65536
13
+ },
14
+ srcPortLow: {
15
+ lessThanOrEqual: 65536
16
+ }
17
+ };
1
18
  const Route = {
2
19
  description: {
3
20
  maxLength: 200
4
21
  }
5
22
  };
6
23
  export {
24
+ AclRule,
7
25
  Route
8
26
  };
@@ -76,7 +76,9 @@ class API extends api.API {
76
76
  * @returns A Promise of Gateway
77
77
  */
78
78
  waitForGateway = (request, options) => intervalRetrier.waitForResource(
79
- options?.stop ?? ((res) => Promise.resolve(!content_gen.GATEWAY_TRANSIENT_STATUSES.includes(res.status))),
79
+ options?.stop ?? ((res) => Promise.resolve(
80
+ !content_gen.GATEWAY_TRANSIENT_STATUSES.includes(res.status)
81
+ )),
80
82
  this.getGateway,
81
83
  request,
82
84
  options
@@ -74,7 +74,9 @@ class API extends API$1 {
74
74
  * @returns A Promise of Gateway
75
75
  */
76
76
  waitForGateway = (request, options) => waitForResource(
77
- options?.stop ?? ((res) => Promise.resolve(!GATEWAY_TRANSIENT_STATUSES.includes(res.status))),
77
+ options?.stop ?? ((res) => Promise.resolve(
78
+ !GATEWAY_TRANSIENT_STATUSES.includes(res.status)
79
+ )),
78
80
  this.getGateway,
79
81
  request,
80
82
  options
@@ -77,7 +77,9 @@ class API extends api.API {
77
77
  * @returns A Promise of Gateway
78
78
  */
79
79
  waitForGateway = (request, options) => intervalRetrier.waitForResource(
80
- options?.stop ?? ((res) => Promise.resolve(!content_gen.GATEWAY_TRANSIENT_STATUSES.includes(res.status))),
80
+ options?.stop ?? ((res) => Promise.resolve(
81
+ !content_gen.GATEWAY_TRANSIENT_STATUSES.includes(res.status)
82
+ )),
81
83
  this.getGateway,
82
84
  request,
83
85
  options