@scaleway/sdk-vpcgw 2.2.1 → 2.3.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.
@@ -1,438 +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(data.gateway_networks, unmarshalGatewayNetwork),
125
- id: data.id,
126
- ip: data.ip ? unmarshalIP(data.ip) : void 0,
127
- ipMobilityEnabled: data.ip_mobility_enabled,
128
- isLegacy: data.is_legacy,
129
- name: data.name,
130
- organizationId: data.organization_id,
131
- projectId: data.project_id,
132
- smtpEnabled: data.smtp_enabled,
133
- status: data.status,
134
- tags: data.tags,
135
- type: data.type ? unmarshalGatewayType(data.type) : void 0,
136
- updatedAt: unmarshalDate(data.updated_at),
137
- upstreamDnsServers: data.upstream_dns_servers,
138
- version: data.version,
139
- zone: data.zone
140
- };
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
+ };
141
113
  };
142
114
  const unmarshalPATRule = (data) => {
143
- if (!isJSONObject(data)) {
144
- throw new TypeError(
145
- `Unmarshalling the type 'PATRule' failed as data isn't a dictionary.`
146
- );
147
- }
148
- return {
149
- createdAt: unmarshalDate(data.created_at),
150
- gatewayId: data.gateway_id,
151
- id: data.id,
152
- privateIp: data.private_ip,
153
- privatePort: data.private_port,
154
- protocol: data.protocol,
155
- publicPort: data.public_port,
156
- updatedAt: unmarshalDate(data.updated_at),
157
- zone: data.zone
158
- };
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
+ };
159
127
  };
160
128
  const unmarshalListDHCPEntriesResponse = (data) => {
161
- if (!isJSONObject(data)) {
162
- throw new TypeError(
163
- `Unmarshalling the type 'ListDHCPEntriesResponse' failed as data isn't a dictionary.`
164
- );
165
- }
166
- return {
167
- dhcpEntries: unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry),
168
- totalCount: data.total_count
169
- };
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
+ };
170
134
  };
171
135
  const unmarshalListDHCPsResponse = (data) => {
172
- if (!isJSONObject(data)) {
173
- throw new TypeError(
174
- `Unmarshalling the type 'ListDHCPsResponse' failed as data isn't a dictionary.`
175
- );
176
- }
177
- return {
178
- dhcps: unmarshalArrayOfObject(data.dhcps, unmarshalDHCP),
179
- totalCount: data.total_count
180
- };
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
+ };
181
141
  };
182
142
  const unmarshalListGatewayNetworksResponse = (data) => {
183
- if (!isJSONObject(data)) {
184
- throw new TypeError(
185
- `Unmarshalling the type 'ListGatewayNetworksResponse' failed as data isn't a dictionary.`
186
- );
187
- }
188
- return {
189
- gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork),
190
- totalCount: data.total_count
191
- };
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
+ };
192
148
  };
193
149
  const unmarshalListGatewayTypesResponse = (data) => {
194
- if (!isJSONObject(data)) {
195
- throw new TypeError(
196
- `Unmarshalling the type 'ListGatewayTypesResponse' failed as data isn't a dictionary.`
197
- );
198
- }
199
- return {
200
- types: unmarshalArrayOfObject(data.types, unmarshalGatewayType)
201
- };
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) };
202
152
  };
203
153
  const unmarshalListGatewaysResponse = (data) => {
204
- if (!isJSONObject(data)) {
205
- throw new TypeError(
206
- `Unmarshalling the type 'ListGatewaysResponse' failed as data isn't a dictionary.`
207
- );
208
- }
209
- return {
210
- gateways: unmarshalArrayOfObject(data.gateways, unmarshalGateway),
211
- totalCount: data.total_count
212
- };
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
+ };
213
159
  };
214
160
  const unmarshalListIPsResponse = (data) => {
215
- if (!isJSONObject(data)) {
216
- throw new TypeError(
217
- `Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.`
218
- );
219
- }
220
- return {
221
- ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
222
- totalCount: data.total_count
223
- };
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
+ };
224
166
  };
225
167
  const unmarshalListPATRulesResponse = (data) => {
226
- if (!isJSONObject(data)) {
227
- throw new TypeError(
228
- `Unmarshalling the type 'ListPATRulesResponse' failed as data isn't a dictionary.`
229
- );
230
- }
231
- return {
232
- patRules: unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule),
233
- totalCount: data.total_count
234
- };
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
+ };
235
173
  };
236
174
  const unmarshalSetDHCPEntriesResponse = (data) => {
237
- if (!isJSONObject(data)) {
238
- throw new TypeError(
239
- `Unmarshalling the type 'SetDHCPEntriesResponse' failed as data isn't a dictionary.`
240
- );
241
- }
242
- return {
243
- dhcpEntries: unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry)
244
- };
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) };
245
177
  };
