@scaleway/sdk-vpcgw 2.2.0 → 2.3.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,440 +1,329 @@
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
1
2
  import randomName from "@scaleway/random-name";
2
- import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
3
3
  const unmarshalDHCP = (data) => {
4
- if (!isJSONObject(data)) {
5
- throw new TypeError(
6
- `Unmarshalling the type 'DHCP' failed as data isn't a dictionary.`
7
- );
8
- }
9
- return {
10
- address: data.address,
11
- createdAt: unmarshalDate(data.created_at),
12
- dnsLocalName: data.dns_local_name,
13
- dnsSearch: data.dns_search,
14
- dnsServersOverride: data.dns_servers_override,
15
- enableDynamic: data.enable_dynamic,
16
- id: data.id,
17
- organizationId: data.organization_id,
18
- poolHigh: data.pool_high,
19
- poolLow: data.pool_low,
20
- projectId: data.project_id,
21
- pushDefaultRoute: data.push_default_route,
22
- pushDnsServer: data.push_dns_server,
23
- rebindTimer: data.rebind_timer,
24
- renewTimer: data.renew_timer,
25
- subnet: data.subnet,
26
- updatedAt: unmarshalDate(data.updated_at),
27
- validLifetime: data.valid_lifetime,
28
- zone: data.zone
29
- };
4
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DHCP' failed as data isn't a dictionary.`);
5
+ return {
6
+ address: data.address,
7
+ createdAt: unmarshalDate(data.created_at),
8
+ dnsLocalName: data.dns_local_name,
9
+ dnsSearch: data.dns_search,
10
+ dnsServersOverride: data.dns_servers_override,
11
+ enableDynamic: data.enable_dynamic,
12
+ id: data.id,
13
+ organizationId: data.organization_id,
14
+ poolHigh: data.pool_high,
15
+ poolLow: data.pool_low,
16
+ projectId: data.project_id,
17
+ pushDefaultRoute: data.push_default_route,
18
+ pushDnsServer: data.push_dns_server,
19
+ rebindTimer: data.rebind_timer,
20
+ renewTimer: data.renew_timer,
21
+ subnet: data.subnet,
22
+ updatedAt: unmarshalDate(data.updated_at),
23
+ validLifetime: data.valid_lifetime,
24
+ zone: data.zone
25
+ };
30
26
  };
31
- const unmarshalIpamConfig = (data) => {
32
- if (!isJSONObject(data)) {
33
- throw new TypeError(
34
- `Unmarshalling the type 'IpamConfig' failed as data isn't a dictionary.`
35
- );
36
- }
37
- return {
38
- ipamIpId: data.ipam_ip_id,
39
- pushDefaultRoute: data.push_default_route
40
- };
27
+ var unmarshalIpamConfig = (data) => {
28
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'IpamConfig' failed as data isn't a dictionary.`);
29
+ return {
30
+ ipamIpId: data.ipam_ip_id,
31
+ pushDefaultRoute: data.push_default_route
32
+ };
41
33
  };
