@scaleway/sdk-instance 2.3.2 → 2.4.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,1829 +1,1230 @@
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMapOfObject } from "@scaleway/sdk-client";
1
2
  import randomName from "@scaleway/random-name";
2
- import { resolveOneOf, isJSONObject, unmarshalMapOfObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
3
3
  const unmarshalPrivateNIC = (data) => {
4
- if (!isJSONObject(data)) {
5
- throw new TypeError(
6
- `Unmarshalling the type 'PrivateNIC' failed as data isn't a dictionary.`
7
- );
8
- }
9
- return {
10
- creationDate: unmarshalDate(data.creation_date),
11
- id: data.id,
12
- macAddress: data.mac_address,
13
- privateNetworkId: data.private_network_id,
14
- serverId: data.server_id,
15
- state: data.state,
16
- tags: data.tags,
17
- zone: data.zone
18
- };
19
- };
20
- const unmarshalServerSummary = (data) => {
21
- if (!isJSONObject(data)) {
22
- throw new TypeError(
23
- `Unmarshalling the type 'ServerSummary' failed as data isn't a dictionary.`
24
- );
25
- }
26
- return {
27
- id: data.id,
28
- name: data.name
29
- };
30
- };
31
- const unmarshalBootscript = (data) => {
32
- if (!isJSONObject(data)) {
33
- throw new TypeError(
34
- `Unmarshalling the type 'Bootscript' failed as data isn't a dictionary.`
35
- );
36
- }
37
- return {
38
- architecture: data.architecture,
39
- bootcmdargs: data.bootcmdargs,
40
- default: data.default,
41
- dtb: data.dtb,
42
- id: data.id,
43
- initrd: data.initrd,
44
- kernel: data.kernel,
45
- organization: data.organization,
46
- project: data.project,
47
- public: data.public,
48
- title: data.title,
49
- zone: data.zone
50
- };
51
- };
52
- const unmarshalVolume = (data) => {
53
- if (!isJSONObject(data)) {
54
- throw new TypeError(
55
- `Unmarshalling the type 'Volume' failed as data isn't a dictionary.`
56
- );
57
- }
58
- return {
59
- creationDate: unmarshalDate(data.creation_date),
60
- exportUri: data.export_uri,
61
- id: data.id,
62
- modificationDate: unmarshalDate(data.modification_date),
63
- name: data.name,
64
- organization: data.organization,
65
- project: data.project,
66
- server: data.server ? unmarshalServerSummary(data.server) : void 0,
67
- size: data.size,
68
- state: data.state,
69
- tags: data.tags,
70
- volumeType: data.volume_type,
71
- zone: data.zone
72
- };
73
- };
74
- const unmarshalVolumeSummary = (data) => {
75
- if (!isJSONObject(data)) {
76
- throw new TypeError(
77
- `Unmarshalling the type 'VolumeSummary' failed as data isn't a dictionary.`
78
- );
79
- }
80
- return {
81
- id: data.id,
82
- name: data.name,
83
- size: data.size,
84
- volumeType: data.volume_type
85
- };
86
- };
87
- const unmarshalImage = (data) => {
88
- if (!isJSONObject(data)) {
89
- throw new TypeError(
90
- `Unmarshalling the type 'Image' failed as data isn't a dictionary.`
91
- );
92
- }
93
- return {
94
- arch: data.arch,
95
- creationDate: unmarshalDate(data.creation_date),
96
- defaultBootscript: data.default_bootscript ? unmarshalBootscript(data.default_bootscript) : void 0,
97
- extraVolumes: unmarshalMapOfObject(data.extra_volumes, unmarshalVolume),
98
- fromServer: data.from_server,
99
- id: data.id,
100
- modificationDate: unmarshalDate(data.modification_date),
101
- name: data.name,
102
- organization: data.organization,
103
- project: data.project,
104
- public: data.public,
105
- rootVolume: data.root_volume ? unmarshalVolumeSummary(data.root_volume) : void 0,
106
- state: data.state,
107
- tags: data.tags,
108
- zone: data.zone
109
- };
110
- };
111
- const unmarshalPlacementGroup = (data) => {
112
- if (!isJSONObject(data)) {
113
- throw new TypeError(
114
- `Unmarshalling the type 'PlacementGroup' failed as data isn't a dictionary.`
115
- );
116
- }
117
- return {
118
- id: data.id,
119
- name: data.name,
120
- organization: data.organization,
121
- policyMode: data.policy_mode,
122
- policyRespected: data.policy_respected,
123
- policyType: data.policy_type,
124
- project: data.project,
125
- tags: data.tags,
126
- zone: data.zone
127
- };
128
- };
129
- const unmarshalSecurityGroupSummary = (data) => {
130
- if (!isJSONObject(data)) {
131
- throw new TypeError(
132
- `Unmarshalling the type 'SecurityGroupSummary' failed as data isn't a dictionary.`
133
- );
134
- }
135
- return {
136
- id: data.id,
137
- name: data.name
138
- };
139
- };
140
- const unmarshalServerFilesystem = (data) => {
141
- if (!isJSONObject(data)) {
142
- throw new TypeError(
143
- `Unmarshalling the type 'ServerFilesystem' failed as data isn't a dictionary.`
144
- );
145
- }
146
- return {
147
- filesystemId: data.filesystem_id,
148
- state: data.state
149
- };
150
- };
151
- const unmarshalServerIp = (data) => {
152
- if (!isJSONObject(data)) {
153
- throw new TypeError(
154
- `Unmarshalling the type 'ServerIp' failed as data isn't a dictionary.`
155
- );
156
- }
157
- return {
158
- address: data.address,
159
- dynamic: data.dynamic,
160
- family: data.family,
161
- gateway: data.gateway,
162
- id: data.id,
163
- ipamId: data.ipam_id,
164
- netmask: data.netmask,
165
- provisioningMode: data.provisioning_mode,
166
- state: data.state,
167
- tags: data.tags
168
- };
169
- };
170
- const unmarshalServerIpv6 = (data) => {
171
- if (!isJSONObject(data)) {
172
- throw new TypeError(
173
- `Unmarshalling the type 'ServerIpv6' failed as data isn't a dictionary.`
174
- );
175
- }
176
- return {
177
- address: data.address,
178
- gateway: data.gateway,
179
- netmask: data.netmask
180
- };
181
- };
182
- const unmarshalServerLocation = (data) => {
183
- if (!isJSONObject(data)) {
184
- throw new TypeError(
185
- `Unmarshalling the type 'ServerLocation' failed as data isn't a dictionary.`
186
- );
187
- }
188
- return {
189
- clusterId: data.cluster_id,
190
- hypervisorId: data.hypervisor_id,
191
- nodeId: data.node_id,
192
- platformId: data.platform_id,
193
- zoneId: data.zone_id
194
- };
195
- };
196
- const unmarshalServerMaintenance = (data) => {
197
- if (!isJSONObject(data)) {
198
- throw new TypeError(
199
- `Unmarshalling the type 'ServerMaintenance' failed as data isn't a dictionary.`
200
- );
201
- }
202
- return {
203
- reason: data.reason,
204
- startDate: unmarshalDate(data.start_date)
205
- };
206
- };
207
- const unmarshalVolumeServer = (data) => {
208
- if (!isJSONObject(data)) {
209
- throw new TypeError(
210
- `Unmarshalling the type 'VolumeServer' failed as data isn't a dictionary.`
211
- );
212
- }
213
- return {
214
- boot: data.boot,
215
- creationDate: unmarshalDate(data.creation_date),
216
- exportUri: data.export_uri,
217
- id: data.id,
218
- modificationDate: unmarshalDate(data.modification_date),
219
- name: data.name,
220
- organization: data.organization,
221
- project: data.project,
222
- server: data.server ? unmarshalServerSummary(data.server) : void 0,
223
- size: data.size,
224
- state: data.state ? data.state : void 0,
225
- volumeType: data.volume_type,
226
- zone: data.zone
227
- };
228
- };
229
- const unmarshalServer = (data) => {
230
- if (!isJSONObject(data)) {
231
- throw new TypeError(
232
- `Unmarshalling the type 'Server' failed as data isn't a dictionary.`
233
- );
234
- }
235
- return {
236
- adminPasswordEncryptedValue: data.admin_password_encrypted_value,
237
- adminPasswordEncryptionSshKeyId: data.admin_password_encryption_ssh_key_id,
238
- allowedActions: data.allowed_actions,
239
- arch: data.arch,
240
- bootType: data.boot_type,
241
- commercialType: data.commercial_type,
242
- creationDate: unmarshalDate(data.creation_date),
243
- dns: data.dns,
244
- dynamicIpRequired: data.dynamic_ip_required,
245
- enableIpv6: data.enable_ipv6,
246
- endOfService: data.end_of_service,
247
- filesystems: unmarshalArrayOfObject(data.filesystems, unmarshalServerFilesystem),
248
- hostname: data.hostname,
249
- id: data.id,
250
- image: data.image ? unmarshalImage(data.image) : void 0,
251
- ipv6: data.ipv6 ? unmarshalServerIpv6(data.ipv6) : void 0,
252
- location: data.location ? unmarshalServerLocation(data.location) : void 0,
253
- macAddress: data.mac_address,
254
- maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalServerMaintenance),
255
- modificationDate: unmarshalDate(data.modification_date),
256
- name: data.name,
257
- organization: data.organization,
258
- placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0,
259
- privateIp: data.private_ip,
260
- privateNics: unmarshalArrayOfObject(data.private_nics, unmarshalPrivateNIC),
261
- project: data.project,
262
- protected: data.protected,
263
- publicIp: data.public_ip ? unmarshalServerIp(data.public_ip) : void 0,
264
- publicIps: unmarshalArrayOfObject(data.public_ips, unmarshalServerIp),
265
- routedIpEnabled: data.routed_ip_enabled,
266
- securityGroup: data.security_group ? unmarshalSecurityGroupSummary(data.security_group) : void 0,
267
- state: data.state,
268
- stateDetail: data.state_detail,
269
- tags: data.tags,
270
- volumes: unmarshalMapOfObject(data.volumes, unmarshalVolumeServer),
271
- zone: data.zone
272
- };
4
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PrivateNIC' failed as data isn't a dictionary.`);
5
+ return {
6
+ creationDate: unmarshalDate(data.creation_date),
7
+ id: data.id,
8
+ macAddress: data.mac_address,
9
+ privateNetworkId: data.private_network_id,
10
+ serverId: data.server_id,
11
+ state: data.state,
12
+ tags: data.tags,
13
+ zone: data.zone
14
+ };
15
+ };
16
+ var unmarshalServerSummary = (data) => {
17
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerSummary' failed as data isn't a dictionary.`);
18
+ return {
19
+ id: data.id,
20
+ name: data.name
21
+ };
22
+ };
23
+ var unmarshalBootscript = (data) => {
24
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Bootscript' failed as data isn't a dictionary.`);
25
+ return {
26
+ architecture: data.architecture,
27
+ bootcmdargs: data.bootcmdargs,
28
+ default: data.default,
29
+ dtb: data.dtb,
30
+ id: data.id,
31
+ initrd: data.initrd,
32
+ kernel: data.kernel,
33
+ organization: data.organization,
34
+ project: data.project,
35
+ public: data.public,
36
+ title: data.title,
37
+ zone: data.zone
38
+ };
39
+ };
40
+ var unmarshalVolume = (data) => {
41
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
42
+ return {
43
+ creationDate: unmarshalDate(data.creation_date),
44
+ exportUri: data.export_uri,
45
+ id: data.id,
46
+ modificationDate: unmarshalDate(data.modification_date),
47
+ name: data.name,
48
+ organization: data.organization,
49
+ project: data.project,
50
+ server: data.server ? unmarshalServerSummary(data.server) : void 0,
51
+ size: data.size,
52
+ state: data.state,
53
+ tags: data.tags,
54
+ volumeType: data.volume_type,
55
+ zone: data.zone
56
+ };
57
+ };
58
+ var unmarshalVolumeSummary = (data) => {
59
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeSummary' failed as data isn't a dictionary.`);
60
+ return {
61
+ id: data.id,
62
+ name: data.name,
63
+ size: data.size,
64
+ volumeType: data.volume_type
65
+ };
66
+ };
67
+ var unmarshalImage = (data) => {
68
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Image' failed as data isn't a dictionary.`);
69
+ return {
70
+ arch: data.arch,
71
+ creationDate: unmarshalDate(data.creation_date),
72
+ defaultBootscript: data.default_bootscript ? unmarshalBootscript(data.default_bootscript) : void 0,
73
+ extraVolumes: unmarshalMapOfObject(data.extra_volumes, unmarshalVolume),
74
+ fromServer: data.from_server,
75
+ id: data.id,
76
+ modificationDate: unmarshalDate(data.modification_date),
77
+ name: data.name,
78
+ organization: data.organization,
79
+ project: data.project,
80
+ public: data.public,
81
+ rootVolume: data.root_volume ? unmarshalVolumeSummary(data.root_volume) : void 0,
82
+ state: data.state,
83
+ tags: data.tags,
84
+ zone: data.zone
85
+ };
86
+ };
87
+ var unmarshalPlacementGroup = (data) => {
88
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PlacementGroup' failed as data isn't a dictionary.`);
89
+ return {
90
+ id: data.id,
91
+ name: data.name,
92
+ organization: data.organization,
93
+ policyMode: data.policy_mode,
94
+ policyRespected: data.policy_respected,
95
+ policyType: data.policy_type,
96
+ project: data.project,
97
+ tags: data.tags,
98
+ zone: data.zone
99
+ };
100
+ };
101
+ var unmarshalSecurityGroupSummary = (data) => {
102
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SecurityGroupSummary' failed as data isn't a dictionary.`);
103
+ return {
104
+ id: data.id,
105
+ name: data.name
106
+ };
107
+ };
108
+ var unmarshalServerFilesystem = (data) => {
109
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerFilesystem' failed as data isn't a dictionary.`);
110
+ return {
111
+ filesystemId: data.filesystem_id,
112
+ state: data.state
113
+ };
114
+ };
115
+ var unmarshalServerIp = (data) => {
116
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerIp' failed as data isn't a dictionary.`);
117
+ return {
118
+ address: data.address,
119
+ dynamic: data.dynamic,
120
+ family: data.family,
121
+ gateway: data.gateway,
122
+ id: data.id,
123
+ ipamId: data.ipam_id,
124
+ netmask: data.netmask,
125
+ provisioningMode: data.provisioning_mode,
126
+ state: data.state,
127
+ tags: data.tags
128
+ };
129
+ };
130
+ var unmarshalServerIpv6 = (data) => {
131
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerIpv6' failed as data isn't a dictionary.`);
132
+ return {
133
+ address: data.address,
134
+ gateway: data.gateway,
135
+ netmask: data.netmask
136
+ };
137
+ };
138
+ var unmarshalServerLocation = (data) => {
139
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerLocation' failed as data isn't a dictionary.`);
140
+ return {
141
+ clusterId: data.cluster_id,
142
+ hypervisorId: data.hypervisor_id,
143
+ nodeId: data.node_id,
144
+ platformId: data.platform_id,
145
+ zoneId: data.zone_id
146
+ };
147
+ };
148
+ var unmarshalServerMaintenance = (data) => {
149
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerMaintenance' failed as data isn't a dictionary.`);
150
+ return {
151
+ reason: data.reason,
152
+ startDate: unmarshalDate(data.start_date)
153
+ };
154
+ };
155
+ var unmarshalVolumeServer = (data) => {
156
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeServer' failed as data isn't a dictionary.`);
157
+ return {
158
+ boot: data.boot,
159
+ creationDate: unmarshalDate(data.creation_date),
160
+ exportUri: data.export_uri,
161
+ id: data.id,
162
+ modificationDate: unmarshalDate(data.modification_date),
163
+ name: data.name,
164
+ organization: data.organization,
165
+ project: data.project,
166
+ server: data.server ? unmarshalServerSummary(data.server) : void 0,
167
+ size: data.size,
168
+ state: data.state ? data.state : void 0,
169
+ volumeType: data.volume_type,
170
+ zone: data.zone
171
+ };
172
+ };
173
+ var unmarshalServer = (data) => {
174
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Server' failed as data isn't a dictionary.`);
175
+ return {
176
+ adminPasswordEncryptedValue: data.admin_password_encrypted_value,
177
+ adminPasswordEncryptionSshKeyId: data.admin_password_encryption_ssh_key_id,
178
+ allowedActions: data.allowed_actions,
179
+ arch: data.arch,
180
+ bootType: data.boot_type,
181
+ commercialType: data.commercial_type,
182
+ creationDate: unmarshalDate(data.creation_date),
183
+ dns: data.dns,
184
+ dynamicIpRequired: data.dynamic_ip_required,
185
+ enableIpv6: data.enable_ipv6,
186
+ endOfService: data.end_of_service,
187
+ filesystems: unmarshalArrayOfObject(data.filesystems, unmarshalServerFilesystem),
188
+ hostname: data.hostname,
189
+ id: data.id,
190
+ image: data.image ? unmarshalImage(data.image) : void 0,
191
+ ipv6: data.ipv6 ? unmarshalServerIpv6(data.ipv6) : void 0,
192
+ location: data.location ? unmarshalServerLocation(data.location) : void 0,
193
+ macAddress: data.mac_address,
194
+ maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalServerMaintenance),
195
+ modificationDate: unmarshalDate(data.modification_date),
196
+ name: data.name,
197
+ organization: data.organization,
198
+ placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0,
199
+ privateIp: data.private_ip,
200
+ privateNics: unmarshalArrayOfObject(data.private_nics, unmarshalPrivateNIC),
201
+ project: data.project,
202
+ protected: data.protected,
203
+ publicIp: data.public_ip ? unmarshalServerIp(data.public_ip) : void 0,
204
+ publicIps: unmarshalArrayOfObject(data.public_ips, unmarshalServerIp),
205
+ routedIpEnabled: data.routed_ip_enabled,
206
+ securityGroup: data.security_group ? unmarshalSecurityGroupSummary(data.security_group) : void 0,
207
+ state: data.state,
208
+ stateDetail: data.state_detail,
209
+ tags: data.tags,
210
+ volumes: unmarshalMapOfObject(data.volumes, unmarshalVolumeServer),
211
+ zone: data.zone
212
+ };
273
213
  };
