@aws-sdk/client-auto-scaling-plans 3.310.0 → 3.315.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,57 +1,39 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, serializeFloat as __serializeFloat, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, serializeFloat as __serializeFloat, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { AutoScalingPlansServiceException as __BaseException } from "../models/AutoScalingPlansServiceException";
4
4
  import { ConcurrentUpdateException, InternalServiceException, InvalidNextTokenException, LimitExceededException, ObjectNotFoundException, ValidationException, } from "../models/models_0";
5
5
  export const se_CreateScalingPlanCommand = async (input, context) => {
6
- const headers = {
7
- "content-type": "application/x-amz-json-1.1",
8
- "x-amz-target": "AnyScaleScalingPlannerFrontendService.CreateScalingPlan",
9
- };
6
+ const headers = sharedHeaders("CreateScalingPlan");
10
7
  let body;
11
8
  body = JSON.stringify(se_CreateScalingPlanRequest(input, context));
12
9
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
10
  };
14
11
  export const se_DeleteScalingPlanCommand = async (input, context) => {
15
- const headers = {
16
- "content-type": "application/x-amz-json-1.1",
17
- "x-amz-target": "AnyScaleScalingPlannerFrontendService.DeleteScalingPlan",
18
- };
12
+ const headers = sharedHeaders("DeleteScalingPlan");
19
13
  let body;
20
- body = JSON.stringify(se_DeleteScalingPlanRequest(input, context));
14
+ body = JSON.stringify(_json(input));
21
15
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
16
  };
23
17
  export const se_DescribeScalingPlanResourcesCommand = async (input, context) => {
24
- const headers = {
25
- "content-type": "application/x-amz-json-1.1",
26
- "x-amz-target": "AnyScaleScalingPlannerFrontendService.DescribeScalingPlanResources",
27
- };
18
+ const headers = sharedHeaders("DescribeScalingPlanResources");
28
19
  let body;
29
- body = JSON.stringify(se_DescribeScalingPlanResourcesRequest(input, context));
20
+ body = JSON.stringify(_json(input));
30
21
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
22
  };
32
23
  export const se_DescribeScalingPlansCommand = async (input, context) => {
33
- const headers = {
34
- "content-type": "application/x-amz-json-1.1",
35
- "x-amz-target": "AnyScaleScalingPlannerFrontendService.DescribeScalingPlans",
36
- };
24
+ const headers = sharedHeaders("DescribeScalingPlans");
37
25
  let body;
38
- body = JSON.stringify(se_DescribeScalingPlansRequest(input, context));
26
+ body = JSON.stringify(_json(input));
39
27
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
28
  };
41
29
  export const se_GetScalingPlanResourceForecastDataCommand = async (input, context) => {
42
- const headers = {
43
- "content-type": "application/x-amz-json-1.1",
44
- "x-amz-target": "AnyScaleScalingPlannerFrontendService.GetScalingPlanResourceForecastData",
45
- };
30
+ const headers = sharedHeaders("GetScalingPlanResourceForecastData");
46
31
  let body;
47
32
  body = JSON.stringify(se_GetScalingPlanResourceForecastDataRequest(input, context));
48
33
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
34
  };
50
35
  export const se_UpdateScalingPlanCommand = async (input, context) => {
51
- const headers = {
52
- "content-type": "application/x-amz-json-1.1",
53
- "x-amz-target": "AnyScaleScalingPlannerFrontendService.UpdateScalingPlan",
54
- };
36
+ const headers = sharedHeaders("UpdateScalingPlan");
55
37
  let body;
56
38
  body = JSON.stringify(se_UpdateScalingPlanRequest(input, context));
57
39
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
@@ -62,12 +44,12 @@ export const de_CreateScalingPlanCommand = async (output, context) => {
62
44
  }
63
45
  const data = await parseBody(output.body, context);
64
46
  let contents = {};
65
- contents = de_CreateScalingPlanResponse(data, context);
47
+ contents = _json(data);
66
48
  const response = {
67
49
  $metadata: deserializeMetadata(output),
68
50
  ...contents,
69
51
  };
70
- return Promise.resolve(response);
52
+ return response;
71
53
  };