246
178
  const unmarshalSetPATRulesResponse = (data) => {
247
- if (!isJSONObject(data)) {
248
- throw new TypeError(
249
- `Unmarshalling the type 'SetPATRulesResponse' failed as data isn't a dictionary.`
250
- );
251
- }
252
- return {
253
- patRules: unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule)
254
- };
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) };
255
181
  };
256
182
  const marshalCreateDHCPRequest = (request, defaults) => ({
257
- address: request.address,
258
- dns_local_name: request.dnsLocalName,
259
- dns_search: request.dnsSearch,
260
- dns_servers_override: request.dnsServersOverride,
261
- enable_dynamic: request.enableDynamic,
262
- pool_high: request.poolHigh,
263
- pool_low: request.poolLow,
264
- project_id: request.projectId ?? defaults.defaultProjectId,
265
- push_default_route: request.pushDefaultRoute,
266
- push_dns_server: request.pushDnsServer,
267
- rebind_timer: request.rebindTimer,
268
- renew_timer: request.renewTimer,
269
- subnet: request.subnet,
270
- 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
271
197
  });
272
198
  const marshalCreateDHCPEntryRequest = (request, defaults) => ({
273
- gateway_network_id: request.gatewayNetworkId,
274
- ip_address: request.ipAddress,
275
- mac_address: request.macAddress
199
+ gateway_network_id: request.gatewayNetworkId,
200
+ ip_address: request.ipAddress,
201
+ mac_address: request.macAddress
276
202
  });
277
- const marshalCreateGatewayNetworkRequestIpamConfig = (request, defaults) => ({
278
- ipam_ip_id: request.ipamIpId,
279
- push_default_route: request.pushDefaultRoute
203
+ var marshalCreateGatewayNetworkRequestIpamConfig = (request, defaults) => ({
204
+ ipam_ip_id: request.ipamIpId,
205
+ push_default_route: request.pushDefaultRoute
280
206
  });
281
207
  const marshalCreateGatewayNetworkRequest = (request, defaults) => ({
282
- enable_dhcp: request.enableDhcp,
283
- enable_masquerade: request.enableMasquerade,
284
- gateway_id: request.gatewayId,
285
- private_network_id: request.privateNetworkId,
286
- ...resolveOneOf([
287
- {
288
- param: "dhcp_id",
289
- value: request.dhcpId
290
- },
291
- {
292
- param: "dhcp",
293
- value: request.dhcp !== void 0 ? marshalCreateDHCPRequest(request.dhcp, defaults) : void 0
294
- },
295
- {
296
- param: "address",
297
- value: request.address
298
- },
299
- {
300
- param: "ipam_config",
301
- value: request.ipamConfig !== void 0 ? marshalCreateGatewayNetworkRequestIpamConfig(request.ipamConfig) : void 0
302
- }
303
- ])
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
+ ])
304
230
  });
305
231
  const marshalCreateGatewayRequest = (request, defaults) => ({
306
- bastion_port: request.bastionPort,
307
- enable_bastion: request.enableBastion,
308
- enable_smtp: request.enableSmtp,
309
- ip_id: request.ipId,
310
- name: request.name || randomName("gw"),
311
- project_id: request.projectId ?? defaults.defaultProjectId,
312
- tags: request.tags,
313
- type: request.type,
314
- 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
315
241
  });
316
242
  const marshalCreateIPRequest = (request, defaults) => ({
317
- project_id: request.projectId ?? defaults.defaultProjectId,
318
- tags: request.tags
243
+ project_id: request.projectId ?? defaults.defaultProjectId,
244
+ tags: request.tags
319
245
  });
320
246
  const marshalCreatePATRuleRequest = (request, defaults) => ({
321
- gateway_id: request.gatewayId,
322
- private_ip: request.privateIp,
323
- private_port: request.privatePort,
324
- protocol: request.protocol,
325
- 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
326
252
  });
