@scaleway/sdk-vpcgw 1.0.1

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.
@@ -0,0 +1,288 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const randomName = require("@scaleway/random-name");
4
+ const sdkClient = require("@scaleway/sdk-client");
5
+ const unmarshalGatewayNetwork = (data) => {
6
+ if (!sdkClient.isJSONObject(data)) {
7
+ throw new TypeError(
8
+ `Unmarshalling the type 'GatewayNetwork' failed as data isn't a dictionary.`
9
+ );
10
+ }
11
+ return {
12
+ createdAt: sdkClient.unmarshalDate(data.created_at),
13
+ gatewayId: data.gateway_id,
14
+ id: data.id,
15
+ ipamIpId: data.ipam_ip_id,
16
+ macAddress: data.mac_address,
17
+ masqueradeEnabled: data.masquerade_enabled,
18
+ privateNetworkId: data.private_network_id,
19
+ pushDefaultRoute: data.push_default_route,
20
+ status: data.status,
21
+ updatedAt: sdkClient.unmarshalDate(data.updated_at),
22
+ zone: data.zone
23
+ };
24
+ };
25
+ const unmarshalIP = (data) => {
26
+ if (!sdkClient.isJSONObject(data)) {
27
+ throw new TypeError(
28
+ `Unmarshalling the type 'IP' failed as data isn't a dictionary.`
29
+ );
30
+ }
31
+ return {
32
+ address: data.address,
33
+ createdAt: sdkClient.unmarshalDate(data.created_at),
34
+ gatewayId: data.gateway_id,
35
+ id: data.id,
36
+ organizationId: data.organization_id,
37
+ projectId: data.project_id,
38
+ reverse: data.reverse,
39
+ tags: data.tags,
40
+ updatedAt: sdkClient.unmarshalDate(data.updated_at),
41
+ zone: data.zone
42
+ };
43
+ };
44
+ const unmarshalGateway = (data) => {
45
+ if (!sdkClient.isJSONObject(data)) {
46
+ throw new TypeError(
47
+ `Unmarshalling the type 'Gateway' failed as data isn't a dictionary.`
48
+ );
49
+ }
50
+ return {
51
+ bandwidth: data.bandwidth,
52
+ bastionAllowedIps: data.bastion_allowed_ips,
53
+ bastionEnabled: data.bastion_enabled,
54
+ bastionPort: data.bastion_port,
55
+ canUpgradeTo: data.can_upgrade_to,
56
+ createdAt: sdkClient.unmarshalDate(data.created_at),
57
+ gatewayNetworks: sdkClient.unmarshalArrayOfObject(
58
+ data.gateway_networks,
59
+ unmarshalGatewayNetwork
60
+ ),
61
+ id: data.id,
62
+ ipv4: data.ipv4 ? unmarshalIP(data.ipv4) : void 0,
63
+ isLegacy: data.is_legacy,
64
+ name: data.name,
65
+ organizationId: data.organization_id,
66
+ projectId: data.project_id,
67
+ smtpEnabled: data.smtp_enabled,
68
+ status: data.status,
69
+ tags: data.tags,
70
+ type: data.type,
71
+ updatedAt: sdkClient.unmarshalDate(data.updated_at),
72
+ version: data.version,
73
+ zone: data.zone
74
+ };
75
+ };
76
+ const unmarshalPatRule = (data) => {
77
+ if (!sdkClient.isJSONObject(data)) {
78
+ throw new TypeError(
79
+ `Unmarshalling the type 'PatRule' failed as data isn't a dictionary.`
80
+ );
81
+ }
82
+ return {
83
+ createdAt: sdkClient.unmarshalDate(data.created_at),
84
+ gatewayId: data.gateway_id,
85
+ id: data.id,
86
+ privateIp: data.private_ip,
87
+ privatePort: data.private_port,
88
+ protocol: data.protocol,
89
+ publicPort: data.public_port,
90
+ updatedAt: sdkClient.unmarshalDate(data.updated_at),
91
+ zone: data.zone
92
+ };
93
+ };
94
+ const unmarshalAddBastionAllowedIPsResponse = (data) => {
95
+ if (!sdkClient.isJSONObject(data)) {
96
+ throw new TypeError(
97
+ `Unmarshalling the type 'AddBastionAllowedIPsResponse' failed as data isn't a dictionary.`
98
+ );
99
+ }
100
+ return {
101
+ ipRanges: data.ip_ranges
102
+ };
103
+ };
104
+ const unmarshalListGatewayNetworksResponse = (data) => {
105
+ if (!sdkClient.isJSONObject(data)) {
106
+ throw new TypeError(
107
+ `Unmarshalling the type 'ListGatewayNetworksResponse' failed as data isn't a dictionary.`
108
+ );
109
+ }
110
+ return {
111
+ gatewayNetworks: sdkClient.unmarshalArrayOfObject(
112
+ data.gateway_networks,
113
+ unmarshalGatewayNetwork
114
+ ),
115
+ totalCount: data.total_count
116
+ };
117
+ };
118
+ const unmarshalGatewayType = (data) => {
119
+ if (!sdkClient.isJSONObject(data)) {
120
+ throw new TypeError(
121
+ `Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`
122
+ );
123
+ }
124
+ return {
125
+ bandwidth: data.bandwidth,
126
+ name: data.name,
127
+ zone: data.zone
128
+ };
129
+ };
130
+ const unmarshalListGatewayTypesResponse = (data) => {
131
+ if (!sdkClient.isJSONObject(data)) {
132
+ throw new TypeError(
133
+ `Unmarshalling the type 'ListGatewayTypesResponse' failed as data isn't a dictionary.`
134
+ );
135
+ }
136
+ return {
137
+ types: sdkClient.unmarshalArrayOfObject(data.types, unmarshalGatewayType)
138
+ };
139
+ };
140
+ const unmarshalListGatewaysResponse = (data) => {
141
+ if (!sdkClient.isJSONObject(data)) {
142
+ throw new TypeError(
143
+ `Unmarshalling the type 'ListGatewaysResponse' failed as data isn't a dictionary.`
144
+ );
145
+ }
146
+ return {
147
+ gateways: sdkClient.unmarshalArrayOfObject(data.gateways, unmarshalGateway),
148
+ totalCount: data.total_count
149
+ };
150
+ };
151
+ const unmarshalListIPsResponse = (data) => {
152
+ if (!sdkClient.isJSONObject(data)) {
153
+ throw new TypeError(
154
+ `Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.`
155
+ );
156
+ }
157
+ return {
158
+ ips: sdkClient.unmarshalArrayOfObject(data.ips, unmarshalIP),
159
+ totalCount: data.total_count
160
+ };
161
+ };
162
+ const unmarshalListPatRulesResponse = (data) => {
163
+ if (!sdkClient.isJSONObject(data)) {
164
+ throw new TypeError(
165
+ `Unmarshalling the type 'ListPatRulesResponse' failed as data isn't a dictionary.`
166
+ );
167
+ }
168
+ return {
169
+ patRules: sdkClient.unmarshalArrayOfObject(data.pat_rules, unmarshalPatRule),
170
+ totalCount: data.total_count
171
+ };
172
+ };
173
+ const unmarshalSetBastionAllowedIPsResponse = (data) => {
174
+ if (!sdkClient.isJSONObject(data)) {
175
+ throw new TypeError(
176
+ `Unmarshalling the type 'SetBastionAllowedIPsResponse' failed as data isn't a dictionary.`
177
+ );
178
+ }
179
+ return {
180
+ ipRanges: data.ip_ranges
181
+ };
182
+ };
183
+ const unmarshalSetPatRulesResponse = (data) => {
184
+ if (!sdkClient.isJSONObject(data)) {
185
+ throw new TypeError(
186
+ `Unmarshalling the type 'SetPatRulesResponse' failed as data isn't a dictionary.`
187
+ );
188
+ }
189
+ return {
190
+ patRules: sdkClient.unmarshalArrayOfObject(data.pat_rules, unmarshalPatRule)
191
+ };
192
+ };
193
+ const marshalAddBastionAllowedIPsRequest = (request, defaults) => ({
194
+ ip_range: request.ipRange
195
+ });
196
+ const marshalCreateGatewayNetworkRequest = (request, defaults) => ({
197
+ enable_masquerade: request.enableMasquerade,
198
+ gateway_id: request.gatewayId,
199
+ ipam_ip_id: request.ipamIpId,
200
+ private_network_id: request.privateNetworkId,
201
+ push_default_route: request.pushDefaultRoute
202
+ });
203
+ const marshalCreateGatewayRequest = (request, defaults) => ({
204
+ bastion_port: request.bastionPort,
205
+ enable_bastion: request.enableBastion,
206
+ enable_smtp: request.enableSmtp,
207
+ ip_id: request.ipId,
208
+ name: request.name || randomName("gw"),
209
+ project_id: request.projectId ?? defaults.defaultProjectId,
210
+ tags: request.tags,
211
+ type: request.type
212
+ });
213
+ const marshalCreateIPRequest = (request, defaults) => ({
214
+ project_id: request.projectId ?? defaults.defaultProjectId,
215
+ tags: request.tags
216
+ });
217
+ const marshalCreatePatRuleRequest = (request, defaults) => ({
218
+ gateway_id: request.gatewayId,
219
+ private_ip: request.privateIp,
220
+ private_port: request.privatePort,
221
+ protocol: request.protocol,
222
+ public_port: request.publicPort
223
+ });
224
+ const marshalSetBastionAllowedIPsRequest = (request, defaults) => ({
225
+ ip_ranges: request.ipRanges
226
+ });
227
+ const marshalSetPatRulesRequestRule = (request, defaults) => ({
228
+ private_ip: request.privateIp,
229
+ private_port: request.privatePort,
230
+ protocol: request.protocol,
231
+ public_port: request.publicPort
232
+ });
233
+ const marshalSetPatRulesRequest = (request, defaults) => ({
234
+ gateway_id: request.gatewayId,
235
+ pat_rules: request.patRules.map(
236
+ (elt) => marshalSetPatRulesRequestRule(elt)
237
+ )
238
+ });
239
+ const marshalUpdateGatewayNetworkRequest = (request, defaults) => ({
240
+ enable_masquerade: request.enableMasquerade,
241
+ ipam_ip_id: request.ipamIpId,
242
+ push_default_route: request.pushDefaultRoute
243
+ });
244
+ const marshalUpdateGatewayRequest = (request, defaults) => ({
245
+ bastion_port: request.bastionPort,
246
+ enable_bastion: request.enableBastion,
247
+ enable_smtp: request.enableSmtp,
248
+ name: request.name,
249
+ tags: request.tags
250
+ });
251
+ const marshalUpdateIPRequest = (request, defaults) => ({
252
+ gateway_id: request.gatewayId,
253
+ reverse: request.reverse,
254
+ tags: request.tags
255
+ });
256
+ const marshalUpdatePatRuleRequest = (request, defaults) => ({
257
+ private_ip: request.privateIp,
258
+ private_port: request.privatePort,
259
+ protocol: request.protocol,
260
+ public_port: request.publicPort
261
+ });
262
+ const marshalUpgradeGatewayRequest = (request, defaults) => ({
263
+ type: request.type
264
+ });
265
+ exports.marshalAddBastionAllowedIPsRequest = marshalAddBastionAllowedIPsRequest;
266
+ exports.marshalCreateGatewayNetworkRequest = marshalCreateGatewayNetworkRequest;
267
+ exports.marshalCreateGatewayRequest = marshalCreateGatewayRequest;
268
+ exports.marshalCreateIPRequest = marshalCreateIPRequest;
269
+ exports.marshalCreatePatRuleRequest = marshalCreatePatRuleRequest;
270
+ exports.marshalSetBastionAllowedIPsRequest = marshalSetBastionAllowedIPsRequest;
271
+ exports.marshalSetPatRulesRequest = marshalSetPatRulesRequest;
272
+ exports.marshalUpdateGatewayNetworkRequest = marshalUpdateGatewayNetworkRequest;
273
+ exports.marshalUpdateGatewayRequest = marshalUpdateGatewayRequest;
274
+ exports.marshalUpdateIPRequest = marshalUpdateIPRequest;
275
+ exports.marshalUpdatePatRuleRequest = marshalUpdatePatRuleRequest;
276
+ exports.marshalUpgradeGatewayRequest = marshalUpgradeGatewayRequest;
277
+ exports.unmarshalAddBastionAllowedIPsResponse = unmarshalAddBastionAllowedIPsResponse;
278
+ exports.unmarshalGateway = unmarshalGateway;
279
+ exports.unmarshalGatewayNetwork = unmarshalGatewayNetwork;
280
+ exports.unmarshalIP = unmarshalIP;
281
+ exports.unmarshalListGatewayNetworksResponse = unmarshalListGatewayNetworksResponse;
282
+ exports.unmarshalListGatewayTypesResponse = unmarshalListGatewayTypesResponse;
283
+ exports.unmarshalListGatewaysResponse = unmarshalListGatewaysResponse;
284
+ exports.unmarshalListIPsResponse = unmarshalListIPsResponse;
285
+ exports.unmarshalListPatRulesResponse = unmarshalListPatRulesResponse;
286
+ exports.unmarshalPatRule = unmarshalPatRule;
287
+ exports.unmarshalSetBastionAllowedIPsResponse = unmarshalSetBastionAllowedIPsResponse;
288
+ exports.unmarshalSetPatRulesResponse = unmarshalSetPatRulesResponse;
@@ -0,0 +1,26 @@
1
+ import type { DefaultValues } from '@scaleway/sdk-client';
2
+ import type { AddBastionAllowedIPsRequest, AddBastionAllowedIPsResponse, CreateGatewayNetworkRequest, CreateGatewayRequest, CreateIPRequest, CreatePatRuleRequest, Gateway, GatewayNetwork, IP, ListGatewayNetworksResponse, ListGatewayTypesResponse, ListGatewaysResponse, ListIPsResponse, ListPatRulesResponse, PatRule, SetBastionAllowedIPsRequest, SetBastionAllowedIPsResponse, SetPatRulesRequest, SetPatRulesResponse, UpdateGatewayNetworkRequest, UpdateGatewayRequest, UpdateIPRequest, UpdatePatRuleRequest, UpgradeGatewayRequest } from './types.gen';
3
+ export declare const unmarshalGatewayNetwork: (data: unknown) => GatewayNetwork;
4
+ export declare const unmarshalIP: (data: unknown) => IP;
5
+ export declare const unmarshalGateway: (data: unknown) => Gateway;
6
+ export declare const unmarshalPatRule: (data: unknown) => PatRule;
7
+ export declare const unmarshalAddBastionAllowedIPsResponse: (data: unknown) => AddBastionAllowedIPsResponse;
8
+ export declare const unmarshalListGatewayNetworksResponse: (data: unknown) => ListGatewayNetworksResponse;
9
+ export declare const unmarshalListGatewayTypesResponse: (data: unknown) => ListGatewayTypesResponse;
10
+ export declare const unmarshalListGatewaysResponse: (data: unknown) => ListGatewaysResponse;
11
+ export declare const unmarshalListIPsResponse: (data: unknown) => ListIPsResponse;
12
+ export declare const unmarshalListPatRulesResponse: (data: unknown) => ListPatRulesResponse;
13
+ export declare const unmarshalSetBastionAllowedIPsResponse: (data: unknown) => SetBastionAllowedIPsResponse;
14
+ export declare const unmarshalSetPatRulesResponse: (data: unknown) => SetPatRulesResponse;
15
+ export declare const marshalAddBastionAllowedIPsRequest: (request: AddBastionAllowedIPsRequest, defaults: DefaultValues) => Record<string, unknown>;
16
+ export declare const marshalCreateGatewayNetworkRequest: (request: CreateGatewayNetworkRequest, defaults: DefaultValues) => Record<string, unknown>;
17
+ export declare const marshalCreateGatewayRequest: (request: CreateGatewayRequest, defaults: DefaultValues) => Record<string, unknown>;
18
+ export declare const marshalCreateIPRequest: (request: CreateIPRequest, defaults: DefaultValues) => Record<string, unknown>;
19
+ export declare const marshalCreatePatRuleRequest: (request: CreatePatRuleRequest, defaults: DefaultValues) => Record<string, unknown>;
20
+ export declare const marshalSetBastionAllowedIPsRequest: (request: SetBastionAllowedIPsRequest, defaults: DefaultValues) => Record<string, unknown>;
21
+ export declare const marshalSetPatRulesRequest: (request: SetPatRulesRequest, defaults: DefaultValues) => Record<string, unknown>;
22
+ export declare const marshalUpdateGatewayNetworkRequest: (request: UpdateGatewayNetworkRequest, defaults: DefaultValues) => Record<string, unknown>;
23
+ export declare const marshalUpdateGatewayRequest: (request: UpdateGatewayRequest, defaults: DefaultValues) => Record<string, unknown>;
24
+ export declare const marshalUpdateIPRequest: (request: UpdateIPRequest, defaults: DefaultValues) => Record<string, unknown>;
25
+ export declare const marshalUpdatePatRuleRequest: (request: UpdatePatRuleRequest, defaults: DefaultValues) => Record<string, unknown>;
26
+ export declare const marshalUpgradeGatewayRequest: (request: UpgradeGatewayRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -0,0 +1,288 @@
1
+ import randomName from "@scaleway/random-name";
2
+ import { isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
3
+ const unmarshalGatewayNetwork = (data) => {
4
+ if (!isJSONObject(data)) {
5
+ throw new TypeError(
6
+ `Unmarshalling the type 'GatewayNetwork' failed as data isn't a dictionary.`
7
+ );
8
+ }
9
+ return {
10
+ createdAt: unmarshalDate(data.created_at),
11
+ gatewayId: data.gateway_id,
12
+ id: data.id,
13
+ ipamIpId: data.ipam_ip_id,
14
+ macAddress: data.mac_address,
15
+ masqueradeEnabled: data.masquerade_enabled,
16
+ privateNetworkId: data.private_network_id,
17
+ pushDefaultRoute: data.push_default_route,
18
+ status: data.status,
19
+ updatedAt: unmarshalDate(data.updated_at),
20
+ zone: data.zone
21
+ };
22
+ };
23
+ const unmarshalIP = (data) => {
24
+ if (!isJSONObject(data)) {
25
+ throw new TypeError(
26
+ `Unmarshalling the type 'IP' failed as data isn't a dictionary.`
27
+ );
28
+ }
29
+ return {
30
+ address: data.address,
31
+ createdAt: unmarshalDate(data.created_at),
32
+ gatewayId: data.gateway_id,
33
+ id: data.id,
34
+ organizationId: data.organization_id,
35
+ projectId: data.project_id,
36
+ reverse: data.reverse,
37
+ tags: data.tags,
38
+ updatedAt: unmarshalDate(data.updated_at),
39
+ zone: data.zone
40
+ };
41
+ };
42
+ const unmarshalGateway = (data) => {
43
+ if (!isJSONObject(data)) {
44
+ throw new TypeError(
45
+ `Unmarshalling the type 'Gateway' failed as data isn't a dictionary.`
46
+ );
47
+ }
48
+ return {
49
+ bandwidth: data.bandwidth,
50
+ bastionAllowedIps: data.bastion_allowed_ips,
51
+ bastionEnabled: data.bastion_enabled,
52
+ bastionPort: data.bastion_port,
53
+ canUpgradeTo: data.can_upgrade_to,
54
+ createdAt: unmarshalDate(data.created_at),
55
+ gatewayNetworks: unmarshalArrayOfObject(
56
+ data.gateway_networks,
57
+ unmarshalGatewayNetwork
58
+ ),
59
+ id: data.id,
60
+ ipv4: data.ipv4 ? unmarshalIP(data.ipv4) : void 0,
61
+ isLegacy: data.is_legacy,
62
+ name: data.name,
63
+ organizationId: data.organization_id,
64
+ projectId: data.project_id,
65
+ smtpEnabled: data.smtp_enabled,
66
+ status: data.status,
67
+ tags: data.tags,
68
+ type: data.type,
69
+ updatedAt: unmarshalDate(data.updated_at),
70
+ version: data.version,
71
+ zone: data.zone
72
+ };
73
+ };
74
+ const unmarshalPatRule = (data) => {
75
+ if (!isJSONObject(data)) {
76
+ throw new TypeError(
77
+ `Unmarshalling the type 'PatRule' failed as data isn't a dictionary.`
78
+ );
79
+ }
80
+ return {
81
+ createdAt: unmarshalDate(data.created_at),
82
+ gatewayId: data.gateway_id,
83
+ id: data.id,
84
+ privateIp: data.private_ip,
85
+ privatePort: data.private_port,
86
+ protocol: data.protocol,
87
+ publicPort: data.public_port,
88
+ updatedAt: unmarshalDate(data.updated_at),
89
+ zone: data.zone
90
+ };
91
+ };
92
+ const unmarshalAddBastionAllowedIPsResponse = (data) => {
93
+ if (!isJSONObject(data)) {
94
+ throw new TypeError(
95
+ `Unmarshalling the type 'AddBastionAllowedIPsResponse' failed as data isn't a dictionary.`
96
+ );
97
+ }
98
+ return {
99
+ ipRanges: data.ip_ranges
100
+ };
101
+ };
102
+ const unmarshalListGatewayNetworksResponse = (data) => {
103
+ if (!isJSONObject(data)) {
104
+ throw new TypeError(
105
+ `Unmarshalling the type 'ListGatewayNetworksResponse' failed as data isn't a dictionary.`
106
+ );
107
+ }
108
+ return {
109
+ gatewayNetworks: unmarshalArrayOfObject(
110
+ data.gateway_networks,
111
+ unmarshalGatewayNetwork
112
+ ),
113
+ totalCount: data.total_count
114
+ };
115
+ };
116
+ const unmarshalGatewayType = (data) => {
117
+ if (!isJSONObject(data)) {
118
+ throw new TypeError(
119
+ `Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`
120
+ );
121
+ }
122
+ return {
123
+ bandwidth: data.bandwidth,
124
+ name: data.name,
125
+ zone: data.zone
126
+ };
127
+ };
128
+ const unmarshalListGatewayTypesResponse = (data) => {
129
+ if (!isJSONObject(data)) {
130
+ throw new TypeError(
131
+ `Unmarshalling the type 'ListGatewayTypesResponse' failed as data isn't a dictionary.`
132
+ );
133
+ }
134
+ return {
135
+ types: unmarshalArrayOfObject(data.types, unmarshalGatewayType)
136
+ };
137
+ };
138
+ const unmarshalListGatewaysResponse = (data) => {
139
+ if (!isJSONObject(data)) {
140
+ throw new TypeError(
141
+ `Unmarshalling the type 'ListGatewaysResponse' failed as data isn't a dictionary.`
142
+ );
143
+ }
144
+ return {
145
+ gateways: unmarshalArrayOfObject(data.gateways, unmarshalGateway),
146
+ totalCount: data.total_count
147
+ };
148
+ };
149
+ const unmarshalListIPsResponse = (data) => {
150
+ if (!isJSONObject(data)) {
151
+ throw new TypeError(
152
+ `Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.`
153
+ );
154
+ }
155
+ return {
156
+ ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
157
+ totalCount: data.total_count
158
+ };
159
+ };
160
+ const unmarshalListPatRulesResponse = (data) => {
161
+ if (!isJSONObject(data)) {
162
+ throw new TypeError(
163
+ `Unmarshalling the type 'ListPatRulesResponse' failed as data isn't a dictionary.`
164
+ );
165
+ }
166
+ return {
167
+ patRules: unmarshalArrayOfObject(data.pat_rules, unmarshalPatRule),
168
+ totalCount: data.total_count
169
+ };
170
+ };
171
+ const unmarshalSetBastionAllowedIPsResponse = (data) => {
172
+ if (!isJSONObject(data)) {
173
+ throw new TypeError(
174
+ `Unmarshalling the type 'SetBastionAllowedIPsResponse' failed as data isn't a dictionary.`
175
+ );
176
+ }
177
+ return {
178
+ ipRanges: data.ip_ranges
179
+ };
180
+ };
181
+ const unmarshalSetPatRulesResponse = (data) => {
182
+ if (!isJSONObject(data)) {
183
+ throw new TypeError(
184
+ `Unmarshalling the type 'SetPatRulesResponse' failed as data isn't a dictionary.`
185
+ );
186
+ }
187
+ return {
188
+ patRules: unmarshalArrayOfObject(data.pat_rules, unmarshalPatRule)
189
+ };
190
+ };
191
+ const marshalAddBastionAllowedIPsRequest = (request, defaults) => ({
192
+ ip_range: request.ipRange
193
+ });
194
+ const marshalCreateGatewayNetworkRequest = (request, defaults) => ({
195
+ enable_masquerade: request.enableMasquerade,
196
+ gateway_id: request.gatewayId,
197
+ ipam_ip_id: request.ipamIpId,
198
+ private_network_id: request.privateNetworkId,
199
+ push_default_route: request.pushDefaultRoute
200
+ });
201
+ const marshalCreateGatewayRequest = (request, defaults) => ({
202
+ bastion_port: request.bastionPort,
203
+ enable_bastion: request.enableBastion,
204
+ enable_smtp: request.enableSmtp,
205
+ ip_id: request.ipId,
206
+ name: request.name || randomName("gw"),
207
+ project_id: request.projectId ?? defaults.defaultProjectId,
208
+ tags: request.tags,
209
+ type: request.type
210
+ });
211
+ const marshalCreateIPRequest = (request, defaults) => ({
212
+ project_id: request.projectId ?? defaults.defaultProjectId,
213
+ tags: request.tags
214
+ });
215
+ const marshalCreatePatRuleRequest = (request, defaults) => ({
216
+ gateway_id: request.gatewayId,
217
+ private_ip: request.privateIp,
218
+ private_port: request.privatePort,
219
+ protocol: request.protocol,
220
+ public_port: request.publicPort
221
+ });
222
+ const marshalSetBastionAllowedIPsRequest = (request, defaults) => ({
223
+ ip_ranges: request.ipRanges
224
+ });
225
+ const marshalSetPatRulesRequestRule = (request, defaults) => ({
226
+ private_ip: request.privateIp,
227
+ private_port: request.privatePort,
228
+ protocol: request.protocol,
229
+ public_port: request.publicPort
230
+ });
231
+ const marshalSetPatRulesRequest = (request, defaults) => ({
232
+ gateway_id: request.gatewayId,
233
+ pat_rules: request.patRules.map(
234
+ (elt) => marshalSetPatRulesRequestRule(elt)
235
+ )
236
+ });
237
+ const marshalUpdateGatewayNetworkRequest = (request, defaults) => ({
238
+ enable_masquerade: request.enableMasquerade,
239
+ ipam_ip_id: request.ipamIpId,
240
+ push_default_route: request.pushDefaultRoute
241
+ });
242
+ const marshalUpdateGatewayRequest = (request, defaults) => ({
243
+ bastion_port: request.bastionPort,
244
+ enable_bastion: request.enableBastion,
245
+ enable_smtp: request.enableSmtp,
246
+ name: request.name,
247
+ tags: request.tags
248
+ });
249
+ const marshalUpdateIPRequest = (request, defaults) => ({
250
+ gateway_id: request.gatewayId,
251
+ reverse: request.reverse,
252
+ tags: request.tags
253
+ });
254
+ const marshalUpdatePatRuleRequest = (request, defaults) => ({
255
+ private_ip: request.privateIp,
256
+ private_port: request.privatePort,
257
+ protocol: request.protocol,
258
+ public_port: request.publicPort
259
+ });
260
+ const marshalUpgradeGatewayRequest = (request, defaults) => ({
261
+ type: request.type
262
+ });
263
+ export {
264
+ marshalAddBastionAllowedIPsRequest,
265
+ marshalCreateGatewayNetworkRequest,
266
+ marshalCreateGatewayRequest,
267
+ marshalCreateIPRequest,
268
+ marshalCreatePatRuleRequest,
269
+ marshalSetBastionAllowedIPsRequest,
270
+ marshalSetPatRulesRequest,
271
+ marshalUpdateGatewayNetworkRequest,
272
+ marshalUpdateGatewayRequest,
273
+ marshalUpdateIPRequest,
274
+ marshalUpdatePatRuleRequest,
275
+ marshalUpgradeGatewayRequest,
276
+ unmarshalAddBastionAllowedIPsResponse,
277
+ unmarshalGateway,
278
+ unmarshalGatewayNetwork,
279
+ unmarshalIP,
280
+ unmarshalListGatewayNetworksResponse,
281
+ unmarshalListGatewayTypesResponse,
282
+ unmarshalListGatewaysResponse,
283
+ unmarshalListIPsResponse,
284
+ unmarshalListPatRulesResponse,
285
+ unmarshalPatRule,
286
+ unmarshalSetBastionAllowedIPsResponse,
287
+ unmarshalSetPatRulesResponse
288
+ };