@scaleway/sdk 2.69.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 (131) hide show
  1. package/dist/api/account/v3/api.gen.cjs +23 -0
  2. package/dist/api/account/v3/api.gen.d.ts +11 -1
  3. package/dist/api/account/v3/api.gen.js +24 -1
  4. package/dist/api/account/v3/index.gen.d.ts +1 -1
  5. package/dist/api/account/v3/marshalling.gen.cjs +171 -0
  6. package/dist/api/account/v3/marshalling.gen.d.ts +3 -1
  7. package/dist/api/account/v3/marshalling.gen.js +173 -2
  8. package/dist/api/account/v3/types.gen.d.ts +93 -0
  9. package/dist/api/applesilicon/v1alpha1/api.gen.cjs +3 -1
  10. package/dist/api/applesilicon/v1alpha1/api.gen.js +3 -1
  11. package/dist/api/applesilicon/v1alpha1/types.gen.d.ts +3 -2
  12. package/dist/api/baremetal/v1/api.gen.cjs +3 -1
  13. package/dist/api/baremetal/v1/api.gen.js +3 -1
  14. package/dist/api/baremetal/v1/marshalling.gen.cjs +4 -2
  15. package/dist/api/baremetal/v1/marshalling.gen.js +4 -2
  16. package/dist/api/baremetal/v1/types.gen.d.ts +65 -64
  17. package/dist/api/block/v1/api.gen.cjs +6 -2
  18. package/dist/api/block/v1/api.gen.js +6 -2
  19. package/dist/api/block/v1alpha1/api.gen.cjs +6 -2
  20. package/dist/api/block/v1alpha1/api.gen.js +6 -2
  21. package/dist/api/block/v1alpha1/marshalling.gen.cjs +0 -1
  22. package/dist/api/block/v1alpha1/marshalling.gen.d.ts +1 -2
  23. package/dist/api/block/v1alpha1/marshalling.gen.js +0 -1
  24. package/dist/api/cockpit/v1/marshalling.gen.cjs +4 -4
  25. package/dist/api/cockpit/v1/marshalling.gen.js +4 -4
  26. package/dist/api/cockpit/v1/types.gen.d.ts +3 -3
  27. package/dist/api/container/v1beta1/api.gen.cjs +18 -6
  28. package/dist/api/container/v1beta1/api.gen.js +18 -6
  29. package/dist/api/dedibox/v1/api.gen.cjs +9 -3
  30. package/dist/api/dedibox/v1/api.gen.js +9 -3
  31. package/dist/api/domain/v2beta1/api.gen.cjs +3 -1
  32. package/dist/api/domain/v2beta1/api.gen.js +3 -1
  33. package/dist/api/edge_services/v1beta1/api.gen.cjs +6 -2
  34. package/dist/api/edge_services/v1beta1/api.gen.js +6 -2
  35. package/dist/api/edge_services/v1beta1/types.gen.d.ts +1 -1
  36. package/dist/api/function/v1beta1/api.gen.cjs +18 -6
  37. package/dist/api/function/v1beta1/api.gen.js +18 -6
  38. package/dist/api/function/v1beta1/types.gen.d.ts +1 -1
  39. package/dist/api/iam/v1alpha1/api.gen.cjs +1 -0
  40. package/dist/api/iam/v1alpha1/api.gen.js +1 -0
  41. package/dist/api/iam/v1alpha1/index.gen.d.ts +1 -1
  42. package/dist/api/iam/v1alpha1/marshalling.gen.cjs +21 -14
  43. package/dist/api/iam/v1alpha1/marshalling.gen.js +21 -14
  44. package/dist/api/iam/v1alpha1/types.gen.d.ts +32 -6
  45. package/dist/api/iam/v1alpha1/validation-rules.gen.cjs +38 -12
  46. package/dist/api/iam/v1alpha1/validation-rules.gen.d.ts +36 -11
  47. package/dist/api/iam/v1alpha1/validation-rules.gen.js +38 -12
  48. package/dist/api/inference/index.gen.cjs +4 -2
  49. package/dist/api/inference/index.gen.d.ts +1 -0
  50. package/dist/api/inference/index.gen.js +4 -2
  51. package/dist/api/inference/v1/api.gen.cjs +278 -0
  52. package/dist/api/inference/v1/api.gen.d.ts +140 -0
  53. package/dist/api/inference/v1/api.gen.js +278 -0
  54. package/dist/api/inference/v1/content.gen.cjs +13 -0
  55. package/dist/api/inference/v1/content.gen.d.ts +5 -0
  56. package/dist/api/inference/v1/content.gen.js +13 -0
  57. package/dist/api/inference/v1/index.gen.cjs +9 -0
  58. package/dist/api/inference/v1/index.gen.d.ts +4 -0
  59. package/dist/api/inference/v1/index.gen.js +9 -0
  60. package/dist/api/inference/v1/marshalling.gen.cjs +260 -0
  61. package/dist/api/inference/v1/marshalling.gen.d.ts +14 -0
  62. package/dist/api/inference/v1/marshalling.gen.js +260 -0
  63. package/dist/api/inference/v1/types.gen.d.ts +397 -0
  64. package/dist/api/inference/v1/validation-rules.gen.cjs +65 -0
  65. package/dist/api/inference/v1/validation-rules.gen.d.ts +57 -0
  66. package/dist/api/inference/v1/validation-rules.gen.js +65 -0
  67. package/dist/api/inference/v1beta1/api.gen.cjs +3 -1
  68. package/dist/api/inference/v1beta1/api.gen.js +3 -1
  69. package/dist/api/instance/v1/index.gen.d.ts +1 -1
  70. package/dist/api/instance/v1/marshalling.gen.cjs +13 -1
  71. package/dist/api/instance/v1/marshalling.gen.js +13 -1
  72. package/dist/api/instance/v1/types.gen.d.ts +10 -2
  73. package/dist/api/k8s/v1/api.gen.cjs +3 -1
  74. package/dist/api/k8s/v1/api.gen.js +3 -1
  75. package/dist/api/k8s/v1/marshalling.gen.cjs +1 -0
  76. package/dist/api/k8s/v1/marshalling.gen.js +1 -0
  77. package/dist/api/k8s/v1/types.gen.d.ts +5 -0
  78. package/dist/api/lb/v1/types.gen.d.ts +3 -3
  79. package/dist/api/mongodb/v1alpha1/api.gen.cjs +6 -2
  80. package/dist/api/mongodb/v1alpha1/api.gen.js +6 -2
  81. package/dist/api/qaas/v1alpha1/api.gen.cjs +6 -2
  82. package/dist/api/qaas/v1alpha1/api.gen.js +6 -2
  83. package/dist/api/rdb/v1/api.gen.cjs +6 -2
  84. package/dist/api/rdb/v1/api.gen.js +6 -2
  85. package/dist/api/redis/v1/api.gen.cjs +3 -1
  86. package/dist/api/redis/v1/api.gen.js +3 -1
  87. package/dist/api/registry/v1/api.gen.cjs +9 -3
  88. package/dist/api/registry/v1/api.gen.js +9 -3
  89. package/dist/api/secret/v1beta1/api.gen.cjs +32 -0
  90. package/dist/api/secret/v1beta1/api.gen.d.ts +17 -1
  91. package/dist/api/secret/v1beta1/api.gen.js +32 -0
  92. package/dist/api/secret/v1beta1/index.gen.d.ts +1 -1
  93. package/dist/api/secret/v1beta1/types.gen.d.ts +17 -0
  94. package/dist/api/serverless_sqldb/v1alpha1/api.gen.cjs +3 -1
  95. package/dist/api/serverless_sqldb/v1alpha1/api.gen.js +3 -1
  96. package/dist/api/tem/v1alpha1/api.gen.cjs +93 -0
  97. package/dist/api/tem/v1alpha1/api.gen.d.ts +44 -1
  98. package/dist/api/tem/v1alpha1/api.gen.js +94 -1
  99. package/dist/api/tem/v1alpha1/index.gen.d.ts +1 -1
  100. package/dist/api/tem/v1alpha1/marshalling.gen.cjs +114 -0
  101. package/dist/api/tem/v1alpha1/marshalling.gen.d.ts +7 -1
  102. package/dist/api/tem/v1alpha1/marshalling.gen.js +114 -0
  103. package/dist/api/tem/v1alpha1/types.gen.d.ts +157 -1
  104. package/dist/api/tem/v1alpha1/validation-rules.gen.cjs +10 -0
  105. package/dist/api/tem/v1alpha1/validation-rules.gen.d.ts +9 -0
  106. package/dist/api/tem/v1alpha1/validation-rules.gen.js +10 -0
  107. package/dist/api/vpc/v2/api.gen.cjs +33 -0
  108. package/dist/api/vpc/v2/api.gen.d.ts +17 -1
  109. package/dist/api/vpc/v2/api.gen.js +34 -1
  110. package/dist/api/vpc/v2/index.gen.d.ts +1 -1
  111. package/dist/api/vpc/v2/marshalling.gen.cjs +59 -0
  112. package/dist/api/vpc/v2/marshalling.gen.d.ts +4 -1
  113. package/dist/api/vpc/v2/marshalling.gen.js +59 -0
  114. package/dist/api/vpc/v2/types.gen.d.ts +80 -0
  115. package/dist/api/vpc/v2/validation-rules.gen.cjs +18 -0
  116. package/dist/api/vpc/v2/validation-rules.gen.d.ts +17 -0
  117. package/dist/api/vpc/v2/validation-rules.gen.js +18 -0
  118. package/dist/api/vpcgw/v1/api.gen.cjs +3 -1
  119. package/dist/api/vpcgw/v1/api.gen.js +3 -1
  120. package/dist/api/vpcgw/v2/api.gen.cjs +3 -1
  121. package/dist/api/vpcgw/v2/api.gen.js +3 -1
  122. package/dist/api/webhosting/v1/api.gen.cjs +6 -2
  123. package/dist/api/webhosting/v1/api.gen.js +6 -2
  124. package/dist/api/webhosting/v1/index.gen.d.ts +1 -1
  125. package/dist/api/webhosting/v1/marshalling.gen.cjs +27 -2
  126. package/dist/api/webhosting/v1/marshalling.gen.js +27 -2
  127. package/dist/api/webhosting/v1/types.gen.d.ts +64 -15
  128. package/dist/scw/constants.cjs +1 -1
  129. package/dist/scw/constants.d.ts +2 -2
  130. package/dist/scw/constants.js +1 -1
  131. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import type { Region as ScwRegion } from '../../../bridge';