42
34
  const unmarshalGatewayNetwork = (data) => {
43
- if (!isJSONObject(data)) {
44
- throw new TypeError(
45
- `Unmarshalling the type 'GatewayNetwork' failed as data isn't a dictionary.`
46
- );
47
- }
48
- return {
49
- address: data.address,
50
- createdAt: unmarshalDate(data.created_at),
51
- dhcp: data.dhcp ? unmarshalDHCP(data.dhcp) : void 0,
52
- enableDhcp: data.enable_dhcp,
53
- enableMasquerade: data.enable_masquerade,
54
- gatewayId: data.gateway_id,
55
- id: data.id,
56
- ipamConfig: data.ipam_config ? unmarshalIpamConfig(data.ipam_config) : void 0,
57
- macAddress: data.mac_address,
58
- privateNetworkId: data.private_network_id,
59
- status: data.status,
60
- updatedAt: unmarshalDate(data.updated_at),
61
- zone: data.zone
62
- };
35
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GatewayNetwork' failed as data isn't a dictionary.`);
36
+ return {
37
+ address: data.address,
38
+ createdAt: unmarshalDate(data.created_at),
39
+ dhcp: data.dhcp ? unmarshalDHCP(data.dhcp) : void 0,
40
+ enableDhcp: data.enable_dhcp,
41
+ enableMasquerade: data.enable_masquerade,
42
+ gatewayId: data.gateway_id,
43
+ id: data.id,
44
+ ipamConfig: data.ipam_config ? unmarshalIpamConfig(data.ipam_config) : void 0,
45
+ macAddress: data.mac_address,
46
+ privateNetworkId: data.private_network_id,
47
+ status: data.status,
48
+ updatedAt: unmarshalDate(data.updated_at),
49
+ zone: data.zone
50
+ };
63
51
  };
64
52
  const unmarshalIP = (data) => {
65
- if (!isJSONObject(data)) {
66
- throw new TypeError(
67
- `Unmarshalling the type 'IP' failed as data isn't a dictionary.`
68
- );
69
- }
70
- return {
71
- address: data.address,
72
- createdAt: unmarshalDate(data.created_at),
73
- gatewayId: data.gateway_id,
74
- id: data.id,
75
- organizationId: data.organization_id,
76
- projectId: data.project_id,
77
- reverse: data.reverse,
78
- tags: data.tags,
79
- updatedAt: unmarshalDate(data.updated_at),
80
- zone: data.zone
81
- };
53
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'IP' failed as data isn't a dictionary.`);
54
+ return {
55
+ address: data.address,
56
+ createdAt: unmarshalDate(data.created_at),
57
+ gatewayId: data.gateway_id,
58
+ id: data.id,
59
+ organizationId: data.organization_id,
60
+ projectId: data.project_id,
61
+ reverse: data.reverse,
62
+ tags: data.tags,
63
+ updatedAt: unmarshalDate(data.updated_at),
64
+ zone: data.zone
65
+ };
82
66
  };
83
67
  const unmarshalDHCPEntry = (data) => {
84
- if (!isJSONObject(data)) {
85
- throw new TypeError(
86
- `Unmarshalling the type 'DHCPEntry' failed as data isn't a dictionary.`
87
- );
88
- }
89
- return {
90
- createdAt: unmarshalDate(data.created_at),
91
- gatewayNetworkId: data.gateway_network_id,
92
- hostname: data.hostname,
93
- id: data.id,
94
- ipAddress: data.ip_address,
95
- macAddress: data.mac_address,
96
- type: data.type,
97
- updatedAt: unmarshalDate(data.updated_at),
98
- zone: data.zone
99
- };
68
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DHCPEntry' failed as data isn't a dictionary.`);
69
+ return {
70
+ createdAt: unmarshalDate(data.created_at),
71
+ gatewayNetworkId: data.gateway_network_id,
72
+ hostname: data.hostname,
73
+ id: data.id,
74
+ ipAddress: data.ip_address,
75
+ macAddress: data.mac_address,
76
+ type: data.type,
77
+ updatedAt: unmarshalDate(data.updated_at),
78
+ zone: data.zone
79
+ };
100
80
  };
101
- const unmarshalGatewayType = (data) => {
102
- if (!isJSONObject(data)) {
103
- throw new TypeError(
104
- `Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`
105
- );
106
- }
107
- return {
108
- bandwidth: data.bandwidth,
109
- name: data.name,
110
- zone: data.zone
111
- };
81
+ var unmarshalGatewayType = (data) => {
82
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`);
83
+ return {
84
+ bandwidth: data.bandwidth,
85
+ name: data.name,
86
+ zone: data.zone
87
+ };
112
88
  };
