@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.
- package/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +3 -6
- package/dist/v1/api.gen.js +490 -691
- package/dist/v1/content.gen.js +10 -11
- package/dist/v1/index.gen.js +38 -36
- package/dist/v1/marshalling.gen.js +266 -375
- package/dist/v2/api.gen.js +343 -494
- package/dist/v2/content.gen.js +10 -11
- package/dist/v2/index.gen.js +32 -30
- package/dist/v2/marshalling.gen.js +144 -235
- package/package.json +4 -4
|
@@ -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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
-
|
|
195
|
-
|
|
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
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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
|
-
|
|
238
|
-
|
|
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
|
-
|
|
248
|
-
|
|
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
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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
|
-
|
|
274
|
-
|
|
275
|
-
|
|
199
|
+
gateway_network_id: request.gatewayNetworkId,
|
|
200
|
+
ip_address: request.ipAddress,
|
|
201
|
+
mac_address: request.macAddress
|
|
276
202
|
});
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
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
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
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
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
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
|
-
|
|
318
|
-
|
|
243
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
244
|
+
tags: request.tags
|
|
319
245
|
});
|
|
320
246
|
const marshalCreatePATRuleRequest = (request, defaults) => ({
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
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
|
-
|
|
328
|
-
|
|
329
|
-
|
|
253
|
+
var marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({
|
|
254
|
+
ip_address: request.ipAddress,
|
|
255
|
+
mac_address: request.macAddress
|
|
330
256
|
});
|
|
331
257
|
const marshalSetDHCPEntriesRequest = (request, defaults) => ({
|
|
332
|
-
|
|
333
|
-
|
|
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
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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
|
-
|
|
343
|
-
|
|
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
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
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
|
-
|
|
364
|
-
|
|
365
|
-
|
|
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
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
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
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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
|
-
|
|
395
|
-
|
|
396
|
-
|
|
318
|
+
gateway_id: request.gatewayId,
|
|
319
|
+
reverse: request.reverse,
|
|
320
|
+
tags: request.tags
|
|
397
321
|
});
|
|
398
322
|
const marshalUpdatePATRuleRequest = (request, defaults) => ({
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
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
|
-
|
|
408
|
-
|
|
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 };
|