@scaleway/sdk-autoscaling 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,376 +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(
140
- data.volumes,
141
- unmarshalVolumeInstanceTemplate
142
- ),
143
- zone: data.zone
144
- };
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
+ };
145
104
  };
146
- const unmarshalInstanceGroupEvent = (data) => {
147
- if (!isJSONObject(data)) {
148
- throw new TypeError(
149
- `Unmarshalling the type 'InstanceGroupEvent' failed as data isn't a dictionary.`
150
- );
151
- }
152
- return {
153
- createdAt: unmarshalDate(data.created_at),
154
- details: data.details,
155
- id: data.id,
156
- level: data.level,
157
- name: data.name,
158
- source: data.source
159
- };
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
+ };
160
115
  };
161
116
  const unmarshalListInstanceGroupEventsResponse = (data) => {
162
- if (!isJSONObject(data)) {
163
- throw new TypeError(
164
- `Unmarshalling the type 'ListInstanceGroupEventsResponse' failed as data isn't a dictionary.`
165
- );
166
- }
167
- return {
168
- instanceEvents: unmarshalArrayOfObject(
169
- data.instance_events,
170
- unmarshalInstanceGroupEvent
171
- ),
172
- totalCount: data.total_count
173
- };
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
+ };
174
122
  };
175
123
  const unmarshalListInstanceGroupsResponse = (data) => {
176
- if (!isJSONObject(data)) {
177
- throw new TypeError(
178
- `Unmarshalling the type 'ListInstanceGroupsResponse' failed as data isn't a dictionary.`
179
- );
180
- }
181
- return {
182
- instanceGroups: unmarshalArrayOfObject(
183
- data.instance_groups,
184
- unmarshalInstanceGroup
185
- ),
186
- totalCount: data.total_count
187
- };
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
+ };
188
129
  };
189
130
  const unmarshalListInstancePoliciesResponse = (data) => {
190
- if (!isJSONObject(data)) {
191
- throw new TypeError(
192
- `Unmarshalling the type 'ListInstancePoliciesResponse' failed as data isn't a dictionary.`
193
- );
194
- }
195
- return {
196
- policies: unmarshalArrayOfObject(data.policies, unmarshalInstancePolicy),
197
- totalCount: data.total_count
198
- };
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
+ };
199
136
  };
200
137
  const unmarshalListInstanceTemplatesResponse = (data) => {
201
- if (!isJSONObject(data)) {
202
- throw new TypeError(
203
- `Unmarshalling the type 'ListInstanceTemplatesResponse' failed as data isn't a dictionary.`
204
- );
205
- }
206
- return {
207
- instanceTemplates: unmarshalArrayOfObject(
208
- data.instance_templates,
209
- unmarshalInstanceTemplate
210
- ),
211
- totalCount: data.total_count
212
- };
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
+ };
213
143
  };
214
- const marshalCapacity = (request, defaults) => ({
215
- cooldown_delay: request.cooldownDelay,
216
- max_replicas: request.maxReplicas,
217
- min_replicas: request.minReplicas
144
+ var marshalCapacity = (request, defaults) => ({
145
+ cooldown_delay: request.cooldownDelay,
146
+ max_replicas: request.maxReplicas,
147
+ min_replicas: request.minReplicas
218
148
  });
219
- const marshalLoadbalancer = (request, defaults) => ({
220
- backend_ids: request.backendIds,
221
- id: request.id,
222
- 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
223
153
  });
224
154
  const marshalCreateInstanceGroupRequest = (request, defaults) => ({
225
- capacity: marshalCapacity(request.capacity),
226
- loadbalancer: marshalLoadbalancer(request.loadbalancer),
227
- name: request.name,
228
- project_id: request.projectId ?? defaults.defaultProjectId,
229
- tags: request.tags,
230
- 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
231
161
  });
232
- const marshalMetric = (request, defaults) => ({
233
- aggregate: request.aggregate,
234
- name: request.name,
235
- operator: request.operator,
236
- sampling_range_min: request.samplingRangeMin,
237
- threshold: request.threshold,
238
- ...resolveOneOf([
239
- { param: "managed_metric", value: request.managedMetric },
240
- { param: "cockpit_metric_name", value: request.cockpitMetricName }
241
- ])
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
+ }])
242
175
  });
243
176
  const marshalCreateInstancePolicyRequest = (request, defaults) => ({
244
- action: request.action,
245
- instance_group_id: request.instanceGroupId,
246
- name: request.name,
247
- priority: request.priority,
248
- type: request.type,
249
- value: request.value,
250
- ...resolveOneOf([
251
- {
252
- param: "metric",
253
- value: request.metric !== void 0 ? marshalMetric(request.metric) : void 0
254
- }
255
- ])
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
+ }])
256
187
  });
257
- const marshalVolumeInstanceTemplateFromEmpty = (request, defaults) => ({
258
- 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
259
192
  });
260
- const marshalVolumeInstanceTemplateFromSnapshot = (request, defaults) => ({
261
- size: request.size,
262
- snapshot_id: request.snapshotId
263
- });
264
- const marshalVolumeInstanceTemplate = (request, defaults) => ({
265
- boot: request.boot,
266
- name: request.name,
267
- tags: request.tags,
268
- volume_type: request.volumeType,
269
- ...resolveOneOf([
270
- {
271
- param: "from_empty",
272
- value: request.fromEmpty !== void 0 ? marshalVolumeInstanceTemplateFromEmpty(request.fromEmpty) : void 0
273
- },
274
- {
275
- param: "from_snapshot",
276
- value: request.fromSnapshot !== void 0 ? marshalVolumeInstanceTemplateFromSnapshot(
277
- request.fromSnapshot
278
- ) : void 0
279
- }
280
- ]),
281
- ...resolveOneOf([{ param: "perf_iops", value: request.perfIops }])
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
+ }])
282
209
  });