113
89
  const unmarshalGateway = (data) => {
114
- if (!isJSONObject(data)) {
115
- throw new TypeError(
116
- `Unmarshalling the type 'Gateway' failed as data isn't a dictionary.`
117
- );
118
- }
119
- return {
120
- bastionEnabled: data.bastion_enabled,
121
- bastionPort: data.bastion_port,
122
- canUpgradeTo: data.can_upgrade_to,
123
- createdAt: unmarshalDate(data.created_at),
124
- gatewayNetworks: unmarshalArrayOfObject(
125
- data.gateway_networks,
126
- unmarshalGatewayNetwork
127
- ),
128
- id: data.id,
129
- ip: data.ip ? unmarshalIP(data.ip) : void 0,
130
- ipMobilityEnabled: data.ip_mobility_enabled,
131
- isLegacy: data.is_legacy,
132
- name: data.name,
133
- organizationId: data.organization_id,
134
- projectId: data.project_id,
135
- smtpEnabled: data.smtp_enabled,
136
- status: data.status,
137
- tags: data.tags,
138
- type: data.type ? unmarshalGatewayType(data.type) : void 0,
139
- updatedAt: unmarshalDate(data.updated_at),
140
- upstreamDnsServers: data.upstream_dns_servers,
141
- version: data.version,
142
- zone: data.zone
143
- };
90
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Gateway' failed as data isn't a dictionary.`);
91
+ return {
92
+ bastionEnabled: data.bastion_enabled,
93
+ bastionPort: data.bastion_port,
94
+ canUpgradeTo: data.can_upgrade_to,
95
+ createdAt: unmarshalDate(data.created_at),
96
+ gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork),
97
+ id: data.id,
98
+ ip: data.ip ? unmarshalIP(data.ip) : void 0,
99
+ ipMobilityEnabled: data.ip_mobility_enabled,
100
+ isLegacy: data.is_legacy,
101
+ name: data.name,
102
+ organizationId: data.organization_id,
103
+ projectId: data.project_id,
104
+ smtpEnabled: data.smtp_enabled,
105
+ status: data.status,
106
+ tags: data.tags,
107
+ type: data.type ? unmarshalGatewayType(data.type) : void 0,
108
+ updatedAt: unmarshalDate(data.updated_at),
109
+ upstreamDnsServers: data.upstream_dns_servers,
110
+ version: data.version,
111
+ zone: data.zone
112
+ };
144
113
  };
145
114
  const unmarshalPATRule = (data) => {
146
- if (!isJSONObject(data)) {
147
- throw new TypeError(
148
- `Unmarshalling the type 'PATRule' failed as data isn't a dictionary.`
149
- );
150
- }
151
- return {
152
- createdAt: unmarshalDate(data.created_at),
153
- gatewayId: data.gateway_id,
154
- id: data.id,
155
- privateIp: data.private_ip,
156
- privatePort: data.private_port,
157
- protocol: data.protocol,
158
- publicPort: data.public_port,
159
- updatedAt: unmarshalDate(data.updated_at),
160
- zone: data.zone
161
- };
115
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PATRule' failed as data isn't a dictionary.`);
116
+ return {
117
+ createdAt: unmarshalDate(data.created_at),
118
+ gatewayId: data.gateway_id,
119
+ id: data.id,
120
+ privateIp: data.private_ip,
121
+ privatePort: data.private_port,
122
+ protocol: data.protocol,
123
+ publicPort: data.public_port,
124
+ updatedAt: unmarshalDate(data.updated_at),
125
+ zone: data.zone
126
+ };
162
127
  };
163
128
  const unmarshalListDHCPEntriesResponse = (data) => {
164
- if (!isJSONObject(data)) {
165
- throw new TypeError(
166
- `Unmarshalling the type 'ListDHCPEntriesResponse' failed as data isn't a dictionary.`
167
- );
168
- }
169
- return {
170
- dhcpEntries: unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry),
171
- totalCount: data.total_count
172
- };
129
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDHCPEntriesResponse' failed as data isn't a dictionary.`);
130
+ return {
131
+ dhcpEntries: unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry),
132
+ totalCount: data.total_count
133
+ };
173
134
  };
174
135
  const unmarshalListDHCPsResponse = (data) => {
175
- if (!isJSONObject(data)) {
176
- throw new TypeError(
177
- `Unmarshalling the type 'ListDHCPsResponse' failed as data isn't a dictionary.`
178
- );
179
- }
180
- return {
181
- dhcps: unmarshalArrayOfObject(data.dhcps, unmarshalDHCP),
182
- totalCount: data.total_count
183
- };
136
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDHCPsResponse' failed as data isn't a dictionary.`);
137
+ return {
138
+ dhcps: unmarshalArrayOfObject(data.dhcps, unmarshalDHCP),
139
+ totalCount: data.total_count
140
+ };
184
141
  };
185
142
  const unmarshalListGatewayNetworksResponse = (data) => {
186
- if (!isJSONObject(data)) {
187
- throw new TypeError(
188
- `Unmarshalling the type 'ListGatewayNetworksResponse' failed as data isn't a dictionary.`
189
- );
190
- }
191
- return {
192
- gatewayNetworks: unmarshalArrayOfObject(
193
- data.gateway_networks,
194
- unmarshalGatewayNetwork
195
- ),
196
- totalCount: data.total_count
197
- };
143
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListGatewayNetworksResponse' failed as data isn't a dictionary.`);
144
+ return {
145
+ gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork),
146
+ totalCount: data.total_count
147
+ };
198
148
  };
199
149
  const unmarshalListGatewayTypesResponse = (data) => {
200
- if (!isJSONObject(data)) {
201
- throw new TypeError(
202
- `Unmarshalling the type 'ListGatewayTypesResponse' failed as data isn't a dictionary.`
203
- );
204
- }
205
- return {
206
- types: unmarshalArrayOfObject(data.types, unmarshalGatewayType)
207
- };
150
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListGatewayTypesResponse' failed as data isn't a dictionary.`);
151
+ return { types: unmarshalArrayOfObject(data.types, unmarshalGatewayType) };
208
152
  };
209
153
  const unmarshalListGatewaysResponse = (data) => {
210
- if (!isJSONObject(data)) {
211
- throw new TypeError(
212
- `Unmarshalling the type 'ListGatewaysResponse' failed as data isn't a dictionary.`
213
- );
214
- }
215
- return {
216
- gateways: unmarshalArrayOfObject(data.gateways, unmarshalGateway),
217
- totalCount: data.total_count
218
- };
154
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListGatewaysResponse' failed as data isn't a dictionary.`);
155
+ return {
156
+ gateways: unmarshalArrayOfObject(data.gateways, unmarshalGateway),
157
+ totalCount: data.total_count
158
+ };
219
159
  };
220
160
  const unmarshalListIPsResponse = (data) => {
221
- if (!isJSONObject(data)) {
222
- throw new TypeError(
223
- `Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.`
224
- );
225
- }
226
- return {
227
- ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
228
- totalCount: data.total_count
229
- };
161
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.`);
162
+ return {
163
+ ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
164
+ totalCount: data.total_count
165
+ };
230
166
  };