274
214
  const unmarshalAttachServerFileSystemResponse = (data) => {
275
- if (!isJSONObject(data)) {
276
- throw new TypeError(
277
- `Unmarshalling the type 'AttachServerFileSystemResponse' failed as data isn't a dictionary.`
278
- );
279
- }
280
- return {
281
- server: data.server ? unmarshalServer(data.server) : void 0
282
- };
215
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AttachServerFileSystemResponse' failed as data isn't a dictionary.`);
216
+ return { server: data.server ? unmarshalServer(data.server) : void 0 };
283
217
  };
284
218
  const unmarshalAttachServerVolumeResponse = (data) => {
285
- if (!isJSONObject(data)) {
286
- throw new TypeError(
287
- `Unmarshalling the type 'AttachServerVolumeResponse' failed as data isn't a dictionary.`
288
- );
289
- }
290
- return {
291
- server: data.server ? unmarshalServer(data.server) : void 0
292
- };
219
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AttachServerVolumeResponse' failed as data isn't a dictionary.`);
220
+ return { server: data.server ? unmarshalServer(data.server) : void 0 };
293
221
  };
294
222
  const unmarshalCreateImageResponse = (data) => {
295
- if (!isJSONObject(data)) {
296
- throw new TypeError(
297
- `Unmarshalling the type 'CreateImageResponse' failed as data isn't a dictionary.`
298
- );
299
- }
300
- return {
301
- image: data.image ? unmarshalImage(data.image) : void 0
302
- };
303
- };
304
- const unmarshalIp = (data) => {
305
- if (!isJSONObject(data)) {
306
- throw new TypeError(
307
- `Unmarshalling the type 'Ip' failed as data isn't a dictionary.`
308
- );
309
- }
310
- return {
311
- address: data.address,
312
- id: data.id,
313
- ipamId: data.ipam_id,
314
- organization: data.organization,
315
- prefix: data.prefix,
316
- project: data.project,
317
- reverse: data.reverse,
318
- server: data.server ? unmarshalServerSummary(data.server) : void 0,
319
- state: data.state,
320
- tags: data.tags,
321
- type: data.type,
322
- zone: data.zone
323
- };
223
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateImageResponse' failed as data isn't a dictionary.`);
224
+ return { image: data.image ? unmarshalImage(data.image) : void 0 };
225
+ };
226
+ var unmarshalIp = (data) => {
227
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Ip' failed as data isn't a dictionary.`);
228
+ return {
229
+ address: data.address,
230
+ id: data.id,
231
+ ipamId: data.ipam_id,
232
+ organization: data.organization,
233
+ prefix: data.prefix,
234
+ project: data.project,
235
+ reverse: data.reverse,
236
+ server: data.server ? unmarshalServerSummary(data.server) : void 0,
237
+ state: data.state,
238
+ tags: data.tags,
239
+ type: data.type,
240
+ zone: data.zone
241
+ };
324
242
  };
325
243
  const unmarshalCreateIpResponse = (data) => {
326
- if (!isJSONObject(data)) {
327
- throw new TypeError(
328
- `Unmarshalling the type 'CreateIpResponse' failed as data isn't a dictionary.`
329
- );
330
- }
331
- return {
332
- ip: data.ip ? unmarshalIp(data.ip) : void 0
333
- };
244
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateIpResponse' failed as data isn't a dictionary.`);
245
+ return { ip: data.ip ? unmarshalIp(data.ip) : void 0 };
334
246
  };
335
247
  const unmarshalCreatePlacementGroupResponse = (data) => {
336
- if (!isJSONObject(data)) {
337
- throw new TypeError(
338
- `Unmarshalling the type 'CreatePlacementGroupResponse' failed as data isn't a dictionary.`
339
- );
340
- }
341
- return {
342
- placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0
343
- };
248
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreatePlacementGroupResponse' failed as data isn't a dictionary.`);
249
+ return { placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0 };
344
250
  };
345
251
  const unmarshalCreatePrivateNICResponse = (data) => {
346
- if (!isJSONObject(data)) {
347
- throw new TypeError(
348
- `Unmarshalling the type 'CreatePrivateNICResponse' failed as data isn't a dictionary.`
349
- );
350
- }
351
- return {
352
- privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : void 0
353
- };
354
- };
355
- const unmarshalSecurityGroup = (data) => {
356
- if (!isJSONObject(data)) {
357
- throw new TypeError(
358
- `Unmarshalling the type 'SecurityGroup' failed as data isn't a dictionary.`
359
- );
360
- }
361
- return {
362
- creationDate: unmarshalDate(data.creation_date),
363
- description: data.description,
364
- enableDefaultSecurity: data.enable_default_security,
365
- id: data.id,
366
- inboundDefaultPolicy: data.inbound_default_policy,
367
- modificationDate: unmarshalDate(data.modification_date),
368
- name: data.name,
369
- organization: data.organization,
370
- organizationDefault: data.organization_default,
371
- outboundDefaultPolicy: data.outbound_default_policy,
372
- project: data.project,
373
- projectDefault: data.project_default,
374
- servers: unmarshalArrayOfObject(data.servers, unmarshalServerSummary),
375
- state: data.state,
376
- stateful: data.stateful,
377
- tags: data.tags,
378
- zone: data.zone
379
- };
252
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreatePrivateNICResponse' failed as data isn't a dictionary.`);
253
+ return { privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : void 0 };
254
+ };
255
+ var unmarshalSecurityGroup = (data) => {
256
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SecurityGroup' failed as data isn't a dictionary.`);
257
+ return {
258
+ creationDate: unmarshalDate(data.creation_date),
259
+ description: data.description,
260
+ enableDefaultSecurity: data.enable_default_security,
261
+ id: data.id,
262
+ inboundDefaultPolicy: data.inbound_default_policy,
263
+ modificationDate: unmarshalDate(data.modification_date),
264
+ name: data.name,
265
+ organization: data.organization,
266
+ organizationDefault: data.organization_default,
267
+ outboundDefaultPolicy: data.outbound_default_policy,
268
+ project: data.project,
269
+ projectDefault: data.project_default,
270
+ servers: unmarshalArrayOfObject(data.servers, unmarshalServerSummary),
271
+ state: data.state,
272
+ stateful: data.stateful,
273
+ tags: data.tags,
274
+ zone: data.zone
275
+ };
380
276
  };
381
277
  const unmarshalCreateSecurityGroupResponse = (data) => {
382
- if (!isJSONObject(data)) {
383
- throw new TypeError(
384
- `Unmarshalling the type 'CreateSecurityGroupResponse' failed as data isn't a dictionary.`
385
- );
386
- }
387
- return {
388
- securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0
389
- };
390
- };
391
- const unmarshalSecurityGroupRule = (data) => {
392
- if (!isJSONObject(data)) {
393
- throw new TypeError(
394
- `Unmarshalling the type 'SecurityGroupRule' failed as data isn't a dictionary.`
395
- );
396
- }
397
- return {
398
- action: data.action,
399
- destPortFrom: data.dest_port_from,
400
- destPortTo: data.dest_port_to,
401
- direction: data.direction,
402
- editable: data.editable,
403
- id: data.id,
404
- ipRange: data.ip_range,
405
- position: data.position,
406
- protocol: data.protocol,
407
- zone: data.zone
408
- };
278
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateSecurityGroupResponse' failed as data isn't a dictionary.`);
279
+ return { securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0 };
280
+ };
281
+ var unmarshalSecurityGroupRule = (data) => {
282
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SecurityGroupRule' failed as data isn't a dictionary.`);
283
+ return {
284
+ action: data.action,
285
+ destPortFrom: data.dest_port_from,
286
+ destPortTo: data.dest_port_to,
287
+ direction: data.direction,
288
+ editable: data.editable,
289
+ id: data.id,
290
+ ipRange: data.ip_range,
291
+ position: data.position,
292
+ protocol: data.protocol,
293
+ zone: data.zone
294
+ };
409
295
  };