72
54
  const de_CreateScalingPlanCommandError = async (output, context) => {
73
55
  const parsedOutput = {
@@ -90,10 +72,9 @@ const de_CreateScalingPlanCommandError = async (output, context) => {
90
72
  throw await de_ValidationExceptionRes(parsedOutput, context);
91
73
  default:
92
74
  const parsedBody = parsedOutput.body;
93
- throwDefaultError({
75
+ return throwDefaultError({
94
76
  output,
95
77
  parsedBody,
96
- exceptionCtor: __BaseException,
97
78
  errorCode,
98
79
  });
99
80
  }
@@ -104,12 +85,12 @@ export const de_DeleteScalingPlanCommand = async (output, context) => {
104
85
  }
105
86
  const data = await parseBody(output.body, context);
106
87
  let contents = {};
107
- contents = de_DeleteScalingPlanResponse(data, context);
88
+ contents = _json(data);
108
89
  const response = {
109
90
  $metadata: deserializeMetadata(output),
110
91
  ...contents,
111
92
  };
112
- return Promise.resolve(response);
93
+ return response;
113
94
  };
114
95
  const de_DeleteScalingPlanCommandError = async (output, context) => {
115
96
  const parsedOutput = {
@@ -132,10 +113,9 @@ const de_DeleteScalingPlanCommandError = async (output, context) => {
132
113
  throw await de_ValidationExceptionRes(parsedOutput, context);
133
114
  default:
134
115
  const parsedBody = parsedOutput.body;
135
- throwDefaultError({
116
+ return throwDefaultError({
136
117
  output,
137
118
  parsedBody,
138
- exceptionCtor: __BaseException,
139
119
  errorCode,
140
120
  });
141
121
  }
@@ -151,7 +131,7 @@ export const de_DescribeScalingPlanResourcesCommand = async (output, context) =>
151
131
  $metadata: deserializeMetadata(output),
152
132
  ...contents,
153
133
  };
154
- return Promise.resolve(response);
134
+ return response;
155
135
  };
156
136
  const de_DescribeScalingPlanResourcesCommandError = async (output, context) => {
157
137
  const parsedOutput = {
@@ -174,10 +154,9 @@ const de_DescribeScalingPlanResourcesCommandError = async (output, context) => {
174
154
  throw await de_ValidationExceptionRes(parsedOutput, context);
175
155
  default:
176
156
  const parsedBody = parsedOutput.body;
177
- throwDefaultError({
157
+ return throwDefaultError({
178
158
  output,
179
159
  parsedBody,
180
- exceptionCtor: __BaseException,
181
160
  errorCode,
182
161
  });
183
162
  }
@@ -193,7 +172,7 @@ export const de_DescribeScalingPlansCommand = async (output, context) => {
193
172
  $metadata: deserializeMetadata(output),
194
173
  ...contents,
195
174
  };
196
- return Promise.resolve(response);
175
+ return response;
197
176
  };
198
177
  const de_DescribeScalingPlansCommandError = async (output, context) => {
199
178
  const parsedOutput = {
@@ -216,10 +195,9 @@ const de_DescribeScalingPlansCommandError = async (output, context) => {
216
195
  throw await de_ValidationExceptionRes(parsedOutput, context);
217
196
  default:
218
197
  const parsedBody = parsedOutput.body;
219
- throwDefaultError({
198
+ return throwDefaultError({
220
199
  output,
221
200
  parsedBody,
222
- exceptionCtor: __BaseException,
223
201
  errorCode,
224
202
  });
225
203
  }
@@ -235,7 +213,7 @@ export const de_GetScalingPlanResourceForecastDataCommand = async (output, conte
235
213
  $metadata: deserializeMetadata(output),
236
214
  ...contents,
237
215
  };
238
- return Promise.resolve(response);
216
+ return response;
239
217
  };
240
218
  const de_GetScalingPlanResourceForecastDataCommandError = async (output, context) => {
241
219
  const parsedOutput = {
@@ -252,10 +230,9 @@ const de_GetScalingPlanResourceForecastDataCommandError = async (output, context
252
230
  throw await de_ValidationExceptionRes(parsedOutput, context);
253
231
  default:
254
232
  const parsedBody = parsedOutput.body;
255
- throwDefaultError({
233
+ return throwDefaultError({
256
234
  output,
257
235
  parsedBody,
258
- exceptionCtor: __BaseException,
259
236
  errorCode,
260
237
  });
261
238
  }
@@ -266,12 +243,12 @@ export const de_UpdateScalingPlanCommand = async (output, context) => {
266
243
  }
267
244
  const data = await parseBody(output.body, context);
268
245
  let contents = {};
269
- contents = de_UpdateScalingPlanResponse(data, context);
246
+ contents = _json(data);
270
247
  const response = {
271
248
  $metadata: deserializeMetadata(output),
272
249
  ...contents,
273
250
  };
274
- return Promise.resolve(response);
251
+ return response;
275
252
  };
276
253
  const de_UpdateScalingPlanCommandError = async (output, context) => {
277
254
  const parsedOutput = {
@@ -294,17 +271,16 @@ const de_UpdateScalingPlanCommandError = async (output, context) => {
294
271
  throw await de_ValidationExceptionRes(parsedOutput, context);
295
272
  default:
296
273
  const parsedBody = parsedOutput.body;
297
- throwDefaultError({
274
+ return throwDefaultError({
298
275
  output,
299
276
  parsedBody,
300
- exceptionCtor: __BaseException,
301
277
  errorCode,
302
278
  });
303
279
  }
304
280
  };
305
281
  const de_ConcurrentUpdateExceptionRes = async (parsedOutput, context) => {
306
282
  const body = parsedOutput.body;
307
- const deserialized = de_ConcurrentUpdateException(body, context);
283
+ const deserialized = _json(body);
308
284
  const exception = new ConcurrentUpdateException({
309
285
  $metadata: deserializeMetadata(parsedOutput),
310
286
  ...deserialized,
@@ -313,7 +289,7 @@ const de_ConcurrentUpdateExceptionRes = async (parsedOutput, context) => {
313
289
  };
314
290
  const de_InternalServiceExceptionRes = async (parsedOutput, context) => {
315
291
  const body = parsedOutput.body;
316
- const deserialized = de_InternalServiceException(body, context);
292
+ const deserialized = _json(body);
317
293
  const exception = new InternalServiceException({
318
294
  $metadata: deserializeMetadata(parsedOutput),
319
295
  ...deserialized,
@@ -322,7 +298,7 @@ const de_InternalServiceExceptionRes = async (parsedOutput, context) => {
322
298
  };
323
299
  const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
324
300
  const body = parsedOutput.body;
325
- const deserialized = de_InvalidNextTokenException(body, context);
301
+ const deserialized = _json(body);
326
302
  const exception = new InvalidNextTokenException({
327
303
  $metadata: deserializeMetadata(parsedOutput),
328
304
  ...deserialized,
@@ -331,7 +307,7 @@ const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
331
307
  };
332
308
  const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
333
309
  const body = parsedOutput.body;
334
- const deserialized = de_LimitExceededException(body, context);
310
+ const deserialized = _json(body);
335
311
  const exception = new LimitExceededException({
336
312
  $metadata: deserializeMetadata(parsedOutput),
337
313
  ...deserialized,
@@ -340,7 +316,7 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
340
316
  };
341
317
  const de_ObjectNotFoundExceptionRes = async (parsedOutput, context) => {
342
318
  const body = parsedOutput.body;
343
- const deserialized = de_ObjectNotFoundException(body, context);
319
+ const deserialized = _json(body);
344
320
  const exception = new ObjectNotFoundException({
345
321
  $metadata: deserializeMetadata(parsedOutput),
346
322
  ...deserialized,
@@ -349,148 +325,49 @@ const de_ObjectNotFoundExceptionRes = async (parsedOutput, context) => {
349
325
  };
350
326
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
351
327
  const body = parsedOutput.body;
352
- const deserialized = de_ValidationException(body, context);
328
+ const deserialized = _json(body);
353
329
  const exception = new ValidationException({
354
330
  $metadata: deserializeMetadata(parsedOutput),
355
331
  ...deserialized,
356
332
  });
357
333
  return __decorateServiceException(exception, body);
358
334
  };
359
- const se_ApplicationSource = (input, context) => {
360
- return {
361
- ...(input.CloudFormationStackARN != null && { CloudFormationStackARN: input.CloudFormationStackARN }),
362
- ...(input.TagFilters != null && { TagFilters: se_TagFilters(input.TagFilters, context) }),
363
- };
364
- };
365
- const se_ApplicationSources = (input, context) => {
366
- return input
367
- .filter((e) => e != null)
368
- .map((entry) => {
369
- return se_ApplicationSource(entry, context);
370
- });
371
- };
372
335
  const se_CreateScalingPlanRequest = (input, context) => {
373
- return {
374
- ...(input.ApplicationSource != null && {
375
- ApplicationSource: se_ApplicationSource(input.ApplicationSource, context),
376
- }),
377
- ...(input.ScalingInstructions != null && {
378
- ScalingInstructions: se_ScalingInstructions(input.ScalingInstructions, context),
379
- }),
380
- ...(input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName }),
381
- };
382
- };
383
- const se_CustomizedLoadMetricSpecification = (input, context) => {
384
- return {
385
- ...(input.Dimensions != null && { Dimensions: se_MetricDimensions(input.Dimensions, context) }),
386
- ...(input.MetricName != null && { MetricName: input.MetricName }),
387
- ...(input.Namespace != null && { Namespace: input.Namespace }),
388
- ...(input.Statistic != null && { Statistic: input.Statistic }),
389
- ...(input.Unit != null && { Unit: input.Unit }),
390
- };
391
- };
392
- const se_CustomizedScalingMetricSpecification = (input, context) => {
393
- return {
394
- ...(input.Dimensions != null && { Dimensions: se_MetricDimensions(input.Dimensions, context) }),
395
- ...(input.MetricName != null && { MetricName: input.MetricName }),
396
- ...(input.Namespace != null && { Namespace: input.Namespace }),
397
- ...(input.Statistic != null && { Statistic: input.Statistic }),
398
- ...(input.Unit != null && { Unit: input.Unit }),
399
- };
400
- };
401
- const se_DeleteScalingPlanRequest = (input, context) => {
402
- return {
403
- ...(input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName }),
404
- ...(input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }),
405
- };
406
- };
407
- const se_DescribeScalingPlanResourcesRequest = (input, context) => {
408
- return {
409
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
410
- ...(input.NextToken != null && { NextToken: input.NextToken }),
411
- ...(input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName }),
412
- ...(input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }),
413
- };
414
- };
415
- const se_DescribeScalingPlansRequest = (input, context) => {
416
- return {
417
- ...(input.ApplicationSources != null && {
418
- ApplicationSources: se_ApplicationSources(input.ApplicationSources, context),
419
- }),
420
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
421
- ...(input.NextToken != null && { NextToken: input.NextToken }),
422
- ...(input.ScalingPlanNames != null && { ScalingPlanNames: se_ScalingPlanNames(input.ScalingPlanNames, context) }),
423
- ...(input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }),
424
- };
336
+ return take(input, {
337
+ ApplicationSource: _json,
338
+ ScalingInstructions: (_) => se_ScalingInstructions(_, context),
339
+ ScalingPlanName: [],
340
+ });
425
341
  };
426
342
  const se_GetScalingPlanResourceForecastDataRequest = (input, context) => {
427
- return {
428
- ...(input.EndTime != null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }),
429
- ...(input.ForecastDataType != null && { ForecastDataType: input.ForecastDataType }),
430
- ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
431
- ...(input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension }),
432
- ...(input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName }),
433
- ...(input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }),
434
- ...(input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }),
435
- ...(input.StartTime != null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }),
436
- };
437
- };
438
- const se_MetricDimension = (input, context) => {
439
- return {
440
- ...(input.Name != null && { Name: input.Name }),
441
- ...(input.Value != null && { Value: input.Value }),
442
- };
443
- };
444
- const se_MetricDimensions = (input, context) => {
445
- return input
446
- .filter((e) => e != null)
447
- .map((entry) => {
448
- return se_MetricDimension(entry, context);
343
+ return take(input, {
344
+ EndTime: (_) => Math.round(_.getTime() / 1000),
345
+ ForecastDataType: [],
346
+ ResourceId: [],
347
+ ScalableDimension: [],
348
+ ScalingPlanName: [],
349
+ ScalingPlanVersion: [],
350
+ ServiceNamespace: [],
351
+ StartTime: (_) => Math.round(_.getTime() / 1000),
449
352
  });
450
353
  };
451
- const se_PredefinedLoadMetricSpecification = (input, context) => {
452
- return {
453
- ...(input.PredefinedLoadMetricType != null && { PredefinedLoadMetricType: input.PredefinedLoadMetricType }),
454
- ...(input.ResourceLabel != null && { ResourceLabel: input.ResourceLabel }),
455
- };
456
- };
457
- const se_PredefinedScalingMetricSpecification = (input, context) => {
458
- return {
459
- ...(input.PredefinedScalingMetricType != null && {
460
- PredefinedScalingMetricType: input.PredefinedScalingMetricType,
461
- }),
462
- ...(input.ResourceLabel != null && { ResourceLabel: input.ResourceLabel }),
463
- };
464
- };
465
354
  const se_ScalingInstruction = (input, context) => {
466
- return {
467
- ...(input.CustomizedLoadMetricSpecification != null && {
468
- CustomizedLoadMetricSpecification: se_CustomizedLoadMetricSpecification(input.CustomizedLoadMetricSpecification, context),
469
- }),
470
- ...(input.DisableDynamicScaling != null && { DisableDynamicScaling: input.DisableDynamicScaling }),
471
- ...(input.MaxCapacity != null && { MaxCapacity: input.MaxCapacity }),
472
- ...(input.MinCapacity != null && { MinCapacity: input.MinCapacity }),
473
- ...(input.PredefinedLoadMetricSpecification != null && {
474
- PredefinedLoadMetricSpecification: se_PredefinedLoadMetricSpecification(input.PredefinedLoadMetricSpecification, context),
475
- }),
476
- ...(input.PredictiveScalingMaxCapacityBehavior != null && {
477
- PredictiveScalingMaxCapacityBehavior: input.PredictiveScalingMaxCapacityBehavior,
478
- }),
479
- ...(input.PredictiveScalingMaxCapacityBuffer != null && {
480
- PredictiveScalingMaxCapacityBuffer: input.PredictiveScalingMaxCapacityBuffer,
481
- }),
482
- ...(input.PredictiveScalingMode != null && { PredictiveScalingMode: input.PredictiveScalingMode }),
483
- ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
484
- ...(input.ScalableDimension != null && { ScalableDimension: input.ScalableDimension }),
485
- ...(input.ScalingPolicyUpdateBehavior != null && {
486
- ScalingPolicyUpdateBehavior: input.ScalingPolicyUpdateBehavior,
487
- }),
488
- ...(input.ScheduledActionBufferTime != null && { ScheduledActionBufferTime: input.ScheduledActionBufferTime }),
489
- ...(input.ServiceNamespace != null && { ServiceNamespace: input.ServiceNamespace }),
490
- ...(input.TargetTrackingConfigurations != null && {
491
- TargetTrackingConfigurations: se_TargetTrackingConfigurations(input.TargetTrackingConfigurations, context),
492
- }),
493
- };
355
+ return take(input, {
356
+ CustomizedLoadMetricSpecification: _json,
357
+ DisableDynamicScaling: [],
358
+ MaxCapacity: [],
359
+ MinCapacity: [],
360
+ PredefinedLoadMetricSpecification: _json,
361
+ PredictiveScalingMaxCapacityBehavior: [],
362
+ PredictiveScalingMaxCapacityBuffer: [],
363
+ PredictiveScalingMode: [],
364
+ ResourceId: [],
365
+ ScalableDimension: [],
366
+ ScalingPolicyUpdateBehavior: [],
367
+ ScheduledActionBufferTime: [],
368
+ ServiceNamespace: [],
369
+ TargetTrackingConfigurations: (_) => se_TargetTrackingConfigurations(_, context),
370
+ });
494
371
  };
495
372
  const se_ScalingInstructions = (input, context) => {
496
373
  return input
@@ -499,47 +376,16 @@ const se_ScalingInstructions = (input, context) => {
499
376
  return se_ScalingInstruction(entry, context);
500
377
  });
501
378
  };
502
- const se_ScalingPlanNames = (input, context) => {
503
- return input
504
- .filter((e) => e != null)
505
- .map((entry) => {
506
- return entry;
507
- });
508
- };
509
- const se_TagFilter = (input, context) => {
510
- return {
511
- ...(input.Key != null && { Key: input.Key }),
512
- ...(input.Values != null && { Values: se_TagValues(input.Values, context) }),
513
- };
514
- };
515
- const se_TagFilters = (input, context) => {
516
- return input
517
- .filter((e) => e != null)
518
- .map((entry) => {
519
- return se_TagFilter(entry, context);
520
- });
521
- };
522
- const se_TagValues = (input, context) => {
523
- return input
524
- .filter((e) => e != null)
525
- .map((entry) => {
526
- return entry;
527
- });
528
- };
529
379
  const se_TargetTrackingConfiguration = (input, context) => {
530
- return {
531
- ...(input.CustomizedScalingMetricSpecification != null && {
532
- CustomizedScalingMetricSpecification: se_CustomizedScalingMetricSpecification(input.CustomizedScalingMetricSpecification, context),
533
- }),
534
- ...(input.DisableScaleIn != null && { DisableScaleIn: input.DisableScaleIn }),
535
- ...(input.EstimatedInstanceWarmup != null && { EstimatedInstanceWarmup: input.EstimatedInstanceWarmup }),
536
- ...(input.PredefinedScalingMetricSpecification != null && {
537
- PredefinedScalingMetricSpecification: se_PredefinedScalingMetricSpecification(input.PredefinedScalingMetricSpecification, context),
538
- }),
539
- ...(input.ScaleInCooldown != null && { ScaleInCooldown: input.ScaleInCooldown }),
540
- ...(input.ScaleOutCooldown != null && { ScaleOutCooldown: input.ScaleOutCooldown }),
541
- ...(input.TargetValue != null && { TargetValue: __serializeFloat(input.TargetValue) }),
542
- };
380
+ return take(input, {
381
+ CustomizedScalingMetricSpecification: _json,
382
+ DisableScaleIn: [],
383
+ EstimatedInstanceWarmup: [],
384
+ PredefinedScalingMetricSpecification: _json,
385
+ ScaleInCooldown: [],
386
+ ScaleOutCooldown: [],
387
+ TargetValue: __serializeFloat,
388
+ });
543
389
  };
544
390
  const se_TargetTrackingConfigurations = (input, context) => {
545
391
  return input
@@ -549,207 +395,98 @@ const se_TargetTrackingConfigurations = (input, context) => {
549
395
  });
550
396
  };
551
397
  const se_UpdateScalingPlanRequest = (input, context) => {
552
- return {
553
- ...(input.ApplicationSource != null && {
554
- ApplicationSource: se_ApplicationSource(input.ApplicationSource, context),
555
- }),
556
- ...(input.ScalingInstructions != null && {
557
- ScalingInstructions: se_ScalingInstructions(input.ScalingInstructions, context),
558
- }),
559
- ...(input.ScalingPlanName != null && { ScalingPlanName: input.ScalingPlanName }),
560
- ...(input.ScalingPlanVersion != null && { ScalingPlanVersion: input.ScalingPlanVersion }),
561
- };
562
- };
563
- const de_ApplicationSource = (output, context) => {
564
- return {
565
- CloudFormationStackARN: __expectString(output.CloudFormationStackARN),
566
- TagFilters: output.TagFilters != null ? de_TagFilters(output.TagFilters, context) : undefined,
567
- };
568
- };
569
- const de_ConcurrentUpdateException = (output, context) => {
570
- return {
571
- Message: __expectString(output.Message),
572
- };
573
- };
574
- const de_CreateScalingPlanResponse = (output, context) => {
575
- return {
576
- ScalingPlanVersion: __expectLong(output.ScalingPlanVersion),
577
- };
578
- };
579
- const de_CustomizedLoadMetricSpecification = (output, context) => {
580
- return {
581
- Dimensions: output.Dimensions != null ? de_MetricDimensions(output.Dimensions, context) : undefined,
582
- MetricName: __expectString(output.MetricName),
583
- Namespace: __expectString(output.Namespace),
584
- Statistic: __expectString(output.Statistic),
585
- Unit: __expectString(output.Unit),
586
- };
587
- };
588
- const de_CustomizedScalingMetricSpecification = (output, context) => {
589
- return {
590
- Dimensions: output.Dimensions != null ? de_MetricDimensions(output.Dimensions, context) : undefined,
591
- MetricName: __expectString(output.MetricName),
592
- Namespace: __expectString(output.Namespace),
593
- Statistic: __expectString(output.Statistic),
594
- Unit: __expectString(output.Unit),
595
- };
398
+ return take(input, {
399
+ ApplicationSource: _json,
400
+ ScalingInstructions: (_) => se_ScalingInstructions(_, context),
401
+ ScalingPlanName: [],
402
+ ScalingPlanVersion: [],
403
+ });
596
404
  };
597
405
  const de_Datapoint = (output, context) => {
598
- return {
599
- Timestamp: output.Timestamp != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.Timestamp))) : undefined,
600
- Value: __limitedParseDouble(output.Value),
601
- };
406
+ return take(output, {
407
+ Timestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
408
+ Value: __limitedParseDouble,
409
+ });
602
410
  };
603
411
  const de_Datapoints = (output, context) => {
604
412
  const retVal = (output || [])
605
413
  .filter((e) => e != null)
606
414
  .map((entry) => {
607
- if (entry === null) {
608
- return null;
609
- }
610
415
  return de_Datapoint(entry, context);
611
416
  });
612
417
  return retVal;
613
418
  };
614
- const de_DeleteScalingPlanResponse = (output, context) => {
615
- return {};
616
- };
617
419
  const de_DescribeScalingPlanResourcesResponse = (output, context) => {
618
- return {
619
- NextToken: __expectString(output.NextToken),
620
- ScalingPlanResources: output.ScalingPlanResources != null ? de_ScalingPlanResources(output.ScalingPlanResources, context) : undefined,
621
- };
420
+ return take(output, {
421
+ NextToken: __expectString,
422
+ ScalingPlanResources: (_) => de_ScalingPlanResources(_, context),
423
+ });
622
424
  };
623
425
  const de_DescribeScalingPlansResponse = (output, context) => {
624
- return {
625
- NextToken: __expectString(output.NextToken),
626
- ScalingPlans: output.ScalingPlans != null ? de_ScalingPlans(output.ScalingPlans, context) : undefined,
627
- };
426
+ return take(output, {
427
+ NextToken: __expectString,
428
+ ScalingPlans: (_) => de_ScalingPlans(_, context),
429
+ });
628
430
  };
629
431
  const de_GetScalingPlanResourceForecastDataResponse = (output, context) => {
630
- return {
631
- Datapoints: output.Datapoints != null ? de_Datapoints(output.Datapoints, context) : undefined,
632
- };
633
- };
634
- const de_InternalServiceException = (output, context) => {
635
- return {
636
- Message: __expectString(output.Message),
637
- };
638
- };
639
- const de_InvalidNextTokenException = (output, context) => {
640
- return {
641
- Message: __expectString(output.Message),
642
- };
643
- };
644
- const de_LimitExceededException = (output, context) => {
645
- return {
646
- Message: __expectString(output.Message),
647
- };
648
- };
649
- const de_MetricDimension = (output, context) => {
650
- return {
651
- Name: __expectString(output.Name),
652
- Value: __expectString(output.Value),
653
- };
654
- };
655
- const de_MetricDimensions = (output, context) => {
656
- const retVal = (output || [])
657
- .filter((e) => e != null)
658
- .map((entry) => {
659
- if (entry === null) {
660
- return null;
661
- }
662
- return de_MetricDimension(entry, context);
432
+ return take(output, {
433
+ Datapoints: (_) => de_Datapoints(_, context),
663
434
  });
664
- return retVal;
665
- };
666
- const de_ObjectNotFoundException = (output, context) => {
667
- return {
668
- Message: __expectString(output.Message),
669
- };
670
- };
671
- const de_PredefinedLoadMetricSpecification = (output, context) => {
672
- return {
673
- PredefinedLoadMetricType: __expectString(output.PredefinedLoadMetricType),
674
- ResourceLabel: __expectString(output.ResourceLabel),
675
- };
676
- };
677
- const de_PredefinedScalingMetricSpecification = (output, context) => {
678
- return {
679
- PredefinedScalingMetricType: __expectString(output.PredefinedScalingMetricType),
680
- ResourceLabel: __expectString(output.ResourceLabel),
681
- };
682
435
  };
683
436
  const de_ScalingInstruction = (output, context) => {
684
- return {
685
- CustomizedLoadMetricSpecification: output.CustomizedLoadMetricSpecification != null
686
- ? de_CustomizedLoadMetricSpecification(output.CustomizedLoadMetricSpecification, context)
687
- : undefined,
688
- DisableDynamicScaling: __expectBoolean(output.DisableDynamicScaling),
689
- MaxCapacity: __expectInt32(output.MaxCapacity),
690
- MinCapacity: __expectInt32(output.MinCapacity),
691
- PredefinedLoadMetricSpecification: output.PredefinedLoadMetricSpecification != null
692
- ? de_PredefinedLoadMetricSpecification(output.PredefinedLoadMetricSpecification, context)
693
- : undefined,
694
- PredictiveScalingMaxCapacityBehavior: __expectString(output.PredictiveScalingMaxCapacityBehavior),
695
- PredictiveScalingMaxCapacityBuffer: __expectInt32(output.PredictiveScalingMaxCapacityBuffer),
696
- PredictiveScalingMode: __expectString(output.PredictiveScalingMode),
697
- ResourceId: __expectString(output.ResourceId),
698
- ScalableDimension: __expectString(output.ScalableDimension),
699
- ScalingPolicyUpdateBehavior: __expectString(output.ScalingPolicyUpdateBehavior),
700
- ScheduledActionBufferTime: __expectInt32(output.ScheduledActionBufferTime),
701
- ServiceNamespace: __expectString(output.ServiceNamespace),
702
- TargetTrackingConfigurations: output.TargetTrackingConfigurations != null
703
- ? de_TargetTrackingConfigurations(output.TargetTrackingConfigurations, context)
704
- : undefined,
705
- };
437
+ return take(output, {
438
+ CustomizedLoadMetricSpecification: _json,
439
+ DisableDynamicScaling: __expectBoolean,
440
+ MaxCapacity: __expectInt32,
441
+ MinCapacity: __expectInt32,
442
+ PredefinedLoadMetricSpecification: _json,
443
+ PredictiveScalingMaxCapacityBehavior: __expectString,
444
+ PredictiveScalingMaxCapacityBuffer: __expectInt32,
445
+ PredictiveScalingMode: __expectString,
446
+ ResourceId: __expectString,
447
+ ScalableDimension: __expectString,
448
+ ScalingPolicyUpdateBehavior: __expectString,
449
+ ScheduledActionBufferTime: __expectInt32,
450
+ ServiceNamespace: __expectString,
451
+ TargetTrackingConfigurations: (_) => de_TargetTrackingConfigurations(_, context),
452
+ });
706
453
  };
707
454
  const de_ScalingInstructions = (output, context) => {
708
455
  const retVal = (output || [])
709
456
  .filter((e) => e != null)
710
457
  .map((entry) => {
711
- if (entry === null) {
712
- return null;
713
- }
714
458
  return de_ScalingInstruction(entry, context);
715
459
  });
716
460
  return retVal;
717
461
  };
718
462
  const de_ScalingPlan = (output, context) => {
719
- return {
720
- ApplicationSource: output.ApplicationSource != null ? de_ApplicationSource(output.ApplicationSource, context) : undefined,
721
- CreationTime: output.CreationTime != null
722
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationTime)))
723
- : undefined,
724
- ScalingInstructions: output.ScalingInstructions != null ? de_ScalingInstructions(output.ScalingInstructions, context) : undefined,
725
- ScalingPlanName: __expectString(output.ScalingPlanName),
726
- ScalingPlanVersion: __expectLong(output.ScalingPlanVersion),
727
- StatusCode: __expectString(output.StatusCode),
728
- StatusMessage: __expectString(output.StatusMessage),
729
- StatusStartTime: output.StatusStartTime != null
730
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.StatusStartTime)))
731
- : undefined,
732
- };
463
+ return take(output, {
464
+ ApplicationSource: _json,
465
+ CreationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
466
+ ScalingInstructions: (_) => de_ScalingInstructions(_, context),
467
+ ScalingPlanName: __expectString,
468
+ ScalingPlanVersion: __expectLong,
469
+ StatusCode: __expectString,
470
+ StatusMessage: __expectString,
471
+ StatusStartTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
472
+ });
733
473
  };
734
474
  const de_ScalingPlanResource = (output, context) => {
735
- return {
736
- ResourceId: __expectString(output.ResourceId),
737
- ScalableDimension: __expectString(output.ScalableDimension),
738
- ScalingPlanName: __expectString(output.ScalingPlanName),
739
- ScalingPlanVersion: __expectLong(output.ScalingPlanVersion),
740
- ScalingPolicies: output.ScalingPolicies != null ? de_ScalingPolicies(output.ScalingPolicies, context) : undefined,
741
- ScalingStatusCode: __expectString(output.ScalingStatusCode),
742
- ScalingStatusMessage: __expectString(output.ScalingStatusMessage),
743
- ServiceNamespace: __expectString(output.ServiceNamespace),
744
- };
475
+ return take(output, {
476
+ ResourceId: __expectString,
477
+ ScalableDimension: __expectString,
478
+ ScalingPlanName: __expectString,
479
+ ScalingPlanVersion: __expectLong,
480
+ ScalingPolicies: (_) => de_ScalingPolicies(_, context),
481
+ ScalingStatusCode: __expectString,
482
+ ScalingStatusMessage: __expectString,
483
+ ServiceNamespace: __expectString,
484
+ });
745
485
  };
746
486
  const de_ScalingPlanResources = (output, context) => {
747
487
  const retVal = (output || [])
748
488
  .filter((e) => e != null)
749
489
  .map((entry) => {
750
- if (entry === null) {
751
- return null;
752
- }
753
490
  return de_ScalingPlanResource(entry, context);
754
491
  });
755
492
  return retVal;
@@ -758,9 +495,6 @@ const de_ScalingPlans = (output, context) => {
758
495
  const retVal = (output || [])
759
496
  .filter((e) => e != null)
760
497
  .map((entry) => {
761
- if (entry === null) {
762
- return null;
763
- }
764
498
  return de_ScalingPlan(entry, context);
765
499
  });
766
500
  return retVal;
@@ -769,84 +503,36 @@ const de_ScalingPolicies = (output, context) => {
769
503
  const retVal = (output || [])
770
504
  .filter((e) => e != null)
771
505
  .map((entry) => {
772
- if (entry === null) {
773
- return null;
774
- }
775
506
  return de_ScalingPolicy(entry, context);
776
507
  });
777
508
  return retVal;
778
509
  };
779
510
  const de_ScalingPolicy = (output, context) => {
780
- return {
781
- PolicyName: __expectString(output.PolicyName),
782
- PolicyType: __expectString(output.PolicyType),
783
- TargetTrackingConfiguration: output.TargetTrackingConfiguration != null
784
- ? de_TargetTrackingConfiguration(output.TargetTrackingConfiguration, context)
785
- : undefined,
786
- };
787
- };
788
- const de_TagFilter = (output, context) => {
789
- return {
790
- Key: __expectString(output.Key),
791
- Values: output.Values != null ? de_TagValues(output.Values, context) : undefined,
792
- };
793
- };
794
- const de_TagFilters = (output, context) => {
795
- const retVal = (output || [])
796
- .filter((e) => e != null)
797
- .map((entry) => {
798
- if (entry === null) {
799
- return null;
800
- }
801
- return de_TagFilter(entry, context);
511
+ return take(output, {
512
+ PolicyName: __expectString,
513
+ PolicyType: __expectString,
514
+ TargetTrackingConfiguration: (_) => de_TargetTrackingConfiguration(_, context),
802
515
  });
803
- return retVal;
804
- };
805
- const de_TagValues = (output, context) => {
806
- const retVal = (output || [])
807
- .filter((e) => e != null)
808
- .map((entry) => {
809
- if (entry === null) {
810
- return null;
811
- }
812
- return __expectString(entry);
813
- });
814
- return retVal;
815
516
  };
816
517
  const de_TargetTrackingConfiguration = (output, context) => {
817
- return {
818
- CustomizedScalingMetricSpecification: output.CustomizedScalingMetricSpecification != null
819
- ? de_CustomizedScalingMetricSpecification(output.CustomizedScalingMetricSpecification, context)
820
- : undefined,
821
- DisableScaleIn: __expectBoolean(output.DisableScaleIn),
822
- EstimatedInstanceWarmup: __expectInt32(output.EstimatedInstanceWarmup),
823
- PredefinedScalingMetricSpecification: output.PredefinedScalingMetricSpecification != null
824
- ? de_PredefinedScalingMetricSpecification(output.PredefinedScalingMetricSpecification, context)
825
- : undefined,
826
- ScaleInCooldown: __expectInt32(output.ScaleInCooldown),
827
- ScaleOutCooldown: __expectInt32(output.ScaleOutCooldown),
828
- TargetValue: __limitedParseDouble(output.TargetValue),
829
- };
518
+ return take(output, {
519
+ CustomizedScalingMetricSpecification: _json,
520
+ DisableScaleIn: __expectBoolean,
521
+ EstimatedInstanceWarmup: __expectInt32,
522
+ PredefinedScalingMetricSpecification: _json,
523
+ ScaleInCooldown: __expectInt32,
524
+ ScaleOutCooldown: __expectInt32,
525
+ TargetValue: __limitedParseDouble,
526
+ });
830
527
  };
831
528
  const de_TargetTrackingConfigurations = (output, context) => {
832
529
  const retVal = (output || [])
833
530
  .filter((e) => e != null)
834
531
  .map((entry) => {
835
- if (entry === null) {
836
- return null;
837
- }
838
532
  return de_TargetTrackingConfiguration(entry, context);
839
533
  });
840
534
  return retVal;
841
535
  };
842
- const de_UpdateScalingPlanResponse = (output, context) => {
843
- return {};
844
- };
845
- const de_ValidationException = (output, context) => {
846
- return {
847
- Message: __expectString(output.Message),
848
- };
849
- };
850
536
  const deserializeMetadata = (output) => ({
851
537
  httpStatusCode: output.statusCode,
852
538
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -860,6 +546,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
860
546
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
861
547
  };
862
548
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
549
+ const throwDefaultError = withBaseException(__BaseException);
863
550
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
864
551
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
865
552
  const contents = {
@@ -878,6 +565,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
878
565
  }
879
566
  return new __HttpRequest(contents);
880
567
  };
568
+ function sharedHeaders(operation) {
569
+ return {
570
+ "content-type": "application/x-amz-json-1.1",
571
+ "x-amz-target": `AnyScaleScalingPlannerFrontendService.${operation}`,
572
+ };
573
+ }
881
574
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
882
575
  if (encoded.length) {
883
576
  return JSON.parse(encoded);