231
167
  const unmarshalListPATRulesResponse = (data) => {
232
- if (!isJSONObject(data)) {
233
- throw new TypeError(
234
- `Unmarshalling the type 'ListPATRulesResponse' failed as data isn't a dictionary.`
235
- );
236
- }
237
- return {
238
- patRules: unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule),
239
- totalCount: data.total_count
240
- };
168
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPATRulesResponse' failed as data isn't a dictionary.`);
169
+ return {
170
+ patRules: unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule),
171
+ totalCount: data.total_count
172
+ };
241
173
  };
242
174
  const unmarshalSetDHCPEntriesResponse = (data) => {
243
- if (!isJSONObject(data)) {
244
- throw new TypeError(
245
- `Unmarshalling the type 'SetDHCPEntriesResponse' failed as data isn't a dictionary.`
246
- );
247
- }
248
- return {
249
- dhcpEntries: unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry)
250
- };
175
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetDHCPEntriesResponse' failed as data isn't a dictionary.`);
176
+ return { dhcpEntries: unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry) };
251
177
  };
252
178
  const unmarshalSetPATRulesResponse = (data) => {
253
- if (!isJSONObject(data)) {
254
- throw new TypeError(
255
- `Unmarshalling the type 'SetPATRulesResponse' failed as data isn't a dictionary.`
256
- );
257
- }
258
- return {
259
- patRules: unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule)
260
- };
179
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetPATRulesResponse' failed as data isn't a dictionary.`);
180
+ return { patRules: unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule) };
261
181
  };
262
182
  const marshalCreateDHCPRequest = (request, defaults) => ({
263
- address: request.address,
264
- dns_local_name: request.dnsLocalName,
265
- dns_search: request.dnsSearch,
266
- dns_servers_override: request.dnsServersOverride,
267
- enable_dynamic: request.enableDynamic,
268
- pool_high: request.poolHigh,
269
- pool_low: request.poolLow,
270
- project_id: request.projectId ?? defaults.defaultProjectId,
271
- push_default_route: request.pushDefaultRoute,
272
- push_dns_server: request.pushDnsServer,
273
- rebind_timer: request.rebindTimer,
274
- renew_timer: request.renewTimer,
275
- subnet: request.subnet,
276
- valid_lifetime: request.validLifetime
183
+ address: request.address,
184
+ dns_local_name: request.dnsLocalName,
185
+ dns_search: request.dnsSearch,
186
+ dns_servers_override: request.dnsServersOverride,
187
+ enable_dynamic: request.enableDynamic,
188
+ pool_high: request.poolHigh,
189
+ pool_low: request.poolLow,
190
+ project_id: request.projectId ?? defaults.defaultProjectId,
191
+ push_default_route: request.pushDefaultRoute,
192
+ push_dns_server: request.pushDnsServer,
193
+ rebind_timer: request.rebindTimer,
194
+ renew_timer: request.renewTimer,
195
+ subnet: request.subnet,
196
+ valid_lifetime: request.validLifetime
277
197
  });
278
198
  const marshalCreateDHCPEntryRequest = (request, defaults) => ({
279
- gateway_network_id: request.gatewayNetworkId,
280
- ip_address: request.ipAddress,
281
- mac_address: request.macAddress
199
+ gateway_network_id: request.gatewayNetworkId,
200
+ ip_address: request.ipAddress,
201
+ mac_address: request.macAddress
282
202
  });
283
- const marshalCreateGatewayNetworkRequestIpamConfig = (request, defaults) => ({
284
- ipam_ip_id: request.ipamIpId,
285
- push_default_route: request.pushDefaultRoute
203
+ var marshalCreateGatewayNetworkRequestIpamConfig = (request, defaults) => ({
204
+ ipam_ip_id: request.ipamIpId,
205
+ push_default_route: request.pushDefaultRoute
286
206
  });
287
207
  const marshalCreateGatewayNetworkRequest = (request, defaults) => ({
288
- enable_dhcp: request.enableDhcp,
289
- enable_masquerade: request.enableMasquerade,
290
- gateway_id: request.gatewayId,
291
- private_network_id: request.privateNetworkId,
292
- ...resolveOneOf([
293
- { param: "dhcp_id", value: request.dhcpId },
294
- {
295
- param: "dhcp",
296
- value: request.dhcp !== void 0 ? marshalCreateDHCPRequest(request.dhcp, defaults) : void 0
297
- },
298
- { param: "address", value: request.address },
299
- {
300
- param: "ipam_config",
301
- value: request.ipamConfig !== void 0 ? marshalCreateGatewayNetworkRequestIpamConfig(
302
- request.ipamConfig
303
- ) : void 0
304
- }
305
- ])
208
+ enable_dhcp: request.enableDhcp,
209
+ enable_masquerade: request.enableMasquerade,
210
+ gateway_id: request.gatewayId,
211
+ private_network_id: request.privateNetworkId,
212
+ ...resolveOneOf([
213
+ {
214
+ param: "dhcp_id",
215
+ value: request.dhcpId
216
+ },
217
+ {
218
+ param: "dhcp",
219
+ value: request.dhcp !== void 0 ? marshalCreateDHCPRequest(request.dhcp, defaults) : void 0
220
+ },
221
+ {
222
+ param: "address",
223
+ value: request.address
224
+ },
225
+ {
226
+ param: "ipam_config",
227
+ value: request.ipamConfig !== void 0 ? marshalCreateGatewayNetworkRequestIpamConfig(request.ipamConfig, defaults) : void 0
228
+ }
229
+ ])
306
230
  });
307
231
  const marshalCreateGatewayRequest = (request, defaults) => ({
308
- bastion_port: request.bastionPort,
309
- enable_bastion: request.enableBastion,
310
- enable_smtp: request.enableSmtp,
311
- ip_id: request.ipId,
312
- name: request.name || randomName("gw"),
313
- project_id: request.projectId ?? defaults.defaultProjectId,
314
- tags: request.tags,
315
- type: request.type,
316
- upstream_dns_servers: request.upstreamDnsServers
232
+ bastion_port: request.bastionPort,
233
+ enable_bastion: request.enableBastion,
234
+ enable_smtp: request.enableSmtp,
235
+ ip_id: request.ipId,
236
+ name: request.name || randomName("gw"),
237
+ project_id: request.projectId ?? defaults.defaultProjectId,
238
+ tags: request.tags,
239
+ type: request.type,
240
+ upstream_dns_servers: request.upstreamDnsServers
317
241
  });
318
242
  const marshalCreateIPRequest = (request, defaults) => ({
319
- project_id: request.projectId ?? defaults.defaultProjectId,
320
- tags: request.tags
243
+ project_id: request.projectId ?? defaults.defaultProjectId,
244
+ tags: request.tags
321
245
  });
322
246
  const marshalCreatePATRuleRequest = (request, defaults) => ({
323
- gateway_id: request.gatewayId,
324
- private_ip: request.privateIp,
325
- private_port: request.privatePort,
326
- protocol: request.protocol,
327
- public_port: request.publicPort
247
+ gateway_id: request.gatewayId,
248
+ private_ip: request.privateIp,
249
+ private_port: request.privatePort,
250
+ protocol: request.protocol,
251
+ public_port: request.publicPort
328
252
  });
329
- const marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({
330
- ip_address: request.ipAddress,
331
- mac_address: request.macAddress
253
+ var marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({
254
+ ip_address: request.ipAddress,
255
+ mac_address: request.macAddress
332
256
  });
333
257
  const marshalSetDHCPEntriesRequest = (request, defaults) => ({
334
- dhcp_entries: request.dhcpEntries !== void 0 ? request.dhcpEntries.map(
335
- (elt) => marshalSetDHCPEntriesRequestEntry(elt)
336
- ) : void 0,
337
- gateway_network_id: request.gatewayNetworkId
258
+ dhcp_entries: request.dhcpEntries !== void 0 ? request.dhcpEntries.map((elt) => marshalSetDHCPEntriesRequestEntry(elt, defaults)) : void 0,
259
+ gateway_network_id: request.gatewayNetworkId
338
260
  });
339
- const marshalSetPATRulesRequestRule = (request, defaults) => ({
340
- private_ip: request.privateIp,
341
- private_port: request.privatePort,
342
- protocol: request.protocol,
343
- public_port: request.publicPort
261
+ var marshalSetPATRulesRequestRule = (request, defaults) => ({
262
+ private_ip: request.privateIp,
263
+ private_port: request.privatePort,
264
+ protocol: request.protocol,
265
+ public_port: request.publicPort
344
266
  });
345
267
  const marshalSetPATRulesRequest = (request, defaults) => ({
346
- gateway_id: request.gatewayId,
347
- pat_rules: request.patRules.map(
348
- (elt) => marshalSetPATRulesRequestRule(elt)
349
- )
350
- });
351
- const marshalUpdateDHCPEntryRequest = (request, defaults) => ({
352
- ip_address: request.ipAddress
268
+ gateway_id: request.gatewayId,
269
+ pat_rules: request.patRules.map((elt) => marshalSetPATRulesRequestRule(elt, defaults))
353
270
  });
271
+ const marshalUpdateDHCPEntryRequest = (request, defaults) => ({ ip_address: request.ipAddress });
354
272
  const marshalUpdateDHCPRequest = (request, defaults) => ({
355
- address: request.address,
356
- dns_local_name: request.dnsLocalName,
357
- dns_search: request.dnsSearch,
358
- dns_servers_override: request.dnsServersOverride,
359
- enable_dynamic: request.enableDynamic,
360
- pool_high: request.poolHigh,
361
- pool_low: request.poolLow,
362
- push_default_route: request.pushDefaultRoute,
363
- push_dns_server: request.pushDnsServer,
364
- rebind_timer: request.rebindTimer,
365
- renew_timer: request.renewTimer,
366
- subnet: request.subnet,
367
- valid_lifetime: request.validLifetime
273
+ address: request.address,
274
+ dns_local_name: request.dnsLocalName,
275
+ dns_search: request.dnsSearch,
276
+ dns_servers_override: request.dnsServersOverride,
277
+ enable_dynamic: request.enableDynamic,
278
+ pool_high: request.poolHigh,
279
+ pool_low: request.poolLow,
280
+ push_default_route: request.pushDefaultRoute,
281
+ push_dns_server: request.pushDnsServer,
282
+ rebind_timer: request.rebindTimer,
283
+ renew_timer: request.renewTimer,
284
+ subnet: request.subnet,
285
+ valid_lifetime: request.validLifetime
368
286
  });
369
- const marshalUpdateGatewayNetworkRequestIpamConfig = (request, defaults) => ({
370
- ipam_ip_id: request.ipamIpId,
371
- push_default_route: request.pushDefaultRoute
287
+ var marshalUpdateGatewayNetworkRequestIpamConfig = (request, defaults) => ({
288
+ ipam_ip_id: request.ipamIpId,
289
+ push_default_route: request.pushDefaultRoute
372
290
  });
373
291
  const marshalUpdateGatewayNetworkRequest = (request, defaults) => ({
374
- enable_dhcp: request.enableDhcp,
375
- enable_masquerade: request.enableMasquerade,
376
- ...resolveOneOf([
377
- { param: "dhcp_id", value: request.dhcpId },
378
- { param: "address", value: request.address },
379
- {
380
- param: "ipam_config",
381
- value: request.ipamConfig !== void 0 ? marshalUpdateGatewayNetworkRequestIpamConfig(
382
- request.ipamConfig
383
- ) : void 0
384
- }
385
- ])
292
+ enable_dhcp: request.enableDhcp,
293
+ enable_masquerade: request.enableMasquerade,
294
+ ...resolveOneOf([
295
+ {
296
+ param: "dhcp_id",
297
+ value: request.dhcpId
298
+ },
299
+ {
300
+ param: "address",
301
+ value: request.address
302
+ },
303
+ {
304
+ param: "ipam_config",
305
+ value: request.ipamConfig !== void 0 ? marshalUpdateGatewayNetworkRequestIpamConfig(request.ipamConfig, defaults) : void 0
306
+ }
307
+ ])
386
308
  });
387
309
  const marshalUpdateGatewayRequest = (request, defaults) => ({
388
- bastion_port: request.bastionPort,
389
- enable_bastion: request.enableBastion,
390
- enable_smtp: request.enableSmtp,
391
- name: request.name,
392
- tags: request.tags,
393
- upstream_dns_servers: request.upstreamDnsServers
310
+ bastion_port: request.bastionPort,
311
+ enable_bastion: request.enableBastion,
312
+ enable_smtp: request.enableSmtp,
313
+ name: request.name,
314
+ tags: request.tags,
315
+ upstream_dns_servers: request.upstreamDnsServers
394
316
  });
395
317
  const marshalUpdateIPRequest = (request, defaults) => ({
396
- gateway_id: request.gatewayId,
397
- reverse: request.reverse,
398
- tags: request.tags
318
+ gateway_id: request.gatewayId,
319
+ reverse: request.reverse,
320
+ tags: request.tags
399
321
  });
400
322
  const marshalUpdatePATRuleRequest = (request, defaults) => ({
401
- private_ip: request.privateIp,
402
- private_port: request.privatePort,
403
- protocol: request.protocol,
404
- public_port: request.publicPort
405
- });
406
- const marshalUpgradeGatewayRequest = (request, defaults) => ({
407
- type: request.type
323
+ private_ip: request.privateIp,
324
+ private_port: request.privatePort,
325
+ protocol: request.protocol,
326
+ public_port: request.publicPort
408
327
  });
409
- export {
410
- marshalCreateDHCPEntryRequest,
411
- marshalCreateDHCPRequest,
412
- marshalCreateGatewayNetworkRequest,
413
- marshalCreateGatewayRequest,
414
- marshalCreateIPRequest,
415
- marshalCreatePATRuleRequest,
416
- marshalSetDHCPEntriesRequest,
417
- marshalSetPATRulesRequest,
418
- marshalUpdateDHCPEntryRequest,
419
- marshalUpdateDHCPRequest,
420
- marshalUpdateGatewayNetworkRequest,
421
- marshalUpdateGatewayRequest,
422
- marshalUpdateIPRequest,
423
- marshalUpdatePATRuleRequest,
424
- marshalUpgradeGatewayRequest,
425
- unmarshalDHCP,
426
- unmarshalDHCPEntry,
427
- unmarshalGateway,
428
- unmarshalGatewayNetwork,
429
- unmarshalIP,
430
- unmarshalListDHCPEntriesResponse,
431
- unmarshalListDHCPsResponse,
432
- unmarshalListGatewayNetworksResponse,
433
- unmarshalListGatewayTypesResponse,
434
- unmarshalListGatewaysResponse,
435
- unmarshalListIPsResponse,
436
- unmarshalListPATRulesResponse,
437
- unmarshalPATRule,
438
- unmarshalSetDHCPEntriesResponse,
439
- unmarshalSetPATRulesResponse
440
- };
328
+ const marshalUpgradeGatewayRequest = (request, defaults) => ({ type: request.type });
329
+ export { marshalCreateDHCPEntryRequest, marshalCreateDHCPRequest, marshalCreateGatewayNetworkRequest, marshalCreateGatewayRequest, marshalCreateIPRequest, marshalCreatePATRuleRequest, marshalSetDHCPEntriesRequest, marshalSetPATRulesRequest, marshalUpdateDHCPEntryRequest, marshalUpdateDHCPRequest, marshalUpdateGatewayNetworkRequest, marshalUpdateGatewayRequest, marshalUpdateIPRequest, marshalUpdatePATRuleRequest, marshalUpgradeGatewayRequest, unmarshalDHCP, unmarshalDHCPEntry, unmarshalGateway, unmarshalGatewayNetwork, unmarshalIP, unmarshalListDHCPEntriesResponse, unmarshalListDHCPsResponse, unmarshalListGatewayNetworksResponse, unmarshalListGatewayTypesResponse, unmarshalListGatewaysResponse, unmarshalListIPsResponse, unmarshalListPATRulesResponse, unmarshalPATRule, unmarshalSetDHCPEntriesResponse, unmarshalSetPATRulesResponse };