410
296
  const unmarshalCreateSecurityGroupRuleResponse = (data) => {
411
- if (!isJSONObject(data)) {
412
- throw new TypeError(
413
- `Unmarshalling the type 'CreateSecurityGroupRuleResponse' failed as data isn't a dictionary.`
414
- );
415
- }
416
- return {
417
- rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0
418
- };
297
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateSecurityGroupRuleResponse' failed as data isn't a dictionary.`);
298
+ return { rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0 };
419
299
  };
420
300
  const unmarshalCreateServerResponse = (data) => {
421
- if (!isJSONObject(data)) {
422
- throw new TypeError(
423
- `Unmarshalling the type 'CreateServerResponse' failed as data isn't a dictionary.`
424
- );
425
- }
426
- return {
427
- server: data.server ? unmarshalServer(data.server) : void 0
428
- };
429
- };
430
- const unmarshalSnapshotBaseVolume = (data) => {
431
- if (!isJSONObject(data)) {
432
- throw new TypeError(
433
- `Unmarshalling the type 'SnapshotBaseVolume' failed as data isn't a dictionary.`
434
- );
435
- }
436
- return {
437
- id: data.id,
438
- name: data.name
439
- };
440
- };
441
- const unmarshalSnapshot = (data) => {
442
- if (!isJSONObject(data)) {
443
- throw new TypeError(
444
- `Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`
445
- );
446
- }
447
- return {
448
- baseVolume: data.base_volume ? unmarshalSnapshotBaseVolume(data.base_volume) : void 0,
449
- creationDate: unmarshalDate(data.creation_date),
450
- errorReason: data.error_reason,
451
- id: data.id,
452
- modificationDate: unmarshalDate(data.modification_date),
453
- name: data.name,
454
- organization: data.organization,
455
- project: data.project,
456
- size: data.size,
457
- state: data.state,
458
- tags: data.tags,
459
- volumeType: data.volume_type,
460
- zone: data.zone
461
- };
462
- };
463
- const unmarshalTask = (data) => {
464
- if (!isJSONObject(data)) {
465
- throw new TypeError(
466
- `Unmarshalling the type 'Task' failed as data isn't a dictionary.`
467
- );
468
- }
469
- return {
470
- description: data.description,
471
- hrefFrom: data.href_from,
472
- hrefResult: data.href_result,
473
- id: data.id,
474
- progress: data.progress,
475
- startedAt: unmarshalDate(data.started_at),
476
- status: data.status,
477
- terminatedAt: unmarshalDate(data.terminated_at),
478
- zone: data.zone
479
- };
301
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateServerResponse' failed as data isn't a dictionary.`);
302
+ return { server: data.server ? unmarshalServer(data.server) : void 0 };
303
+ };
304
+ var unmarshalSnapshotBaseVolume = (data) => {
305
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SnapshotBaseVolume' failed as data isn't a dictionary.`);
306
+ return {
307
+ id: data.id,
308
+ name: data.name
309
+ };
310
+ };
311
+ var unmarshalSnapshot = (data) => {
312
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);
313
+ return {
314
+ baseVolume: data.base_volume ? unmarshalSnapshotBaseVolume(data.base_volume) : void 0,
315
+ creationDate: unmarshalDate(data.creation_date),
316
+ errorReason: data.error_reason,
317
+ id: data.id,
318
+ modificationDate: unmarshalDate(data.modification_date),
319
+ name: data.name,
320
+ organization: data.organization,
321
+ project: data.project,
322
+ size: data.size,
323
+ state: data.state,
324
+ tags: data.tags,
325
+ volumeType: data.volume_type,
326
+ zone: data.zone
327
+ };
328
+ };
329
+ var unmarshalTask = (data) => {
330
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Task' failed as data isn't a dictionary.`);
331
+ return {
332
+ description: data.description,
333
+ hrefFrom: data.href_from,
334
+ hrefResult: data.href_result,
335
+ id: data.id,
336
+ progress: data.progress,
337
+ startedAt: unmarshalDate(data.started_at),
338
+ status: data.status,
339
+ terminatedAt: unmarshalDate(data.terminated_at),
340
+ zone: data.zone
341
+ };
480
342
  };
481
343
  const unmarshalCreateSnapshotResponse = (data) => {
482
- if (!isJSONObject(data)) {
483
- throw new TypeError(
484
- `Unmarshalling the type 'CreateSnapshotResponse' failed as data isn't a dictionary.`
485
- );
486
- }
487
- return {
488
- snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0,
489
- task: data.task ? unmarshalTask(data.task) : void 0
490
- };
344
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateSnapshotResponse' failed as data isn't a dictionary.`);
345
+ return {
346
+ snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0,
347
+ task: data.task ? unmarshalTask(data.task) : void 0
348
+ };
491
349
  };
492
350
  const unmarshalCreateVolumeResponse = (data) => {
493
- if (!isJSONObject(data)) {
494
- throw new TypeError(
495
- `Unmarshalling the type 'CreateVolumeResponse' failed as data isn't a dictionary.`
496
- );
497
- }
498
- return {
499
- volume: data.volume ? unmarshalVolume(data.volume) : void 0
500
- };
351
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateVolumeResponse' failed as data isn't a dictionary.`);
352
+ return { volume: data.volume ? unmarshalVolume(data.volume) : void 0 };
501
353
  };
502
354
  const unmarshalDetachServerFileSystemResponse = (data) => {
503
- if (!isJSONObject(data)) {
504
- throw new TypeError(
505
- `Unmarshalling the type 'DetachServerFileSystemResponse' failed as data isn't a dictionary.`
506
- );
507
- }
508
- return {
509
- server: data.server ? unmarshalServer(data.server) : void 0
510
- };
355
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DetachServerFileSystemResponse' failed as data isn't a dictionary.`);
356
+ return { server: data.server ? unmarshalServer(data.server) : void 0 };
511
357
  };
512
358
  const unmarshalDetachServerVolumeResponse = (data) => {
513
- if (!isJSONObject(data)) {
514
- throw new TypeError(
515
- `Unmarshalling the type 'DetachServerVolumeResponse' failed as data isn't a dictionary.`
516
- );
517
- }
518
- return {
519
- server: data.server ? unmarshalServer(data.server) : void 0
520
- };
359
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DetachServerVolumeResponse' failed as data isn't a dictionary.`);
360
+ return { server: data.server ? unmarshalServer(data.server) : void 0 };
521
361
  };
522
362
  const unmarshalExportSnapshotResponse = (data) => {
523
- if (!isJSONObject(data)) {
524
- throw new TypeError(
525
- `Unmarshalling the type 'ExportSnapshotResponse' failed as data isn't a dictionary.`
526
- );
527
- }
528
- return {
529
- task: data.task ? unmarshalTask(data.task) : void 0
530
- };
531
- };
532
- const unmarshalDashboard = (data) => {
533
- if (!isJSONObject(data)) {
534
- throw new TypeError(
535
- `Unmarshalling the type 'Dashboard' failed as data isn't a dictionary.`
536
- );
537
- }
538
- return {
539
- imagesCount: data.images_count,
540
- ipsCount: data.ips_count,
541
- ipsUnused: data.ips_unused,
542
- placementGroupsCount: data.placement_groups_count,
543
- privateNicsCount: data.private_nics_count,
544
- runningServersCount: data.running_servers_count,
545
- securityGroupsCount: data.security_groups_count,
546
- serversByTypes: data.servers_by_types,
547
- serversCount: data.servers_count,
548
- snapshotsCount: data.snapshots_count,
549
- volumesBSsdCount: data.volumes_b_ssd_count,
550
- volumesBSsdTotalSize: data.volumes_b_ssd_total_size,
551
- volumesCount: data.volumes_count,
552
- volumesLSsdCount: data.volumes_l_ssd_count,
553
- volumesLSsdTotalSize: data.volumes_l_ssd_total_size,
554
- volumesScratchCount: data.volumes_scratch_count
555
- };
363
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ExportSnapshotResponse' failed as data isn't a dictionary.`);
364
+ return { task: data.task ? unmarshalTask(data.task) : void 0 };
365
+ };
366
+ var unmarshalDashboard = (data) => {
367
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Dashboard' failed as data isn't a dictionary.`);
368
+ return {
369
+ imagesCount: data.images_count,
370
+ ipsCount: data.ips_count,
371
+ ipsUnused: data.ips_unused,
372
+ placementGroupsCount: data.placement_groups_count,
373
+ privateNicsCount: data.private_nics_count,
374
+ runningServersCount: data.running_servers_count,
375
+ securityGroupsCount: data.security_groups_count,
376
+ serversByTypes: data.servers_by_types,
377
+ serversCount: data.servers_count,
378
+ snapshotsCount: data.snapshots_count,
379
+ volumesBSsdCount: data.volumes_b_ssd_count,
380
+ volumesBSsdTotalSize: data.volumes_b_ssd_total_size,
381
+ volumesCount: data.volumes_count,
382
+ volumesLSsdCount: data.volumes_l_ssd_count,
383
+ volumesLSsdTotalSize: data.volumes_l_ssd_total_size,
384
+ volumesScratchCount: data.volumes_scratch_count
385
+ };
556
386
  };
557
387
  const unmarshalGetDashboardResponse = (data) => {
558
- if (!isJSONObject(data)) {
559
- throw new TypeError(
560
- `Unmarshalling the type 'GetDashboardResponse' failed as data isn't a dictionary.`
561
- );
562
- }
563
- return {
564
- dashboard: data.dashboard ? unmarshalDashboard(data.dashboard) : void 0
565
- };
388
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetDashboardResponse' failed as data isn't a dictionary.`);
389
+ return { dashboard: data.dashboard ? unmarshalDashboard(data.dashboard) : void 0 };
566
390
  };
567
391
  const unmarshalGetImageResponse = (data) => {
568
- if (!isJSONObject(data)) {
569
- throw new TypeError(
570
- `Unmarshalling the type 'GetImageResponse' failed as data isn't a dictionary.`
571
- );
572
- }
573
- return {
574
- image: data.image ? unmarshalImage(data.image) : void 0
575
- };
392
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetImageResponse' failed as data isn't a dictionary.`);
393
+ return { image: data.image ? unmarshalImage(data.image) : void 0 };
576
394
  };
577
395
  const unmarshalGetIpResponse = (data) => {
578
- if (!isJSONObject(data)) {
579
- throw new TypeError(
580
- `Unmarshalling the type 'GetIpResponse' failed as data isn't a dictionary.`
581
- );
582
- }
583
- return {
584
- ip: data.ip ? unmarshalIp(data.ip) : void 0
585
- };
396
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetIpResponse' failed as data isn't a dictionary.`);
397
+ return { ip: data.ip ? unmarshalIp(data.ip) : void 0 };
586
398
  };
587
399
  const unmarshalGetPlacementGroupResponse = (data) => {
588
- if (!isJSONObject(data)) {
589
- throw new TypeError(
590
- `Unmarshalling the type 'GetPlacementGroupResponse' failed as data isn't a dictionary.`
591
- );
592
- }
593
- return {
594
- placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0
595
- };
596
- };
597
- const unmarshalPlacementGroupServer = (data) => {
598
- if (!isJSONObject(data)) {
599
- throw new TypeError(
600
- `Unmarshalling the type 'PlacementGroupServer' failed as data isn't a dictionary.`
601
- );
602
- }
603
- return {
604
- id: data.id,
605
- name: data.name,
606
- policyRespected: data.policy_respected
607
- };
400
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetPlacementGroupResponse' failed as data isn't a dictionary.`);
401
+ return { placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0 };
402
+ };
403
+ var unmarshalPlacementGroupServer = (data) => {
404
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PlacementGroupServer' failed as data isn't a dictionary.`);
405
+ return {
406
+ id: data.id,
407
+ name: data.name,
408
+ policyRespected: data.policy_respected
409
+ };
608
410
  };
609
411
  const unmarshalGetPlacementGroupServersResponse = (data) => {
610
- if (!isJSONObject(data)) {
611
- throw new TypeError(
612
- `Unmarshalling the type 'GetPlacementGroupServersResponse' failed as data isn't a dictionary.`
613
- );
614
- }
615
- return {
616
- servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer)
617
- };
412
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetPlacementGroupServersResponse' failed as data isn't a dictionary.`);
413
+ return { servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer) };
618
414
  };
619
415
  const unmarshalGetPrivateNICResponse = (data) => {
620
- if (!isJSONObject(data)) {
621
- throw new TypeError(
622
- `Unmarshalling the type 'GetPrivateNICResponse' failed as data isn't a dictionary.`
623
- );
624
- }
625
- return {
626
- privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : void 0
627
- };
416
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetPrivateNICResponse' failed as data isn't a dictionary.`);
417
+ return { privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : void 0 };
628
418
  };
629
419
  const unmarshalGetSecurityGroupResponse = (data) => {
630
- if (!isJSONObject(data)) {
631
- throw new TypeError(
632
- `Unmarshalling the type 'GetSecurityGroupResponse' failed as data isn't a dictionary.`
633
- );
634
- }
635
- return {
636
- securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0
637
- };
420
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetSecurityGroupResponse' failed as data isn't a dictionary.`);
421
+ return { securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0 };
638
422
  };
639
423
  const unmarshalGetSecurityGroupRuleResponse = (data) => {
640
- if (!isJSONObject(data)) {
641
- throw new TypeError(
642
- `Unmarshalling the type 'GetSecurityGroupRuleResponse' failed as data isn't a dictionary.`
643
- );
644
- }
645
- return {
646
- rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0
647
- };
424
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetSecurityGroupRuleResponse' failed as data isn't a dictionary.`);
425
+ return { rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0 };
648
426
  };
649
427
  const unmarshalGetServerResponse = (data) => {
650
- if (!isJSONObject(data)) {
651
- throw new TypeError(
652
- `Unmarshalling the type 'GetServerResponse' failed as data isn't a dictionary.`
653
- );
654
- }
655
- return {
656
- server: data.server ? unmarshalServer(data.server) : void 0
657
- };
658
- };
659
- const unmarshalGetServerTypesAvailabilityResponseAvailability = (data) => {
660
- if (!isJSONObject(data)) {
661
- throw new TypeError(
662
- `Unmarshalling the type 'GetServerTypesAvailabilityResponseAvailability' failed as data isn't a dictionary.`
663
- );
664
- }
665
- return {
666
- availability: data.availability
667
- };
428
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetServerResponse' failed as data isn't a dictionary.`);
429
+ return { server: data.server ? unmarshalServer(data.server) : void 0 };
430
+ };
431
+ var unmarshalGetServerTypesAvailabilityResponseAvailability = (data) => {
432
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetServerTypesAvailabilityResponseAvailability' failed as data isn't a dictionary.`);
433
+ return { availability: data.availability };
668
434
  };
669
435
  const unmarshalGetServerTypesAvailabilityResponse = (data) => {
670
- if (!isJSONObject(data)) {
671
- throw new TypeError(
672
- `Unmarshalling the type 'GetServerTypesAvailabilityResponse' failed as data isn't a dictionary.`
673
- );
674
- }
675
- return {
676
- servers: unmarshalMapOfObject(data.servers, unmarshalGetServerTypesAvailabilityResponseAvailability),
677
- totalCount: data.total_count
678
- };
436
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetServerTypesAvailabilityResponse' failed as data isn't a dictionary.`);
437
+ return {
438
+ servers: unmarshalMapOfObject(data.servers, unmarshalGetServerTypesAvailabilityResponseAvailability),
439
+ totalCount: data.total_count
440
+ };
679
441
  };
680
442
  const unmarshalGetSnapshotResponse = (data) => {
681
- if (!isJSONObject(data)) {
682
- throw new TypeError(
683
- `Unmarshalling the type 'GetSnapshotResponse' failed as data isn't a dictionary.`
684
- );
685
- }
686
- return {
687
- snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0
688
- };
443
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetSnapshotResponse' failed as data isn't a dictionary.`);
444
+ return { snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0 };
689
445
  };
690
446
  const unmarshalGetVolumeResponse = (data) => {
691
- if (!isJSONObject(data)) {
692
- throw new TypeError(
693
- `Unmarshalling the type 'GetVolumeResponse' failed as data isn't a dictionary.`
694
- );
695
- }
696
- return {
697
- volume: data.volume ? unmarshalVolume(data.volume) : void 0
698
- };
447
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetVolumeResponse' failed as data isn't a dictionary.`);
448
+ return { volume: data.volume ? unmarshalVolume(data.volume) : void 0 };
699
449
  };
700
450
  const unmarshalListImagesResponse = (data) => {
701
- if (!isJSONObject(data)) {
702
- throw new TypeError(
703
- `Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`
704
- );
705
- }
706
- return {
707
- images: unmarshalArrayOfObject(data.images, unmarshalImage),
708
- totalCount: data.total_count
709
- };
451
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`);
452
+ return {
453
+ images: unmarshalArrayOfObject(data.images, unmarshalImage),
454
+ totalCount: data.total_count
455
+ };
710
456
  };
