@scaleway/sdk-s2s-vpn 2.4.0 → 2.5.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.
@@ -1,374 +1,292 @@
1
- import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
- const unmarshalBgpSession = (data) => {
3
- if (!isJSONObject(data)) {
4
- throw new TypeError(
5
- `Unmarshalling the type 'BgpSession' failed as data isn't a dictionary.`
6
- );
7
- }
8
- return {
9
- peerPrivateIp: data.peer_private_ip,
10
- privateIp: data.private_ip,
11
- routingPolicyId: data.routing_policy_id
12
- };
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
+ var unmarshalBgpSession = (data) => {
3
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BgpSession' failed as data isn't a dictionary.`);
4
+ return {
5
+ peerPrivateIp: data.peer_private_ip,
6
+ privateIp: data.private_ip,
7
+ routingPolicyId: data.routing_policy_id
8
+ };
13
9
  };
14
- const unmarshalConnectionCipher = (data) => {
15
- if (!isJSONObject(data)) {
16
- throw new TypeError(
17
- `Unmarshalling the type 'ConnectionCipher' failed as data isn't a dictionary.`
18
- );
19
- }
20
- return {
21
- dhGroup: data.dh_group ? data.dh_group : void 0,
22
- encryption: data.encryption,
23
- integrity: data.integrity ? data.integrity : void 0
24
- };
10
+ var unmarshalConnectionCipher = (data) => {
11
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ConnectionCipher' failed as data isn't a dictionary.`);
12
+ return {
13
+ dhGroup: data.dh_group ? data.dh_group : void 0,
14
+ encryption: data.encryption,
15
+ integrity: data.integrity ? data.integrity : void 0
16
+ };
25
17
  };
26
18
  const unmarshalConnection = (data) => {
27
- if (!isJSONObject(data)) {
28
- throw new TypeError(
29
- `Unmarshalling the type 'Connection' failed as data isn't a dictionary.`
30
- );
31
- }
32
- return {
33
- bgpSessionIpv4: data.bgp_session_ipv4 ? unmarshalBgpSession(data.bgp_session_ipv4) : void 0,
34
- bgpSessionIpv6: data.bgp_session_ipv6 ? unmarshalBgpSession(data.bgp_session_ipv6) : void 0,
35
- bgpStatusIpv4: data.bgp_status_ipv4,
36
- bgpStatusIpv6: data.bgp_status_ipv6,
37
- createdAt: unmarshalDate(data.created_at),
38
- customerGatewayId: data.customer_gateway_id,
39
- espCiphers: unmarshalArrayOfObject(
40
- data.esp_ciphers,
41
- unmarshalConnectionCipher
42
- ),
43
- id: data.id,
44
- ikev2Ciphers: unmarshalArrayOfObject(
45
- data.ikev2_ciphers,
46
- unmarshalConnectionCipher
47
- ),
48
- initiationPolicy: data.initiation_policy,
49
- isIpv6: data.is_ipv6,
50
- name: data.name,
51
- organizationId: data.organization_id,
52
- projectId: data.project_id,
53
- region: data.region,
54
- routePropagationEnabled: data.route_propagation_enabled,
55
- secretId: data.secret_id,
56
- secretRevision: data.secret_revision,
57
- status: data.status,
58
- tags: data.tags,
59
- tunnelStatus: data.tunnel_status,
60
- tunnelStatusIpv4: data.tunnel_status_ipv4 ? data.tunnel_status_ipv4 : void 0,
61
- tunnelStatusIpv6: data.tunnel_status_ipv6 ? data.tunnel_status_ipv6 : void 0,
62
- updatedAt: unmarshalDate(data.updated_at),
63
- vpnGatewayId: data.vpn_gateway_id
64
- };
19
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Connection' failed as data isn't a dictionary.`);
20
+ return {
21
+ bgpSessionIpv4: data.bgp_session_ipv4 ? unmarshalBgpSession(data.bgp_session_ipv4) : void 0,
22
+ bgpSessionIpv6: data.bgp_session_ipv6 ? unmarshalBgpSession(data.bgp_session_ipv6) : void 0,
23
+ bgpStatusIpv4: data.bgp_status_ipv4,
24
+ bgpStatusIpv6: data.bgp_status_ipv6,
25
+ createdAt: unmarshalDate(data.created_at),
26
+ customerGatewayId: data.customer_gateway_id,
27
+ espCiphers: unmarshalArrayOfObject(data.esp_ciphers, unmarshalConnectionCipher),
28
+ id: data.id,
29
+ ikev2Ciphers: unmarshalArrayOfObject(data.ikev2_ciphers, unmarshalConnectionCipher),
30
+ initiationPolicy: data.initiation_policy,
31
+ isIpv6: data.is_ipv6,
32
+ name: data.name,
33
+ organizationId: data.organization_id,
34
+ projectId: data.project_id,
35
+ region: data.region,
36
+ routePropagationEnabled: data.route_propagation_enabled,
37
+ secretId: data.secret_id,
38
+ secretRevision: data.secret_revision,
39
+ status: data.status,
40
+ tags: data.tags,
41
+ tunnelStatus: data.tunnel_status,
42
+ tunnelStatusIpv4: data.tunnel_status_ipv4 ? data.tunnel_status_ipv4 : void 0,
43
+ tunnelStatusIpv6: data.tunnel_status_ipv6 ? data.tunnel_status_ipv6 : void 0,
44
+ updatedAt: unmarshalDate(data.updated_at),
45
+ vpnGatewayId: data.vpn_gateway_id
46
+ };
65
47
  };
66
48
  const unmarshalCustomerGateway = (data) => {
67
- if (!isJSONObject(data)) {
68
- throw new TypeError(
69
- `Unmarshalling the type 'CustomerGateway' failed as data isn't a dictionary.`
70
- );
71
- }
72
- return {
73
- asn: data.asn,
74
- connectionIds: data.connection_ids,
75
- createdAt: unmarshalDate(data.created_at),
76
- id: data.id,
77
- name: data.name,
78
- organizationId: data.organization_id,
79
- projectId: data.project_id,
80
- publicIpv4: data.public_ipv4,
81
- publicIpv6: data.public_ipv6,
82
- region: data.region,
83
- tags: data.tags,
84
- updatedAt: unmarshalDate(data.updated_at)
85
- };
49
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CustomerGateway' failed as data isn't a dictionary.`);
50
+ return {
51
+ asn: data.asn,
52
+ connectionIds: data.connection_ids,
53
+ createdAt: unmarshalDate(data.created_at),
54
+ id: data.id,
55
+ name: data.name,
56
+ organizationId: data.organization_id,
57
+ projectId: data.project_id,
58
+ publicIpv4: data.public_ipv4,
59
+ publicIpv6: data.public_ipv6,
60
+ region: data.region,
61
+ tags: data.tags,
62
+ updatedAt: unmarshalDate(data.updated_at)
63
+ };
86
64
  };
87
65
  const unmarshalRoutingPolicy = (data) => {
88
- if (!isJSONObject(data)) {
89
- throw new TypeError(
90
- `Unmarshalling the type 'RoutingPolicy' failed as data isn't a dictionary.`
91
- );
92
- }
93
- return {
94
- createdAt: 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: unmarshalDate(data.updated_at)
105
- };
66
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RoutingPolicy' failed as data isn't a dictionary.`);
67
+ return {
68
+ createdAt: unmarshalDate(data.created_at),
69
+ id: data.id,
70
+ isIpv6: data.is_ipv6,
71
+ name: data.name,
72
+ organizationId: data.organization_id,
73
+ prefixFilterIn: data.prefix_filter_in,
74
+ prefixFilterOut: data.prefix_filter_out,
75
+ projectId: data.project_id,
76
+ region: data.region,
77
+ tags: data.tags,
78
+ updatedAt: unmarshalDate(data.updated_at)
79
+ };
106
80
  };
107
- const unmarshalVpnGatewayPrivateConfig = (data) => {
108
- if (!isJSONObject(data)) {
109
- throw new TypeError(
110
- `Unmarshalling the type 'VpnGatewayPrivateConfig' failed as data isn't a dictionary.`
111
- );
112
- }
113
- return {};
81
+ var unmarshalVpnGatewayPrivateConfig = (data) => {
82
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VpnGatewayPrivateConfig' failed as data isn't a dictionary.`);
83
+ return {};
114
84
  };
115
- const unmarshalVpnGatewayPublicConfig = (data) => {
116
- if (!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
- };
85
+ var unmarshalVpnGatewayPublicConfig = (data) => {
86
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VpnGatewayPublicConfig' failed as data isn't a dictionary.`);
87
+ return {
88
+ ipamIpv4Id: data.ipam_ipv4_id,
89
+ ipamIpv6Id: data.ipam_ipv6_id
90
+ };
125
91
  };