283
210
  const marshalCreateInstanceTemplateRequest = (request, defaults) => ({
284
- cloud_init: request.cloudInit,
285
- commercial_type: request.commercialType,
286
- image_id: request.imageId,
287
- name: request.name,
288
- placement_group_id: request.placementGroupId,
289
- private_network_ids: request.privateNetworkIds,
290
- project_id: request.projectId ?? defaults.defaultProjectId,
291
- public_ips_v4_count: request.publicIpsV4Count,
292
- public_ips_v6_count: request.publicIpsV6Count,
293
- security_group_id: request.securityGroupId,
294
- tags: request.tags,
295
- volumes: Object.entries(request.volumes).reduce(
296
- (acc, [key, value]) => ({
297
- ...acc,
298
- [key]: marshalVolumeInstanceTemplate(value)
299
- }),
300
- {}
301
- )
302
- });
303
- const marshalUpdateInstanceGroupRequestCapacity = (request, defaults) => ({
304
- cooldown_delay: request.cooldownDelay,
305
- max_replicas: request.maxReplicas,
306
- 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
+ }), {})
307
226
  });
308
- const marshalUpdateInstanceGroupRequestLoadbalancer = (request, defaults) => ({
309
- backend_ids: request.backendIds
227
+ var marshalUpdateInstanceGroupRequestCapacity = (request, defaults) => ({
228
+ cooldown_delay: request.cooldownDelay,
229
+ max_replicas: request.maxReplicas,
230
+ min_replicas: request.minReplicas
310
231
  });
232
+ var marshalUpdateInstanceGroupRequestLoadbalancer = (request, defaults) => ({ backend_ids: request.backendIds });
311
233
  const marshalUpdateInstanceGroupRequest = (request, defaults) => ({
312
- capacity: request.capacity !== void 0 ? marshalUpdateInstanceGroupRequestCapacity(request.capacity) : void 0,
313
- loadbalancer: request.loadbalancer !== void 0 ? marshalUpdateInstanceGroupRequestLoadbalancer(
314
- request.loadbalancer
315
- ) : void 0,
316
- name: request.name,
317
- 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
318
238
  });
319
- const marshalUpdateInstancePolicyRequestMetric = (request, defaults) => ({
320
- aggregate: request.aggregate,
321
- name: request.name,
322
- operator: request.operator,
323
- sampling_range_min: request.samplingRangeMin,
324
- threshold: request.threshold,
325
- ...resolveOneOf([
326
- { param: "managed_metric", value: request.managedMetric },
327
- { param: "cockpit_metric_name", value: request.cockpitMetricName }
328
- ])
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
+ }])
329
252
  });
330
253
  const marshalUpdateInstancePolicyRequest = (request, defaults) => ({
331
- action: request.action,
332
- name: request.name,
333
- priority: request.priority,
334
- type: request.type,
335
- value: request.value,
336
- ...resolveOneOf([
337
- {
338
- param: "metric",
339
- value: request.metric !== void 0 ? marshalUpdateInstancePolicyRequestMetric(request.metric) : void 0
340
- }
341
- ])
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
+ }])
342
263
  });
343
264
  const marshalUpdateInstanceTemplateRequest = (request, defaults) => ({
344
- cloud_init: request.cloudInit,
345
- commercial_type: request.commercialType,
346
- image_id: request.imageId,
347
- name: request.name,
348
- placement_group_id: request.placementGroupId,
349
- private_network_ids: request.privateNetworkIds,
350
- public_ips_v4_count: request.publicIpsV4Count,
351
- public_ips_v6_count: request.publicIpsV6Count,
352
- security_group_id: request.securityGroupId,
353
- tags: request.tags,
354
- volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce(
355
- (acc, [key, value]) => ({
356
- ...acc,
357
- [key]: marshalVolumeInstanceTemplate(value)
358
- }),
359
- {}
360
- ) : 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
361
279
  });
362
- export {
363
- marshalCreateInstanceGroupRequest,
364
- marshalCreateInstancePolicyRequest,
365
- marshalCreateInstanceTemplateRequest,
366
- marshalUpdateInstanceGroupRequest,
367
- marshalUpdateInstancePolicyRequest,
368
- marshalUpdateInstanceTemplateRequest,
369
- unmarshalInstanceGroup,
370
- unmarshalInstancePolicy,
371
- unmarshalInstanceTemplate,
372
- unmarshalListInstanceGroupEventsResponse,
373
- unmarshalListInstanceGroupsResponse,
374
- unmarshalListInstancePoliciesResponse,
375
- unmarshalListInstanceTemplatesResponse
376
- };
280
+ export { marshalCreateInstanceGroupRequest, marshalCreateInstancePolicyRequest, marshalCreateInstanceTemplateRequest, marshalUpdateInstanceGroupRequest, marshalUpdateInstancePolicyRequest, marshalUpdateInstanceTemplateRequest, unmarshalInstanceGroup, unmarshalInstancePolicy, unmarshalInstanceTemplate, unmarshalListInstanceGroupEventsResponse, unmarshalListInstanceGroupsResponse, unmarshalListInstancePoliciesResponse, unmarshalListInstanceTemplatesResponse };