1
+ import type { Region as ScwRegion, Zone as ScwZone } from '../../../bridge';
2
2
  export type BlocklistType = 'unknown_type' | 'mailbox_full' | 'mailbox_not_found';
3
3
  export type DomainLastStatusAutoconfigStateReason = 'unknown_reason' | 'permission_denied' | 'domain_not_found';
4
4
  export type DomainLastStatusRecordStatus = 'unknown_record_status' | 'valid' | 'invalid' | 'not_found';
@@ -11,6 +11,8 @@ export type ListBlocklistsRequestOrderBy = 'created_at_desc' | 'created_at_asc'
11
11
  export type ListEmailsRequestOrderBy = 'created_at_desc' | 'created_at_asc' | 'updated_at_desc' | 'updated_at_asc' | 'status_desc' | 'status_asc' | 'mail_from_desc' | 'mail_from_asc' | 'mail_rcpt_desc' | 'mail_rcpt_asc' | 'subject_desc' | 'subject_asc';
12
12
  export type ListWebhookEventsRequestOrderBy = 'created_at_desc' | 'created_at_asc';
13
13
  export type ListWebhooksRequestOrderBy = 'created_at_desc' | 'created_at_asc';
14
+ export type OfferName = 'unknown_name' | 'essential' | 'scale';
15
+ export type PoolStatus = 'unknown_status' | 'disabled' | 'creating' | 'ready' | 'error';
14
16
  export type ProjectSettingsPeriodicReportFrequency = 'unknown_frequency' | 'monthly' | 'weekly' | 'daily';