711
457
  const unmarshalListIpsResponse = (data) => {
712
- if (!isJSONObject(data)) {
713
- throw new TypeError(
714
- `Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.`
715
- );
716
- }
717
- return {
718
- ips: unmarshalArrayOfObject(data.ips, unmarshalIp),
719
- totalCount: data.total_count
720
- };
458
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.`);
459
+ return {
460
+ ips: unmarshalArrayOfObject(data.ips, unmarshalIp),
461
+ totalCount: data.total_count
462
+ };
721
463
  };
722
464
  const unmarshalListPlacementGroupsResponse = (data) => {
723
- if (!isJSONObject(data)) {
724
- throw new TypeError(
725
- `Unmarshalling the type 'ListPlacementGroupsResponse' failed as data isn't a dictionary.`
726
- );
727
- }
728
- return {
729
- placementGroups: unmarshalArrayOfObject(data.placement_groups, unmarshalPlacementGroup),
730
- totalCount: data.total_count
731
- };
465
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPlacementGroupsResponse' failed as data isn't a dictionary.`);
466
+ return {
467
+ placementGroups: unmarshalArrayOfObject(data.placement_groups, unmarshalPlacementGroup),
468
+ totalCount: data.total_count
469
+ };
732
470
  };
733
471
  const unmarshalListPrivateNICsResponse = (data) => {
734
- if (!isJSONObject(data)) {
735
- throw new TypeError(
736
- `Unmarshalling the type 'ListPrivateNICsResponse' failed as data isn't a dictionary.`
737
- );
738
- }
739
- return {
740
- privateNics: unmarshalArrayOfObject(data.private_nics, unmarshalPrivateNIC),
741
- totalCount: data.total_count
742
- };
472
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPrivateNICsResponse' failed as data isn't a dictionary.`);
473
+ return {
474
+ privateNics: unmarshalArrayOfObject(data.private_nics, unmarshalPrivateNIC),
475
+ totalCount: data.total_count
476
+ };
743
477
  };
744
478
  const unmarshalListSecurityGroupRulesResponse = (data) => {
745
- if (!isJSONObject(data)) {
746
- throw new TypeError(
747
- `Unmarshalling the type 'ListSecurityGroupRulesResponse' failed as data isn't a dictionary.`
748
- );
749
- }
750
- return {
751
- rules: unmarshalArrayOfObject(data.rules, unmarshalSecurityGroupRule),
752
- totalCount: data.total_count
753
- };
479
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSecurityGroupRulesResponse' failed as data isn't a dictionary.`);
480
+ return {
481
+ rules: unmarshalArrayOfObject(data.rules, unmarshalSecurityGroupRule),
482
+ totalCount: data.total_count
483
+ };
754
484
  };
755
485
  const unmarshalListSecurityGroupsResponse = (data) => {
756
- if (!isJSONObject(data)) {
757
- throw new TypeError(
758
- `Unmarshalling the type 'ListSecurityGroupsResponse' failed as data isn't a dictionary.`
759
- );
760
- }
761
- return {
762
- securityGroups: unmarshalArrayOfObject(data.security_groups, unmarshalSecurityGroup),
763
- totalCount: data.total_count
764
- };
486
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSecurityGroupsResponse' failed as data isn't a dictionary.`);
487
+ return {
488
+ securityGroups: unmarshalArrayOfObject(data.security_groups, unmarshalSecurityGroup),
489
+ totalCount: data.total_count
490
+ };
765
491
  };
766
492
  const unmarshalListServerActionsResponse = (data) => {
767
- if (!isJSONObject(data)) {
768
- throw new TypeError(
769
- `Unmarshalling the type 'ListServerActionsResponse' failed as data isn't a dictionary.`
770
- );
771
- }
772
- return {
773
- actions: data.actions
774
- };
493
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListServerActionsResponse' failed as data isn't a dictionary.`);
494
+ return { actions: data.actions };
775
495
  };
776
496
  const unmarshalListServerUserDataResponse = (data) => {
777
- if (!isJSONObject(data)) {
778
- throw new TypeError(
779
- `Unmarshalling the type 'ListServerUserDataResponse' failed as data isn't a dictionary.`
780
- );
781
- }
782
- return {
783
- userData: data.user_data
784
- };
497
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListServerUserDataResponse' failed as data isn't a dictionary.`);
498
+ return { userData: data.user_data };
785
499
  };
786
500
  const unmarshalListServersResponse = (data) => {
787
- if (!isJSONObject(data)) {
788
- throw new TypeError(
789
- `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`
790
- );
791
- }
792
- return {
793
- servers: unmarshalArrayOfObject(data.servers, unmarshalServer),
794
- totalCount: data.total_count
795
- };
796
- };
797
- const unmarshalServerTypeNetworkInterface = (data) => {
798
- if (!isJSONObject(data)) {
799
- throw new TypeError(
800
- `Unmarshalling the type 'ServerTypeNetworkInterface' failed as data isn't a dictionary.`
801
- );
802
- }
803
- return {
804
- internalBandwidth: data.internal_bandwidth,
805
- internetBandwidth: data.internet_bandwidth
806
- };
807
- };
808
- const unmarshalServerTypeVolumeConstraintSizes = (data) => {
809
- if (!isJSONObject(data)) {
810
- throw new TypeError(
811
- `Unmarshalling the type 'ServerTypeVolumeConstraintSizes' failed as data isn't a dictionary.`
812
- );
813
- }
814
- return {
815
- maxSize: data.max_size,
816
- minSize: data.min_size
817
- };
818
- };
819
- const unmarshalServerTypeCapabilities = (data) => {
820
- if (!isJSONObject(data)) {
821
- throw new TypeError(
822
- `Unmarshalling the type 'ServerTypeCapabilities' failed as data isn't a dictionary.`
823
- );
824
- }
825
- return {
826
- blockStorage: data.block_storage,
827
- bootTypes: data.boot_types,
828
- maxFileSystems: data.max_file_systems
829
- };
830
- };
831
- const unmarshalServerTypeGPUInfo = (data) => {
832
- if (!isJSONObject(data)) {
833
- throw new TypeError(
834
- `Unmarshalling the type 'ServerTypeGPUInfo' failed as data isn't a dictionary.`
835
- );
836
- }
837
- return {
838
- gpuManufacturer: data.gpu_manufacturer,
839
- gpuMemory: data.gpu_memory,
840
- gpuName: data.gpu_name
841
- };
842
- };
843
- const unmarshalServerTypeNetwork = (data) => {
844
- if (!isJSONObject(data)) {
845
- throw new TypeError(
846
- `Unmarshalling the type 'ServerTypeNetwork' failed as data isn't a dictionary.`
847
- );
848
- }
849
- return {
850
- interfaces: unmarshalArrayOfObject(data.interfaces, unmarshalServerTypeNetworkInterface),
851
- ipv6Support: data.ipv6_support,
852
- sumInternalBandwidth: data.sum_internal_bandwidth,
853
- sumInternetBandwidth: data.sum_internet_bandwidth
854
- };
855
- };
856
- const unmarshalServerTypeVolumeConstraintsByType = (data) => {
857
- if (!isJSONObject(data)) {
858
- throw new TypeError(
859
- `Unmarshalling the type 'ServerTypeVolumeConstraintsByType' failed as data isn't a dictionary.`
860
- );
861
- }
862
- return {
863
- lSsd: data.l_ssd ? unmarshalServerTypeVolumeConstraintSizes(data.l_ssd) : void 0
864
- };
865
- };
866
- const unmarshalServerType = (data) => {
867
- if (!isJSONObject(data)) {
868
- throw new TypeError(
869
- `Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`
870
- );
871
- }
872
- return {
873
- altNames: data.alt_names,
874
- arch: data.arch,
875
- blockBandwidth: data.block_bandwidth,
876
- capabilities: data.capabilities ? unmarshalServerTypeCapabilities(data.capabilities) : void 0,
877
- endOfService: data.end_of_service,
878
- gpu: data.gpu,
879
- gpuInfo: data.gpu_info ? unmarshalServerTypeGPUInfo(data.gpu_info) : void 0,
880
- hourlyPrice: data.hourly_price,
881
- monthlyPrice: data.monthly_price,
882
- ncpus: data.ncpus,
883
- network: data.network ? unmarshalServerTypeNetwork(data.network) : void 0,
884
- perVolumeConstraint: data.per_volume_constraint ? unmarshalServerTypeVolumeConstraintsByType(data.per_volume_constraint) : void 0,
885
- ram: data.ram,
886
- scratchStorageMaxSize: data.scratch_storage_max_size,
887
- scratchStorageMaxVolumesCount: data.scratch_storage_max_volumes_count,
888
- volumesConstraint: data.volumes_constraint ? unmarshalServerTypeVolumeConstraintSizes(data.volumes_constraint) : void 0
889
- };
501
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`);
502
+ return {
503
+ servers: unmarshalArrayOfObject(data.servers, unmarshalServer),
504
+ totalCount: data.total_count
505
+ };
506
+ };
507
+ var unmarshalServerTypeNetworkInterface = (data) => {
508
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerTypeNetworkInterface' failed as data isn't a dictionary.`);
509
+ return {
510
+ internalBandwidth: data.internal_bandwidth,
511
+ internetBandwidth: data.internet_bandwidth
512
+ };
513
+ };
514
+ var unmarshalServerTypeVolumeConstraintSizes = (data) => {
515
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerTypeVolumeConstraintSizes' failed as data isn't a dictionary.`);
516
+ return {
517
+ maxSize: data.max_size,
518
+ minSize: data.min_size
519
+ };
520
+ };
521
+ var unmarshalServerTypeCapabilities = (data) => {
522
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerTypeCapabilities' failed as data isn't a dictionary.`);
523
+ return {
524
+ blockStorage: data.block_storage,
525
+ bootTypes: data.boot_types,
526
+ maxFileSystems: data.max_file_systems
527
+ };
528
+ };
529
+ var unmarshalServerTypeGPUInfo = (data) => {
530
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerTypeGPUInfo' failed as data isn't a dictionary.`);
531
+ return {
532
+ gpuManufacturer: data.gpu_manufacturer,
533
+ gpuMemory: data.gpu_memory,
534
+ gpuName: data.gpu_name
535
+ };
536
+ };
537
+ var unmarshalServerTypeNetwork = (data) => {
538
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerTypeNetwork' failed as data isn't a dictionary.`);
539
+ return {
540
+ interfaces: unmarshalArrayOfObject(data.interfaces, unmarshalServerTypeNetworkInterface),
541
+ ipv6Support: data.ipv6_support,
542
+ sumInternalBandwidth: data.sum_internal_bandwidth,
543
+ sumInternetBandwidth: data.sum_internet_bandwidth
544
+ };
545
+ };
546
+ var unmarshalServerTypeVolumeConstraintsByType = (data) => {
547
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerTypeVolumeConstraintsByType' failed as data isn't a dictionary.`);
548
+ return { lSsd: data.l_ssd ? unmarshalServerTypeVolumeConstraintSizes(data.l_ssd) : void 0 };
549
+ };
550
+ var unmarshalServerType = (data) => {
551
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`);
552
+ return {
553
+ altNames: data.alt_names,
554
+ arch: data.arch,
555
+ blockBandwidth: data.block_bandwidth,
556
+ capabilities: data.capabilities ? unmarshalServerTypeCapabilities(data.capabilities) : void 0,
557
+ endOfService: data.end_of_service,
558
+ gpu: data.gpu,
559
+ gpuInfo: data.gpu_info ? unmarshalServerTypeGPUInfo(data.gpu_info) : void 0,
560
+ hourlyPrice: data.hourly_price,
561
+ monthlyPrice: data.monthly_price,
562
+ ncpus: data.ncpus,
563
+ network: data.network ? unmarshalServerTypeNetwork(data.network) : void 0,
564
+ perVolumeConstraint: data.per_volume_constraint ? unmarshalServerTypeVolumeConstraintsByType(data.per_volume_constraint) : void 0,
565
+ ram: data.ram,
566
+ scratchStorageMaxSize: data.scratch_storage_max_size,
567
+ scratchStorageMaxVolumesCount: data.scratch_storage_max_volumes_count,
568
+ volumesConstraint: data.volumes_constraint ? unmarshalServerTypeVolumeConstraintSizes(data.volumes_constraint) : void 0
569
+ };
890
570
  };
891
571
  const unmarshalListServersTypesResponse = (data) => {
892
- if (!isJSONObject(data)) {
893
- throw new TypeError(
894
- `Unmarshalling the type 'ListServersTypesResponse' failed as data isn't a dictionary.`
895
- );
896
- }
897
- return {
898
- servers: unmarshalMapOfObject(data.servers, unmarshalServerType),
899
- totalCount: data.total_count
900
- };
572
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListServersTypesResponse' failed as data isn't a dictionary.`);
573
+ return {
574
+ servers: unmarshalMapOfObject(data.servers, unmarshalServerType),
575
+ totalCount: data.total_count
576
+ };
901
577
  };
902
578
  const unmarshalListSnapshotsResponse = (data) => {
903
- if (!isJSONObject(data)) {
904
- throw new TypeError(
905
- `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`
906
- );
907
- }
908
- return {
909
- snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
910
- totalCount: data.total_count
911
- };
579
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);
580
+ return {
581
+ snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
582
+ totalCount: data.total_count
583
+ };
912
584
  };
913
585
  const unmarshalListVolumesResponse = (data) => {
914
- if (!isJSONObject(data)) {
915
- throw new TypeError(
916
- `Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`
917
- );
918
- }
919
- return {
920
- totalCount: data.total_count,
921
- volumes: unmarshalArrayOfObject(data.volumes, unmarshalVolume)
922
- };
923
- };
924
- const unmarshalVolumeTypeCapabilities = (data) => {
925
- if (!isJSONObject(data)) {
926
- throw new TypeError(
927
- `Unmarshalling the type 'VolumeTypeCapabilities' failed as data isn't a dictionary.`
928
- );
929
- }
930
- return {
931
- snapshot: data.snapshot
932
- };
933
- };
934
- const unmarshalVolumeTypeConstraints = (data) => {
935
- if (!isJSONObject(data)) {
936
- throw new TypeError(
937
- `Unmarshalling the type 'VolumeTypeConstraints' failed as data isn't a dictionary.`
938
- );
939
- }
940
- return {
941
- max: data.max,
942
- min: data.min
943
- };
944
- };
945
- const unmarshalVolumeType = (data) => {
946
- if (!isJSONObject(data)) {
947
- throw new TypeError(
948
- `Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`
949
- );
950
- }
951
- return {
952
- capabilities: data.capabilities ? unmarshalVolumeTypeCapabilities(data.capabilities) : void 0,
953
- constraints: data.constraints ? unmarshalVolumeTypeConstraints(data.constraints) : void 0,
954
- displayName: data.display_name
955
- };
586
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`);
587
+ return {
588
+ totalCount: data.total_count,
589
+ volumes: unmarshalArrayOfObject(data.volumes, unmarshalVolume)
590
+ };
591
+ };
592
+ var unmarshalVolumeTypeCapabilities = (data) => {
593
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeTypeCapabilities' failed as data isn't a dictionary.`);
594
+ return { snapshot: data.snapshot };
595
+ };
596
+ var unmarshalVolumeTypeConstraints = (data) => {
597
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeTypeConstraints' failed as data isn't a dictionary.`);
598
+ return {
599
+ max: data.max,
600
+ min: data.min
601
+ };
602
+ };
603
+ var unmarshalVolumeType = (data) => {
604
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`);
605
+ return {
606
+ capabilities: data.capabilities ? unmarshalVolumeTypeCapabilities(data.capabilities) : void 0,
607
+ constraints: data.constraints ? unmarshalVolumeTypeConstraints(data.constraints) : void 0,
608
+ displayName: data.display_name
609
+ };
956
610
  };
957
611
  const unmarshalListVolumesTypesResponse = (data) => {
958
- if (!isJSONObject(data)) {
959
- throw new TypeError(
960
- `Unmarshalling the type 'ListVolumesTypesResponse' failed as data isn't a dictionary.`
961
- );
962
- }
963
- return {
964
- totalCount: data.total_count,
965
- volumes: unmarshalMapOfObject(data.volumes, unmarshalVolumeType)
966
- };
612
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVolumesTypesResponse' failed as data isn't a dictionary.`);
613
+ return {
614
+ totalCount: data.total_count,
615
+ volumes: unmarshalMapOfObject(data.volumes, unmarshalVolumeType)
616
+ };
967
617
  };
968
618
  const unmarshalMigrationPlan = (data) => {
969
- if (!isJSONObject(data)) {
970
- throw new TypeError(
971
- `Unmarshalling the type 'MigrationPlan' failed as data isn't a dictionary.`
972
- );
973
- }
974
- return {
975
- snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
976
- validationKey: data.validation_key,
977
- volume: data.volume ? unmarshalVolume(data.volume) : void 0
978
- };
619
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'MigrationPlan' failed as data isn't a dictionary.`);
620
+ return {
621
+ snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
622
+ validationKey: data.validation_key,
623
+ volume: data.volume ? unmarshalVolume(data.volume) : void 0
624
+ };
979
625
  };
