@scaleway/sdk-s2s-vpn 1.2.0 → 2.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.
package/README.md ADDED
@@ -0,0 +1,96 @@
1
+ # @scaleway/sdk-s2s-vpn
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@scaleway/sdk-s2s-vpn.svg)](https://www.npmjs.com/package/@scaleway/sdk-s2s-vpn)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@scaleway/sdk-s2s-vpn.svg)](https://www.npmjs.com/package/@scaleway/sdk-s2s-vpn)
5
+ [![license](https://img.shields.io/npm/l/@scaleway/sdk-s2s-vpn.svg)](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
6
+
7
+ Scaleway SDK for S2S Vpn API.
8
+
9
+ > **Note**
10
+ > This is an automatically generated package that is part of the [Scaleway SDK for JavaScript](https://github.com/scaleway/scaleway-sdk-js).
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @scaleway/sdk-s2s-vpn @scaleway/sdk-client
16
+ ```
17
+
18
+ or with pnpm:
19
+
20
+ ```bash
21
+ pnpm add @scaleway/sdk-s2s-vpn @scaleway/sdk-client
22
+ ```
23
+
24
+ or with yarn:
25
+
26
+ ```bash
27
+ yarn add @scaleway/sdk-s2s-vpn @scaleway/sdk-client
28
+ ```
29
+
30
+ ## Getting Started
31
+
32
+ You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) on how to retrieve them.
33
+
34
+ ### Basic Usage
35
+
36
+ ```typescript
37
+ import { createClient } from '@scaleway/sdk-client'
38
+ import { S2SVpn } from '@scaleway/sdk-s2s-vpn'
39
+
40
+ const client = createClient({
41
+ accessKey: 'SCWXXXXXXXXXXXXXXXXX',
42
+ secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
43
+ defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
44
+ defaultRegion: 'fr-par',
45
+ defaultZone: 'fr-par-1',
46
+ })
47
+
48
+ const api = new S2SVpn.v1.API(client)
49
+
50
+ // Use the API
51
+ // Example: await api.listServers()
52
+ ```
53
+
54
+ ### Using Configuration Loader
55
+
56
+ For a simpler setup, you can load credentials from the configuration file or environment variables:
57
+
58
+ ```typescript
59
+ import { createClient } from '@scaleway/sdk-client'
60
+ import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'
61
+ import { S2SVpn } from '@scaleway/sdk-s2s-vpn'
62
+
63
+ const profile = loadProfileFromConfigurationFile()
64
+ const client = createClient(profile)
65
+ const api = new S2SVpn.v1.API(client)
66
+ ```
67
+
68
+ ## Documentation
69
+
70
+ - 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
71
+ - 🌐 [Scaleway S2S Vpn API Documentation](https://www.scaleway.com/en/developers/api/s2s-vpn/)
72
+ - 📖 [Main Repository](https://github.com/scaleway/scaleway-sdk-js)
73
+ - 💡 [Example Projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
74
+
75
+ ## Features
76
+
77
+ - ✅ Full TypeScript support with complete type definitions
78
+ - ✅ Promise-based API
79
+ - ✅ Automatic pagination helpers
80
+ - ✅ Built-in error handling
81
+ - ✅ Compatible with Node.js ≥ 20
82
+
83
+ ## Support
84
+
85
+ We love feedback! Feel free to reach us on:
86
+ - [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
87
+ - [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
88
+
89
+ ## Contributing
90
+
91
+ This repository is at its early stage and is still in active development. If you are looking for a way to contribute, please read [CONTRIBUTING.md](https://github.com/scaleway/scaleway-sdk-js/blob/master/CONTRIBUTING.md).
92
+
93
+ ## License
94
+
95
+ This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
96
+
@@ -1,6 +1,6 @@
1
- import { API as ParentAPI } from '@scaleway/sdk-client';
2
1
  import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client';
3
- import type { Connection, CreateConnectionRequest, CreateConnectionResponse, CreateCustomerGatewayRequest, CreateRoutingPolicyRequest, CreateVpnGatewayRequest, CustomerGateway, DeleteConnectionRequest, DeleteCustomerGatewayRequest, DeleteRoutingPolicyRequest, DeleteVpnGatewayRequest, DetachRoutingPolicyRequest, DisableRoutePropagationRequest, EnableRoutePropagationRequest, GetConnectionRequest, GetCustomerGatewayRequest, GetRoutingPolicyRequest, GetVpnGatewayRequest, ListConnectionsRequest, ListConnectionsResponse, ListCustomerGatewaysRequest, ListCustomerGatewaysResponse, ListRoutingPoliciesRequest, ListRoutingPoliciesResponse, ListVpnGatewayTypesRequest, ListVpnGatewayTypesResponse, ListVpnGatewaysRequest, ListVpnGatewaysResponse, RenewConnectionPskRequest, RenewConnectionPskResponse, RoutingPolicy, SetRoutingPolicyRequest, UpdateConnectionRequest, UpdateCustomerGatewayRequest, UpdateRoutingPolicyRequest, UpdateVpnGatewayRequest, VpnGateway } from './types.gen.js';
2
+ import { API as ParentAPI } from '@scaleway/sdk-client';
3
+ import type { Connection, CreateConnectionRequest, CreateConnectionResponse, CreateCustomerGatewayRequest, CreateRoutingPolicyRequest, CreateVpnGatewayRequest, CustomerGateway, DeleteConnectionRequest, DeleteCustomerGatewayRequest, DeleteRoutingPolicyRequest, DeleteVpnGatewayRequest, DetachRoutingPolicyRequest, DisableRoutePropagationRequest, EnableRoutePropagationRequest, GetConnectionRequest, GetCustomerGatewayRequest, GetRoutingPolicyRequest, GetVpnGatewayRequest, ListConnectionsRequest, ListConnectionsResponse, ListCustomerGatewaysRequest, ListCustomerGatewaysResponse, ListRoutingPoliciesRequest, ListRoutingPoliciesResponse, ListVpnGatewaysRequest, ListVpnGatewaysResponse, ListVpnGatewayTypesRequest, ListVpnGatewayTypesResponse, RenewConnectionPskRequest, RenewConnectionPskResponse, RoutingPolicy, SetRoutingPolicyRequest, UpdateConnectionRequest, UpdateCustomerGatewayRequest, UpdateRoutingPolicyRequest, UpdateVpnGatewayRequest, VpnGateway } from './types.gen.js';
4
4
  /**
5
5
  * Site-to-Site VPN.
6
6
 
@@ -1,5 +1,5 @@
1
1
  export { API } from './api.gen.js';
2
2
  export * from './content.gen.js';
3
3
  export * from './marshalling.gen.js';
4
- export type { BgpSession, BgpSessionStatus, Connection, ConnectionCipher, ConnectionDhGroup, ConnectionEncryption, ConnectionInitiationPolicy, ConnectionIntegrity, ConnectionStatus, CreateConnectionRequest, CreateConnectionRequestBgpConfig, CreateConnectionRequestInitiationPolicy, CreateConnectionResponse, CreateCustomerGatewayRequest, CreateRoutingPolicyRequest, CreateVpnGatewayRequest, CreateVpnGatewayRequestPublicConfig, CustomerGateway, DeleteConnectionRequest, DeleteCustomerGatewayRequest, DeleteRoutingPolicyRequest, DeleteVpnGatewayRequest, DetachRoutingPolicyRequest, DisableRoutePropagationRequest, EnableRoutePropagationRequest, GatewayType, GetConnectionRequest, GetCustomerGatewayRequest, GetRoutingPolicyRequest, GetVpnGatewayRequest, ListConnectionsRequest, ListConnectionsRequestOrderBy, ListConnectionsResponse, ListCustomerGatewaysRequest, ListCustomerGatewaysRequestOrderBy, ListCustomerGatewaysResponse, ListRoutingPoliciesRequest, ListRoutingPoliciesRequestOrderBy, ListRoutingPoliciesResponse, ListVpnGatewayTypesRequest, ListVpnGatewayTypesResponse, ListVpnGatewaysRequest, ListVpnGatewaysRequestOrderBy, ListVpnGatewaysResponse, RenewConnectionPskRequest, RenewConnectionPskResponse, RoutingPolicy, SetRoutingPolicyRequest, TunnelStatus, UpdateConnectionRequest, UpdateCustomerGatewayRequest, UpdateRoutingPolicyRequest, UpdateVpnGatewayRequest, VpnGateway, VpnGatewayPrivateConfig, VpnGatewayPublicConfig, VpnGatewayStatus, } from './types.gen.js';
4
+ export type { BgpSession, BgpSessionStatus, Connection, ConnectionCipher, ConnectionDhGroup, ConnectionEncryption, ConnectionInitiationPolicy, ConnectionIntegrity, ConnectionStatus, CreateConnectionRequest, CreateConnectionRequestBgpConfig, CreateConnectionRequestInitiationPolicy, CreateConnectionResponse, CreateCustomerGatewayRequest, CreateRoutingPolicyRequest, CreateVpnGatewayRequest, CreateVpnGatewayRequestPublicConfig, CustomerGateway, DeleteConnectionRequest, DeleteCustomerGatewayRequest, DeleteRoutingPolicyRequest, DeleteVpnGatewayRequest, DetachRoutingPolicyRequest, DisableRoutePropagationRequest, EnableRoutePropagationRequest, GatewayType, GetConnectionRequest, GetCustomerGatewayRequest, GetRoutingPolicyRequest, GetVpnGatewayRequest, ListConnectionsRequest, ListConnectionsRequestOrderBy, ListConnectionsResponse, ListCustomerGatewaysRequest, ListCustomerGatewaysRequestOrderBy, ListCustomerGatewaysResponse, ListRoutingPoliciesRequest, ListRoutingPoliciesRequestOrderBy, ListRoutingPoliciesResponse, ListVpnGatewaysRequest, ListVpnGatewaysRequestOrderBy, ListVpnGatewaysResponse, ListVpnGatewayTypesRequest, ListVpnGatewayTypesResponse, RenewConnectionPskRequest, RenewConnectionPskResponse, RoutingPolicy, SetRoutingPolicyRequest, TunnelStatus, UpdateConnectionRequest, UpdateCustomerGatewayRequest, UpdateRoutingPolicyRequest, UpdateVpnGatewayRequest, VpnGateway, VpnGatewayPrivateConfig, VpnGatewayPublicConfig, VpnGatewayStatus, } from './types.gen.js';
5
5
  export * as ValidationRules from './validation-rules.gen.js';
@@ -1,5 +1,5 @@
1
1
  import type { DefaultValues } from '@scaleway/sdk-client';
2
- import type { Connection, CreateConnectionRequest, CreateConnectionResponse, CreateCustomerGatewayRequest, CreateRoutingPolicyRequest, CreateVpnGatewayRequest, CustomerGateway, DetachRoutingPolicyRequest, ListConnectionsResponse, ListCustomerGatewaysResponse, ListRoutingPoliciesResponse, ListVpnGatewayTypesResponse, ListVpnGatewaysResponse, RenewConnectionPskResponse, RoutingPolicy, SetRoutingPolicyRequest, UpdateConnectionRequest, UpdateCustomerGatewayRequest, UpdateRoutingPolicyRequest, UpdateVpnGatewayRequest, VpnGateway } from './types.gen.js';
2
+ import type { Connection, CreateConnectionRequest, CreateConnectionResponse, CreateCustomerGatewayRequest, CreateRoutingPolicyRequest, CreateVpnGatewayRequest, CustomerGateway, DetachRoutingPolicyRequest, ListConnectionsResponse, ListCustomerGatewaysResponse, ListRoutingPoliciesResponse, ListVpnGatewaysResponse, ListVpnGatewayTypesResponse, RenewConnectionPskResponse, RoutingPolicy, SetRoutingPolicyRequest, UpdateConnectionRequest, UpdateCustomerGatewayRequest, UpdateRoutingPolicyRequest, UpdateVpnGatewayRequest, VpnGateway } from './types.gen.js';
3
3
  export declare const unmarshalConnection: (data: unknown) => Connection;
4
4
  export declare const unmarshalCustomerGateway: (data: unknown) => CustomerGateway;
5
5
  export declare const unmarshalRoutingPolicy: (data: unknown) => RoutingPolicy;
@@ -204,7 +204,8 @@ const unmarshalGatewayType = (data) => {
204
204
  allowedConnections: data.allowed_connections,
205
205
  bandwidth: data.bandwidth,
206
206
  name: data.name,
207
- region: data.region
207
+ region: data.region,
208
+ zones: data.zones
208
209
  };
209
210
  };
210
211
  const unmarshalListVpnGatewayTypesResponse = (data) => {
@@ -231,6 +231,7 @@ export interface GatewayType {
231
231
  name: string;
232
232
  bandwidth: number;
233
233
  allowedConnections: number;
234
+ zones: string[];
234
235
  /**
235
236
  * Region to target. If none is passed will use default region from the config.
236
237
  */
package/package.json CHANGED
@@ -1,23 +1,20 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-s2s-vpn",
3
- "version": "1.2.0",
3
+ "version": "2.2.0",
4
4
  "description": "Scaleway SDK s2s-vpn",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
+ "README.md",
7
8
  "dist"
8
9
  ],
9
10
  "type": "module",
10
11
  "exports": {
11
12
  ".": {
12
13
  "types": "./dist/index.gen.d.ts",
13
- "import": "./dist/index.gen.js",
14
- "require": "./dist/index.gen.cjs",
15
14
  "default": "./dist/index.gen.js"
16
15
  },
17
16
  "./*": {
18
17
  "types": "./dist/*/index.gen.d.ts",
19
- "import": "./dist/*/index.gen.js",
20
- "require": "./dist/*/index.gen.cjs",
21
18
  "default": "./dist/*/index.gen.js"
22
19
  }
23
20
  },
@@ -26,17 +23,17 @@
26
23
  "directory": "packages_generated/s2s-vpn"
27
24
  },
28
25
  "engines": {
29
- "node": ">=20.18.3"
26
+ "node": ">=20.19.6"
30
27
  },
31
28
  "dependencies": {
32
- "@scaleway/random-name": "5.1.1",
33
- "@scaleway/sdk-std": "1.2.0"
29
+ "@scaleway/random-name": "5.1.2",
30
+ "@scaleway/sdk-std": "2.1.0"
34
31
  },
35
32
  "peerDependencies": {
36
- "@scaleway/sdk-client": "^1.3.3"
33
+ "@scaleway/sdk-client": "^2.1.0"
37
34
  },
38
35
  "devDependencies": {
39
- "@scaleway/sdk-client": "^1.3.3"
36
+ "@scaleway/sdk-client": "^2.1.0"
40
37
  },
41
38
  "scripts": {
42
39
  "package:check": "pnpm publint",
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index_gen = require("./v1alpha1/index.gen.cjs");
4
- exports.S2SVpnv1alpha1 = index_gen;
@@ -1,475 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sdkClient = require("@scaleway/sdk-client");
4
- const content_gen = require("./content.gen.cjs");
5
- const marshalling_gen = require("./marshalling.gen.cjs");
6
- const jsonContentHeaders = {
7
- "Content-Type": "application/json; charset=utf-8"
8
- };
9
- class API extends sdkClient.API {
10
- /**
11
- * Locality of this API.
12
- * type ∈ {'zone','region','global','unspecified'}
13
- */
14
- static LOCALITY = sdkClient.toApiLocality({
15
- regions: ["fr-par", "nl-ams", "pl-waw"]
16
- });
17
- pageOfListVpnGatewayTypes = (request = {}) => this.client.fetch(
18
- {
19
- method: "GET",
20
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateway-types`,
21
- urlParams: sdkClient.urlParams(
22
- ["page", request.page],
23
- [
24
- "page_size",
25
- request.pageSize ?? this.client.settings.defaultPageSize
26
- ]
27
- )
28
- },
29
- marshalling_gen.unmarshalListVpnGatewayTypesResponse
30
- );
31
- /**
32
- * List VPN gateway types. List the different VPN gateway commercial offer types available at Scaleway. The response is an array of objects describing the name and technical details of each available VPN gateway type.
33
- *
34
- * @param request - The request {@link ListVpnGatewayTypesRequest}
35
- * @returns A Promise of ListVpnGatewayTypesResponse
36
- */
37
- listVpnGatewayTypes = (request = {}) => sdkClient.enrichForPagination("gatewayTypes", this.pageOfListVpnGatewayTypes, request);
38
- pageOfListVpnGateways = (request = {}) => this.client.fetch(
39
- {
40
- method: "GET",
41
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways`,
42
- urlParams: sdkClient.urlParams(
43
- ["gateway_types", request.gatewayTypes],
44
- ["name", request.name],
45
- ["order_by", request.orderBy],
46
- ["page", request.page],
47
- [
48
- "page_size",
49
- request.pageSize ?? this.client.settings.defaultPageSize
50
- ],
51
- ["private_network_ids", request.privateNetworkIds],
52
- ["project_id", request.projectId],
53
- ["statuses", request.statuses],
54
- ["tags", request.tags]
55
- )
56
- },
57
- marshalling_gen.unmarshalListVpnGatewaysResponse
58
- );
59
- /**
60
- * List VPN gateways. List all your VPN gateways. A number of filters are available, including Project ID, name, tags and status.
61
- *
62
- * @param request - The request {@link ListVpnGatewaysRequest}
63
- * @returns A Promise of ListVpnGatewaysResponse
64
- */
65
- listVpnGateways = (request = {}) => sdkClient.enrichForPagination("gateways", this.pageOfListVpnGateways, request);
66
- /**
67
- * Get a VPN gateway. Get a VPN gateway for the given VPN gateway ID.
68
- *
69
- * @param request - The request {@link GetVpnGatewayRequest}
70
- * @returns A Promise of VpnGateway
71
- */
72
- getVpnGateway = (request) => this.client.fetch(
73
- {
74
- method: "GET",
75
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways/${sdkClient.validatePathParam("gatewayId", request.gatewayId)}`
76
- },
77
- marshalling_gen.unmarshalVpnGateway
78
- );
79
- /**
80
- * Waits for {@link VpnGateway} to be in a final state.
81
- *
82
- * @param request - The request {@link GetVpnGatewayRequest}
83
- * @param options - The waiting options
84
- * @returns A Promise of VpnGateway
85
- */
86
- waitForVpnGateway = (request, options) => sdkClient.waitForResource(
87
- options?.stop ?? ((res) => Promise.resolve(
88
- !content_gen.VPN_GATEWAY_TRANSIENT_STATUSES.includes(res.status)
89
- )),
90
- this.getVpnGateway,
91
- request,
92
- options
93
- );
94
- /**
95
- * Create VPN gateway.
96
- *
97
- * @param request - The request {@link CreateVpnGatewayRequest}
98
- * @returns A Promise of VpnGateway
99
- */
100
- createVpnGateway = (request) => this.client.fetch(
101
- {
102
- body: JSON.stringify(
103
- marshalling_gen.marshalCreateVpnGatewayRequest(request, this.client.settings)
104
- ),
105
- headers: jsonContentHeaders,
106
- method: "POST",
107
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways`
108
- },
109
- marshalling_gen.unmarshalVpnGateway
110
- );
111
- /**
112
- * Update a VPN gateway. Update an existing VPN gateway, specified by its VPN gateway ID. Only its name and tags can be updated.
113
- *
114
- * @param request - The request {@link UpdateVpnGatewayRequest}
115
- * @returns A Promise of VpnGateway
116
- */
117
- updateVpnGateway = (request) => this.client.fetch(
118
- {
119
- body: JSON.stringify(
120
- marshalling_gen.marshalUpdateVpnGatewayRequest(request, this.client.settings)
121
- ),
122
- headers: jsonContentHeaders,
123
- method: "PATCH",
124
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways/${sdkClient.validatePathParam("gatewayId", request.gatewayId)}`
125
- },
126
- marshalling_gen.unmarshalVpnGateway
127
- );
128
- /**
129
- * Delete a VPN gateway. Delete an existing VPN gateway, specified by its VPN gateway ID.
130
- *
131
- * @param request - The request {@link DeleteVpnGatewayRequest}
132
- * @returns A Promise of VpnGateway
133
- */
134
- deleteVpnGateway = (request) => this.client.fetch(
135
- {
136
- method: "DELETE",
137
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways/${sdkClient.validatePathParam("gatewayId", request.gatewayId)}`
138
- },
139
- marshalling_gen.unmarshalVpnGateway
140
- );
141
- pageOfListConnections = (request = {}) => this.client.fetch(
142
- {
143
- method: "GET",
144
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections`,
145
- urlParams: sdkClient.urlParams(
146
- ["customer_gateway_ids", request.customerGatewayIds],
147
- ["is_ipv6", request.isIpv6],
148
- ["name", request.name],
149
- ["order_by", request.orderBy],
150
- ["page", request.page],
151
- [
152
- "page_size",
153
- request.pageSize ?? this.client.settings.defaultPageSize
154
- ],
155
- ["project_id", request.projectId],
156
- ["route_propagation_enabled", request.routePropagationEnabled],
157
- ["routing_policy_ids", request.routingPolicyIds],
158
- ["statuses", request.statuses],
159
- ["tags", request.tags],
160
- ["vpn_gateway_ids", request.vpnGatewayIds]
161
- )
162
- },
163
- marshalling_gen.unmarshalListConnectionsResponse
164
- );
165
- /**
166
- * List connections. List all your connections. A number of filters are available, including Project ID, name, tags and status.
167
- *
168
- * @param request - The request {@link ListConnectionsRequest}
169
- * @returns A Promise of ListConnectionsResponse
170
- */
171
- listConnections = (request = {}) => sdkClient.enrichForPagination("connections", this.pageOfListConnections, request);
172
- /**
173
- * Get a connection. Get a connection for the given connection ID. The response object includes information about the connection's various configuration details.
174
- *
175
- * @param request - The request {@link GetConnectionRequest}
176
- * @returns A Promise of Connection
177
- */
178
- getConnection = (request) => this.client.fetch(
179
- {
180
- method: "GET",
181
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${sdkClient.validatePathParam("connectionId", request.connectionId)}`
182
- },
183
- marshalling_gen.unmarshalConnection
184
- );
185
- /**
186
- * Create a connection.
187
- *
188
- * @param request - The request {@link CreateConnectionRequest}
189
- * @returns A Promise of CreateConnectionResponse
190
- */
191
- createConnection = (request) => this.client.fetch(
192
- {
193
- body: JSON.stringify(
194
- marshalling_gen.marshalCreateConnectionRequest(request, this.client.settings)
195
- ),
196
- headers: jsonContentHeaders,
197
- method: "POST",
198
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections`
199
- },
200
- marshalling_gen.unmarshalCreateConnectionResponse
201
- );
202
- /**
203
- * Update a connection. Update an existing connection, specified by its connection ID.
204
- *
205
- * @param request - The request {@link UpdateConnectionRequest}
206
- * @returns A Promise of Connection
207
- */
208
- updateConnection = (request) => this.client.fetch(
209
- {
210
- body: JSON.stringify(
211
- marshalling_gen.marshalUpdateConnectionRequest(request, this.client.settings)
212
- ),
213
- headers: jsonContentHeaders,
214
- method: "PATCH",
215
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${sdkClient.validatePathParam("connectionId", request.connectionId)}`
216
- },
217
- marshalling_gen.unmarshalConnection
218
- );
219
- /**
220
- * Delete a connection. Delete an existing connection, specified by its connection ID.
221
- *
222
- * @param request - The request {@link DeleteConnectionRequest}
223
- */
224
- deleteConnection = (request) => this.client.fetch({
225
- method: "DELETE",
226
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${sdkClient.validatePathParam("connectionId", request.connectionId)}`
227
- });
228
- /**
229
- * Renew pre-shared key. Renew pre-shared key for a given connection.
230
- *
231
- * @param request - The request {@link RenewConnectionPskRequest}
232
- * @returns A Promise of RenewConnectionPskResponse
233
- */
234
- renewConnectionPsk = (request) => this.client.fetch(
235
- {
236
- body: "{}",
237
- headers: jsonContentHeaders,
238
- method: "POST",
239
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${sdkClient.validatePathParam("connectionId", request.connectionId)}/renew-psk`
240
- },
241
- marshalling_gen.unmarshalRenewConnectionPskResponse
242
- );
243
- /**
244
- * Set a new routing policy. Set a new routing policy on a connection, overriding the existing one if present, specified by its connection ID.
245
- *
246
- * @param request - The request {@link SetRoutingPolicyRequest}
247
- * @returns A Promise of Connection
248
- */
249
- setRoutingPolicy = (request) => this.client.fetch(
250
- {
251
- body: JSON.stringify(
252
- marshalling_gen.marshalSetRoutingPolicyRequest(request, this.client.settings)
253
- ),
254
- headers: jsonContentHeaders,
255
- method: "POST",
256
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${sdkClient.validatePathParam("connectionId", request.connectionId)}/set-routing-policy`
257
- },
258
- marshalling_gen.unmarshalConnection
259
- );
260
- /**
261
- * Detach a routing policy. Detach an existing routing policy from a connection, specified by its connection ID.
262
- *
263
- * @param request - The request {@link DetachRoutingPolicyRequest}
264
- * @returns A Promise of Connection
265
- */
266
- detachRoutingPolicy = (request) => this.client.fetch(
267
- {
268
- body: JSON.stringify(
269
- marshalling_gen.marshalDetachRoutingPolicyRequest(request, this.client.settings)
270
- ),
271
- headers: jsonContentHeaders,
272
- method: "POST",
273
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${sdkClient.validatePathParam("connectionId", request.connectionId)}/detach-routing-policy`
274
- },
275
- marshalling_gen.unmarshalConnection
276
- );
277
- /**
278
- * Enable route propagation. Enable all allowed prefixes (defined in a routing policy) to be announced in the BGP session. This allows traffic to flow between the attached VPC and the on-premises infrastructure along the announced routes. Note that by default, even when route propagation is enabled, all routes are blocked. It is essential to attach a routing policy to define the ranges of routes to announce.
279
- *
280
- * @param request - The request {@link EnableRoutePropagationRequest}
281
- * @returns A Promise of Connection
282
- */
283
- enableRoutePropagation = (request) => this.client.fetch(
284
- {
285
- body: "{}",
286
- headers: jsonContentHeaders,
287
- method: "POST",
288
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${sdkClient.validatePathParam("connectionId", request.connectionId)}/enable-route-propagation`
289
- },
290
- marshalling_gen.unmarshalConnection
291
- );
292
- /**
293
- * Disable route propagation. Prevent any prefixes from being announced in the BGP session. Traffic will not be able to flow over the VPN Gateway until route propagation is re-enabled.
294
- *
295
- * @param request - The request {@link DisableRoutePropagationRequest}
296
- * @returns A Promise of Connection
297
- */
298
- disableRoutePropagation = (request) => this.client.fetch(
299
- {
300
- body: "{}",
301
- headers: jsonContentHeaders,
302
- method: "POST",
303
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${sdkClient.validatePathParam("connectionId", request.connectionId)}/disable-route-propagation`
304
- },
305
- marshalling_gen.unmarshalConnection
306
- );
307
- pageOfListCustomerGateways = (request = {}) => this.client.fetch(
308
- {
309
- method: "GET",
310
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways`,
311
- urlParams: sdkClient.urlParams(
312
- ["name", request.name],
313
- ["order_by", request.orderBy],
314
- ["page", request.page],
315
- [
316
- "page_size",
317
- request.pageSize ?? this.client.settings.defaultPageSize
318
- ],
319
- ["project_id", request.projectId],
320
- ["tags", request.tags]
321
- )
322
- },
323
- marshalling_gen.unmarshalListCustomerGatewaysResponse
324
- );
325
- /**
326
- * List customer gateways. List all your customer gateways. A number of filters are available, including Project ID, name, and tags.
327
- *
328
- * @param request - The request {@link ListCustomerGatewaysRequest}
329
- * @returns A Promise of ListCustomerGatewaysResponse
330
- */
331
- listCustomerGateways = (request = {}) => sdkClient.enrichForPagination("gateways", this.pageOfListCustomerGateways, request);
332
- /**
333
- * Get a customer gateway. Get a customer gateway for the given customer gateway ID.
334
- *
335
- * @param request - The request {@link GetCustomerGatewayRequest}
336
- * @returns A Promise of CustomerGateway
337
- */
338
- getCustomerGateway = (request) => this.client.fetch(
339
- {
340
- method: "GET",
341
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${sdkClient.validatePathParam("gatewayId", request.gatewayId)}`
342
- },
343
- marshalling_gen.unmarshalCustomerGateway
344
- );
345
- /**
346
- * Create a customer gateway.
347
- *
348
- * @param request - The request {@link CreateCustomerGatewayRequest}
349
- * @returns A Promise of CustomerGateway
350
- */
351
- createCustomerGateway = (request) => this.client.fetch(
352
- {
353
- body: JSON.stringify(
354
- marshalling_gen.marshalCreateCustomerGatewayRequest(request, this.client.settings)
355
- ),
356
- headers: jsonContentHeaders,
357
- method: "POST",
358
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways`
359
- },
360
- marshalling_gen.unmarshalCustomerGateway
361
- );
362
- /**
363
- * Update a customer gateway. Update an existing customer gateway, specified by its customer gateway ID. You can update its name, tags, public IPv4 & IPv6 address and AS Number.
364
- *
365
- * @param request - The request {@link UpdateCustomerGatewayRequest}
366
- * @returns A Promise of CustomerGateway
367
- */
368
- updateCustomerGateway = (request) => this.client.fetch(
369
- {
370
- body: JSON.stringify(
371
- marshalling_gen.marshalUpdateCustomerGatewayRequest(request, this.client.settings)
372
- ),
373
- headers: jsonContentHeaders,
374
- method: "PATCH",
375
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${sdkClient.validatePathParam("gatewayId", request.gatewayId)}`
376
- },
377
- marshalling_gen.unmarshalCustomerGateway
378
- );
379
- /**
380
- * Delete a customer gateway. Delete an existing customer gateway, specified by its customer gateway ID.
381
- *
382
- * @param request - The request {@link DeleteCustomerGatewayRequest}
383
- */
384
- deleteCustomerGateway = (request) => this.client.fetch({
385
- method: "DELETE",
386
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${sdkClient.validatePathParam("gatewayId", request.gatewayId)}`
387
- });
388
- pageOfListRoutingPolicies = (request = {}) => this.client.fetch(
389
- {
390
- method: "GET",
391
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`,
392
- urlParams: sdkClient.urlParams(
393
- ["ipv6", request.ipv6],
394
- ["name", request.name],
395
- ["order_by", request.orderBy],
396
- ["page", request.page],
397
- [
398
- "page_size",
399
- request.pageSize ?? this.client.settings.defaultPageSize
400
- ],
401
- ["project_id", request.projectId],
402
- ["tags", request.tags]
403
- )
404
- },
405
- marshalling_gen.unmarshalListRoutingPoliciesResponse
406
- );
407
- /**
408
- * List routing policies. List all routing policies in a given region. A routing policy can be attached to one or multiple connections (S2S VPN connections).
409
- *
410
- * @param request - The request {@link ListRoutingPoliciesRequest}
411
- * @returns A Promise of ListRoutingPoliciesResponse
412
- */
413
- listRoutingPolicies = (request = {}) => sdkClient.enrichForPagination(
414
- "routingPolicies",
415
- this.pageOfListRoutingPolicies,
416
- request
417
- );
418
- /**
419
- * Get routing policy. Get a routing policy for the given routing policy ID. The response object gives information including the policy's name, tags and prefix filters.
420
- *
421
- * @param request - The request {@link GetRoutingPolicyRequest}
422
- * @returns A Promise of RoutingPolicy
423
- */
424
- getRoutingPolicy = (request) => this.client.fetch(
425
- {
426
- method: "GET",
427
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${sdkClient.validatePathParam("routingPolicyId", request.routingPolicyId)}`
428
- },
429
- marshalling_gen.unmarshalRoutingPolicy
430
- );
431
- /**
432
- * Create a routing policy. Create a routing policy. Routing policies allow you to set IP prefix filters to define the incoming route announcements to accept from the customer gateway, and the outgoing routes to announce to the customer gateway.
433
- *
434
- * @param request - The request {@link CreateRoutingPolicyRequest}
435
- * @returns A Promise of RoutingPolicy
436
- */
437
- createRoutingPolicy = (request) => this.client.fetch(
438
- {
439
- body: JSON.stringify(
440
- marshalling_gen.marshalCreateRoutingPolicyRequest(request, this.client.settings)
441
- ),
442
- headers: jsonContentHeaders,
443
- method: "POST",
444
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`
445
- },
446
- marshalling_gen.unmarshalRoutingPolicy
447
- );
448
- /**
449
- * Update a routing policy. Update an existing routing policy, specified by its routing policy ID. Its name, tags and incoming/outgoing prefix filters can be updated.
450
- *
451
- * @param request - The request {@link UpdateRoutingPolicyRequest}
452
- * @returns A Promise of RoutingPolicy
453
- */
454
- updateRoutingPolicy = (request) => this.client.fetch(
455
- {
456
- body: JSON.stringify(
457
- marshalling_gen.marshalUpdateRoutingPolicyRequest(request, this.client.settings)
458
- ),
459
- headers: jsonContentHeaders,
460
- method: "PATCH",
461
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${sdkClient.validatePathParam("routingPolicyId", request.routingPolicyId)}`
462
- },
463
- marshalling_gen.unmarshalRoutingPolicy
464
- );
465
- /**
466
- * Delete a routing policy. Delete an existing routing policy, specified by its routing policy ID.
467
- *
468
- * @param request - The request {@link DeleteRoutingPolicyRequest}
469
- */
470
- deleteRoutingPolicy = (request) => this.client.fetch({
471
- method: "DELETE",
472
- path: `/s2s-vpn/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${sdkClient.validatePathParam("routingPolicyId", request.routingPolicyId)}`
473
- });
474
- }
475
- exports.API = API;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const VPN_GATEWAY_TRANSIENT_STATUSES = [
4
- "configuring",
5
- "provisioning",
6
- "deprovisioning"
7
- ];
8
- exports.VPN_GATEWAY_TRANSIENT_STATUSES = VPN_GATEWAY_TRANSIENT_STATUSES;
@@ -1,30 +0,0 @@
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
- const marshalling_gen = require("./marshalling.gen.cjs");
6
- const validationRules_gen = require("./validation-rules.gen.cjs");
7
- exports.API = api_gen.API;
8
- exports.VPN_GATEWAY_TRANSIENT_STATUSES = content_gen.VPN_GATEWAY_TRANSIENT_STATUSES;
9
- exports.marshalCreateConnectionRequest = marshalling_gen.marshalCreateConnectionRequest;
10
- exports.marshalCreateCustomerGatewayRequest = marshalling_gen.marshalCreateCustomerGatewayRequest;
11
- exports.marshalCreateRoutingPolicyRequest = marshalling_gen.marshalCreateRoutingPolicyRequest;
12
- exports.marshalCreateVpnGatewayRequest = marshalling_gen.marshalCreateVpnGatewayRequest;
13
- exports.marshalDetachRoutingPolicyRequest = marshalling_gen.marshalDetachRoutingPolicyRequest;
14
- exports.marshalSetRoutingPolicyRequest = marshalling_gen.marshalSetRoutingPolicyRequest;
15
- exports.marshalUpdateConnectionRequest = marshalling_gen.marshalUpdateConnectionRequest;
16
- exports.marshalUpdateCustomerGatewayRequest = marshalling_gen.marshalUpdateCustomerGatewayRequest;
17
- exports.marshalUpdateRoutingPolicyRequest = marshalling_gen.marshalUpdateRoutingPolicyRequest;
18
- exports.marshalUpdateVpnGatewayRequest = marshalling_gen.marshalUpdateVpnGatewayRequest;
19
- exports.unmarshalConnection = marshalling_gen.unmarshalConnection;
20
- exports.unmarshalCreateConnectionResponse = marshalling_gen.unmarshalCreateConnectionResponse;
21
- exports.unmarshalCustomerGateway = marshalling_gen.unmarshalCustomerGateway;
22
- exports.unmarshalListConnectionsResponse = marshalling_gen.unmarshalListConnectionsResponse;
23
- exports.unmarshalListCustomerGatewaysResponse = marshalling_gen.unmarshalListCustomerGatewaysResponse;
24
- exports.unmarshalListRoutingPoliciesResponse = marshalling_gen.unmarshalListRoutingPoliciesResponse;
25
- exports.unmarshalListVpnGatewayTypesResponse = marshalling_gen.unmarshalListVpnGatewayTypesResponse;
26
- exports.unmarshalListVpnGatewaysResponse = marshalling_gen.unmarshalListVpnGatewaysResponse;
27
- exports.unmarshalRenewConnectionPskResponse = marshalling_gen.unmarshalRenewConnectionPskResponse;
28
- exports.unmarshalRoutingPolicy = marshalling_gen.unmarshalRoutingPolicy;
29
- exports.unmarshalVpnGateway = marshalling_gen.unmarshalVpnGateway;
30
- exports.ValidationRules = validationRules_gen;
@@ -1,370 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sdkClient = require("@scaleway/sdk-client");
4
- const unmarshalBgpSession = (data) => {
5
- if (!sdkClient.isJSONObject(data)) {
6
- throw new TypeError(
7
- `Unmarshalling the type 'BgpSession' failed as data isn't a dictionary.`
8
- );
9
- }
10
- return {
11
- peerPrivateIp: data.peer_private_ip,
12
- privateIp: data.private_ip,
13
- routingPolicyId: data.routing_policy_id
14
- };
15
- };
16
- const unmarshalConnectionCipher = (data) => {
17
- if (!sdkClient.isJSONObject(data)) {
18
- throw new TypeError(
19
- `Unmarshalling the type 'ConnectionCipher' failed as data isn't a dictionary.`
20
- );
21
- }
22
- return {
23
- dhGroup: data.dh_group ? data.dh_group : void 0,
24
- encryption: data.encryption,
25
- integrity: data.integrity ? data.integrity : void 0
26
- };
27
- };
28
- const unmarshalConnection = (data) => {
29
- if (!sdkClient.isJSONObject(data)) {
30
- throw new TypeError(
31
- `Unmarshalling the type 'Connection' failed as data isn't a dictionary.`
32
- );
33
- }
34
- return {
35
- bgpSessionIpv4: data.bgp_session_ipv4 ? unmarshalBgpSession(data.bgp_session_ipv4) : void 0,
36
- bgpSessionIpv6: data.bgp_session_ipv6 ? unmarshalBgpSession(data.bgp_session_ipv6) : void 0,
37
- bgpStatusIpv4: data.bgp_status_ipv4,
38
- bgpStatusIpv6: data.bgp_status_ipv6,
39
- createdAt: sdkClient.unmarshalDate(data.created_at),
40
- customerGatewayId: data.customer_gateway_id,
41
- espCiphers: sdkClient.unmarshalArrayOfObject(
42
- data.esp_ciphers,
43
- unmarshalConnectionCipher
44
- ),
45
- id: data.id,
46
- ikev2Ciphers: sdkClient.unmarshalArrayOfObject(
47
- data.ikev2_ciphers,
48
- unmarshalConnectionCipher
49
- ),
50
- initiationPolicy: data.initiation_policy,
51
- isIpv6: data.is_ipv6,
52
- name: data.name,
53
- organizationId: data.organization_id,
54
- projectId: data.project_id,
55
- region: data.region,
56
- routePropagationEnabled: data.route_propagation_enabled,
57
- secretId: data.secret_id,
58
- secretRevision: data.secret_revision,
59
- status: data.status,
60
- tags: data.tags,
61
- tunnelStatus: data.tunnel_status,
62
- tunnelStatusIpv4: data.tunnel_status_ipv4 ? data.tunnel_status_ipv4 : void 0,
63
- tunnelStatusIpv6: data.tunnel_status_ipv6 ? data.tunnel_status_ipv6 : void 0,
64
- updatedAt: sdkClient.unmarshalDate(data.updated_at),
65
- vpnGatewayId: data.vpn_gateway_id
66
- };
67
- };
68
- const unmarshalCustomerGateway = (data) => {
69
- if (!sdkClient.isJSONObject(data)) {
70
- throw new TypeError(
71
- `Unmarshalling the type 'CustomerGateway' failed as data isn't a dictionary.`
72
- );
73
- }
74
- return {
75
- asn: data.asn,
76
- createdAt: sdkClient.unmarshalDate(data.created_at),
77
- id: data.id,
78
- name: data.name,
79
- organizationId: data.organization_id,
80
- projectId: data.project_id,
81
- publicIpv4: data.public_ipv4,
82
- publicIpv6: data.public_ipv6,
83
- tags: data.tags,
84
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
85
- };
86
- };
87
- const unmarshalRoutingPolicy = (data) => {
88
- if (!sdkClient.isJSONObject(data)) {
89
- throw new TypeError(
90
- `Unmarshalling the type 'RoutingPolicy' failed as data isn't a dictionary.`
91
- );
92
- }
93
- return {
94
- createdAt: sdkClient.unmarshalDate(data.created_at),
95
- id: data.id,
96
- isIpv6: data.is_ipv6,
97
- name: data.name,
98
- organizationId: data.organization_id,
99
- prefixFilterIn: data.prefix_filter_in,
100
- prefixFilterOut: data.prefix_filter_out,
101
- projectId: data.project_id,
102
- region: data.region,
103
- tags: data.tags,
104
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
105
- };
106
- };
107
- const unmarshalVpnGatewayPrivateConfig = (data) => {
108
- if (!sdkClient.isJSONObject(data)) {
109
- throw new TypeError(
110
- `Unmarshalling the type 'VpnGatewayPrivateConfig' failed as data isn't a dictionary.`
111
- );
112
- }
113
- return {};
114
- };
115
- const unmarshalVpnGatewayPublicConfig = (data) => {
116
- if (!sdkClient.isJSONObject(data)) {
117
- throw new TypeError(
118
- `Unmarshalling the type 'VpnGatewayPublicConfig' failed as data isn't a dictionary.`
119
- );
120
- }
121
- return {
122
- ipamIpv4Id: data.ipam_ipv4_id,
123
- ipamIpv6Id: data.ipam_ipv6_id
124
- };
125
- };
126
- const unmarshalVpnGateway = (data) => {
127
- if (!sdkClient.isJSONObject(data)) {
128
- throw new TypeError(
129
- `Unmarshalling the type 'VpnGateway' failed as data isn't a dictionary.`
130
- );
131
- }
132
- return {
133
- asn: data.asn,
134
- createdAt: sdkClient.unmarshalDate(data.created_at),
135
- gatewayType: data.gateway_type,
136
- id: data.id,
137
- ipamPrivateIpv4Id: data.ipam_private_ipv4_id,
138
- ipamPrivateIpv6Id: data.ipam_private_ipv6_id,
139
- name: data.name,
140
- organizationId: data.organization_id,
141
- privateConfig: data.private_config ? unmarshalVpnGatewayPrivateConfig(data.private_config) : void 0,
142
- privateNetworkId: data.private_network_id,
143
- projectId: data.project_id,
144
- publicConfig: data.public_config ? unmarshalVpnGatewayPublicConfig(data.public_config) : void 0,
145
- region: data.region,
146
- status: data.status,
147
- tags: data.tags,
148
- updatedAt: sdkClient.unmarshalDate(data.updated_at),
149
- zone: data.zone
150
- };
151
- };
152
- const unmarshalCreateConnectionResponse = (data) => {
153
- if (!sdkClient.isJSONObject(data)) {
154
- throw new TypeError(
155
- `Unmarshalling the type 'CreateConnectionResponse' failed as data isn't a dictionary.`
156
- );
157
- }
158
- return {
159
- connection: data.connection ? unmarshalConnection(data.connection) : void 0,
160
- preSharedKey: data.pre_shared_key
161
- };
162
- };
163
- const unmarshalListConnectionsResponse = (data) => {
164
- if (!sdkClient.isJSONObject(data)) {
165
- throw new TypeError(
166
- `Unmarshalling the type 'ListConnectionsResponse' failed as data isn't a dictionary.`
167
- );
168
- }
169
- return {
170
- connections: sdkClient.unmarshalArrayOfObject(data.connections, unmarshalConnection),
171
- totalCount: data.total_count
172
- };
173
- };
174
- const unmarshalListCustomerGatewaysResponse = (data) => {
175
- if (!sdkClient.isJSONObject(data)) {
176
- throw new TypeError(
177
- `Unmarshalling the type 'ListCustomerGatewaysResponse' failed as data isn't a dictionary.`
178
- );
179
- }
180
- return {
181
- gateways: sdkClient.unmarshalArrayOfObject(data.gateways, unmarshalCustomerGateway),
182
- totalCount: data.total_count
183
- };
184
- };
185
- const unmarshalListRoutingPoliciesResponse = (data) => {
186
- if (!sdkClient.isJSONObject(data)) {
187
- throw new TypeError(
188
- `Unmarshalling the type 'ListRoutingPoliciesResponse' failed as data isn't a dictionary.`
189
- );
190
- }
191
- return {
192
- routingPolicies: sdkClient.unmarshalArrayOfObject(
193
- data.routing_policies,
194
- unmarshalRoutingPolicy
195
- ),
196
- totalCount: data.total_count
197
- };
198
- };
199
- const unmarshalGatewayType = (data) => {
200
- if (!sdkClient.isJSONObject(data)) {
201
- throw new TypeError(
202
- `Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`
203
- );
204
- }
205
- return {
206
- allowedConnections: data.allowed_connections,
207
- bandwidth: data.bandwidth,
208
- name: data.name,
209
- region: data.region
210
- };
211
- };
212
- const unmarshalListVpnGatewayTypesResponse = (data) => {
213
- if (!sdkClient.isJSONObject(data)) {
214
- throw new TypeError(
215
- `Unmarshalling the type 'ListVpnGatewayTypesResponse' failed as data isn't a dictionary.`
216
- );
217
- }
218
- return {
219
- gatewayTypes: sdkClient.unmarshalArrayOfObject(
220
- data.gateway_types,
221
- unmarshalGatewayType
222
- ),
223
- totalCount: data.total_count
224
- };
225
- };
226
- const unmarshalListVpnGatewaysResponse = (data) => {
227
- if (!sdkClient.isJSONObject(data)) {
228
- throw new TypeError(
229
- `Unmarshalling the type 'ListVpnGatewaysResponse' failed as data isn't a dictionary.`
230
- );
231
- }
232
- return {
233
- gateways: sdkClient.unmarshalArrayOfObject(data.gateways, unmarshalVpnGateway),
234
- totalCount: data.total_count
235
- };
236
- };
237
- const unmarshalRenewConnectionPskResponse = (data) => {
238
- if (!sdkClient.isJSONObject(data)) {
239
- throw new TypeError(
240
- `Unmarshalling the type 'RenewConnectionPskResponse' failed as data isn't a dictionary.`
241
- );
242
- }
243
- return {
244
- connection: data.connection ? unmarshalConnection(data.connection) : void 0,
245
- preSharedKey: data.pre_shared_key
246
- };
247
- };
248
- const marshalConnectionCipher = (request, defaults) => ({
249
- dh_group: request.dhGroup,
250
- encryption: request.encryption,
251
- integrity: request.integrity
252
- });
253
- const marshalCreateConnectionRequestBgpConfig = (request, defaults) => ({
254
- peer_private_ip: request.peerPrivateIp,
255
- private_ip: request.privateIp,
256
- routing_policy_id: request.routingPolicyId
257
- });
258
- const marshalCreateConnectionRequest = (request, defaults) => ({
259
- bgp_config_ipv4: request.bgpConfigIpv4 !== void 0 ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv4) : void 0,
260
- bgp_config_ipv6: request.bgpConfigIpv6 !== void 0 ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv6) : void 0,
261
- customer_gateway_id: request.customerGatewayId,
262
- enable_route_propagation: request.enableRoutePropagation,
263
- esp_ciphers: request.espCiphers.map(
264
- (elt) => marshalConnectionCipher(elt)
265
- ),
266
- ikev2_ciphers: request.ikev2Ciphers.map(
267
- (elt) => marshalConnectionCipher(elt)
268
- ),
269
- initiation_policy: request.initiationPolicy,
270
- is_ipv6: request.isIpv6,
271
- name: request.name,
272
- project_id: request.projectId ?? defaults.defaultProjectId,
273
- tags: request.tags,
274
- vpn_gateway_id: request.vpnGatewayId
275
- });
276
- const marshalCreateCustomerGatewayRequest = (request, defaults) => ({
277
- asn: request.asn,
278
- ipv4_public: request.ipv4Public,
279
- ipv6_public: request.ipv6Public,
280
- name: request.name,
281
- project_id: request.projectId ?? defaults.defaultProjectId,
282
- tags: request.tags
283
- });
284
- const marshalCreateRoutingPolicyRequest = (request, defaults) => ({
285
- is_ipv6: request.isIpv6,
286
- name: request.name,
287
- prefix_filter_in: request.prefixFilterIn,
288
- prefix_filter_out: request.prefixFilterOut,
289
- project_id: request.projectId ?? defaults.defaultProjectId,
290
- tags: request.tags
291
- });
292
- const marshalCreateVpnGatewayRequestPublicConfig = (request, defaults) => ({
293
- ipam_ipv4_id: request.ipamIpv4Id,
294
- ipam_ipv6_id: request.ipamIpv6Id
295
- });
296
- const marshalCreateVpnGatewayRequest = (request, defaults) => ({
297
- gateway_type: request.gatewayType,
298
- ipam_private_ipv4_id: request.ipamPrivateIpv4Id,
299
- ipam_private_ipv6_id: request.ipamPrivateIpv6Id,
300
- name: request.name,
301
- private_network_id: request.privateNetworkId,
302
- project_id: request.projectId ?? defaults.defaultProjectId,
303
- tags: request.tags,
304
- zone: request.zone ?? defaults.defaultZone,
305
- ...sdkClient.resolveOneOf([
306
- {
307
- param: "public_config",
308
- value: request.publicConfig !== void 0 ? marshalCreateVpnGatewayRequestPublicConfig(
309
- request.publicConfig
310
- ) : void 0
311
- }
312
- ])
313
- });
314
- const marshalDetachRoutingPolicyRequest = (request, defaults) => ({
315
- ...sdkClient.resolveOneOf([
316
- { param: "routing_policy_v4", value: request.routingPolicyV4 },
317
- { param: "routing_policy_v6", value: request.routingPolicyV6 }
318
- ])
319
- });
320
- const marshalSetRoutingPolicyRequest = (request, defaults) => ({
321
- ...sdkClient.resolveOneOf([
322
- { param: "routing_policy_v4", value: request.routingPolicyV4 },
323
- { param: "routing_policy_v6", value: request.routingPolicyV6 }
324
- ])
325
- });
326
- const marshalUpdateConnectionRequest = (request, defaults) => ({
327
- esp_ciphers: request.espCiphers !== void 0 ? request.espCiphers.map((elt) => marshalConnectionCipher(elt)) : void 0,
328
- ikev2_ciphers: request.ikev2Ciphers !== void 0 ? request.ikev2Ciphers.map((elt) => marshalConnectionCipher(elt)) : void 0,
329
- initiation_policy: request.initiationPolicy,
330
- name: request.name,
331
- tags: request.tags
332
- });
333
- const marshalUpdateCustomerGatewayRequest = (request, defaults) => ({
334
- asn: request.asn,
335
- ipv4_public: request.ipv4Public,
336
- ipv6_public: request.ipv6Public,
337
- name: request.name,
338
- tags: request.tags
339
- });
340
- const marshalUpdateRoutingPolicyRequest = (request, defaults) => ({
341
- name: request.name,
342
- prefix_filter_in: request.prefixFilterIn,
343
- prefix_filter_out: request.prefixFilterOut,
344
- tags: request.tags
345
- });
346
- const marshalUpdateVpnGatewayRequest = (request, defaults) => ({
347
- name: request.name,
348
- tags: request.tags
349
- });
350
- exports.marshalCreateConnectionRequest = marshalCreateConnectionRequest;
351
- exports.marshalCreateCustomerGatewayRequest = marshalCreateCustomerGatewayRequest;
352
- exports.marshalCreateRoutingPolicyRequest = marshalCreateRoutingPolicyRequest;
353
- exports.marshalCreateVpnGatewayRequest = marshalCreateVpnGatewayRequest;
354
- exports.marshalDetachRoutingPolicyRequest = marshalDetachRoutingPolicyRequest;
355
- exports.marshalSetRoutingPolicyRequest = marshalSetRoutingPolicyRequest;
356
- exports.marshalUpdateConnectionRequest = marshalUpdateConnectionRequest;
357
- exports.marshalUpdateCustomerGatewayRequest = marshalUpdateCustomerGatewayRequest;
358
- exports.marshalUpdateRoutingPolicyRequest = marshalUpdateRoutingPolicyRequest;
359
- exports.marshalUpdateVpnGatewayRequest = marshalUpdateVpnGatewayRequest;
360
- exports.unmarshalConnection = unmarshalConnection;
361
- exports.unmarshalCreateConnectionResponse = unmarshalCreateConnectionResponse;
362
- exports.unmarshalCustomerGateway = unmarshalCustomerGateway;
363
- exports.unmarshalListConnectionsResponse = unmarshalListConnectionsResponse;
364
- exports.unmarshalListCustomerGatewaysResponse = unmarshalListCustomerGatewaysResponse;
365
- exports.unmarshalListRoutingPoliciesResponse = unmarshalListRoutingPoliciesResponse;
366
- exports.unmarshalListVpnGatewayTypesResponse = unmarshalListVpnGatewayTypesResponse;
367
- exports.unmarshalListVpnGatewaysResponse = unmarshalListVpnGatewaysResponse;
368
- exports.unmarshalRenewConnectionPskResponse = unmarshalRenewConnectionPskResponse;
369
- exports.unmarshalRoutingPolicy = unmarshalRoutingPolicy;
370
- exports.unmarshalVpnGateway = unmarshalVpnGateway;
@@ -1,142 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const CreateConnectionRequest = {
4
- name: {
5
- maxLength: 255,
6
- minLength: 1
7
- }
8
- };
9
- const CreateCustomerGatewayRequest = {
10
- asn: {
11
- greaterThanOrEqual: 1
12
- },
13
- name: {
14
- maxLength: 255,
15
- minLength: 1
16
- }
17
- };
18
- const CreateRoutingPolicyRequest = {
19
- name: {
20
- maxLength: 255,
21
- minLength: 1
22
- }
23
- };
24
- const CreateVpnGatewayRequest = {
25
- name: {
26
- maxLength: 255,
27
- minLength: 1
28
- }
29
- };
30
- const CustomerGateway = {
31
- asn: {
32
- greaterThanOrEqual: 1
33
- }
34
- };
35
- const ListConnectionsRequest = {
36
- name: {
37
- maxLength: 255,
38
- minLength: 1
39
- },
40
- page: {
41
- greaterThanOrEqual: 1
42
- },
43
- pageSize: {
44
- greaterThanOrEqual: 1,
45
- lessThanOrEqual: 1e3
46
- }
47
- };
48
- const ListCustomerGatewaysRequest = {
49
- name: {
50
- maxLength: 255,
51
- minLength: 1
52
- },
53
- page: {
54
- greaterThanOrEqual: 1
55
- },
56
- pageSize: {
57
- greaterThanOrEqual: 1,
58
- lessThanOrEqual: 1e3
59
- }
60
- };
61
- const ListRoutingPoliciesRequest = {
62
- name: {
63
- maxLength: 255,
64
- minLength: 1
65
- },
66
- page: {
67
- greaterThanOrEqual: 1
68
- },
69
- pageSize: {
70
- greaterThanOrEqual: 1,
71
- lessThanOrEqual: 1e3
72
- }
73
- };
74
- const ListVpnGatewayTypesRequest = {
75
- page: {
76
- greaterThanOrEqual: 1
77
- },
78
- pageSize: {
79
- greaterThanOrEqual: 1,
80
- lessThanOrEqual: 1e3
81
- }
82
- };
83
- const ListVpnGatewaysRequest = {
84
- name: {
85
- maxLength: 255,
86
- minLength: 1
87
- },
88
- page: {
89
- greaterThanOrEqual: 1
90
- },
91
- pageSize: {
92
- greaterThanOrEqual: 1,
93
- lessThanOrEqual: 1e3
94
- }
95
- };
96
- const UpdateConnectionRequest = {
97
- name: {
98
- maxLength: 255,
99
- minLength: 1
100
- }
101
- };
102
- const UpdateCustomerGatewayRequest = {
103
- asn: {
104
- greaterThanOrEqual: 1
105
- },
106
- name: {
107
- maxLength: 255,
108
- minLength: 1
109
- }
110
- };
111
- const UpdateRoutingPolicyRequest = {
112
- name: {
113
- maxLength: 255,
114
- minLength: 1
115
- }
116
- };
117
- const UpdateVpnGatewayRequest = {
118
- name: {
119
- maxLength: 255,
120
- minLength: 1
121
- }
122
- };
123
- const VpnGateway = {
124
- asn: {
125
- greaterThanOrEqual: 1
126
- }
127
- };
128
- exports.CreateConnectionRequest = CreateConnectionRequest;
129
- exports.CreateCustomerGatewayRequest = CreateCustomerGatewayRequest;
130
- exports.CreateRoutingPolicyRequest = CreateRoutingPolicyRequest;
131
- exports.CreateVpnGatewayRequest = CreateVpnGatewayRequest;
132
- exports.CustomerGateway = CustomerGateway;
133
- exports.ListConnectionsRequest = ListConnectionsRequest;
134
- exports.ListCustomerGatewaysRequest = ListCustomerGatewaysRequest;
135
- exports.ListRoutingPoliciesRequest = ListRoutingPoliciesRequest;
136
- exports.ListVpnGatewayTypesRequest = ListVpnGatewayTypesRequest;
137
- exports.ListVpnGatewaysRequest = ListVpnGatewaysRequest;
138
- exports.UpdateConnectionRequest = UpdateConnectionRequest;
139
- exports.UpdateCustomerGatewayRequest = UpdateCustomerGatewayRequest;
140
- exports.UpdateRoutingPolicyRequest = UpdateRoutingPolicyRequest;
141
- exports.UpdateVpnGatewayRequest = UpdateVpnGatewayRequest;
142
- exports.VpnGateway = VpnGateway;