15
17
  export type WebhookEventStatus = 'unknown_status' | 'sending' | 'sent' | 'failed';
16
18
  export type WebhookEventType = 'unknown_type' | 'email_queued' | 'email_dropped' | 'email_deferred' | 'email_delivered' | 'email_spam' | 'email_mailbox_not_found' | 'email_blocklisted' | 'blocklist_created';
@@ -214,6 +216,79 @@ export interface Domain {
214
216
  */
215
217
  region: ScwRegion;
216
218
  }
219
+ export interface OfferSubscription {
220
+ /** ID of the offer-subscription Organization. */
221
+ organizationId: string;
222
+ /** ID of the offer-subscription Project. */
223
+ projectId: string;
224
+ /** Name of the offer associated with the Project. */
225
+ offerName: OfferName;
226
+ /** Date and time of the subscription. */
227
+ subscribedAt?: Date;
228
+ /** Date and time of the end of the offer-subscription commitment. */
229
+ cancellationAvailableAt?: Date;
230
+ /** Service Level Agreement percentage of the offer-subscription. */
231
+ sla: number;
232
+ /**
233
+ * Max number of domains that can be associated with the offer-subscription
234
+ * for a particular Project.
235
+ */
236
+ maxDomains: number;
237
+ /**
238
+ * Max number of dedicated IPs that can be associated with the
239
+ * offer-subscription for a particular Project.
240
+ */
241
+ maxDedicatedIps: number;
242
+ /**
243
+ * Max number of webhooks that can be associated with the offer-subscription
244
+ * for a particular Project.
245
+ */
246
+ maxWebhooksPerDomain: number;
247
+ /**
248
+ * Max number of custom blocklists that can be associated with the
249
+ * offer-subscription for a particular Project.
250
+ */
251
+ maxCustomBlocklistsPerDomain: number;
252
+ /** Number of emails included in the offer-subscription per month. */
253
+ includedMonthlyEmails: number;
254
+ }
255
+ export interface Offer {
256
+ /** Name of the offer. */
257
+ name: OfferName;
258
+ /** Date and time of the offer creation. */
259
+ createdAt?: Date;
260
+ /** Period of commitment. */
261
+ commitmentPeriod?: string;
262
+ /** Service Level Agreement percentage of the offer. */
263
+ sla: number;
264
+ /** Max number of checked domains that can be associated with the offer. */
265
+ maxDomains: number;
266
+ /** Max number of dedicated IPs that can be associated with the offer. */
267
+ maxDedicatedIps: number;
268
+ /** Number of emails included in the offer per month. */
269
+ includedMonthlyEmails: number;
270
+ /** Max number of webhooks that can be associated with the offer. */
271
+ maxWebhooksPerDomain: number;
272
+ /**
273
+ * Max number of active custom blocklists that can be associated with the
274
+ * offer.
275
+ */
276
+ maxCustomBlocklistsPerDomain: number;
277
+ }
278
+ export interface Pool {
279
+ /** ID of the Project. */
280
+ projectId: string;
281
+ /** Status of the pool. */
282
+ status: PoolStatus;
283
+ /** Details of the pool. */
284
+ details?: string;
285
+ /** Zone of the pool. */
286
+ zone?: ScwZone;
287
+ /** IPs of the pool. */
288
+ ips: string[];
289
+ /** Reverse hostname of all IPs of the pool. */
290
+ reverse?: string;
291
+ }
217
292
  export interface WebhookEvent {
218
293
  /** ID of the Webhook Event. */
219
294
  id: string;
@@ -445,6 +520,15 @@ export type GetEmailRequest = {
445
520
  /** ID of the email to retrieve. */
446
521
  emailId: string;
447
522
  };
523
+ export type GetProjectConsumptionRequest = {
524
+ /**
525
+ * Region to target. If none is passed will use default region from the
526
+ * config.
527
+ */
528
+ region?: ScwRegion;
529
+ /** ID of the project. */
530
+ projectId?: string;
531
+ };
448
532
  export type GetProjectSettingsRequest = {
449
533
  /**
450
534
  * Region to target. If none is passed will use default region from the
@@ -579,6 +663,53 @@ export interface ListEmailsResponse {
579
663
  /** Single page of emails matching the requested criteria. */
580
664
  emails: Email[];
581
665
  }
666
+ export type ListOfferSubscriptionsRequest = {
667
+ /**
668
+ * Region to target. If none is passed will use default region from the
669
+ * config.
670
+ */
671
+ region?: ScwRegion;
672
+ /** ID of the Project. */
673
+ projectId?: string;
674
+ };
675
+ export interface ListOfferSubscriptionsResponse {
676
+ /** Number of offer-subscriptions matching the requested criteria. */
677
+ totalCount: number;
678
+ /** Single page of offer-subscriptions matching the requested criteria. */
679
+ offerSubscriptions: OfferSubscription[];
680
+ }
681
+ export type ListOffersRequest = {
682
+ /**
683
+ * Region to target. If none is passed will use default region from the
684
+ * config.
685
+ */
686
+ region?: ScwRegion;
687
+ };
688
+ export interface ListOffersResponse {
689
+ /** Number of offers matching the requested criteria. */
690
+ totalCount: number;
691
+ /** Single page of offers matching the requested criteria. */
692
+ offers: Offer[];
693
+ }
694
+ export type ListPoolsRequest = {
695
+ /**
696
+ * Region to target. If none is passed will use default region from the
697
+ * config.
698
+ */
699
+ region?: ScwRegion;
700
+ /** Requested page number. Value must be greater or equal to 1. */
701
+ page?: number;
702
+ /** Requested page size. Value must be between 1 and 1000. */
703
+ pageSize?: number;
704
+ /** ID of the Project. */
705
+ projectId?: string;
706
+ };
707
+ export interface ListPoolsResponse {
708
+ /** Number of pools matching the requested criteria. */
709
+ totalCount: number;
710
+ /** Single page of pools matching the requested criteria. */
711
+ pools: Pool[];
712
+ }
582
713
  export type ListWebhookEventsRequest = {
583
714
  /**
584
715
  * Region to target. If none is passed will use default region from the
@@ -637,6 +768,20 @@ export interface ListWebhooksResponse {
637
768
  /** Single page of Webhooks matching the requested criteria. */
638
769
  webhooks: Webhook[];
639
770
  }
771
+ export interface ProjectConsumption {
772
+ /** ID of the project. */
773
+ projectId: string;
774
+ /** Number of domains in the project. */
775
+ domainsCount: number;
776
+ /** Number of dedicated IP in the project. */
777
+ dedicatedIpsCount: number;
778
+ /** Number of emails sent during the current month in the project. */
779
+ monthlyEmailsCount: number;
780
+ /** Number of webhooks in the project. */
781
+ webhooksCount: number;
782
+ /** Number of custom blocklists in the project. */
783
+ customBlocklistsCount: number;
784
+ }
640
785
  export interface ProjectSettings {
641
786
  /** Information about your periodic report. */
642
787
  periodicReport?: ProjectSettingsPeriodicReport;
@@ -693,6 +838,17 @@ export type UpdateDomainRequest = {
693
838
  */
694
839
  autoconfig?: boolean;
695
840
  };
841
+ export type UpdateOfferSubscriptionRequest = {
842
+ /**
843
+ * Region to target. If none is passed will use default region from the
844
+ * config.
845
+ */
846
+ region?: ScwRegion;
847
+ /** ID of the Project. */
848
+ projectId?: string;
849
+ /** Name of the offer-subscription. */
850
+ name?: OfferName;
851
+ };
696
852
  export type UpdateProjectSettingsRequest = {
697
853
  /**
698
854
  * Region to target. If none is passed will use default region from the
@@ -81,6 +81,15 @@ const ListEmailsRequest = {
81
81
  minLength: 6
82
82
  }
83
83
  };
84
+ const ListPoolsRequest = {
85
+ page: {
86
+ greaterThanOrEqual: 1
87
+ },
88
+ pageSize: {
89
+ greaterThanOrEqual: 1,
90
+ lessThanOrEqual: 1e3
91
+ }
92
+ };
84
93
  const ListWebhookEventsRequest = {
85
94
  page: {
86
95
  greaterThan: 0
@@ -129,6 +138,7 @@ exports.CreateWebhookRequest = CreateWebhookRequest;
129
138
  exports.ListBlocklistsRequest = ListBlocklistsRequest;
130
139
  exports.ListDomainsRequest = ListDomainsRequest;
131
140
  exports.ListEmailsRequest = ListEmailsRequest;
141
+ exports.ListPoolsRequest = ListPoolsRequest;
132
142
  exports.ListWebhookEventsRequest = ListWebhookEventsRequest;
133
143
  exports.ListWebhooksRequest = ListWebhooksRequest;
134
144
  exports.UpdateProjectSettingsRequestUpdatePeriodicReport = UpdateProjectSettingsRequestUpdatePeriodicReport;
@@ -79,6 +79,15 @@ export declare const ListEmailsRequest: {
79
79
  minLength: number;
80
80
  };
81
81
  };
82
+ export declare const ListPoolsRequest: {
83
+ page: {
84
+ greaterThanOrEqual: number;
85
+ };
86
+ pageSize: {
87
+ greaterThanOrEqual: number;
88
+ lessThanOrEqual: number;
89
+ };
90
+ };
82
91
  export declare const ListWebhookEventsRequest: {
83
92
  page: {
84
93
  greaterThan: number;
@@ -79,6 +79,15 @@ const ListEmailsRequest = {
79
79
  minLength: 6
80
80
  }
81
81
  };
82
+ const ListPoolsRequest = {
83
+ page: {
84
+ greaterThanOrEqual: 1
85
+ },
86
+ pageSize: {
87
+ greaterThanOrEqual: 1,
88
+ lessThanOrEqual: 1e3
89
+ }
90
+ };
82
91
  const ListWebhookEventsRequest = {
83
92
  page: {
84
93
  greaterThan: 0
@@ -128,6 +137,7 @@ export {
128
137
  ListBlocklistsRequest,
129
138
  ListDomainsRequest,
130
139
  ListEmailsRequest,
140
+ ListPoolsRequest,
131
141
  ListWebhookEventsRequest,
132
142
  ListWebhooksRequest,
133
143
  UpdateProjectSettingsRequestUpdatePeriodicReport,
@@ -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
  };