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