980
626
  const unmarshalServerActionResponse = (data) => {
981
- if (!isJSONObject(data)) {
982
- throw new TypeError(
983
- `Unmarshalling the type 'ServerActionResponse' failed as data isn't a dictionary.`
984
- );
985
- }
986
- return {
987
- task: data.task ? unmarshalTask(data.task) : void 0
988
- };
627
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerActionResponse' failed as data isn't a dictionary.`);
628
+ return { task: data.task ? unmarshalTask(data.task) : void 0 };
989
629
  };
990
630
  const unmarshalServerCompatibleTypes = (data) => {
991
- if (!isJSONObject(data)) {
992
- throw new TypeError(
993
- `Unmarshalling the type 'ServerCompatibleTypes' failed as data isn't a dictionary.`
994
- );
995
- }
996
- return {
997
- compatibleTypes: data.compatible_types
998
- };
631
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerCompatibleTypes' failed as data isn't a dictionary.`);
632
+ return { compatibleTypes: data.compatible_types };
999
633
  };
1000
634
  const unmarshalSetImageResponse = (data) => {
1001
- if (!isJSONObject(data)) {
1002
- throw new TypeError(
1003
- `Unmarshalling the type 'SetImageResponse' failed as data isn't a dictionary.`
1004
- );
1005
- }
1006
- return {
1007
- image: data.image ? unmarshalImage(data.image) : void 0
1008
- };
635
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetImageResponse' failed as data isn't a dictionary.`);
636
+ return { image: data.image ? unmarshalImage(data.image) : void 0 };
1009
637
  };
1010
638
  const unmarshalSetPlacementGroupResponse = (data) => {
1011
- if (!isJSONObject(data)) {
1012
- throw new TypeError(
1013
- `Unmarshalling the type 'SetPlacementGroupResponse' failed as data isn't a dictionary.`
1014
- );
1015
- }
1016
- return {
1017
- placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0
1018
- };
639
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetPlacementGroupResponse' failed as data isn't a dictionary.`);
640
+ return { placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0 };
1019
641
  };
1020
642
  const unmarshalSetPlacementGroupServersResponse = (data) => {
1021
- if (!isJSONObject(data)) {
1022
- throw new TypeError(
1023
- `Unmarshalling the type 'SetPlacementGroupServersResponse' failed as data isn't a dictionary.`
1024
- );
1025
- }
1026
- return {
1027
- servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer)
1028
- };
643
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetPlacementGroupServersResponse' failed as data isn't a dictionary.`);
644
+ return { servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer) };
1029
645
  };
1030
646
  const unmarshalSetSecurityGroupResponse = (data) => {
1031
- if (!isJSONObject(data)) {
1032
- throw new TypeError(
1033
- `Unmarshalling the type 'SetSecurityGroupResponse' failed as data isn't a dictionary.`
1034
- );
1035
- }
1036
- return {
1037
- securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0
1038
- };
647
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetSecurityGroupResponse' failed as data isn't a dictionary.`);
648
+ return { securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0 };
1039
649
  };
1040
650
  const unmarshalSetSecurityGroupRuleResponse = (data) => {
1041
- if (!isJSONObject(data)) {
1042
- throw new TypeError(
1043
- `Unmarshalling the type 'SetSecurityGroupRuleResponse' failed as data isn't a dictionary.`
1044
- );
1045
- }
1046
- return {
1047
- rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0
1048
- };
651
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetSecurityGroupRuleResponse' failed as data isn't a dictionary.`);
652
+ return { rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0 };
1049
653
  };
1050
654
  const unmarshalSetSecurityGroupRulesResponse = (data) => {
1051
- if (!isJSONObject(data)) {
1052
- throw new TypeError(
1053
- `Unmarshalling the type 'SetSecurityGroupRulesResponse' failed as data isn't a dictionary.`
1054
- );
1055
- }
1056
- return {
1057
- rules: unmarshalArrayOfObject(data.rules, unmarshalSecurityGroupRule)
1058
- };
655
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetSecurityGroupRulesResponse' failed as data isn't a dictionary.`);
656
+ return { rules: unmarshalArrayOfObject(data.rules, unmarshalSecurityGroupRule) };
1059
657
  };
1060
658
  const unmarshalSetServerResponse = (data) => {
1061
- if (!isJSONObject(data)) {
1062
- throw new TypeError(
1063
- `Unmarshalling the type 'SetServerResponse' failed as data isn't a dictionary.`
1064
- );
1065
- }
1066
- return {
1067
- server: data.server ? unmarshalServer(data.server) : void 0
1068
- };
659
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetServerResponse' failed as data isn't a dictionary.`);
660
+ return { server: data.server ? unmarshalServer(data.server) : void 0 };
1069
661
  };
1070
662
  const unmarshalSetSnapshotResponse = (data) => {
1071
- if (!isJSONObject(data)) {
1072
- throw new TypeError(
1073
- `Unmarshalling the type 'SetSnapshotResponse' failed as data isn't a dictionary.`
1074
- );
1075
- }
1076
- return {
1077
- snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0
1078
- };
663
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetSnapshotResponse' failed as data isn't a dictionary.`);
664
+ return { snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0 };
1079
665
  };
1080
666
  const unmarshalUpdateImageResponse = (data) => {
1081
- if (!isJSONObject(data)) {
1082
- throw new TypeError(
1083
- `Unmarshalling the type 'UpdateImageResponse' failed as data isn't a dictionary.`
1084
- );
1085
- }
1086
- return {
1087
- image: data.image ? unmarshalImage(data.image) : void 0
1088
- };
667
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'UpdateImageResponse' failed as data isn't a dictionary.`);
668
+ return { image: data.image ? unmarshalImage(data.image) : void 0 };
1089
669
  };
1090
670
  const unmarshalUpdateIpResponse = (data) => {
1091
- if (!isJSONObject(data)) {
1092
- throw new TypeError(
1093
- `Unmarshalling the type 'UpdateIpResponse' failed as data isn't a dictionary.`
1094
- );
1095
- }
1096
- return {
1097
- ip: data.ip ? unmarshalIp(data.ip) : void 0
1098
- };
671
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'UpdateIpResponse' failed as data isn't a dictionary.`);
672
+ return { ip: data.ip ? unmarshalIp(data.ip) : void 0 };
1099
673
  };
1100
674
  const unmarshalUpdatePlacementGroupResponse = (data) => {
1101
- if (!isJSONObject(data)) {
1102
- throw new TypeError(
1103
- `Unmarshalling the type 'UpdatePlacementGroupResponse' failed as data isn't a dictionary.`
1104
- );
1105
- }
1106
- return {
1107
- placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0
1108
- };
675
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'UpdatePlacementGroupResponse' failed as data isn't a dictionary.`);
676
+ return { placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0 };
1109
677
  };
1110
678
  const unmarshalUpdatePlacementGroupServersResponse = (data) => {
1111
- if (!isJSONObject(data)) {
1112
- throw new TypeError(
1113
- `Unmarshalling the type 'UpdatePlacementGroupServersResponse' failed as data isn't a dictionary.`
1114
- );
1115
- }
1116
- return {
1117
- servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer)
1118
- };
679
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'UpdatePlacementGroupServersResponse' failed as data isn't a dictionary.`);
680
+ return { servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer) };
1119
681
  };
1120
682
  const unmarshalUpdateSecurityGroupResponse = (data) => {
1121
- if (!isJSONObject(data)) {
1122
- throw new TypeError(
1123
- `Unmarshalling the type 'UpdateSecurityGroupResponse' failed as data isn't a dictionary.`
1124
- );
1125
- }
1126
- return {
1127
- securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0
1128
- };
683
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'UpdateSecurityGroupResponse' failed as data isn't a dictionary.`);
684
+ return { securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0 };
1129
685
  };
1130
686
  const unmarshalUpdateSecurityGroupRuleResponse = (data) => {
1131
- if (!isJSONObject(data)) {
1132
- throw new TypeError(
1133
- `Unmarshalling the type 'UpdateSecurityGroupRuleResponse' failed as data isn't a dictionary.`
1134
- );
1135
- }
1136
- return {
1137
- rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0
1138
- };
687
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'UpdateSecurityGroupRuleResponse' failed as data isn't a dictionary.`);
688
+ return { rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0 };
1139
689
  };
1140
690
  const unmarshalUpdateServerResponse = (data) => {
1141
- if (!isJSONObject(data)) {
1142
- throw new TypeError(
1143
- `Unmarshalling the type 'UpdateServerResponse' failed as data isn't a dictionary.`
1144
- );
1145
- }
1146
- return {
1147
- server: data.server ? unmarshalServer(data.server) : void 0
1148
- };
691
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'UpdateServerResponse' failed as data isn't a dictionary.`);
692
+ return { server: data.server ? unmarshalServer(data.server) : void 0 };
1149
693
  };
1150
694
  const unmarshalUpdateSnapshotResponse = (data) => {
1151
- if (!isJSONObject(data)) {
1152
- throw new TypeError(
1153
- `Unmarshalling the type 'UpdateSnapshotResponse' failed as data isn't a dictionary.`
1154
- );
1155
- }
1156
- return {
1157
- snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0
1158
- };
695
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'UpdateSnapshotResponse' failed as data isn't a dictionary.`);
696
+ return { snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0 };
1159
697
  };
1160
698
  const unmarshalUpdateVolumeResponse = (data) => {
1161
- if (!isJSONObject(data)) {
1162
- throw new TypeError(
1163
- `Unmarshalling the type 'UpdateVolumeResponse' failed as data isn't a dictionary.`
1164
- );
1165
- }
1166
- return {
1167
- volume: data.volume ? unmarshalVolume(data.volume) : void 0
1168
- };
699
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'UpdateVolumeResponse' failed as data isn't a dictionary.`);
700
+ return { volume: data.volume ? unmarshalVolume(data.volume) : void 0 };
1169
701
  };
1170
702
  const marshalApplyBlockMigrationRequest = (request, defaults) => ({
1171
- validation_key: request.validationKey,
1172
- ...resolveOneOf([
1173
- {
1174
- param: "volume_id",
1175
- value: request.volumeId
1176
- },
1177
- {
1178
- param: "snapshot_id",
1179
- value: request.snapshotId
1180
- }
1181
- ])
1182
- });
1183
- const marshalAttachServerFileSystemRequest = (request, defaults) => ({
1184
- filesystem_id: request.filesystemId
703
+ validation_key: request.validationKey,
704
+ ...resolveOneOf([{
705
+ param: "volume_id",
706
+ value: request.volumeId
707
+ }, {
708
+ param: "snapshot_id",
709
+ value: request.snapshotId
710
+ }])
1185
711
  });
712
+ const marshalAttachServerFileSystemRequest = (request, defaults) => ({ filesystem_id: request.filesystemId });
1186
713
  const marshalAttachServerVolumeRequest = (request, defaults) => ({
1187
- boot: request.boot,
1188
- volume_id: request.volumeId,
1189
- volume_type: request.volumeType
1190
- });
1191
- const marshalCheckBlockMigrationOrganizationQuotasRequest = (request, defaults) => ({
1192
- organization: request.organization ?? defaults.defaultOrganizationId
714
+ boot: request.boot,
715
+ volume_id: request.volumeId,
716
+ volume_type: request.volumeType
1193
717
  });
1194
- const marshalVolumeTemplate = (request, defaults) => ({
1195
- id: request.id,
1196
- name: request.name,
1197
- size: request.size,
1198
- volume_type: request.volumeType,
1199
- ...resolveOneOf([
1200
- {
1201
- param: "project",
1202
- value: request.project
1203
- },
1204
- {
1205
- param: "organization",
1206
- value: request.organization
1207
- }
1208
- ])
718
+ const marshalCheckBlockMigrationOrganizationQuotasRequest = (request, defaults) => ({ organization: request.organization ?? defaults.defaultOrganizationId });
719
+ var marshalVolumeTemplate = (request, defaults) => ({
720
+ id: request.id,
721
+ name: request.name,
722
+ size: request.size,
723
+ volume_type: request.volumeType,
724
+ ...resolveOneOf([{
725
+ param: "project",
726
+ value: request.project
727
+ }, {
728
+ param: "organization",
729
+ value: request.organization
730
+ }])
1209
731
  });
1210
732
  const marshalCreateImageRequest = (request, defaults) => ({
1211
- arch: request.arch,
1212
- extra_volumes: request.extraVolumes !== void 0 ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeTemplate(value) }), {}) : void 0,
1213
- name: request.name || randomName("img"),
1214
- public: request.public,
1215
- root_volume: request.rootVolume,
1216
- tags: request.tags,
1217
- ...resolveOneOf([
1218
- {
1219
- default: defaults.defaultProjectId,
1220
- param: "project",
1221
- value: request.project
1222
- },
1223
- {
1224
- default: defaults.defaultOrganizationId,
1225
- param: "organization",
1226
- value: request.organization
1227
- }
1228
- ])
733
+ arch: request.arch,
734
+ extra_volumes: request.extraVolumes !== void 0 ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({
735
+ ...acc,
736
+ [key]: marshalVolumeTemplate(value, defaults)
737
+ }), {}) : void 0,
738
+ name: request.name || randomName("img"),
739
+ public: request.public,
740
+ root_volume: request.rootVolume,
741
+ tags: request.tags,
742
+ ...resolveOneOf([{
743
+ default: defaults.defaultProjectId,
744
+ param: "project",
745
+ value: request.project
746
+ }, {
747
+ default: defaults.defaultOrganizationId,
748
+ param: "organization",
749
+ value: request.organization
750
+ }])
1229
751
  });
1230
752
  const marshalCreateIpRequest = (request, defaults) => ({
1231
- server: request.server,
1232
- tags: request.tags,
1233
- type: request.type,
1234
- ...resolveOneOf([
1235
- {
1236
- default: defaults.defaultProjectId,
1237
- param: "project",
1238
- value: request.project
1239
- },
1240
- {
1241
- default: defaults.defaultOrganizationId,
1242
- param: "organization",
1243
- value: request.organization
1244
- }
1245
- ])
753
+ server: request.server,
754
+ tags: request.tags,
755
+ type: request.type,
756
+ ...resolveOneOf([{
757
+ default: defaults.defaultProjectId,
758
+ param: "project",
759
+ value: request.project
760
+ }, {
761
+ default: defaults.defaultOrganizationId,
762
+ param: "organization",
763
+ value: request.organization
764
+ }])
1246
765
  });
1247
766
  const marshalCreatePlacementGroupRequest = (request, defaults) => ({
1248
- name: request.name || randomName("pg"),
1249
- policy_mode: request.policyMode,
1250
- policy_type: request.policyType,
1251
- tags: request.tags,
1252
- ...resolveOneOf([
1253
- {
1254
- default: defaults.defaultProjectId,
1255
- param: "project",
1256
- value: request.project
1257
- },
1258
- {
1259
- default: defaults.defaultOrganizationId,
1260
- param: "organization",
1261
- value: request.organization
1262
- }
1263
- ])
767
+ name: request.name || randomName("pg"),
768
+ policy_mode: request.policyMode,
769
+ policy_type: request.policyType,
770
+ tags: request.tags,
771
+ ...resolveOneOf([{
772
+ default: defaults.defaultProjectId,
773
+ param: "project",
774
+ value: request.project
775
+ }, {
776
+ default: defaults.defaultOrganizationId,
777
+ param: "organization",
778
+ value: request.organization
779
+ }])
1264
780
  });
1265
781
  const marshalCreatePrivateNICRequest = (request, defaults) => ({
1266
- ip_ids: request.ipIds,
1267
- ipam_ip_ids: request.ipamIpIds,
1268
- private_network_id: request.privateNetworkId,
1269
- tags: request.tags
782
+ ip_ids: request.ipIds,
783
+ ipam_ip_ids: request.ipamIpIds,
784
+ private_network_id: request.privateNetworkId,
785
+ tags: request.tags
1270
786
  });
