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