@scaleway/sdk-autoscaling 2.2.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,365 +1,280 @@
1
- import { resolveOneOf, isJSONObject, unmarshalDate, unmarshalMapOfObject, unmarshalArrayOfObject } from "@scaleway/sdk-client";
2
- const unmarshalCapacity = (data) => {
3
- if (!isJSONObject(data)) {
4
- throw new TypeError(
5
- `Unmarshalling the type 'Capacity' failed as data isn't a dictionary.`
6
- );
7
- }
8
- return {
9
- cooldownDelay: data.cooldown_delay,
10
- maxReplicas: data.max_replicas,
11
- minReplicas: data.min_replicas
12
- };
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMapOfObject } from "@scaleway/sdk-client";
2
+ var unmarshalCapacity = (data) => {
3
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Capacity' failed as data isn't a dictionary.`);
4
+ return {
5
+ cooldownDelay: data.cooldown_delay,
6
+ maxReplicas: data.max_replicas,
7
+ minReplicas: data.min_replicas
8
+ };
13
9
  };
14
- const unmarshalLoadbalancer = (data) => {
15
- if (!isJSONObject(data)) {
16
- throw new TypeError(
17
- `Unmarshalling the type 'Loadbalancer' failed as data isn't a dictionary.`
18
- );
19
- }
20
- return {
21
- backendIds: data.backend_ids,
22
- id: data.id,
23
- privateNetworkId: data.private_network_id
24
- };
10
+ var unmarshalLoadbalancer = (data) => {
11
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Loadbalancer' failed as data isn't a dictionary.`);
12
+ return {
13
+ backendIds: data.backend_ids,
14
+ id: data.id,
15
+ privateNetworkId: data.private_network_id
16
+ };
25
17
  };
26
18
  const unmarshalInstanceGroup = (data) => {
27
- if (!isJSONObject(data)) {
28
- throw new TypeError(
29
- `Unmarshalling the type 'InstanceGroup' failed as data isn't a dictionary.`
30
- );
31
- }
32
- return {
33
- capacity: unmarshalCapacity(data.capacity),
34
- createdAt: unmarshalDate(data.created_at),
35
- errorMessages: data.error_messages,
36
- id: data.id,
37
- instanceTemplateId: data.instance_template_id,
38
- loadbalancer: unmarshalLoadbalancer(data.loadbalancer),
39
- name: data.name,
40
- projectId: data.project_id,
41
- tags: data.tags,
42
- updatedAt: unmarshalDate(data.updated_at),
43
- zone: data.zone
44
- };
19
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceGroup' failed as data isn't a dictionary.`);
20
+ return {
21
+ capacity: unmarshalCapacity(data.capacity),
22
+ createdAt: unmarshalDate(data.created_at),
23
+ errorMessages: data.error_messages,
24
+ id: data.id,
25
+ instanceTemplateId: data.instance_template_id,
26
+ loadbalancer: unmarshalLoadbalancer(data.loadbalancer),
27
+ name: data.name,
28
+ projectId: data.project_id,
29
+ tags: data.tags,
30
+ updatedAt: unmarshalDate(data.updated_at),
31
+ zone: data.zone
32
+ };
45
33
  };
46
- const unmarshalMetric = (data) => {
47
- if (!isJSONObject(data)) {
48
- throw new TypeError(
49
- `Unmarshalling the type 'Metric' failed as data isn't a dictionary.`
50
- );
51
- }
52
- return {
53
- aggregate: data.aggregate,
54
- cockpitMetricName: data.cockpit_metric_name,
55
- managedMetric: data.managed_metric ? data.managed_metric : void 0,
56
- name: data.name,
57
- operator: data.operator,
58
- samplingRangeMin: data.sampling_range_min,
59
- threshold: data.threshold
60
- };
34
+ var unmarshalMetric = (data) => {
35
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Metric' failed as data isn't a dictionary.`);
36
+ return {
37
+ aggregate: data.aggregate,
38
+ cockpitMetricName: data.cockpit_metric_name,
39
+ managedMetric: data.managed_metric ? data.managed_metric : void 0,
40
+ name: data.name,
41
+ operator: data.operator,
42
+ samplingRangeMin: data.sampling_range_min,
43
+ threshold: data.threshold
44
+ };
61
45
  };
62
46
  const unmarshalInstancePolicy = (data) => {
63
- if (!isJSONObject(data)) {
64
- throw new TypeError(
65
- `Unmarshalling the type 'InstancePolicy' failed as data isn't a dictionary.`
66
- );
67
- }
68
- return {
69
- action: data.action,
70
- id: data.id,
71
- instanceGroupId: data.instance_group_id,
72
- metric: data.metric ? unmarshalMetric(data.metric) : void 0,
73
- name: data.name,
74
- priority: data.priority,
75
- type: data.type,
76
- value: data.value,
77
- zone: data.zone
78
- };
47
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstancePolicy' failed as data isn't a dictionary.`);
48
+ return {
49
+ action: data.action,
50
+ id: data.id,
51
+ instanceGroupId: data.instance_group_id,
52
+ metric: data.metric ? unmarshalMetric(data.metric) : void 0,
53
+ name: data.name,
54
+ priority: data.priority,
55
+ type: data.type,
56
+ value: data.value,
57
+ zone: data.zone
58
+ };
79
59
  };
80
- const unmarshalVolumeInstanceTemplateFromEmpty = (data) => {
81
- if (!isJSONObject(data)) {
82
- throw new TypeError(
83
- `Unmarshalling the type 'VolumeInstanceTemplateFromEmpty' failed as data isn't a dictionary.`
84
- );
85
- }
86
- return {
87
- size: data.size
88
- };
60
+ var unmarshalVolumeInstanceTemplateFromEmpty = (data) => {
61
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeInstanceTemplateFromEmpty' failed as data isn't a dictionary.`);
62
+ return { size: data.size };
89
63
  };
90
- const unmarshalVolumeInstanceTemplateFromSnapshot = (data) => {
91
- if (!isJSONObject(data)) {
92
- throw new TypeError(
93
- `Unmarshalling the type 'VolumeInstanceTemplateFromSnapshot' failed as data isn't a dictionary.`
94
- );
95
- }
96
- return {
97
- size: data.size,
98
- snapshotId: data.snapshot_id
99
- };
64
+ var unmarshalVolumeInstanceTemplateFromSnapshot = (data) => {
65
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeInstanceTemplateFromSnapshot' failed as data isn't a dictionary.`);
66
+ return {
67
+ size: data.size,
68
+ snapshotId: data.snapshot_id
69
+ };
100
70
  };
101
- const unmarshalVolumeInstanceTemplate = (data) => {
102
- if (!isJSONObject(data)) {
103
- throw new TypeError(
104
- `Unmarshalling the type 'VolumeInstanceTemplate' failed as data isn't a dictionary.`
105
- );
106
- }
107
- return {
108
- boot: data.boot,
109
- fromEmpty: data.from_empty ? unmarshalVolumeInstanceTemplateFromEmpty(data.from_empty) : void 0,
110
- fromSnapshot: data.from_snapshot ? unmarshalVolumeInstanceTemplateFromSnapshot(data.from_snapshot) : void 0,
111
- name: data.name,
112
- perfIops: data.perf_iops,
113
- tags: data.tags,
114
- volumeType: data.volume_type
115
- };
71
+ var unmarshalVolumeInstanceTemplate = (data) => {
72
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeInstanceTemplate' failed as data isn't a dictionary.`);
73
+ return {
74
+ boot: data.boot,
75
+ fromEmpty: data.from_empty ? unmarshalVolumeInstanceTemplateFromEmpty(data.from_empty) : void 0,
76
+ fromSnapshot: data.from_snapshot ? unmarshalVolumeInstanceTemplateFromSnapshot(data.from_snapshot) : void 0,
77
+ name: data.name,
78
+ perfIops: data.perf_iops,
79
+ tags: data.tags,
80
+ volumeType: data.volume_type
81
+ };
116
82
  };
117
83
  const unmarshalInstanceTemplate = (data) => {
118
- if (!isJSONObject(data)) {
119
- throw new TypeError(
120
- `Unmarshalling the type 'InstanceTemplate' failed as data isn't a dictionary.`
121
- );
122
- }
123
- return {
124
- cloudInit: data.cloud_init,
125
- commercialType: data.commercial_type,
126
- createdAt: unmarshalDate(data.created_at),
127
- id: data.id,
128
- imageId: data.image_id,
129
- name: data.name,
130
- placementGroupId: data.placement_group_id,
131
- privateNetworkIds: data.private_network_ids,
132
- projectId: data.project_id,
133
- publicIpsV4Count: data.public_ips_v4_count,
134
- publicIpsV6Count: data.public_ips_v6_count,
135
- securityGroupId: data.security_group_id,
136
- status: data.status,
137
- tags: data.tags,
138
- updatedAt: unmarshalDate(data.updated_at),
139
- volumes: unmarshalMapOfObject(data.volumes, unmarshalVolumeInstanceTemplate),
140
- zone: data.zone
141
- };
84
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceTemplate' failed as data isn't a dictionary.`);
85
+ return {
86
+ cloudInit: data.cloud_init,
87
+ commercialType: data.commercial_type,
88
+ createdAt: unmarshalDate(data.created_at),
89
+ id: data.id,
90
+ imageId: data.image_id,
91
+ name: data.name,
92
+ placementGroupId: data.placement_group_id,
93
+ privateNetworkIds: data.private_network_ids,
94
+ projectId: data.project_id,
95
+ publicIpsV4Count: data.public_ips_v4_count,
96
+ publicIpsV6Count: data.public_ips_v6_count,
97
+ securityGroupId: data.security_group_id,
98
+ status: data.status,
99
+ tags: data.tags,
100
+ updatedAt: unmarshalDate(data.updated_at),
101
+ volumes: unmarshalMapOfObject(data.volumes, unmarshalVolumeInstanceTemplate),
102
+ zone: data.zone
103
+ };
142
104
  };
143
- const unmarshalInstanceGroupEvent = (data) => {
144
- if (!isJSONObject(data)) {
145
- throw new TypeError(
146
- `Unmarshalling the type 'InstanceGroupEvent' failed as data isn't a dictionary.`
147
- );
148
- }
149
- return {
150
- createdAt: unmarshalDate(data.created_at),
151
- details: data.details,
152
- id: data.id,
153
- level: data.level,
154
- name: data.name,
155
- source: data.source
156
- };
105
+ var unmarshalInstanceGroupEvent = (data) => {
106
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceGroupEvent' failed as data isn't a dictionary.`);
107
+ return {
108
+ createdAt: unmarshalDate(data.created_at),
109
+ details: data.details,
110
+ id: data.id,
111
+ level: data.level,
112
+ name: data.name,
113
+ source: data.source
114
+ };
157
115
  };
158
116
  const unmarshalListInstanceGroupEventsResponse = (data) => {
159
- if (!isJSONObject(data)) {
160
- throw new TypeError(
161
- `Unmarshalling the type 'ListInstanceGroupEventsResponse' failed as data isn't a dictionary.`
162
- );
163
- }
164
- return {
165
- instanceEvents: unmarshalArrayOfObject(data.instance_events, unmarshalInstanceGroupEvent),
166
- totalCount: data.total_count
167
- };
117
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstanceGroupEventsResponse' failed as data isn't a dictionary.`);
118
+ return {
119
+ instanceEvents: unmarshalArrayOfObject(data.instance_events, unmarshalInstanceGroupEvent),
120
+ totalCount: data.total_count
121
+ };
168
122
  };
169
123
  const unmarshalListInstanceGroupsResponse = (data) => {
170
- if (!isJSONObject(data)) {
171
- throw new TypeError(
172
- `Unmarshalling the type 'ListInstanceGroupsResponse' failed as data isn't a dictionary.`
173
- );
174
- }
175
- return {
176
- instanceGroups: unmarshalArrayOfObject(data.instance_groups, unmarshalInstanceGroup),
177
- totalCount: data.total_count
178
- };
124
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstanceGroupsResponse' failed as data isn't a dictionary.`);
125
+ return {
126
+ instanceGroups: unmarshalArrayOfObject(data.instance_groups, unmarshalInstanceGroup),
127
+ totalCount: data.total_count
128
+ };
179
129
  };
180
130
  const unmarshalListInstancePoliciesResponse = (data) => {
181
- if (!isJSONObject(data)) {
182
- throw new TypeError(
183
- `Unmarshalling the type 'ListInstancePoliciesResponse' failed as data isn't a dictionary.`
184
- );
185
- }
186
- return {
187
- policies: unmarshalArrayOfObject(data.policies, unmarshalInstancePolicy),
188
- totalCount: data.total_count
189
- };
131
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstancePoliciesResponse' failed as data isn't a dictionary.`);
132
+ return {
133
+ policies: unmarshalArrayOfObject(data.policies, unmarshalInstancePolicy),
134
+ totalCount: data.total_count
135
+ };
190
136
  };
191
137
  const unmarshalListInstanceTemplatesResponse = (data) => {
192
- if (!isJSONObject(data)) {
193
- throw new TypeError(
194
- `Unmarshalling the type 'ListInstanceTemplatesResponse' failed as data isn't a dictionary.`
195
- );
196
- }
197
- return {
198
- instanceTemplates: unmarshalArrayOfObject(data.instance_templates, unmarshalInstanceTemplate),
199
- totalCount: data.total_count
200
- };
138
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstanceTemplatesResponse' failed as data isn't a dictionary.`);
139
+ return {
140
+ instanceTemplates: unmarshalArrayOfObject(data.instance_templates, unmarshalInstanceTemplate),
141
+ totalCount: data.total_count
142
+ };
201
143
  };
202
- const marshalCapacity = (request, defaults) => ({
203
- cooldown_delay: request.cooldownDelay,
204
- max_replicas: request.maxReplicas,
205
- min_replicas: request.minReplicas
144
+ var marshalCapacity = (request, defaults) => ({
145
+ cooldown_delay: request.cooldownDelay,
146
+ max_replicas: request.maxReplicas,
147
+ min_replicas: request.minReplicas
206
148
  });
207
- const marshalLoadbalancer = (request, defaults) => ({
208
- backend_ids: request.backendIds,
209
- id: request.id,
210
- private_network_id: request.privateNetworkId
149
+ var marshalLoadbalancer = (request, defaults) => ({
150
+ backend_ids: request.backendIds,
151
+ id: request.id,
152
+ private_network_id: request.privateNetworkId
211
153
  });
212
154
  const marshalCreateInstanceGroupRequest = (request, defaults) => ({
213
- capacity: marshalCapacity(request.capacity),
214
- loadbalancer: marshalLoadbalancer(request.loadbalancer),
215
- name: request.name,
216
- project_id: request.projectId ?? defaults.defaultProjectId,
217
- tags: request.tags,
218
- template_id: request.templateId
155
+ capacity: marshalCapacity(request.capacity, defaults),
156
+ loadbalancer: marshalLoadbalancer(request.loadbalancer, defaults),
157
+ name: request.name,
158
+ project_id: request.projectId ?? defaults.defaultProjectId,
159
+ tags: request.tags,
160
+ template_id: request.templateId
219
161
  });
220
- const marshalMetric = (request, defaults) => ({
221
- aggregate: request.aggregate,
222
- name: request.name,
223
- operator: request.operator,
224
- sampling_range_min: request.samplingRangeMin,
225
- threshold: request.threshold,
226
- ...resolveOneOf([
227
- {
228
- param: "managed_metric",
229
- value: request.managedMetric
230
- },
231
- {
232
- param: "cockpit_metric_name",
233
- value: request.cockpitMetricName
234
- }
235
- ])
162
+ var marshalMetric = (request, defaults) => ({
163
+ aggregate: request.aggregate,
164
+ name: request.name,
165
+ operator: request.operator,
166
+ sampling_range_min: request.samplingRangeMin,
167
+ threshold: request.threshold,
168
+ ...resolveOneOf([{
169
+ param: "managed_metric",
170
+ value: request.managedMetric
171
+ }, {
172
+ param: "cockpit_metric_name",
173
+ value: request.cockpitMetricName
174
+ }])
236
175
  });
237
176
  const marshalCreateInstancePolicyRequest = (request, defaults) => ({
238
- action: request.action,
239
- instance_group_id: request.instanceGroupId,
240
- name: request.name,
241
- priority: request.priority,
242
- type: request.type,
243
- value: request.value,
244
- ...resolveOneOf([
245
- {
246
- param: "metric",
247
- value: request.metric !== void 0 ? marshalMetric(request.metric) : void 0
248
- }
249
- ])
177
+ action: request.action,
178
+ instance_group_id: request.instanceGroupId,
179
+ name: request.name,
180
+ priority: request.priority,
181
+ type: request.type,
182
+ value: request.value,
183
+ ...resolveOneOf([{
184
+ param: "metric",
185
+ value: request.metric !== void 0 ? marshalMetric(request.metric, defaults) : void 0
186
+ }])
250
187
  });
251
- const marshalVolumeInstanceTemplateFromEmpty = (request, defaults) => ({
252
- size: request.size
188
+ var marshalVolumeInstanceTemplateFromEmpty = (request, defaults) => ({ size: request.size });
189
+ var marshalVolumeInstanceTemplateFromSnapshot = (request, defaults) => ({
190
+ size: request.size,
191
+ snapshot_id: request.snapshotId
253
192
  });
254
- const marshalVolumeInstanceTemplateFromSnapshot = (request, defaults) => ({
255
- size: request.size,
256
- snapshot_id: request.snapshotId
257
- });
258
- const marshalVolumeInstanceTemplate = (request, defaults) => ({
259
- boot: request.boot,
260
- name: request.name,
261
- tags: request.tags,
262
- volume_type: request.volumeType,
263
- ...resolveOneOf([
264
- {
265
- param: "from_empty",
266
- value: request.fromEmpty !== void 0 ? marshalVolumeInstanceTemplateFromEmpty(request.fromEmpty) : void 0
267
- },
268
- {
269
- param: "from_snapshot",
270
- value: request.fromSnapshot !== void 0 ? marshalVolumeInstanceTemplateFromSnapshot(request.fromSnapshot) : void 0
271
- }
272
- ]),
273
- ...resolveOneOf([
274
- {
275
- param: "perf_iops",
276
- value: request.perfIops
277
- }
278
- ])
193
+ var marshalVolumeInstanceTemplate = (request, defaults) => ({
194
+ boot: request.boot,
195
+ name: request.name,
196
+ tags: request.tags,
197
+ volume_type: request.volumeType,
198
+ ...resolveOneOf([{
199
+ param: "from_empty",
200
+ value: request.fromEmpty !== void 0 ? marshalVolumeInstanceTemplateFromEmpty(request.fromEmpty, defaults) : void 0
201
+ }, {
202
+ param: "from_snapshot",
203
+ value: request.fromSnapshot !== void 0 ? marshalVolumeInstanceTemplateFromSnapshot(request.fromSnapshot, defaults) : void 0
204
+ }]),
205
+ ...resolveOneOf([{
206
+ param: "perf_iops",
207
+ value: request.perfIops
208
+ }])
279
209
  });
280
210
  const marshalCreateInstanceTemplateRequest = (request, defaults) => ({
281
- cloud_init: request.cloudInit,
282
- commercial_type: request.commercialType,
283
- image_id: request.imageId,
284
- name: request.name,
285
- placement_group_id: request.placementGroupId,
286
- private_network_ids: request.privateNetworkIds,
287
- project_id: request.projectId ?? defaults.defaultProjectId,
288
- public_ips_v4_count: request.publicIpsV4Count,
289
- public_ips_v6_count: request.publicIpsV6Count,
290
- security_group_id: request.securityGroupId,
291
- tags: request.tags,
292
- volumes: Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeInstanceTemplate(value) }), {})
293
- });
294
- const marshalUpdateInstanceGroupRequestCapacity = (request, defaults) => ({
295
- cooldown_delay: request.cooldownDelay,
296
- max_replicas: request.maxReplicas,
297
- min_replicas: request.minReplicas
211
+ cloud_init: request.cloudInit,
212
+ commercial_type: request.commercialType,
213
+ image_id: request.imageId,
214
+ name: request.name,
215
+ placement_group_id: request.placementGroupId,
216
+ private_network_ids: request.privateNetworkIds,
217
+ project_id: request.projectId ?? defaults.defaultProjectId,
218
+ public_ips_v4_count: request.publicIpsV4Count,
219
+ public_ips_v6_count: request.publicIpsV6Count,
220
+ security_group_id: request.securityGroupId,
221
+ tags: request.tags,
222
+ volumes: Object.entries(request.volumes).reduce((acc, [key, value]) => ({
223
+ ...acc,
224
+ [key]: marshalVolumeInstanceTemplate(value, defaults)
225
+ }), {})
298
226
  });
299
- const marshalUpdateInstanceGroupRequestLoadbalancer = (request, defaults) => ({
300
- backend_ids: request.backendIds
227
+ var marshalUpdateInstanceGroupRequestCapacity = (request, defaults) => ({
228
+ cooldown_delay: request.cooldownDelay,
229
+ max_replicas: request.maxReplicas,
230
+ min_replicas: request.minReplicas
301
231
  });
232
+ var marshalUpdateInstanceGroupRequestLoadbalancer = (request, defaults) => ({ backend_ids: request.backendIds });
302
233
  const marshalUpdateInstanceGroupRequest = (request, defaults) => ({
303
- capacity: request.capacity !== void 0 ? marshalUpdateInstanceGroupRequestCapacity(request.capacity) : void 0,
304
- loadbalancer: request.loadbalancer !== void 0 ? marshalUpdateInstanceGroupRequestLoadbalancer(request.loadbalancer) : void 0,
305
- name: request.name,
306
- tags: request.tags
234
+ capacity: request.capacity !== void 0 ? marshalUpdateInstanceGroupRequestCapacity(request.capacity, defaults) : void 0,
235
+ loadbalancer: request.loadbalancer !== void 0 ? marshalUpdateInstanceGroupRequestLoadbalancer(request.loadbalancer, defaults) : void 0,
236
+ name: request.name,
237
+ tags: request.tags
307
238
  });
308
- const marshalUpdateInstancePolicyRequestMetric = (request, defaults) => ({
309
- aggregate: request.aggregate,
310
- name: request.name,
311
- operator: request.operator,
312
- sampling_range_min: request.samplingRangeMin,
313
- threshold: request.threshold,
314
- ...resolveOneOf([
315
- {
316
- param: "managed_metric",
317
- value: request.managedMetric
318
- },
319
- {
320
- param: "cockpit_metric_name",
321
- value: request.cockpitMetricName
322
- }
323
- ])
239
+ var marshalUpdateInstancePolicyRequestMetric = (request, defaults) => ({
240
+ aggregate: request.aggregate,
241
+ name: request.name,
242
+ operator: request.operator,
243
+ sampling_range_min: request.samplingRangeMin,
244
+ threshold: request.threshold,
245
+ ...resolveOneOf([{
246
+ param: "managed_metric",
247
+ value: request.managedMetric
248
+ }, {
249
+ param: "cockpit_metric_name",
250
+ value: request.cockpitMetricName
251
+ }])
324
252
  });
325
253
  const marshalUpdateInstancePolicyRequest = (request, defaults) => ({
326
- action: request.action,
327
- name: request.name,
328
- priority: request.priority,
329
- type: request.type,
330
- value: request.value,
331
- ...resolveOneOf([
332
- {
333
- param: "metric",
334
- value: request.metric !== void 0 ? marshalUpdateInstancePolicyRequestMetric(request.metric) : void 0
335
- }
336
- ])
254
+ action: request.action,
255
+ name: request.name,
256
+ priority: request.priority,
257
+ type: request.type,
258
+ value: request.value,
259
+ ...resolveOneOf([{
260
+ param: "metric",
261
+ value: request.metric !== void 0 ? marshalUpdateInstancePolicyRequestMetric(request.metric, defaults) : void 0
262
+ }])
337
263
  });
338
264
  const marshalUpdateInstanceTemplateRequest = (request, defaults) => ({
339
- cloud_init: request.cloudInit,
340
- commercial_type: request.commercialType,
341
- image_id: request.imageId,
342
- name: request.name,
343
- placement_group_id: request.placementGroupId,
344
- private_network_ids: request.privateNetworkIds,
345
- public_ips_v4_count: request.publicIpsV4Count,
346
- public_ips_v6_count: request.publicIpsV6Count,
347
- security_group_id: request.securityGroupId,
348
- tags: request.tags,
349
- volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeInstanceTemplate(value) }), {}) : void 0
265
+ cloud_init: request.cloudInit,
266
+ commercial_type: request.commercialType,
267
+ image_id: request.imageId,
268
+ name: request.name,
269
+ placement_group_id: request.placementGroupId,
270
+ private_network_ids: request.privateNetworkIds,
271
+ public_ips_v4_count: request.publicIpsV4Count,
272
+ public_ips_v6_count: request.publicIpsV6Count,
273
+ security_group_id: request.securityGroupId,
274
+ tags: request.tags,
275
+ volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({
276
+ ...acc,
277
+ [key]: marshalVolumeInstanceTemplate(value, defaults)
278
+ }), {}) : void 0
350
279
  });
351
- export {
352
- marshalCreateInstanceGroupRequest,
353
- marshalCreateInstancePolicyRequest,
354
- marshalCreateInstanceTemplateRequest,
355
- marshalUpdateInstanceGroupRequest,
356
- marshalUpdateInstancePolicyRequest,
357
- marshalUpdateInstanceTemplateRequest,
358
- unmarshalInstanceGroup,
359
- unmarshalInstancePolicy,
360
- unmarshalInstanceTemplate,
361
- unmarshalListInstanceGroupEventsResponse,
362
- unmarshalListInstanceGroupsResponse,
363
- unmarshalListInstancePoliciesResponse,
364
- unmarshalListInstanceTemplatesResponse
365
- };
280
+ export { marshalCreateInstanceGroupRequest, marshalCreateInstancePolicyRequest, marshalCreateInstanceTemplateRequest, marshalUpdateInstanceGroupRequest, marshalUpdateInstancePolicyRequest, marshalUpdateInstanceTemplateRequest, unmarshalInstanceGroup, unmarshalInstancePolicy, unmarshalInstanceTemplate, unmarshalListInstanceGroupEventsResponse, unmarshalListInstanceGroupsResponse, unmarshalListInstancePoliciesResponse, unmarshalListInstanceTemplatesResponse };