327
- const marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({
328
- ip_address: request.ipAddress,
329
- mac_address: request.macAddress
253
+ var marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({
254
+ ip_address: request.ipAddress,
255
+ mac_address: request.macAddress
330
256
  });
331
257
  const marshalSetDHCPEntriesRequest = (request, defaults) => ({
332
- dhcp_entries: request.dhcpEntries !== void 0 ? request.dhcpEntries.map((elt) => marshalSetDHCPEntriesRequestEntry(elt)) : void 0,
333
- 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
334
260
  });
335
- const marshalSetPATRulesRequestRule = (request, defaults) => ({
336
- private_ip: request.privateIp,
337
- private_port: request.privatePort,
338
- protocol: request.protocol,
339
- 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
340
266
  });
341
267
  const marshalSetPATRulesRequest = (request, defaults) => ({
342
- gateway_id: request.gatewayId,
343
- pat_rules: request.patRules.map((elt) => marshalSetPATRulesRequestRule(elt))
344
- });
345
- const marshalUpdateDHCPEntryRequest = (request, defaults) => ({
346
- ip_address: request.ipAddress
268
+ gateway_id: request.gatewayId,
269
+ pat_rules: request.patRules.map((elt) => marshalSetPATRulesRequestRule(elt, defaults))
347
270
  });
271
+ const marshalUpdateDHCPEntryRequest = (request, defaults) => ({ ip_address: request.ipAddress });
348
272
  const marshalUpdateDHCPRequest = (request, defaults) => ({
349
- address: request.address,
350
- dns_local_name: request.dnsLocalName,
351
- dns_search: request.dnsSearch,
352
- dns_servers_override: request.dnsServersOverride,
353
- enable_dynamic: request.enableDynamic,
354
- pool_high: request.poolHigh,
355
- pool_low: request.poolLow,
356
- push_default_route: request.pushDefaultRoute,
357
- push_dns_server: request.pushDnsServer,
358
- rebind_timer: request.rebindTimer,
359
- renew_timer: request.renewTimer,
360
- subnet: request.subnet,
361
- 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
362
286
  });
363
- const marshalUpdateGatewayNetworkRequestIpamConfig = (request, defaults) => ({
364
- ipam_ip_id: request.ipamIpId,
365
- push_default_route: request.pushDefaultRoute
287
+ var marshalUpdateGatewayNetworkRequestIpamConfig = (request, defaults) => ({
288
+ ipam_ip_id: request.ipamIpId,
289
+ push_default_route: request.pushDefaultRoute
366
290
  });
367
291
  const marshalUpdateGatewayNetworkRequest = (request, defaults) => ({
368
- enable_dhcp: request.enableDhcp,
369
- enable_masquerade: request.enableMasquerade,
370
- ...resolveOneOf([
371
- {
372
- param: "dhcp_id",
373
- value: request.dhcpId
374
- },
375
- {
376
- param: "address",
377
- value: request.address
378
- },
379
- {
380
- param: "ipam_config",
381
- value: request.ipamConfig !== void 0 ? marshalUpdateGatewayNetworkRequestIpamConfig(request.ipamConfig) : void 0
382
- }
383
- ])
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
+ ])
384
308
  });
385
309
  const marshalUpdateGatewayRequest = (request, defaults) => ({
386
- bastion_port: request.bastionPort,
387
- enable_bastion: request.enableBastion,
388
- enable_smtp: request.enableSmtp,
389
- name: request.name,
390
- tags: request.tags,
391
- 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
392
316
  });
393
317
  const marshalUpdateIPRequest = (request, defaults) => ({
394
- gateway_id: request.gatewayId,
395
- reverse: request.reverse,
396
- tags: request.tags
318
+ gateway_id: request.gatewayId,
319
+ reverse: request.reverse,
320
+ tags: request.tags
397
321
  });
398
322
  const marshalUpdatePATRuleRequest = (request, defaults) => ({
399
- private_ip: request.privateIp,
400
- private_port: request.privatePort,
401
- protocol: request.protocol,
402
- public_port: request.publicPort
403
- });
404
- const marshalUpgradeGatewayRequest = (request, defaults) => ({
405
- type: request.type
323
+ private_ip: request.privateIp,
324
+ private_port: request.privatePort,
325
+ protocol: request.protocol,
326
+ public_port: request.publicPort
406
327
  });
407
- export {
408
- marshalCreateDHCPEntryRequest,
409
- marshalCreateDHCPRequest,
410
- marshalCreateGatewayNetworkRequest,
411
- marshalCreateGatewayRequest,
412
- marshalCreateIPRequest,
413
- marshalCreatePATRuleRequest,
414
- marshalSetDHCPEntriesRequest,
415
- marshalSetPATRulesRequest,
416
- marshalUpdateDHCPEntryRequest,
417
- marshalUpdateDHCPRequest,
418
- marshalUpdateGatewayNetworkRequest,
419
- marshalUpdateGatewayRequest,
420
- marshalUpdateIPRequest,
421
- marshalUpdatePATRuleRequest,
422
- marshalUpgradeGatewayRequest,
423
- unmarshalDHCP,
424
- unmarshalDHCPEntry,
425
- unmarshalGateway,
426
- unmarshalGatewayNetwork,
427
- unmarshalIP,
428
- unmarshalListDHCPEntriesResponse,
429
- unmarshalListDHCPsResponse,
430
- unmarshalListGatewayNetworksResponse,
431
- unmarshalListGatewayTypesResponse,
432
- unmarshalListGatewaysResponse,
433
- unmarshalListIPsResponse,
434
- unmarshalListPATRulesResponse,
435
- unmarshalPATRule,
436
- unmarshalSetDHCPEntriesResponse,
437
- unmarshalSetPATRulesResponse
438
- };
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 };