126
92
  const unmarshalVpnGateway = (data) => {
127
- if (!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
- connectionIds: data.connection_ids,
135
- createdAt: unmarshalDate(data.created_at),
136
- gatewayType: data.gateway_type,
137
- id: data.id,
138
- ipamPrivateIpv4Id: data.ipam_private_ipv4_id,
139
- ipamPrivateIpv6Id: data.ipam_private_ipv6_id,
140
- name: data.name,
141
- organizationId: data.organization_id,
142
- privateConfig: data.private_config ? unmarshalVpnGatewayPrivateConfig(data.private_config) : void 0,
143
- privateNetworkId: data.private_network_id,
144
- projectId: data.project_id,
145
- publicConfig: data.public_config ? unmarshalVpnGatewayPublicConfig(data.public_config) : void 0,
146
- region: data.region,
147
- status: data.status,
148
- tags: data.tags,
149
- updatedAt: unmarshalDate(data.updated_at),
150
- zone: data.zone
151
- };
93
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VpnGateway' failed as data isn't a dictionary.`);
94
+ return {
95
+ asn: data.asn,
96
+ connectionIds: data.connection_ids,
97
+ createdAt: unmarshalDate(data.created_at),
98
+ gatewayType: data.gateway_type,
99
+ id: data.id,
100
+ ipamPrivateIpv4Id: data.ipam_private_ipv4_id,
101
+ ipamPrivateIpv6Id: data.ipam_private_ipv6_id,
102
+ name: data.name,
103
+ organizationId: data.organization_id,
104
+ privateConfig: data.private_config ? unmarshalVpnGatewayPrivateConfig(data.private_config) : void 0,
105
+ privateNetworkId: data.private_network_id,
106
+ projectId: data.project_id,
107
+ publicConfig: data.public_config ? unmarshalVpnGatewayPublicConfig(data.public_config) : void 0,
108
+ region: data.region,
109
+ status: data.status,
110
+ tags: data.tags,
111
+ updatedAt: unmarshalDate(data.updated_at),
112
+ zone: data.zone
113
+ };
152
114
  };
153
115
  const unmarshalCreateConnectionResponse = (data) => {
154
- if (!isJSONObject(data)) {
155
- throw new TypeError(
156
- `Unmarshalling the type 'CreateConnectionResponse' failed as data isn't a dictionary.`
157
- );
158
- }
159
- return {
160
- connection: data.connection ? unmarshalConnection(data.connection) : void 0,
161
- preSharedKey: data.pre_shared_key
162
- };
116
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateConnectionResponse' failed as data isn't a dictionary.`);
117
+ return {
118
+ connection: data.connection ? unmarshalConnection(data.connection) : void 0,
119
+ preSharedKey: data.pre_shared_key
120
+ };
163
121
  };
164
122
  const unmarshalListConnectionsResponse = (data) => {
165
- if (!isJSONObject(data)) {
166
- throw new TypeError(
167
- `Unmarshalling the type 'ListConnectionsResponse' failed as data isn't a dictionary.`
168
- );
169
- }
170
- return {
171
- connections: unmarshalArrayOfObject(data.connections, unmarshalConnection),
172
- totalCount: data.total_count
173
- };
123
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListConnectionsResponse' failed as data isn't a dictionary.`);
124
+ return {
125
+ connections: unmarshalArrayOfObject(data.connections, unmarshalConnection),
126
+ totalCount: data.total_count
127
+ };
174
128
  };
175
129
  const unmarshalListCustomerGatewaysResponse = (data) => {
176
- if (!isJSONObject(data)) {
177
- throw new TypeError(
178
- `Unmarshalling the type 'ListCustomerGatewaysResponse' failed as data isn't a dictionary.`
179
- );
180
- }
181
- return {
182
- gateways: unmarshalArrayOfObject(data.gateways, unmarshalCustomerGateway),
183
- totalCount: data.total_count
184
- };
130
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListCustomerGatewaysResponse' failed as data isn't a dictionary.`);
131
+ return {
132
+ gateways: unmarshalArrayOfObject(data.gateways, unmarshalCustomerGateway),
133
+ totalCount: data.total_count
134
+ };
185
135
  };
186
136
  const unmarshalListRoutingPoliciesResponse = (data) => {
187
- if (!isJSONObject(data)) {
188
- throw new TypeError(
189
- `Unmarshalling the type 'ListRoutingPoliciesResponse' failed as data isn't a dictionary.`
190
- );
191
- }
192
- return {
193
- routingPolicies: unmarshalArrayOfObject(
194
- data.routing_policies,
195
- unmarshalRoutingPolicy
196
- ),
197
- totalCount: data.total_count
198
- };
137
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListRoutingPoliciesResponse' failed as data isn't a dictionary.`);
138
+ return {
139
+ routingPolicies: unmarshalArrayOfObject(data.routing_policies, unmarshalRoutingPolicy),
140
+ totalCount: data.total_count
141
+ };
199
142
  };
200
- const unmarshalGatewayType = (data) => {
201
- if (!isJSONObject(data)) {
202
- throw new TypeError(
203
- `Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`
204
- );
205
- }
206
- return {
207
- allowedConnections: data.allowed_connections,
208
- bandwidth: data.bandwidth,
209
- name: data.name,
210
- region: data.region,
211
- zones: data.zones
212
- };
143
+ var unmarshalGatewayType = (data) => {
144
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`);
145
+ return {
146
+ allowedConnections: data.allowed_connections,
147
+ bandwidth: data.bandwidth,
148
+ name: data.name,
149
+ region: data.region,
150
+ zones: data.zones
151
+ };
213
152
  };
