@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.
- 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 -697
- package/dist/v1/content.gen.js +10 -11
- package/dist/v1/index.gen.d.ts +1 -1
- package/dist/v1/index.gen.js +38 -36
- package/dist/v1/marshalling.gen.js +266 -377
- package/dist/v2/api.gen.js +343 -506
- package/dist/v2/content.gen.js +10 -11
- package/dist/v2/index.gen.d.ts +1 -1
- package/dist/v2/index.gen.js +32 -30
- package/dist/v2/marshalling.gen.js +144 -243
- package/package.json +4 -4
|
@@ -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
|
-
|
|
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
|
-
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
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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
|
-
|
|
201
|
-
|
|
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
|
-
|
|
211
|
-
|
|
212
|
-
|
|
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
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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
|
-
|
|
233
|
-
|
|
234
|
-
|
|
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
|
-
|
|
244
|
-
|
|
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
|
-
|
|
254
|
-
|
|
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
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
-
|
|
280
|
-
|
|
281
|
-
|
|
199
|
+
gateway_network_id: request.gatewayNetworkId,
|
|
200
|
+
ip_address: request.ipAddress,
|
|
201
|
+
mac_address: request.macAddress
|
|
282
202
|
});
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
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
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
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
|
-
|
|
320
|
-
|
|
243
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
244
|
+
tags: request.tags
|
|
321
245
|
});
|
|
322
246
|
const marshalCreatePATRuleRequest = (request, defaults) => ({
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
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
|
-
|
|
330
|
-
|
|
331
|
-
|
|
253
|
+
var marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({
|
|
254
|
+
ip_address: request.ipAddress,
|
|
255
|
+
mac_address: request.macAddress
|
|
332
256
|
});
|
|
333
257
|
const marshalSetDHCPEntriesRequest = (request, defaults) => ({
|
|
334
|
-
|
|
335
|
-
|
|
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
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
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
|
-
|
|
347
|
-
|
|
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
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
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
|
-
|
|
370
|
-
|
|
371
|
-
|
|
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
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
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
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
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
|
-
|
|
397
|
-
|
|
398
|
-
|
|
318
|
+
gateway_id: request.gatewayId,
|
|
319
|
+
reverse: request.reverse,
|
|
320
|
+
tags: request.tags
|
|
399
321
|
});
|
|
400
322
|
const marshalUpdatePATRuleRequest = (request, defaults) => ({
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
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
|
-
|
|
410
|
-
|
|
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 };
|