1271
787
  const marshalCreateSecurityGroupRequest = (request, defaults) => ({
1272
- description: request.description,
1273
- enable_default_security: request.enableDefaultSecurity,
1274
- inbound_default_policy: request.inboundDefaultPolicy,
1275
- name: request.name || randomName("sg"),
1276
- outbound_default_policy: request.outboundDefaultPolicy,
1277
- stateful: request.stateful,
1278
- tags: request.tags,
1279
- ...resolveOneOf([
1280
- {
1281
- default: defaults.defaultProjectId,
1282
- param: "project",
1283
- value: request.project
1284
- },
1285
- {
1286
- default: defaults.defaultOrganizationId,
1287
- param: "organization",
1288
- value: request.organization
1289
- }
1290
- ]),
1291
- ...resolveOneOf([
1292
- {
1293
- param: "organization_default",
1294
- value: request.organizationDefault
1295
- },
1296
- {
1297
- param: "project_default",
1298
- value: request.projectDefault
1299
- }
1300
- ])
788
+ description: request.description,
789
+ enable_default_security: request.enableDefaultSecurity,
790
+ inbound_default_policy: request.inboundDefaultPolicy,
791
+ name: request.name || randomName("sg"),
792
+ outbound_default_policy: request.outboundDefaultPolicy,
793
+ stateful: request.stateful,
794
+ tags: request.tags,
795
+ ...resolveOneOf([{
796
+ default: defaults.defaultProjectId,
797
+ param: "project",
798
+ value: request.project
799
+ }, {
800
+ default: defaults.defaultOrganizationId,
801
+ param: "organization",
802
+ value: request.organization
803
+ }]),
804
+ ...resolveOneOf([{
805
+ param: "organization_default",
806
+ value: request.organizationDefault
807
+ }, {
808
+ param: "project_default",
809
+ value: request.projectDefault
810
+ }])
1301
811
  });
1302
812
  const marshalCreateSecurityGroupRuleRequest = (request, defaults) => ({
1303
- action: request.action,
1304
- dest_port_from: request.destPortFrom,
1305
- dest_port_to: request.destPortTo,
1306
- direction: request.direction,
1307
- editable: request.editable,
1308
- ip_range: request.ipRange,
1309
- position: request.position,
1310
- protocol: request.protocol
813
+ action: request.action,
814
+ dest_port_from: request.destPortFrom,
815
+ dest_port_to: request.destPortTo,
816
+ direction: request.direction,
817
+ editable: request.editable,
818
+ ip_range: request.ipRange,
819
+ position: request.position,
820
+ protocol: request.protocol
1311
821
  });
1312
- const marshalVolumeServerTemplate = (request, defaults) => ({
1313
- base_snapshot: request.baseSnapshot,
1314
- boot: request.boot,
1315
- id: request.id,
1316
- name: request.name,
1317
- organization: request.organization,
1318
- project: request.project,
1319
- size: request.size,
1320
- volume_type: request.volumeType
822
+ var marshalVolumeServerTemplate = (request, defaults) => ({
823
+ base_snapshot: request.baseSnapshot,
824
+ boot: request.boot,
825
+ id: request.id,
826
+ name: request.name,
827
+ organization: request.organization,
828
+ project: request.project,
829
+ size: request.size,
830
+ volume_type: request.volumeType
1321
831
  });
1322
832
  const marshalCreateServerRequest = (request, defaults) => ({
1323
- admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId,
1324
- boot_type: request.bootType,
1325
- commercial_type: request.commercialType,
1326
- dynamic_ip_required: request.dynamicIpRequired,
1327
- enable_ipv6: request.enableIpv6,
1328
- image: request.image,
1329
- name: request.name || randomName("srv"),
1330
- placement_group: request.placementGroup,
1331
- protected: request.protected,
1332
- public_ip: request.publicIp,
1333
- public_ips: request.publicIps,
1334
- routed_ip_enabled: request.routedIpEnabled,
1335
- security_group: request.securityGroup,
1336
- tags: request.tags,
1337
- volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeServerTemplate(value) }), {}) : void 0,
1338
- ...resolveOneOf([
1339
- {
1340
- default: defaults.defaultProjectId,
1341
- param: "project",
1342
- value: request.project
1343
- },
1344
- {
1345
- default: defaults.defaultOrganizationId,
1346
- param: "organization",
1347
- value: request.organization
1348
- }
1349
- ])
833
+ admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId,
834
+ boot_type: request.bootType,
835
+ commercial_type: request.commercialType,
836
+ dynamic_ip_required: request.dynamicIpRequired,
837
+ enable_ipv6: request.enableIpv6,
838
+ image: request.image,
839
+ name: request.name || randomName("srv"),
840
+ placement_group: request.placementGroup,
841
+ protected: request.protected,
842
+ public_ip: request.publicIp,
843
+ public_ips: request.publicIps,
844
+ routed_ip_enabled: request.routedIpEnabled,
845
+ security_group: request.securityGroup,
846
+ tags: request.tags,
847
+ volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({
848
+ ...acc,
849
+ [key]: marshalVolumeServerTemplate(value, defaults)
850
+ }), {}) : void 0,
851
+ ...resolveOneOf([{
852
+ default: defaults.defaultProjectId,
853
+ param: "project",
854
+ value: request.project
855
+ }, {
856
+ default: defaults.defaultOrganizationId,
857
+ param: "organization",
858
+ value: request.organization
859
+ }])
1350
860
  });
1351
861
  const marshalCreateSnapshotRequest = (request, defaults) => ({
1352
- bucket: request.bucket,
1353
- key: request.key,
1354
- name: request.name || randomName("snp"),
1355
- size: request.size,
1356
- tags: request.tags,
1357
- volume_id: request.volumeId,
1358
- volume_type: request.volumeType,
1359
- ...resolveOneOf([
1360
- {
1361
- default: defaults.defaultProjectId,
1362
- param: "project",
1363
- value: request.project
1364
- },
1365
- {
1366
- default: defaults.defaultOrganizationId,
1367
- param: "organization",
1368
- value: request.organization
1369
- }
1370
- ])
862
+ bucket: request.bucket,
863
+ key: request.key,
864
+ name: request.name || randomName("snp"),
865
+ size: request.size,
866
+ tags: request.tags,
867
+ volume_id: request.volumeId,
868
+ volume_type: request.volumeType,
869
+ ...resolveOneOf([{
870
+ default: defaults.defaultProjectId,
871
+ param: "project",
872
+ value: request.project
873
+ }, {
874
+ default: defaults.defaultOrganizationId,
875
+ param: "organization",
876
+ value: request.organization
877
+ }])
1371
878
  });
1372
879
  const marshalCreateVolumeRequest = (request, defaults) => ({
1373
- name: request.name || randomName("vol"),
1374
- tags: request.tags,
1375
- volume_type: request.volumeType,
1376
- ...resolveOneOf([
1377
- {
1378
- default: defaults.defaultProjectId,
1379
- param: "project",
1380
- value: request.project
1381
- },
1382
- {
1383
- default: defaults.defaultOrganizationId,
1384
- param: "organization",
1385
- value: request.organization
1386
- }
1387
- ]),
1388
- ...resolveOneOf([
1389
- {
1390
- param: "size",
1391
- value: request.size
1392
- },
1393
- {
1394
- param: "base_snapshot",
1395
- value: request.baseSnapshot
1396
- }
1397
- ])
1398
- });
1399
- const marshalDetachServerFileSystemRequest = (request, defaults) => ({
1400
- filesystem_id: request.filesystemId
1401
- });
1402
- const marshalDetachServerVolumeRequest = (request, defaults) => ({
1403
- volume_id: request.volumeId
880
+ name: request.name || randomName("vol"),
881
+ tags: request.tags,
882
+ volume_type: request.volumeType,
883
+ ...resolveOneOf([{
884
+ default: defaults.defaultProjectId,
885
+ param: "project",
886
+ value: request.project
887
+ }, {
888
+ default: defaults.defaultOrganizationId,
889
+ param: "organization",
890
+ value: request.organization
891
+ }]),
892
+ ...resolveOneOf([{
893
+ param: "size",
894
+ value: request.size
895
+ }, {
896
+ param: "base_snapshot",
897
+ value: request.baseSnapshot
898
+ }])
1404
899
  });
900
+ const marshalDetachServerFileSystemRequest = (request, defaults) => ({ filesystem_id: request.filesystemId });
901
+ const marshalDetachServerVolumeRequest = (request, defaults) => ({ volume_id: request.volumeId });
1405
902
  const marshalExportSnapshotRequest = (request, defaults) => ({
1406
- bucket: request.bucket,
1407
- key: request.key
1408
- });
1409
- const marshalPlanBlockMigrationRequest = (request, defaults) => ({
1410
- ...resolveOneOf([
1411
- {
1412
- param: "volume_id",
1413
- value: request.volumeId
1414
- },
1415
- {
1416
- param: "snapshot_id",
1417
- value: request.snapshotId
1418
- }
1419
- ])
1420
- });
1421
- const marshalServerActionRequestVolumeBackupTemplate = (request, defaults) => ({
1422
- volume_type: request.volumeType
903
+ bucket: request.bucket,
904
+ key: request.key
1423
905
  });
906
+ const marshalPlanBlockMigrationRequest = (request, defaults) => ({ ...resolveOneOf([{
907
+ param: "volume_id",
908
+ value: request.volumeId
909
+ }, {
910
+ param: "snapshot_id",
911
+ value: request.snapshotId
912
+ }]) });
913
+ var marshalServerActionRequestVolumeBackupTemplate = (request, defaults) => ({ volume_type: request.volumeType });
1424
914
  const marshalServerActionRequest = (request, defaults) => ({
1425
- action: request.action,
1426
- disable_ipv6: request.disableIpv6,
1427
- name: request.name,
1428
- volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalServerActionRequestVolumeBackupTemplate(value) }), {}) : void 0
915
+ action: request.action,
916
+ disable_ipv6: request.disableIpv6,
917
+ name: request.name,
918
+ volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({
919
+ ...acc,
920
+ [key]: marshalServerActionRequestVolumeBackupTemplate(value, defaults)
921
+ }), {}) : void 0
1429
922
  });
