@scaleway/sdk-vpc 1.1.0 → 1.2.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.
@@ -6,12 +6,13 @@ const jsonContentHeaders = {
6
6
  "Content-Type": "application/json; charset=utf-8"
7
7
  };
8
8
  class API extends sdkClient.API {
9
- /** Lists the available regions of the API. */
10
- static LOCALITIES = [
11
- "fr-par",
12
- "nl-ams",
13
- "pl-waw"
14
- ];
9
+ /**
10
+ * Locality of this API.
11
+ * type ∈ {'zone','region','global','unspecified'}
12
+ */
13
+ static LOCALITY = sdkClient.toApiLocality({
14
+ regions: ["fr-par", "nl-ams", "pl-waw"]
15
+ });
15
16
  pageOfListVPCs = (request = {}) => this.client.fetch(
16
17
  {
17
18
  method: "GET",
@@ -215,6 +216,21 @@ class API extends sdkClient.API {
215
216
  },
216
217
  marshalling_gen.unmarshalVPC
217
218
  );
219
+ /**
220
+ * Enable custom routes propagation on a VPC. Enable custom routes propagation on an existing VPC. Note that you will not be able to deactivate it afterwards.
221
+ *
222
+ * @param request - The request {@link EnableCustomRoutesPropagationRequest}
223
+ * @returns A Promise of VPC
224
+ */
225
+ enableCustomRoutesPropagation = (request) => this.client.fetch(
226
+ {
227
+ body: "{}",
228
+ headers: jsonContentHeaders,
229
+ method: "POST",
230
+ path: `/vpc/v2/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${sdkClient.validatePathParam("vpcId", request.vpcId)}/enable-custom-routes-propagation`
231
+ },
232
+ marshalling_gen.unmarshalVPC
233
+ );
218
234
  pageOfListSubnets = (request = {}) => this.client.fetch(
219
235
  {
220
236
  method: "GET",
@@ -1,14 +1,17 @@
1
1
  import { API as ParentAPI } from '@scaleway/sdk-client';
2
- import type { Region as ScwRegion } from '@scaleway/sdk-client';
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, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC } from './types.gen';
2
+ import type { ApiLocality } from '@scaleway/sdk-client';
3
+ import type { AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteRouteRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCRequest, EnableCustomRoutesPropagationRequest, EnableDHCPRequest, EnableRoutingRequest, GetAclRequest, GetAclResponse, GetPrivateNetworkRequest, GetRouteRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksResponse, ListSubnetsRequest, ListSubnetsResponse, ListVPCsRequest, ListVPCsResponse, PrivateNetwork, Route, SetAclRequest, SetAclResponse, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC } from './types.gen';
4
4
  /**
5
5
  * VPC API.
6
6
 
7
7
  This API allows you to manage your Virtual Private Clouds (VPCs) and Private Networks.
8
8
  */
9
9
  export declare class API extends ParentAPI {
10
- /** Lists the available regions of the API. */
11
- static readonly LOCALITIES: ScwRegion[];
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static readonly LOCALITY: ApiLocality;
12
15
  protected pageOfListVPCs: (request?: Readonly<ListVPCsRequest>) => Promise<ListVPCsResponse>;
13
16
  /**
14
17
  * List VPCs. List existing VPCs in the specified region.
@@ -99,6 +102,13 @@ export declare class API extends ParentAPI {
99
102
  * @returns A Promise of VPC
100
103
  */
101
104
  enableRouting: (request: Readonly<EnableRoutingRequest>) => Promise<VPC>;
105
+ /**
106
+ * Enable custom routes propagation on a VPC. Enable custom routes propagation on an existing VPC. Note that you will not be able to deactivate it afterwards.
107
+ *
108
+ * @param request - The request {@link EnableCustomRoutesPropagationRequest}
109
+ * @returns A Promise of VPC
110
+ */
111
+ enableCustomRoutesPropagation: (request: Readonly<EnableCustomRoutesPropagationRequest>) => Promise<VPC>;
102
112
  protected pageOfListSubnets: (request?: Readonly<ListSubnetsRequest>) => Promise<ListSubnetsResponse>;
103
113
  /**
104
114
  * List subnets. List any Private Network's subnets. See ListPrivateNetworks to list a specific Private Network's subnets.
@@ -1,15 +1,16 @@
1
- import { API as API$1, urlParams, validatePathParam, enrichForPagination } from "@scaleway/sdk-client";
1
+ import { API as API$1, toApiLocality, urlParams, validatePathParam, enrichForPagination } from "@scaleway/sdk-client";
2
2
  import { unmarshalListVPCsResponse, marshalCreateVPCRequest, unmarshalVPC, marshalUpdateVPCRequest, unmarshalListPrivateNetworksResponse, marshalCreatePrivateNetworkRequest, unmarshalPrivateNetwork, marshalUpdatePrivateNetworkRequest, unmarshalListSubnetsResponse, marshalAddSubnetsRequest, unmarshalAddSubnetsResponse, marshalDeleteSubnetsRequest, unmarshalDeleteSubnetsResponse, marshalCreateRouteRequest, unmarshalRoute, marshalUpdateRouteRequest, unmarshalGetAclResponse, marshalSetAclRequest, unmarshalSetAclResponse } from "./marshalling.gen.js";
3
3
  const jsonContentHeaders = {
4
4
  "Content-Type": "application/json; charset=utf-8"
5
5
  };
6
6
  class API extends API$1 {
7
- /** Lists the available regions of the API. */
8
- static LOCALITIES = [
9
- "fr-par",
10
- "nl-ams",
11
- "pl-waw"
12
- ];
7
+ /**
8
+ * Locality of this API.
9
+ * type ∈ {'zone','region','global','unspecified'}
10
+ */
11
+ static LOCALITY = toApiLocality({
12
+ regions: ["fr-par", "nl-ams", "pl-waw"]
13
+ });
13
14
  pageOfListVPCs = (request = {}) => this.client.fetch(
14
15
  {
15
16
  method: "GET",
@@ -213,6 +214,21 @@ class API extends API$1 {
213
214
  },
214
215
  unmarshalVPC
215
216
  );
217
+ /**
218
+ * Enable custom routes propagation on a VPC. Enable custom routes propagation on an existing VPC. Note that you will not be able to deactivate it afterwards.
219
+ *
220
+ * @param request - The request {@link EnableCustomRoutesPropagationRequest}
221
+ * @returns A Promise of VPC
222
+ */
223
+ enableCustomRoutesPropagation = (request) => this.client.fetch(
224
+ {
225
+ body: "{}",
226
+ headers: jsonContentHeaders,
227
+ method: "POST",
228
+ path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/enable-custom-routes-propagation`
229
+ },
230
+ unmarshalVPC
231
+ );
216
232
  pageOfListSubnets = (request = {}) => this.client.fetch(
217
233
  {
218
234
  method: "GET",
@@ -1,4 +1,4 @@
1
1
  export { API } from './api.gen';
2
2
  export * from './marshalling.gen';
3
- 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, Subnet, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC, } from './types.gen';
3
+ export type { AclRule, AclRuleProtocol, Action, AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteRouteRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCRequest, EnableCustomRoutesPropagationRequest, EnableDHCPRequest, EnableRoutingRequest, GetAclRequest, GetAclResponse, GetPrivateNetworkRequest, GetRouteRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksRequestOrderBy, ListPrivateNetworksResponse, ListSubnetsRequest, ListSubnetsRequestOrderBy, ListSubnetsResponse, ListVPCsRequest, ListVPCsRequestOrderBy, ListVPCsResponse, PrivateNetwork, Route, SetAclRequest, SetAclResponse, Subnet, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC, } from './types.gen';
4
4
  export * as ValidationRules from './validation-rules.gen';
@@ -67,6 +67,7 @@ const unmarshalVPC = (data) => {
67
67
  }
68
68
  return {
69
69
  createdAt: sdkClient.unmarshalDate(data.created_at),
70
+ customRoutesPropagationEnabled: data.custom_routes_propagation_enabled,
70
71
  id: data.id,
71
72
  isDefault: data.is_default,
72
73
  name: data.name,
@@ -1,5 +1,5 @@
1
1
  import randomName from "@scaleway/random-name";
2
- import { isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
2
+ import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
3
3
  const unmarshalSubnet = (data) => {
4
4
  if (!isJSONObject(data)) {
5
5
  throw new TypeError(
@@ -65,6 +65,7 @@ const unmarshalVPC = (data) => {
65
65
  }
66
66
  return {
67
67
  createdAt: unmarshalDate(data.created_at),
68
+ customRoutesPropagationEnabled: data.custom_routes_propagation_enabled,
68
69
  id: data.id,
69
70
  isDefault: data.is_default,
70
71
  name: data.name,
@@ -213,6 +213,10 @@ export interface VPC {
213
213
  * Defines whether the VPC routes traffic between its Private Networks.
214
214
  */
215
215
  routingEnabled: boolean;
216
+ /**
217
+ * Defines whether the VPC advertises custom routes between its Private Networks.
218
+ */
219
+ customRoutesPropagationEnabled: boolean;
216
220
  }
217
221
  export type AddSubnetsRequest = {
218
222
  /**
@@ -360,6 +364,16 @@ export type DeleteVPCRequest = {
360
364
  */
361
365
  vpcId: string;
362
366
  };
367
+ export type EnableCustomRoutesPropagationRequest = {
368
+ /**
369
+ * Region to target. If none is passed will use default region from the config.
370
+ */
371
+ region?: ScwRegion;
372
+ /**
373
+ * VPC ID.
374
+ */
375
+ vpcId: string;
376
+ };
363
377
  export type EnableDHCPRequest = {
364
378
  /**
365
379
  * Region to target. If none is passed will use default region from the config.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-vpc",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Scaleway SDK vpc",
5
- "types": "dist/index.d.ts",
5
+ "license": "Apache-2.0",
6
6
  "files": [
7
7
  "dist"
8
8
  ],
@@ -30,13 +30,13 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@scaleway/random-name": "5.1.1",
33
- "@scaleway/sdk-std": "1.0.3"
33
+ "@scaleway/sdk-std": "1.0.5"
34
34
  },
35
35
  "peerDependencies": {
36
- "@scaleway/sdk-client": "^1.2.2"
36
+ "@scaleway/sdk-client": "^1.3.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@scaleway/sdk-client": "^1.2.2"
39
+ "@scaleway/sdk-client": "^1.3.0"
40
40
  },
41
41
  "scripts": {
42
42
  "package:check": "pnpm publint",