214
153
  const unmarshalListVpnGatewayTypesResponse = (data) => {
215
- if (!isJSONObject(data)) {
216
- throw new TypeError(
217
- `Unmarshalling the type 'ListVpnGatewayTypesResponse' failed as data isn't a dictionary.`
218
- );
219
- }
220
- return {
221
- gatewayTypes: unmarshalArrayOfObject(
222
- data.gateway_types,
223
- unmarshalGatewayType
224
- ),
225
- totalCount: data.total_count
226
- };
154
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVpnGatewayTypesResponse' failed as data isn't a dictionary.`);
155
+ return {
156
+ gatewayTypes: unmarshalArrayOfObject(data.gateway_types, unmarshalGatewayType),
157
+ totalCount: data.total_count
158
+ };
227
159
  };
228
160
  const unmarshalListVpnGatewaysResponse = (data) => {
229
- if (!isJSONObject(data)) {
230
- throw new TypeError(
231
- `Unmarshalling the type 'ListVpnGatewaysResponse' failed as data isn't a dictionary.`
232
- );
233
- }
234
- return {
235
- gateways: unmarshalArrayOfObject(data.gateways, unmarshalVpnGateway),
236
- totalCount: data.total_count
237
- };
161
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVpnGatewaysResponse' failed as data isn't a dictionary.`);
162
+ return {
163
+ gateways: unmarshalArrayOfObject(data.gateways, unmarshalVpnGateway),
164
+ totalCount: data.total_count
165
+ };
238
166
  };
239
167
  const unmarshalRenewConnectionPskResponse = (data) => {
240
- if (!isJSONObject(data)) {
241
- throw new TypeError(
242
- `Unmarshalling the type 'RenewConnectionPskResponse' failed as data isn't a dictionary.`
243
- );
244
- }
245
- return {
246
- connection: data.connection ? unmarshalConnection(data.connection) : void 0,
247
- preSharedKey: data.pre_shared_key
248
- };
168
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RenewConnectionPskResponse' failed as data isn't a dictionary.`);
169
+ return {
170
+ connection: data.connection ? unmarshalConnection(data.connection) : void 0,
171
+ preSharedKey: data.pre_shared_key
172
+ };
249
173
  };
250
- const marshalConnectionCipher = (request, defaults) => ({
251
- dh_group: request.dhGroup,
252
- encryption: request.encryption,
253
- integrity: request.integrity
174
+ var marshalConnectionCipher = (request, defaults) => ({
175
+ dh_group: request.dhGroup,
176
+ encryption: request.encryption,
177
+ integrity: request.integrity
254
178
  });
255
- const marshalCreateConnectionRequestBgpConfig = (request, defaults) => ({
256
- peer_private_ip: request.peerPrivateIp,
257
- private_ip: request.privateIp,
258
- routing_policy_id: request.routingPolicyId
179
+ var marshalCreateConnectionRequestBgpConfig = (request, defaults) => ({
180
+ peer_private_ip: request.peerPrivateIp,
181
+ private_ip: request.privateIp,
182
+ routing_policy_id: request.routingPolicyId
259
183
  });
260
184
  const marshalCreateConnectionRequest = (request, defaults) => ({
261
- bgp_config_ipv4: request.bgpConfigIpv4 !== void 0 ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv4) : void 0,
262
- bgp_config_ipv6: request.bgpConfigIpv6 !== void 0 ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv6) : void 0,
263
- customer_gateway_id: request.customerGatewayId,
264
- enable_route_propagation: request.enableRoutePropagation,
265
- esp_ciphers: request.espCiphers.map(
266
- (elt) => marshalConnectionCipher(elt)
267
- ),
268
- ikev2_ciphers: request.ikev2Ciphers.map(
269
- (elt) => marshalConnectionCipher(elt)
270
- ),
271
- initiation_policy: request.initiationPolicy,
272
- is_ipv6: request.isIpv6,
273
- name: request.name,
274
- project_id: request.projectId ?? defaults.defaultProjectId,
275
- tags: request.tags,
276
- vpn_gateway_id: request.vpnGatewayId
185
+ bgp_config_ipv4: request.bgpConfigIpv4 !== void 0 ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv4, defaults) : void 0,
186
+ bgp_config_ipv6: request.bgpConfigIpv6 !== void 0 ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv6, defaults) : void 0,
187
+ customer_gateway_id: request.customerGatewayId,
188
+ enable_route_propagation: request.enableRoutePropagation,
189
+ esp_ciphers: request.espCiphers.map((elt) => marshalConnectionCipher(elt, defaults)),
190
+ ikev2_ciphers: request.ikev2Ciphers.map((elt) => marshalConnectionCipher(elt, defaults)),
191
+ initiation_policy: request.initiationPolicy,
192
+ is_ipv6: request.isIpv6,
193
+ name: request.name,
194
+ project_id: request.projectId ?? defaults.defaultProjectId,
195
+ tags: request.tags,
196
+ vpn_gateway_id: request.vpnGatewayId
277
197
  });
278
198
  const marshalCreateCustomerGatewayRequest = (request, defaults) => ({
279
- asn: request.asn,
280
- ipv4_public: request.ipv4Public,
281
- ipv6_public: request.ipv6Public,
282
- name: request.name,
283
- project_id: request.projectId ?? defaults.defaultProjectId,
284
- tags: request.tags
199
+ asn: request.asn,
200
+ ipv4_public: request.ipv4Public,
201
+ ipv6_public: request.ipv6Public,
202
+ name: request.name,
203
+ project_id: request.projectId ?? defaults.defaultProjectId,
204
+ tags: request.tags
285
205
  });
286
206
  const marshalCreateRoutingPolicyRequest = (request, defaults) => ({
287
- is_ipv6: request.isIpv6,
288
- name: request.name,
289
- prefix_filter_in: request.prefixFilterIn,
290
- prefix_filter_out: request.prefixFilterOut,
291
- project_id: request.projectId ?? defaults.defaultProjectId,
292
- tags: request.tags
207
+ is_ipv6: request.isIpv6,
208
+ name: request.name,
209
+ prefix_filter_in: request.prefixFilterIn,
210
+ prefix_filter_out: request.prefixFilterOut,
211
+ project_id: request.projectId ?? defaults.defaultProjectId,
212
+ tags: request.tags
293
213
  });
294
- const marshalCreateVpnGatewayRequestPublicConfig = (request, defaults) => ({
295
- ipam_ipv4_id: request.ipamIpv4Id,
296
- ipam_ipv6_id: request.ipamIpv6Id
214
+ var marshalCreateVpnGatewayRequestDualIpTunnel = (request, defaults) => ({
215
+ ipam_ipv4_id: request.ipamIpv4Id,
216
+ ipam_ipv6_id: request.ipamIpv6Id
297
217
  });
298
- const marshalCreateVpnGatewayRequest = (request, defaults) => ({
299
- gateway_type: request.gatewayType,
300
- ipam_private_ipv4_id: request.ipamPrivateIpv4Id,
301
- ipam_private_ipv6_id: request.ipamPrivateIpv6Id,
302
- name: request.name,
303
- private_network_id: request.privateNetworkId,
304
- project_id: request.projectId ?? defaults.defaultProjectId,
305
- tags: request.tags,
306
- zone: request.zone ?? defaults.defaultZone,
307
- ...resolveOneOf([
308
- {
309
- param: "public_config",
310
- value: request.publicConfig !== void 0 ? marshalCreateVpnGatewayRequestPublicConfig(
311
- request.publicConfig
312
- ) : void 0
313
- }
314
- ])
315
- });
316
- const marshalDetachRoutingPolicyRequest = (request, defaults) => ({
317
- ...resolveOneOf([
318
- { param: "routing_policy_v4", value: request.routingPolicyV4 },
319
- { param: "routing_policy_v6", value: request.routingPolicyV6 }
320
- ])
218
+ var marshalCreateVpnGatewayRequestSingleIpTunnel = (request, defaults) => ({ ipam_id: request.ipamId });
219
+ var marshalCreateVpnGatewayRequestPublicConfig = (request, defaults) => ({
220
+ ipam_ipv4_id: request.ipamIpv4Id,
221
+ ipam_ipv6_id: request.ipamIpv6Id
321
222
  });
322
- const marshalSetRoutingPolicyRequest = (request, defaults) => ({
323
- ...resolveOneOf([
324
- { param: "routing_policy_v4", value: request.routingPolicyV4 },
325
- { param: "routing_policy_v6", value: request.routingPolicyV6 }
326
- ])
223
+ var marshalCreateVpnGatewayRequestPublicTunnelConfig = (request, defaults) => ({ ...resolveOneOf([
224
+ {
225
+ param: "single_ipv4_tunnel",
226
+ value: request.singleIpv4Tunnel !== void 0 ? marshalCreateVpnGatewayRequestSingleIpTunnel(request.singleIpv4Tunnel, defaults) : void 0
227
+ },
228
+ {
229
+ param: "single_ipv6_tunnel",
230
+ value: request.singleIpv6Tunnel !== void 0 ? marshalCreateVpnGatewayRequestSingleIpTunnel(request.singleIpv6Tunnel, defaults) : void 0
231
+ },
232
+ {
233
+ param: "dual_ipv4v6_tunnel",
234
+ value: request.dualIpv4V6Tunnel !== void 0 ? marshalCreateVpnGatewayRequestDualIpTunnel(request.dualIpv4V6Tunnel, defaults) : void 0
235
+ }
236
+ ]) });
237
+ const marshalCreateVpnGatewayRequest = (request, defaults) => ({
238
+ gateway_type: request.gatewayType,
239
+ ipam_private_ipv4_id: request.ipamPrivateIpv4Id,
240
+ ipam_private_ipv6_id: request.ipamPrivateIpv6Id,
241
+ name: request.name,
242
+ private_network_id: request.privateNetworkId,
243
+ project_id: request.projectId ?? defaults.defaultProjectId,
244
+ tags: request.tags,
245
+ zone: request.zone ?? defaults.defaultZone,
246
+ ...resolveOneOf([{
247
+ param: "public_config",
248
+ value: request.publicConfig !== void 0 ? marshalCreateVpnGatewayRequestPublicConfig(request.publicConfig, defaults) : void 0
249
+ }, {
250
+ param: "public_tunnel_config",
251
+ value: request.publicTunnelConfig !== void 0 ? marshalCreateVpnGatewayRequestPublicTunnelConfig(request.publicTunnelConfig, defaults) : void 0
252
+ }])
327
253
  });
254
+ const marshalDetachRoutingPolicyRequest = (request, defaults) => ({ ...resolveOneOf([{
255
+ param: "routing_policy_v4",
256
+ value: request.routingPolicyV4
257
+ }, {
258
+ param: "routing_policy_v6",
259
+ value: request.routingPolicyV6
260
+ }]) });
261
+ const marshalSetRoutingPolicyRequest = (request, defaults) => ({ ...resolveOneOf([{
262
+ param: "routing_policy_v4",
263
+ value: request.routingPolicyV4
264
+ }, {
265
+ param: "routing_policy_v6",
266
+ value: request.routingPolicyV6
267
+ }]) });
328
268
  const marshalUpdateConnectionRequest = (request, defaults) => ({
329
- esp_ciphers: request.espCiphers !== void 0 ? request.espCiphers.map((elt) => marshalConnectionCipher(elt)) : void 0,
330
- ikev2_ciphers: request.ikev2Ciphers !== void 0 ? request.ikev2Ciphers.map((elt) => marshalConnectionCipher(elt)) : void 0,
331
- initiation_policy: request.initiationPolicy,
332
- name: request.name,
333
- tags: request.tags
269
+ esp_ciphers: request.espCiphers !== void 0 ? request.espCiphers.map((elt) => marshalConnectionCipher(elt, defaults)) : void 0,
270
+ ikev2_ciphers: request.ikev2Ciphers !== void 0 ? request.ikev2Ciphers.map((elt) => marshalConnectionCipher(elt, defaults)) : void 0,
271
+ initiation_policy: request.initiationPolicy,
272
+ name: request.name,
273
+ tags: request.tags
334
274
  });
335
275
  const marshalUpdateCustomerGatewayRequest = (request, defaults) => ({
336
- asn: request.asn,
337
- ipv4_public: request.ipv4Public,
338
- ipv6_public: request.ipv6Public,
339
- name: request.name,
340
- tags: request.tags
276
+ asn: request.asn,
277
+ ipv4_public: request.ipv4Public,
278
+ ipv6_public: request.ipv6Public,
279
+ name: request.name,
280
+ tags: request.tags
341
281
  });
342
282
  const marshalUpdateRoutingPolicyRequest = (request, defaults) => ({
343
- name: request.name,
344
- prefix_filter_in: request.prefixFilterIn,
345
- prefix_filter_out: request.prefixFilterOut,
346
- tags: request.tags
283
+ name: request.name,
284
+ prefix_filter_in: request.prefixFilterIn,
285
+ prefix_filter_out: request.prefixFilterOut,
286
+ tags: request.tags
347
287
  });
348
288
  const marshalUpdateVpnGatewayRequest = (request, defaults) => ({
349
- name: request.name,
350
- tags: request.tags
289
+ name: request.name,
290
+ tags: request.tags
351
291
  });
352
- export {
353
- marshalCreateConnectionRequest,
354
- marshalCreateCustomerGatewayRequest,
355
- marshalCreateRoutingPolicyRequest,
356
- marshalCreateVpnGatewayRequest,
357
- marshalDetachRoutingPolicyRequest,
358
- marshalSetRoutingPolicyRequest,
359
- marshalUpdateConnectionRequest,
360
- marshalUpdateCustomerGatewayRequest,
361
- marshalUpdateRoutingPolicyRequest,
362
- marshalUpdateVpnGatewayRequest,
363
- unmarshalConnection,
364
- unmarshalCreateConnectionResponse,
365
- unmarshalCustomerGateway,
366
- unmarshalListConnectionsResponse,
367
- unmarshalListCustomerGatewaysResponse,
368
- unmarshalListRoutingPoliciesResponse,
369
- unmarshalListVpnGatewayTypesResponse,
370
- unmarshalListVpnGatewaysResponse,
371
- unmarshalRenewConnectionPskResponse,
372
- unmarshalRoutingPolicy,
373
- unmarshalVpnGateway
374
- };
292
+ export { marshalCreateConnectionRequest, marshalCreateCustomerGatewayRequest, marshalCreateRoutingPolicyRequest, marshalCreateVpnGatewayRequest, marshalDetachRoutingPolicyRequest, marshalSetRoutingPolicyRequest, marshalUpdateConnectionRequest, marshalUpdateCustomerGatewayRequest, marshalUpdateRoutingPolicyRequest, marshalUpdateVpnGatewayRequest, unmarshalConnection, unmarshalCreateConnectionResponse, unmarshalCustomerGateway, unmarshalListConnectionsResponse, unmarshalListCustomerGatewaysResponse, unmarshalListRoutingPoliciesResponse, unmarshalListVpnGatewayTypesResponse, unmarshalListVpnGatewaysResponse, unmarshalRenewConnectionPskResponse, unmarshalRoutingPolicy, unmarshalVpnGateway };