1430
- const marshalServerSummary = (request, defaults) => ({
1431
- id: request.id,
1432
- name: request.name
923
+ var marshalServerSummary = (request, defaults) => ({
924
+ id: request.id,
925
+ name: request.name
1433
926
  });
1434
- const marshalBootscript = (request, defaults) => ({
1435
- architecture: request.architecture,
1436
- bootcmdargs: request.bootcmdargs,
1437
- default: request.default,
1438
- dtb: request.dtb,
1439
- id: request.id,
1440
- initrd: request.initrd,
1441
- kernel: request.kernel,
1442
- organization: request.organization,
1443
- project: request.project,
1444
- public: request.public,
1445
- title: request.title,
1446
- zone: request.zone
927
+ var marshalBootscript = (request, defaults) => ({
928
+ architecture: request.architecture,
929
+ bootcmdargs: request.bootcmdargs,
930
+ default: request.default,
931
+ dtb: request.dtb,
932
+ id: request.id,
933
+ initrd: request.initrd,
934
+ kernel: request.kernel,
935
+ organization: request.organization,
936
+ project: request.project,
937
+ public: request.public,
938
+ title: request.title,
939
+ zone: request.zone
1447
940
  });
1448
- const marshalVolume = (request, defaults) => ({
1449
- creation_date: request.creationDate,
1450
- export_uri: request.exportUri,
1451
- id: request.id,
1452
- modification_date: request.modificationDate,
1453
- name: request.name,
1454
- organization: request.organization,
1455
- project: request.project,
1456
- server: request.server !== void 0 ? marshalServerSummary(request.server) : void 0,
1457
- size: request.size,
1458
- state: request.state,
1459
- tags: request.tags,
1460
- volume_type: request.volumeType,
1461
- zone: request.zone
941
+ var marshalVolume = (request, defaults) => ({
942
+ creation_date: request.creationDate,
943
+ export_uri: request.exportUri,
944
+ id: request.id,
945
+ modification_date: request.modificationDate,
946
+ name: request.name,
947
+ organization: request.organization,
948
+ project: request.project,
949
+ server: request.server !== void 0 ? marshalServerSummary(request.server, defaults) : void 0,
950
+ size: request.size,
951
+ state: request.state,
952
+ tags: request.tags,
953
+ volume_type: request.volumeType,
954
+ zone: request.zone
1462
955
  });
1463
- const marshalVolumeSummary = (request, defaults) => ({
1464
- id: request.id,
1465
- name: request.name,
1466
- size: request.size,
1467
- volume_type: request.volumeType
956
+ var marshalVolumeSummary = (request, defaults) => ({
957
+ id: request.id,
958
+ name: request.name,
959
+ size: request.size,
960
+ volume_type: request.volumeType
1468
961
  });
1469
962
  const marshalSetImageRequest = (request, defaults) => ({
1470
- arch: request.arch,
1471
- creation_date: request.creationDate,
1472
- default_bootscript: request.defaultBootscript !== void 0 ? marshalBootscript(request.defaultBootscript) : void 0,
1473
- extra_volumes: request.extraVolumes !== void 0 ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolume(value) }), {}) : void 0,
1474
- from_server: request.fromServer,
1475
- modification_date: request.modificationDate,
1476
- name: request.name,
1477
- organization: request.organization ?? defaults.defaultOrganizationId,
1478
- project: request.project ?? defaults.defaultProjectId,
1479
- public: request.public,
1480
- root_volume: request.rootVolume !== void 0 ? marshalVolumeSummary(request.rootVolume) : void 0,
1481
- state: request.state,
1482
- tags: request.tags
963
+ arch: request.arch,
964
+ creation_date: request.creationDate,
965
+ default_bootscript: request.defaultBootscript !== void 0 ? marshalBootscript(request.defaultBootscript, defaults) : void 0,
966
+ extra_volumes: request.extraVolumes !== void 0 ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({
967
+ ...acc,
968
+ [key]: marshalVolume(value, defaults)
969
+ }), {}) : void 0,
970
+ from_server: request.fromServer,
971
+ modification_date: request.modificationDate,
972
+ name: request.name,
973
+ organization: request.organization ?? defaults.defaultOrganizationId,
974
+ project: request.project ?? defaults.defaultProjectId,
975
+ public: request.public,
976
+ root_volume: request.rootVolume !== void 0 ? marshalVolumeSummary(request.rootVolume, defaults) : void 0,
977
+ state: request.state,
978
+ tags: request.tags
1483
979
  });
1484
980
  const marshalSetPlacementGroupRequest = (request, defaults) => ({
1485
- name: request.name,
1486
- organization: request.organization ?? defaults.defaultOrganizationId,
1487
- policy_mode: request.policyMode,
1488
- policy_type: request.policyType,
1489
- project: request.project ?? defaults.defaultProjectId,
1490
- tags: request.tags
1491
- });
1492
- const marshalSetPlacementGroupServersRequest = (request, defaults) => ({
1493
- servers: request.servers
981
+ name: request.name,
982
+ organization: request.organization ?? defaults.defaultOrganizationId,
983
+ policy_mode: request.policyMode,
984
+ policy_type: request.policyType,
985
+ project: request.project ?? defaults.defaultProjectId,
986
+ tags: request.tags
1494
987
  });
988
+ const marshalSetPlacementGroupServersRequest = (request, defaults) => ({ servers: request.servers });
1495
989
  const marshalSetSecurityGroupRequest = (request, defaults) => ({
1496
- creation_date: request.creationDate,
1497
- description: request.description,
1498
- enable_default_security: request.enableDefaultSecurity,
1499
- inbound_default_policy: request.inboundDefaultPolicy,
1500
- modification_date: request.modificationDate,
1501
- name: request.name,
1502
- organization: request.organization ?? defaults.defaultOrganizationId,
1503
- organization_default: request.organizationDefault,
1504
- outbound_default_policy: request.outboundDefaultPolicy,
1505
- project: request.project ?? defaults.defaultProjectId,
1506
- project_default: request.projectDefault,
1507
- servers: request.servers !== void 0 ? request.servers.map((elt) => marshalServerSummary(elt)) : void 0,
1508
- stateful: request.stateful,
1509
- tags: request.tags
990
+ creation_date: request.creationDate,
991
+ description: request.description,
992
+ enable_default_security: request.enableDefaultSecurity,
993
+ inbound_default_policy: request.inboundDefaultPolicy,
994
+ modification_date: request.modificationDate,
995
+ name: request.name,
996
+ organization: request.organization ?? defaults.defaultOrganizationId,
997
+ organization_default: request.organizationDefault,
998
+ outbound_default_policy: request.outboundDefaultPolicy,
999
+ project: request.project ?? defaults.defaultProjectId,
1000
+ project_default: request.projectDefault,
1001
+ servers: request.servers !== void 0 ? request.servers.map((elt) => marshalServerSummary(elt, defaults)) : void 0,
1002
+ stateful: request.stateful,
1003
+ tags: request.tags
1510
1004
  });
1511
1005
  const marshalSetSecurityGroupRuleRequest = (request, defaults) => ({
1512
- action: request.action,
1513
- dest_port_from: request.destPortFrom,
1514
- dest_port_to: request.destPortTo,
1515
- direction: request.direction,
1516
- editable: request.editable,
1517
- id: request.id,
1518
- ip_range: request.ipRange,
1519
- position: request.position,
1520
- protocol: request.protocol
1006
+ action: request.action,
1007
+ dest_port_from: request.destPortFrom,
1008
+ dest_port_to: request.destPortTo,
1009
+ direction: request.direction,
1010
+ editable: request.editable,
1011
+ id: request.id,
1012
+ ip_range: request.ipRange,
1013
+ position: request.position,
1014
+ protocol: request.protocol
1521
1015
  });
1522
- const marshalSetSecurityGroupRulesRequestRule = (request, defaults) => ({
1523
- action: request.action,
1524
- dest_port_from: request.destPortFrom,
1525
- dest_port_to: request.destPortTo,
1526
- direction: request.direction,
1527
- editable: request.editable,
1528
- id: request.id,
1529
- ip_range: request.ipRange,
1530
- position: request.position,
1531
- protocol: request.protocol,
1532
- zone: request.zone
1016
+ var marshalSetSecurityGroupRulesRequestRule = (request, defaults) => ({
1017
+ action: request.action,
1018
+ dest_port_from: request.destPortFrom,
1019
+ dest_port_to: request.destPortTo,
1020
+ direction: request.direction,
1021
+ editable: request.editable,
1022
+ id: request.id,
1023
+ ip_range: request.ipRange,
1024
+ position: request.position,
1025
+ protocol: request.protocol,
1026
+ zone: request.zone
1533
1027
  });
1534
- const marshalSetSecurityGroupRulesRequest = (request, defaults) => ({
1535
- rules: request.rules !== void 0 ? request.rules.map((elt) => marshalSetSecurityGroupRulesRequestRule(elt)) : void 0
1028
+ const marshalSetSecurityGroupRulesRequest = (request, defaults) => ({ rules: request.rules !== void 0 ? request.rules.map((elt) => marshalSetSecurityGroupRulesRequestRule(elt, defaults)) : void 0 });
1029
+ var marshalImage = (request, defaults) => ({
1030
+ arch: request.arch,
1031
+ creation_date: request.creationDate,
1032
+ default_bootscript: request.defaultBootscript !== void 0 ? marshalBootscript(request.defaultBootscript, defaults) : void 0,
1033
+ extra_volumes: Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({
1034
+ ...acc,
1035
+ [key]: marshalVolume(value, defaults)
1036
+ }), {}),
1037
+ from_server: request.fromServer,
1038
+ id: request.id,
1039
+ modification_date: request.modificationDate,
1040
+ name: request.name,
1041
+ organization: request.organization,
1042
+ project: request.project,
1043
+ public: request.public,
1044
+ root_volume: request.rootVolume !== void 0 ? marshalVolumeSummary(request.rootVolume, defaults) : void 0,
1045
+ state: request.state,
1046
+ tags: request.tags,
1047
+ zone: request.zone
1536
1048
  });
1537
- const marshalImage = (request, defaults) => ({
1538
- arch: request.arch,
1539
- creation_date: request.creationDate,
1540
- default_bootscript: request.defaultBootscript !== void 0 ? marshalBootscript(request.defaultBootscript) : void 0,
1541
- extra_volumes: Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolume(value) }), {}),
1542
- from_server: request.fromServer,
1543
- id: request.id,
1544
- modification_date: request.modificationDate,
1545
- name: request.name,
1546
- organization: request.organization,
1547
- project: request.project,
1548
- public: request.public,
1549
- root_volume: request.rootVolume !== void 0 ? marshalVolumeSummary(request.rootVolume) : void 0,
1550
- state: request.state,
1551
- tags: request.tags,
1552
- zone: request.zone
1049
+ var marshalPlacementGroup = (request, defaults) => ({
1050
+ id: request.id,
1051
+ name: request.name,
1052
+ organization: request.organization,
1053
+ policy_mode: request.policyMode,
1054
+ policy_respected: request.policyRespected,
1055
+ policy_type: request.policyType,
1056
+ project: request.project,
1057
+ tags: request.tags,
1058
+ zone: request.zone
1553
1059
  });
1554
- const marshalPlacementGroup = (request, defaults) => ({
1555
- id: request.id,
1556
- name: request.name,
1557
- organization: request.organization,
1558
- policy_mode: request.policyMode,
1559
- policy_respected: request.policyRespected,
1560
- policy_type: request.policyType,
1561
- project: request.project,
1562
- tags: request.tags,
1563
- zone: request.zone
1060
+ var marshalPrivateNIC = (request, defaults) => ({
1061
+ creation_date: request.creationDate,
1062
+ id: request.id,
1063
+ mac_address: request.macAddress,
1064
+ private_network_id: request.privateNetworkId,
1065
+ server_id: request.serverId,
1066
+ state: request.state,
1067
+ tags: request.tags,
1068
+ zone: request.zone
1564
1069
  });
1565
- const marshalPrivateNIC = (request, defaults) => ({
1566
- creation_date: request.creationDate,
1567
- id: request.id,
1568
- mac_address: request.macAddress,
1569
- private_network_id: request.privateNetworkId,
1570
- server_id: request.serverId,
1571
- state: request.state,
1572
- tags: request.tags,
1573
- zone: request.zone
1070
+ var marshalSecurityGroupSummary = (request, defaults) => ({
1071
+ id: request.id,
1072
+ name: request.name
1574
1073
  });
1575
- const marshalSecurityGroupSummary = (request, defaults) => ({
1576
- id: request.id,
1577
- name: request.name
1074
+ var marshalServerIp = (request, defaults) => ({
1075
+ address: request.address,
1076
+ dynamic: request.dynamic,
1077
+ family: request.family,
1078
+ gateway: request.gateway,
1079
+ id: request.id,
1080
+ ipam_id: request.ipamId,
1081
+ netmask: request.netmask,
1082
+ provisioning_mode: request.provisioningMode,
1083
+ state: request.state,
1084
+ tags: request.tags
1578
1085
  });
1579
- const marshalServerIp = (request, defaults) => ({
1580
- address: request.address,
1581
- dynamic: request.dynamic,
1582
- family: request.family,
1583
- gateway: request.gateway,
1584
- id: request.id,
1585
- ipam_id: request.ipamId,
1586
- netmask: request.netmask,
1587
- provisioning_mode: request.provisioningMode,
1588
- state: request.state,
1589
- tags: request.tags
1086
+ var marshalServerIpv6 = (request, defaults) => ({
1087
+ address: request.address,
1088
+ gateway: request.gateway,
1089
+ netmask: request.netmask
1590
1090
  });
1591
- const marshalServerIpv6 = (request, defaults) => ({
1592
- address: request.address,
1593
- gateway: request.gateway,
1594
- netmask: request.netmask
1091
+ var marshalServerLocation = (request, defaults) => ({
1092
+ cluster_id: request.clusterId,
1093
+ hypervisor_id: request.hypervisorId,
1094
+ node_id: request.nodeId,
1095
+ platform_id: request.platformId,
1096
+ zone_id: request.zoneId
1595
1097
  });
1596
- const marshalServerLocation = (request, defaults) => ({
1597
- cluster_id: request.clusterId,
1598
- hypervisor_id: request.hypervisorId,
1599
- node_id: request.nodeId,
1600
- platform_id: request.platformId,
1601
- zone_id: request.zoneId
1602
- });
1603
- const marshalServerMaintenance = (request, defaults) => ({
1604
- reason: request.reason,
1605
- start_date: request.startDate
1098
+ var marshalServerMaintenance = (request, defaults) => ({
1099
+ reason: request.reason,
1100
+ start_date: request.startDate
1606
1101
  });
1607
1102
  const marshalSetServerRequest = (request, defaults) => ({
1608
- admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId,
1609
- allowed_actions: request.allowedActions !== void 0 ? request.allowedActions : void 0,
1610
- arch: request.arch,
1611
- boot_type: request.bootType,
1612
- commercial_type: request.commercialType,
1613
- creation_date: request.creationDate,
1614
- dynamic_ip_required: request.dynamicIpRequired,
1615
- enable_ipv6: request.enableIpv6,
1616
- hostname: request.hostname,
1617
- image: request.image !== void 0 ? marshalImage(request.image) : void 0,
1618
- ipv6: request.ipv6 !== void 0 ? marshalServerIpv6(request.ipv6) : void 0,
1619
- location: request.location !== void 0 ? marshalServerLocation(request.location) : void 0,
1620
- maintenances: request.maintenances !== void 0 ? request.maintenances.map((elt) => marshalServerMaintenance(elt)) : void 0,
1621
- modification_date: request.modificationDate,
1622
- name: request.name,
1623
- organization: request.organization ?? defaults.defaultOrganizationId,
1624
- placement_group: request.placementGroup !== void 0 ? marshalPlacementGroup(request.placementGroup) : void 0,
1625
- private_ip: request.privateIp,
1626
- private_nics: request.privateNics !== void 0 ? request.privateNics.map((elt) => marshalPrivateNIC(elt)) : void 0,
1627
- project: request.project ?? defaults.defaultProjectId,
1628
- protected: request.protected,
1629
- public_ip: request.publicIp !== void 0 ? marshalServerIp(request.publicIp) : void 0,
1630
- public_ips: request.publicIps !== void 0 ? request.publicIps.map((elt) => marshalServerIp(elt)) : void 0,
1631
- routed_ip_enabled: request.routedIpEnabled,
1632
- security_group: request.securityGroup !== void 0 ? marshalSecurityGroupSummary(request.securityGroup) : void 0,
1633
- state: request.state,
1634
- state_detail: request.stateDetail,
1635
- tags: request.tags,
1636
- volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolume(value) }), {}) : void 0
1103
+ admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId,
1104
+ allowed_actions: request.allowedActions !== void 0 ? request.allowedActions : void 0,
1105
+ arch: request.arch,
1106
+ boot_type: request.bootType,
1107
+ commercial_type: request.commercialType,
1108
+ creation_date: request.creationDate,
1109
+ dynamic_ip_required: request.dynamicIpRequired,
1110
+ enable_ipv6: request.enableIpv6,
1111
+ hostname: request.hostname,
1112
+ image: request.image !== void 0 ? marshalImage(request.image, defaults) : void 0,
1113
+ ipv6: request.ipv6 !== void 0 ? marshalServerIpv6(request.ipv6, defaults) : void 0,
1114
+ location: request.location !== void 0 ? marshalServerLocation(request.location, defaults) : void 0,
1115
+ maintenances: request.maintenances !== void 0 ? request.maintenances.map((elt) => marshalServerMaintenance(elt, defaults)) : void 0,
1116
+ modification_date: request.modificationDate,
1117
+ name: request.name,
1118
+ organization: request.organization ?? defaults.defaultOrganizationId,
1119
+ placement_group: request.placementGroup !== void 0 ? marshalPlacementGroup(request.placementGroup, defaults) : void 0,
1120
+ private_ip: request.privateIp,
1121
+ private_nics: request.privateNics !== void 0 ? request.privateNics.map((elt) => marshalPrivateNIC(elt, defaults)) : void 0,
1122
+ project: request.project ?? defaults.defaultProjectId,
1123
+ protected: request.protected,
1124
+ public_ip: request.publicIp !== void 0 ? marshalServerIp(request.publicIp, defaults) : void 0,
1125
+ public_ips: request.publicIps !== void 0 ? request.publicIps.map((elt) => marshalServerIp(elt, defaults)) : void 0,
1126
+ routed_ip_enabled: request.routedIpEnabled,
1127
+ security_group: request.securityGroup !== void 0 ? marshalSecurityGroupSummary(request.securityGroup, defaults) : void 0,
1128
+ state: request.state,
1129
+ state_detail: request.stateDetail,
1130
+ tags: request.tags,
1131
+ volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({
1132
+ ...acc,
1133
+ [key]: marshalVolume(value, defaults)
1134
+ }), {}) : void 0
1637
1135
  });
1638
- const marshalSnapshotBaseVolume = (request, defaults) => ({
1639
- id: request.id,
1640
- name: request.name
1136
+ var marshalSnapshotBaseVolume = (request, defaults) => ({
1137
+ id: request.id,
1138
+ name: request.name
1641
1139
  });
1642
1140
  const marshalSetSnapshotRequest = (request, defaults) => ({
1643
- base_volume: request.baseVolume !== void 0 ? marshalSnapshotBaseVolume(request.baseVolume) : void 0,
1644
- creation_date: request.creationDate,
1645
- id: request.id,
1646
- modification_date: request.modificationDate,
1647
- name: request.name,
1648
- organization: request.organization ?? defaults.defaultOrganizationId,
1649
- project: request.project ?? defaults.defaultProjectId,
1650
- size: request.size,
1651
- state: request.state,
1652
- tags: request.tags,
1653
- volume_type: request.volumeType
1654
- });
1655
- const marshalVolumeImageUpdateTemplate = (request, defaults) => ({
1656
- id: request.id
1141
+ base_volume: request.baseVolume !== void 0 ? marshalSnapshotBaseVolume(request.baseVolume, defaults) : void 0,
1142
+ creation_date: request.creationDate,
1143
+ id: request.id,
1144
+ modification_date: request.modificationDate,
1145
+ name: request.name,
1146
+ organization: request.organization ?? defaults.defaultOrganizationId,
1147
+ project: request.project ?? defaults.defaultProjectId,
1148
+ size: request.size,
1149
+ state: request.state,
1150
+ tags: request.tags,
1151
+ volume_type: request.volumeType
1657
1152
  });
1153
+ var marshalVolumeImageUpdateTemplate = (request, defaults) => ({ id: request.id });
1658
1154
  const marshalUpdateImageRequest = (request, defaults) => ({
1659
- arch: request.arch,
1660
- extra_volumes: request.extraVolumes !== void 0 ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeImageUpdateTemplate(value) }), {}) : void 0,
1661
- name: request.name,
1662
- public: request.public,
1663
- tags: request.tags
1155
+ arch: request.arch,
1156
+ extra_volumes: request.extraVolumes !== void 0 ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({
1157
+ ...acc,
1158
+ [key]: marshalVolumeImageUpdateTemplate(value, defaults)
1159
+ }), {}) : void 0,
1160
+ name: request.name,
1161
+ public: request.public,
1162
+ tags: request.tags
1664
1163
  });
1665
1164
  const marshalUpdateIpRequest = (request, defaults) => ({
1666
- reverse: request.reverse,
1667
- server: request.server,
1668
- tags: request.tags,
1669
- type: request.type
1165
+ reverse: request.reverse,
1166
+ server: request.server,
1167
+ tags: request.tags,
1168
+ type: request.type
1670
1169
  });
1671
1170
  const marshalUpdatePlacementGroupRequest = (request, defaults) => ({
1672
- name: request.name,
1673
- policy_mode: request.policyMode,
1674
- policy_type: request.policyType,
1675
- tags: request.tags
1676
- });
1677
- const marshalUpdatePlacementGroupServersRequest = (request, defaults) => ({
1678
- servers: request.servers
1679
- });
1680
- const marshalUpdatePrivateNICRequest = (request, defaults) => ({
1681
- tags: request.tags
1171
+ name: request.name,
1172
+ policy_mode: request.policyMode,
1173
+ policy_type: request.policyType,
1174
+ tags: request.tags
1682
1175
  });
1176
+ const marshalUpdatePlacementGroupServersRequest = (request, defaults) => ({ servers: request.servers });
1177
+ const marshalUpdatePrivateNICRequest = (request, defaults) => ({ tags: request.tags });
1683
1178
  const marshalUpdateSecurityGroupRequest = (request, defaults) => ({
1684
- description: request.description,
1685
- enable_default_security: request.enableDefaultSecurity,
1686
- inbound_default_policy: request.inboundDefaultPolicy,
1687
- name: request.name,
1688
- organization_default: request.organizationDefault,
1689
- outbound_default_policy: request.outboundDefaultPolicy,
1690
- project_default: request.projectDefault,
1691
- stateful: request.stateful,
1692
- tags: request.tags
1179
+ description: request.description,
1180
+ enable_default_security: request.enableDefaultSecurity,
1181
+ inbound_default_policy: request.inboundDefaultPolicy,
1182
+ name: request.name,
1183
+ organization_default: request.organizationDefault,
1184
+ outbound_default_policy: request.outboundDefaultPolicy,
1185
+ project_default: request.projectDefault,
1186
+ stateful: request.stateful,
1187
+ tags: request.tags
1693
1188
  });
1694
1189
  const marshalUpdateSecurityGroupRuleRequest = (request, defaults) => ({
1695
- action: request.action,
1696
- dest_port_from: request.destPortFrom,
1697
- dest_port_to: request.destPortTo,
1698
- direction: request.direction,
1699
- ip_range: request.ipRange,
1700
- position: request.position,
1701
- protocol: request.protocol
1190
+ action: request.action,
1191
+ dest_port_from: request.destPortFrom,
1192
+ dest_port_to: request.destPortTo,
1193
+ direction: request.direction,
1194
+ ip_range: request.ipRange,
1195
+ position: request.position,
1196
+ protocol: request.protocol
1702
1197
  });
1703
- const marshalSecurityGroupTemplate = (request, defaults) => ({
1704
- id: request.id,
1705
- name: request.name
1198
+ var marshalSecurityGroupTemplate = (request, defaults) => ({
1199
+ id: request.id,
1200
+ name: request.name
1706
1201
  });
1707
1202
  const marshalUpdateServerRequest = (request, defaults) => ({
1708
- admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId,
1709
- boot_type: request.bootType,
1710
- commercial_type: request.commercialType,
1711
- dynamic_ip_required: request.dynamicIpRequired,
1712
- enable_ipv6: request.enableIpv6,
1713
- name: request.name,
1714
- placement_group: request.placementGroup,
1715
- private_nics: request.privateNics,
1716
- protected: request.protected,
1717
- public_ips: request.publicIps,
1718
- routed_ip_enabled: request.routedIpEnabled,
1719
- security_group: request.securityGroup !== void 0 ? marshalSecurityGroupTemplate(request.securityGroup) : void 0,
1720
- tags: request.tags,
1721
- volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeServerTemplate(value) }), {}) : void 0
1203
+ admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId,
1204
+ boot_type: request.bootType,
1205
+ commercial_type: request.commercialType,
1206
+ dynamic_ip_required: request.dynamicIpRequired,
1207
+ enable_ipv6: request.enableIpv6,
1208
+ name: request.name,
1209
+ placement_group: request.placementGroup,
1210
+ private_nics: request.privateNics,
1211
+ protected: request.protected,
1212
+ public_ips: request.publicIps,
1213
+ routed_ip_enabled: request.routedIpEnabled,
1214
+ security_group: request.securityGroup !== void 0 ? marshalSecurityGroupTemplate(request.securityGroup, defaults) : void 0,
1215
+ tags: request.tags,
1216
+ volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({
1217
+ ...acc,
1218
+ [key]: marshalVolumeServerTemplate(value, defaults)
1219
+ }), {}) : void 0
1722
1220
  });
1723
1221
  const marshalUpdateSnapshotRequest = (request, defaults) => ({
1724
- name: request.name,
1725
- tags: request.tags
1222
+ name: request.name,
1223
+ tags: request.tags
1726
1224
  });
1727
1225
  const marshalUpdateVolumeRequest = (request, defaults) => ({
1728
- name: request.name,
1729
- size: request.size,
1730
- tags: request.tags
1226
+ name: request.name,
1227
+ size: request.size,
1228
+ tags: request.tags
1731
1229
  });
1732
- export {
1733
- marshalApplyBlockMigrationRequest,
1734
- marshalAttachServerFileSystemRequest,
1735
- marshalAttachServerVolumeRequest,
1736
- marshalCheckBlockMigrationOrganizationQuotasRequest,
1737
- marshalCreateImageRequest,
1738
- marshalCreateIpRequest,
1739
- marshalCreatePlacementGroupRequest,
1740
- marshalCreatePrivateNICRequest,
1741
- marshalCreateSecurityGroupRequest,
1742
- marshalCreateSecurityGroupRuleRequest,
1743
- marshalCreateServerRequest,
1744
- marshalCreateSnapshotRequest,
1745
- marshalCreateVolumeRequest,
1746
- marshalDetachServerFileSystemRequest,
1747
- marshalDetachServerVolumeRequest,
1748
- marshalExportSnapshotRequest,
1749
- marshalPlanBlockMigrationRequest,
1750
- marshalServerActionRequest,
1751
- marshalSetImageRequest,
1752
- marshalSetPlacementGroupRequest,
1753
- marshalSetPlacementGroupServersRequest,
1754
- marshalSetSecurityGroupRequest,
1755
- marshalSetSecurityGroupRuleRequest,
1756
- marshalSetSecurityGroupRulesRequest,
1757
- marshalSetServerRequest,
1758
- marshalSetSnapshotRequest,
1759
- marshalUpdateImageRequest,
1760
- marshalUpdateIpRequest,
1761
- marshalUpdatePlacementGroupRequest,
1762
- marshalUpdatePlacementGroupServersRequest,
1763
- marshalUpdatePrivateNICRequest,
1764
- marshalUpdateSecurityGroupRequest,
1765
- marshalUpdateSecurityGroupRuleRequest,
1766
- marshalUpdateServerRequest,
1767
- marshalUpdateSnapshotRequest,
1768
- marshalUpdateVolumeRequest,
1769
- unmarshalAttachServerFileSystemResponse,
1770
- unmarshalAttachServerVolumeResponse,
1771
- unmarshalCreateImageResponse,
1772
- unmarshalCreateIpResponse,
1773
- unmarshalCreatePlacementGroupResponse,
1774
- unmarshalCreatePrivateNICResponse,
1775
- unmarshalCreateSecurityGroupResponse,
1776
- unmarshalCreateSecurityGroupRuleResponse,
1777
- unmarshalCreateServerResponse,
1778
- unmarshalCreateSnapshotResponse,
1779
- unmarshalCreateVolumeResponse,
1780
- unmarshalDetachServerFileSystemResponse,
1781
- unmarshalDetachServerVolumeResponse,
1782
- unmarshalExportSnapshotResponse,
1783
- unmarshalGetDashboardResponse,
1784
- unmarshalGetImageResponse,
1785
- unmarshalGetIpResponse,
1786
- unmarshalGetPlacementGroupResponse,
1787
- unmarshalGetPlacementGroupServersResponse,
1788
- unmarshalGetPrivateNICResponse,
1789
- unmarshalGetSecurityGroupResponse,
1790
- unmarshalGetSecurityGroupRuleResponse,
1791
- unmarshalGetServerResponse,
1792
- unmarshalGetServerTypesAvailabilityResponse,
1793
- unmarshalGetSnapshotResponse,
1794
- unmarshalGetVolumeResponse,
1795
- unmarshalListImagesResponse,
1796
- unmarshalListIpsResponse,
1797
- unmarshalListPlacementGroupsResponse,
1798
- unmarshalListPrivateNICsResponse,
1799
- unmarshalListSecurityGroupRulesResponse,
1800
- unmarshalListSecurityGroupsResponse,
1801
- unmarshalListServerActionsResponse,
1802
- unmarshalListServerUserDataResponse,
1803
- unmarshalListServersResponse,
1804
- unmarshalListServersTypesResponse,
1805
- unmarshalListSnapshotsResponse,
1806
- unmarshalListVolumesResponse,
1807
- unmarshalListVolumesTypesResponse,
1808
- unmarshalMigrationPlan,
1809
- unmarshalPrivateNIC,
1810
- unmarshalServerActionResponse,
1811
- unmarshalServerCompatibleTypes,
1812
- unmarshalSetImageResponse,
1813
- unmarshalSetPlacementGroupResponse,
1814
- unmarshalSetPlacementGroupServersResponse,
1815
- unmarshalSetSecurityGroupResponse,
1816
- unmarshalSetSecurityGroupRuleResponse,
1817
- unmarshalSetSecurityGroupRulesResponse,
1818
- unmarshalSetServerResponse,
1819
- unmarshalSetSnapshotResponse,
1820
- unmarshalUpdateImageResponse,
1821
- unmarshalUpdateIpResponse,
1822
- unmarshalUpdatePlacementGroupResponse,
1823
- unmarshalUpdatePlacementGroupServersResponse,
1824
- unmarshalUpdateSecurityGroupResponse,
1825
- unmarshalUpdateSecurityGroupRuleResponse,
1826
- unmarshalUpdateServerResponse,
1827
- unmarshalUpdateSnapshotResponse,
1828
- unmarshalUpdateVolumeResponse
1829
- };
1230
+ export { marshalApplyBlockMigrationRequest, marshalAttachServerFileSystemRequest, marshalAttachServerVolumeRequest, marshalCheckBlockMigrationOrganizationQuotasRequest, marshalCreateImageRequest, marshalCreateIpRequest, marshalCreatePlacementGroupRequest, marshalCreatePrivateNICRequest, marshalCreateSecurityGroupRequest, marshalCreateSecurityGroupRuleRequest, marshalCreateServerRequest, marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalDetachServerFileSystemRequest, marshalDetachServerVolumeRequest, marshalExportSnapshotRequest, marshalPlanBlockMigrationRequest, marshalServerActionRequest, marshalSetImageRequest, marshalSetPlacementGroupRequest, marshalSetPlacementGroupServersRequest, marshalSetSecurityGroupRequest, marshalSetSecurityGroupRuleRequest, marshalSetSecurityGroupRulesRequest, marshalSetServerRequest, marshalSetSnapshotRequest, marshalUpdateImageRequest, marshalUpdateIpRequest, marshalUpdatePlacementGroupRequest, marshalUpdatePlacementGroupServersRequest, marshalUpdatePrivateNICRequest, marshalUpdateSecurityGroupRequest, marshalUpdateSecurityGroupRuleRequest, marshalUpdateServerRequest, marshalUpdateSnapshotRequest, marshalUpdateVolumeRequest, unmarshalAttachServerFileSystemResponse, unmarshalAttachServerVolumeResponse, unmarshalCreateImageResponse, unmarshalCreateIpResponse, unmarshalCreatePlacementGroupResponse, unmarshalCreatePrivateNICResponse, unmarshalCreateSecurityGroupResponse, unmarshalCreateSecurityGroupRuleResponse, unmarshalCreateServerResponse, unmarshalCreateSnapshotResponse, unmarshalCreateVolumeResponse, unmarshalDetachServerFileSystemResponse, unmarshalDetachServerVolumeResponse, unmarshalExportSnapshotResponse, unmarshalGetDashboardResponse, unmarshalGetImageResponse, unmarshalGetIpResponse, unmarshalGetPlacementGroupResponse, unmarshalGetPlacementGroupServersResponse, unmarshalGetPrivateNICResponse, unmarshalGetSecurityGroupResponse, unmarshalGetSecurityGroupRuleResponse, unmarshalGetServerResponse, unmarshalGetServerTypesAvailabilityResponse, unmarshalGetSnapshotResponse, unmarshalGetVolumeResponse, unmarshalListImagesResponse, unmarshalListIpsResponse, unmarshalListPlacementGroupsResponse, unmarshalListPrivateNICsResponse, unmarshalListSecurityGroupRulesResponse, unmarshalListSecurityGroupsResponse, unmarshalListServerActionsResponse, unmarshalListServerUserDataResponse, unmarshalListServersResponse, unmarshalListServersTypesResponse, unmarshalListSnapshotsResponse, unmarshalListVolumesResponse, unmarshalListVolumesTypesResponse, unmarshalMigrationPlan, unmarshalPrivateNIC, unmarshalServerActionResponse, unmarshalServerCompatibleTypes, unmarshalSetImageResponse, unmarshalSetPlacementGroupResponse, unmarshalSetPlacementGroupServersResponse, unmarshalSetSecurityGroupResponse, unmarshalSetSecurityGroupRuleResponse, unmarshalSetSecurityGroupRulesResponse, unmarshalSetServerResponse, unmarshalSetSnapshotResponse, unmarshalUpdateImageResponse, unmarshalUpdateIpResponse, unmarshalUpdatePlacementGroupResponse, unmarshalUpdatePlacementGroupServersResponse, unmarshalUpdateSecurityGroupResponse, unmarshalUpdateSecurityGroupRuleResponse, unmarshalUpdateServerResponse, unmarshalUpdateSnapshotResponse, unmarshalUpdateVolumeResponse };