@aws-sdk/client-application-auto-scaling 3.52.0 → 3.53.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.
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deserializeAws_json1_1RegisterScalableTargetCommand = exports.deserializeAws_json1_1PutScheduledActionCommand = exports.deserializeAws_json1_1PutScalingPolicyCommand = exports.deserializeAws_json1_1DescribeScheduledActionsCommand = exports.deserializeAws_json1_1DescribeScalingPoliciesCommand = exports.deserializeAws_json1_1DescribeScalingActivitiesCommand = exports.deserializeAws_json1_1DescribeScalableTargetsCommand = exports.deserializeAws_json1_1DeregisterScalableTargetCommand = exports.deserializeAws_json1_1DeleteScheduledActionCommand = exports.deserializeAws_json1_1DeleteScalingPolicyCommand = exports.serializeAws_json1_1RegisterScalableTargetCommand = exports.serializeAws_json1_1PutScheduledActionCommand = exports.serializeAws_json1_1PutScalingPolicyCommand = exports.serializeAws_json1_1DescribeScheduledActionsCommand = exports.serializeAws_json1_1DescribeScalingPoliciesCommand = exports.serializeAws_json1_1DescribeScalingActivitiesCommand = exports.serializeAws_json1_1DescribeScalableTargetsCommand = exports.serializeAws_json1_1DeregisterScalableTargetCommand = exports.serializeAws_json1_1DeleteScheduledActionCommand = exports.serializeAws_json1_1DeleteScalingPolicyCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const ApplicationAutoScalingServiceException_1 = require("../models/ApplicationAutoScalingServiceException");
7
+ const models_0_1 = require("../models/models_0");
6
8
  const serializeAws_json1_1DeleteScalingPolicyCommand = async (input, context) => {
7
9
  const headers = {
8
10
  "content-type": "application/x-amz-json-1.1",
@@ -128,51 +130,25 @@ const deserializeAws_json1_1DeleteScalingPolicyCommandError = async (output, con
128
130
  switch (errorCode) {
129
131
  case "ConcurrentUpdateException":
130
132
  case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
131
- response = {
132
- ...(await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)),
133
- name: errorCode,
134
- $metadata: deserializeMetadata(output),
135
- };
136
- break;
133
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
137
134
  case "InternalServiceException":
138
135
  case "com.amazonaws.applicationautoscaling#InternalServiceException":
139
- response = {
140
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
141
- name: errorCode,
142
- $metadata: deserializeMetadata(output),
143
- };
144
- break;
136
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
145
137
  case "ObjectNotFoundException":
146
138
  case "com.amazonaws.applicationautoscaling#ObjectNotFoundException":
147
- response = {
148
- ...(await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context)),
149
- name: errorCode,
150
- $metadata: deserializeMetadata(output),
151
- };
152
- break;
139
+ throw await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context);
153
140
  case "ValidationException":
154
141
  case "com.amazonaws.applicationautoscaling#ValidationException":
155
- response = {
156
- ...(await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)),
157
- name: errorCode,
158
- $metadata: deserializeMetadata(output),
159
- };
160
- break;
142
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
161
143
  default:
162
144
  const parsedBody = parsedOutput.body;
163
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
164
- response = {
165
- ...parsedBody,
166
- name: `${errorCode}`,
167
- message: parsedBody.message || parsedBody.Message || errorCode,
145
+ response = new ApplicationAutoScalingServiceException_1.ApplicationAutoScalingServiceException({
146
+ name: parsedBody.code || parsedBody.Code || errorCode,
168
147
  $fault: "client",
169
148
  $metadata: deserializeMetadata(output),
170
- };
149
+ });
150
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
171
151
  }
172
- const message = response.message || response.Message || errorCode;
173
- response.message = message;
174
- delete response.Message;
175
- return Promise.reject(Object.assign(new Error(message), response));
176
152
  };
177
153
  const deserializeAws_json1_1DeleteScheduledActionCommand = async (output, context) => {
178
154
  if (output.statusCode >= 300) {
@@ -199,51 +175,25 @@ const deserializeAws_json1_1DeleteScheduledActionCommandError = async (output, c
199
175
  switch (errorCode) {
200
176
  case "ConcurrentUpdateException":
201
177
  case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
202
- response = {
203
- ...(await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)),
204
- name: errorCode,
205
- $metadata: deserializeMetadata(output),
206
- };
207
- break;
178
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
208
179
  case "InternalServiceException":
209
180
  case "com.amazonaws.applicationautoscaling#InternalServiceException":
210
- response = {
211
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
212
- name: errorCode,
213
- $metadata: deserializeMetadata(output),
214
- };
215
- break;
181
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
216
182
  case "ObjectNotFoundException":
217
183
  case "com.amazonaws.applicationautoscaling#ObjectNotFoundException":
218
- response = {
219
- ...(await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context)),
220
- name: errorCode,
221
- $metadata: deserializeMetadata(output),
222
- };
223
- break;
184
+ throw await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context);
224
185
  case "ValidationException":
225
186
  case "com.amazonaws.applicationautoscaling#ValidationException":
226
- response = {
227
- ...(await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)),
228
- name: errorCode,
229
- $metadata: deserializeMetadata(output),
230
- };
231
- break;
187
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
232
188
  default:
233
189
  const parsedBody = parsedOutput.body;
234
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
235
- response = {
236
- ...parsedBody,
237
- name: `${errorCode}`,
238
- message: parsedBody.message || parsedBody.Message || errorCode,
190
+ response = new ApplicationAutoScalingServiceException_1.ApplicationAutoScalingServiceException({
191
+ name: parsedBody.code || parsedBody.Code || errorCode,
239
192
  $fault: "client",
240
193
  $metadata: deserializeMetadata(output),
241
- };
194
+ });
195
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
242
196
  }
243
- const message = response.message || response.Message || errorCode;
244
- response.message = message;
245
- delete response.Message;
246
- return Promise.reject(Object.assign(new Error(message), response));
247
197
  };
248
198
  const deserializeAws_json1_1DeregisterScalableTargetCommand = async (output, context) => {
249
199
  if (output.statusCode >= 300) {
@@ -270,51 +220,25 @@ const deserializeAws_json1_1DeregisterScalableTargetCommandError = async (output
270
220
  switch (errorCode) {
271
221
  case "ConcurrentUpdateException":
272
222
  case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
273
- response = {
274
- ...(await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)),
275
- name: errorCode,
276
- $metadata: deserializeMetadata(output),
277
- };
278
- break;
223
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
279
224
  case "InternalServiceException":
280
225
  case "com.amazonaws.applicationautoscaling#InternalServiceException":
281
- response = {
282
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
283
- name: errorCode,
284
- $metadata: deserializeMetadata(output),
285
- };
286
- break;
226
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
287
227
  case "ObjectNotFoundException":
288
228
  case "com.amazonaws.applicationautoscaling#ObjectNotFoundException":
289
- response = {
290
- ...(await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context)),
291
- name: errorCode,
292
- $metadata: deserializeMetadata(output),
293
- };
294
- break;
229
+ throw await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context);
295
230
  case "ValidationException":
296
231
  case "com.amazonaws.applicationautoscaling#ValidationException":
297
- response = {
298
- ...(await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)),
299
- name: errorCode,
300
- $metadata: deserializeMetadata(output),
301
- };
302
- break;
232
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
303
233
  default:
304
234
  const parsedBody = parsedOutput.body;
305
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
306
- response = {
307
- ...parsedBody,
308
- name: `${errorCode}`,
309
- message: parsedBody.message || parsedBody.Message || errorCode,
235
+ response = new ApplicationAutoScalingServiceException_1.ApplicationAutoScalingServiceException({
236
+ name: parsedBody.code || parsedBody.Code || errorCode,
310
237
  $fault: "client",
311
238
  $metadata: deserializeMetadata(output),
312
- };
239
+ });
240
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
313
241
  }
314
- const message = response.message || response.Message || errorCode;
315
- response.message = message;
316
- delete response.Message;
317
- return Promise.reject(Object.assign(new Error(message), response));
318
242
  };
319
243
  const deserializeAws_json1_1DescribeScalableTargetsCommand = async (output, context) => {
320
244
  if (output.statusCode >= 300) {
@@ -341,51 +265,25 @@ const deserializeAws_json1_1DescribeScalableTargetsCommandError = async (output,
341
265
  switch (errorCode) {
342
266
  case "ConcurrentUpdateException":
343
267
  case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
344
- response = {
345
- ...(await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)),
346
- name: errorCode,
347
- $metadata: deserializeMetadata(output),
348
- };
349
- break;
268
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
350
269
  case "InternalServiceException":
351
270
  case "com.amazonaws.applicationautoscaling#InternalServiceException":
352
- response = {
353
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
354
- name: errorCode,
355
- $metadata: deserializeMetadata(output),
356
- };
357
- break;
271
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
358
272
  case "InvalidNextTokenException":
359
273
  case "com.amazonaws.applicationautoscaling#InvalidNextTokenException":
360
- response = {
361
- ...(await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)),
362
- name: errorCode,
363
- $metadata: deserializeMetadata(output),
364
- };
365
- break;
274
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
366
275
  case "ValidationException":
367
276
  case "com.amazonaws.applicationautoscaling#ValidationException":
368
- response = {
369
- ...(await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)),
370
- name: errorCode,
371
- $metadata: deserializeMetadata(output),
372
- };
373
- break;
277
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
374
278
  default:
375
279
  const parsedBody = parsedOutput.body;
376
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
377
- response = {
378
- ...parsedBody,
379
- name: `${errorCode}`,
380
- message: parsedBody.message || parsedBody.Message || errorCode,
280
+ response = new ApplicationAutoScalingServiceException_1.ApplicationAutoScalingServiceException({
281
+ name: parsedBody.code || parsedBody.Code || errorCode,
381
282
  $fault: "client",
382
283
  $metadata: deserializeMetadata(output),
383
- };
284
+ });
285
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
384
286
  }
385
- const message = response.message || response.Message || errorCode;
386
- response.message = message;
387
- delete response.Message;
388
- return Promise.reject(Object.assign(new Error(message), response));
389
287
  };
390
288
  const deserializeAws_json1_1DescribeScalingActivitiesCommand = async (output, context) => {
391
289
  if (output.statusCode >= 300) {
@@ -412,51 +310,25 @@ const deserializeAws_json1_1DescribeScalingActivitiesCommandError = async (outpu
412
310
  switch (errorCode) {
413
311
  case "ConcurrentUpdateException":
414
312
  case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
415
- response = {
416
- ...(await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)),
417
- name: errorCode,
418
- $metadata: deserializeMetadata(output),
419
- };
420
- break;
313
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
421
314
  case "InternalServiceException":
422
315
  case "com.amazonaws.applicationautoscaling#InternalServiceException":
423
- response = {
424
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
425
- name: errorCode,
426
- $metadata: deserializeMetadata(output),
427
- };
428
- break;
316
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
429
317
  case "InvalidNextTokenException":
430
318
  case "com.amazonaws.applicationautoscaling#InvalidNextTokenException":
431
- response = {
432
- ...(await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)),
433
- name: errorCode,
434
- $metadata: deserializeMetadata(output),
435
- };
436
- break;
319
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
437
320
  case "ValidationException":
438
321
  case "com.amazonaws.applicationautoscaling#ValidationException":
439
- response = {
440
- ...(await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)),
441
- name: errorCode,
442
- $metadata: deserializeMetadata(output),
443
- };
444
- break;
322
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
445
323
  default:
446
324
  const parsedBody = parsedOutput.body;
447
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
448
- response = {
449
- ...parsedBody,
450
- name: `${errorCode}`,
451
- message: parsedBody.message || parsedBody.Message || errorCode,
325
+ response = new ApplicationAutoScalingServiceException_1.ApplicationAutoScalingServiceException({
326
+ name: parsedBody.code || parsedBody.Code || errorCode,
452
327
  $fault: "client",
453
328
  $metadata: deserializeMetadata(output),
454
- };
329
+ });
330
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
455
331
  }
456
- const message = response.message || response.Message || errorCode;
457
- response.message = message;
458
- delete response.Message;
459
- return Promise.reject(Object.assign(new Error(message), response));
460
332
  };
461
333
  const deserializeAws_json1_1DescribeScalingPoliciesCommand = async (output, context) => {
462
334
  if (output.statusCode >= 300) {
@@ -483,59 +355,28 @@ const deserializeAws_json1_1DescribeScalingPoliciesCommandError = async (output,
483
355
  switch (errorCode) {
484
356
  case "ConcurrentUpdateException":
485
357
  case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
486
- response = {
487
- ...(await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)),
488
- name: errorCode,
489
- $metadata: deserializeMetadata(output),
490
- };
491
- break;
358
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
492
359
  case "FailedResourceAccessException":
493
360
  case "com.amazonaws.applicationautoscaling#FailedResourceAccessException":
494
- response = {
495
- ...(await deserializeAws_json1_1FailedResourceAccessExceptionResponse(parsedOutput, context)),
496
- name: errorCode,
497
- $metadata: deserializeMetadata(output),
498
- };
499
- break;
361
+ throw await deserializeAws_json1_1FailedResourceAccessExceptionResponse(parsedOutput, context);
500
362
  case "InternalServiceException":
501
363
  case "com.amazonaws.applicationautoscaling#InternalServiceException":
502
- response = {
503
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
504
- name: errorCode,
505
- $metadata: deserializeMetadata(output),
506
- };
507
- break;
364
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
508
365
  case "InvalidNextTokenException":
509
366
  case "com.amazonaws.applicationautoscaling#InvalidNextTokenException":
510
- response = {
511
- ...(await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)),
512
- name: errorCode,
513
- $metadata: deserializeMetadata(output),
514
- };
515
- break;
367
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
516
368
  case "ValidationException":
517
369
  case "com.amazonaws.applicationautoscaling#ValidationException":
518
- response = {
519
- ...(await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)),
520
- name: errorCode,
521
- $metadata: deserializeMetadata(output),
522
- };
523
- break;
370
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
524
371
  default:
525
372
  const parsedBody = parsedOutput.body;
526
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
527
- response = {
528
- ...parsedBody,
529
- name: `${errorCode}`,
530
- message: parsedBody.message || parsedBody.Message || errorCode,
373
+ response = new ApplicationAutoScalingServiceException_1.ApplicationAutoScalingServiceException({
374
+ name: parsedBody.code || parsedBody.Code || errorCode,
531
375
  $fault: "client",
532
376
  $metadata: deserializeMetadata(output),
533
- };
377
+ });
378
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
534
379
  }
535
- const message = response.message || response.Message || errorCode;
536
- response.message = message;
537
- delete response.Message;
538
- return Promise.reject(Object.assign(new Error(message), response));
539
380
  };
540
381
  const deserializeAws_json1_1DescribeScheduledActionsCommand = async (output, context) => {
541
382
  if (output.statusCode >= 300) {
@@ -562,51 +403,25 @@ const deserializeAws_json1_1DescribeScheduledActionsCommandError = async (output
562
403
  switch (errorCode) {
563
404
  case "ConcurrentUpdateException":
564
405
  case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
565
- response = {
566
- ...(await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)),
567
- name: errorCode,
568
- $metadata: deserializeMetadata(output),
569
- };
570
- break;
406
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
571
407
  case "InternalServiceException":
572
408
  case "com.amazonaws.applicationautoscaling#InternalServiceException":
573
- response = {
574
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
575
- name: errorCode,
576
- $metadata: deserializeMetadata(output),
577
- };
578
- break;
409
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
579
410
  case "InvalidNextTokenException":
580
411
  case "com.amazonaws.applicationautoscaling#InvalidNextTokenException":
581
- response = {
582
- ...(await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)),
583
- name: errorCode,
584
- $metadata: deserializeMetadata(output),
585
- };
586
- break;
412
+ throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
587
413
  case "ValidationException":
588
414
  case "com.amazonaws.applicationautoscaling#ValidationException":
589
- response = {
590
- ...(await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)),
591
- name: errorCode,
592
- $metadata: deserializeMetadata(output),
593
- };
594
- break;
415
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
595
416
  default:
596
417
  const parsedBody = parsedOutput.body;
597
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
598
- response = {
599
- ...parsedBody,
600
- name: `${errorCode}`,
601
- message: parsedBody.message || parsedBody.Message || errorCode,
418
+ response = new ApplicationAutoScalingServiceException_1.ApplicationAutoScalingServiceException({
419
+ name: parsedBody.code || parsedBody.Code || errorCode,
602
420
  $fault: "client",
603
421
  $metadata: deserializeMetadata(output),
604
- };
422
+ });
423
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
605
424
  }
606
- const message = response.message || response.Message || errorCode;
607
- response.message = message;
608
- delete response.Message;
609
- return Promise.reject(Object.assign(new Error(message), response));
610
425
  };
611
426
  const deserializeAws_json1_1PutScalingPolicyCommand = async (output, context) => {
612
427
  if (output.statusCode >= 300) {
@@ -633,67 +448,31 @@ const deserializeAws_json1_1PutScalingPolicyCommandError = async (output, contex
633
448
  switch (errorCode) {
634
449
  case "ConcurrentUpdateException":
635
450
  case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
636
- response = {
637
- ...(await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)),
638
- name: errorCode,
639
- $metadata: deserializeMetadata(output),
640
- };
641
- break;
451
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
642
452
  case "FailedResourceAccessException":
643
453
  case "com.amazonaws.applicationautoscaling#FailedResourceAccessException":
644
- response = {
645
- ...(await deserializeAws_json1_1FailedResourceAccessExceptionResponse(parsedOutput, context)),
646
- name: errorCode,
647
- $metadata: deserializeMetadata(output),
648
- };
649
- break;
454
+ throw await deserializeAws_json1_1FailedResourceAccessExceptionResponse(parsedOutput, context);
650
455
  case "InternalServiceException":
651
456
  case "com.amazonaws.applicationautoscaling#InternalServiceException":
652
- response = {
653
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
654
- name: errorCode,
655
- $metadata: deserializeMetadata(output),
656
- };
657
- break;
457
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
658
458
  case "LimitExceededException":
659
459
  case "com.amazonaws.applicationautoscaling#LimitExceededException":
660
- response = {
661
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
662
- name: errorCode,
663
- $metadata: deserializeMetadata(output),
664
- };
665
- break;
460
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
666
461
  case "ObjectNotFoundException":
667
462
  case "com.amazonaws.applicationautoscaling#ObjectNotFoundException":
668
- response = {
669
- ...(await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context)),
670
- name: errorCode,
671
- $metadata: deserializeMetadata(output),
672
- };
673
- break;
463
+ throw await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context);
674
464
  case "ValidationException":
675
465
  case "com.amazonaws.applicationautoscaling#ValidationException":
676
- response = {
677
- ...(await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)),
678
- name: errorCode,
679
- $metadata: deserializeMetadata(output),
680
- };
681
- break;
466
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
682
467
  default:
683
468
  const parsedBody = parsedOutput.body;
684
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
685
- response = {
686
- ...parsedBody,
687
- name: `${errorCode}`,
688
- message: parsedBody.message || parsedBody.Message || errorCode,
469
+ response = new ApplicationAutoScalingServiceException_1.ApplicationAutoScalingServiceException({
470
+ name: parsedBody.code || parsedBody.Code || errorCode,
689
471
  $fault: "client",
690
472
  $metadata: deserializeMetadata(output),
691
- };
473
+ });
474
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
692
475
  }
693
- const message = response.message || response.Message || errorCode;
694
- response.message = message;
695
- delete response.Message;
696
- return Promise.reject(Object.assign(new Error(message), response));
697
476
  };
698
477
  const deserializeAws_json1_1PutScheduledActionCommand = async (output, context) => {
699
478
  if (output.statusCode >= 300) {
@@ -720,59 +499,28 @@ const deserializeAws_json1_1PutScheduledActionCommandError = async (output, cont
720
499
  switch (errorCode) {
721
500
  case "ConcurrentUpdateException":
722
501
  case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
723
- response = {
724
- ...(await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)),
725
- name: errorCode,
726
- $metadata: deserializeMetadata(output),
727
- };
728
- break;
502
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
729
503
  case "InternalServiceException":
730
504
  case "com.amazonaws.applicationautoscaling#InternalServiceException":
731
- response = {
732
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
733
- name: errorCode,
734
- $metadata: deserializeMetadata(output),
735
- };
736
- break;
505
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
737
506
  case "LimitExceededException":
738
507
  case "com.amazonaws.applicationautoscaling#LimitExceededException":
739
- response = {
740
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
741
- name: errorCode,
742
- $metadata: deserializeMetadata(output),
743
- };
744
- break;
508
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
745
509
  case "ObjectNotFoundException":
746
510
  case "com.amazonaws.applicationautoscaling#ObjectNotFoundException":
747
- response = {
748
- ...(await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context)),
749
- name: errorCode,
750
- $metadata: deserializeMetadata(output),
751
- };
752
- break;
511
+ throw await deserializeAws_json1_1ObjectNotFoundExceptionResponse(parsedOutput, context);
753
512
  case "ValidationException":
754
513
  case "com.amazonaws.applicationautoscaling#ValidationException":
755
- response = {
756
- ...(await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)),
757
- name: errorCode,
758
- $metadata: deserializeMetadata(output),
759
- };
760
- break;
514
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
761
515
  default:
762
516
  const parsedBody = parsedOutput.body;
763
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
764
- response = {
765
- ...parsedBody,
766
- name: `${errorCode}`,
767
- message: parsedBody.message || parsedBody.Message || errorCode,
517
+ response = new ApplicationAutoScalingServiceException_1.ApplicationAutoScalingServiceException({
518
+ name: parsedBody.code || parsedBody.Code || errorCode,
768
519
  $fault: "client",
769
520
  $metadata: deserializeMetadata(output),
770
- };
521
+ });
522
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
771
523
  }
772
- const message = response.message || response.Message || errorCode;
773
- response.message = message;
774
- delete response.Message;
775
- return Promise.reject(Object.assign(new Error(message), response));
776
524
  };
777
525
  const deserializeAws_json1_1RegisterScalableTargetCommand = async (output, context) => {
778
526
  if (output.statusCode >= 300) {
@@ -799,128 +547,88 @@ const deserializeAws_json1_1RegisterScalableTargetCommandError = async (output,
799
547
  switch (errorCode) {
800
548
  case "ConcurrentUpdateException":
801
549
  case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
802
- response = {
803
- ...(await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context)),
804
- name: errorCode,
805
- $metadata: deserializeMetadata(output),
806
- };
807
- break;
550
+ throw await deserializeAws_json1_1ConcurrentUpdateExceptionResponse(parsedOutput, context);
808
551
  case "InternalServiceException":
809
552
  case "com.amazonaws.applicationautoscaling#InternalServiceException":
810
- response = {
811
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
812
- name: errorCode,
813
- $metadata: deserializeMetadata(output),
814
- };
815
- break;
553
+ throw await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context);
816
554
  case "LimitExceededException":
817
555
  case "com.amazonaws.applicationautoscaling#LimitExceededException":
818
- response = {
819
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
820
- name: errorCode,
821
- $metadata: deserializeMetadata(output),
822
- };
823
- break;
556
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
824
557
  case "ValidationException":
825
558
  case "com.amazonaws.applicationautoscaling#ValidationException":
826
- response = {
827
- ...(await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)),
828
- name: errorCode,
829
- $metadata: deserializeMetadata(output),
830
- };
831
- break;
559
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
832
560
  default:
833
561
  const parsedBody = parsedOutput.body;
834
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
835
- response = {
836
- ...parsedBody,
837
- name: `${errorCode}`,
838
- message: parsedBody.message || parsedBody.Message || errorCode,
562
+ response = new ApplicationAutoScalingServiceException_1.ApplicationAutoScalingServiceException({
563
+ name: parsedBody.code || parsedBody.Code || errorCode,
839
564
  $fault: "client",
840
565
  $metadata: deserializeMetadata(output),
841
- };
566
+ });
567
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
842
568
  }
843
- const message = response.message || response.Message || errorCode;
844
- response.message = message;
845
- delete response.Message;
846
- return Promise.reject(Object.assign(new Error(message), response));
847
569
  };
848
570
  const deserializeAws_json1_1ConcurrentUpdateExceptionResponse = async (parsedOutput, context) => {
849
571
  const body = parsedOutput.body;
850
572
  const deserialized = deserializeAws_json1_1ConcurrentUpdateException(body, context);
851
- const contents = {
852
- name: "ConcurrentUpdateException",
853
- $fault: "server",
573
+ const exception = new models_0_1.ConcurrentUpdateException({
854
574
  $metadata: deserializeMetadata(parsedOutput),
855
575
  ...deserialized,
856
- };
857
- return contents;
576
+ });
577
+ return smithy_client_1.decorateServiceException(exception, body);
858
578
  };
859
579
  const deserializeAws_json1_1FailedResourceAccessExceptionResponse = async (parsedOutput, context) => {
860
580
  const body = parsedOutput.body;
861
581
  const deserialized = deserializeAws_json1_1FailedResourceAccessException(body, context);
862
- const contents = {
863
- name: "FailedResourceAccessException",
864
- $fault: "client",
582
+ const exception = new models_0_1.FailedResourceAccessException({
865
583
  $metadata: deserializeMetadata(parsedOutput),
866
584
  ...deserialized,
867
- };
868
- return contents;
585
+ });
586
+ return smithy_client_1.decorateServiceException(exception, body);
869
587
  };
870
588
  const deserializeAws_json1_1InternalServiceExceptionResponse = async (parsedOutput, context) => {
871
589
  const body = parsedOutput.body;
872
590
  const deserialized = deserializeAws_json1_1InternalServiceException(body, context);
873
- const contents = {
874
- name: "InternalServiceException",
875
- $fault: "server",
591
+ const exception = new models_0_1.InternalServiceException({
876
592
  $metadata: deserializeMetadata(parsedOutput),
877
593
  ...deserialized,
878
- };
879
- return contents;
594
+ });
595
+ return smithy_client_1.decorateServiceException(exception, body);
880
596
  };
881
597
  const deserializeAws_json1_1InvalidNextTokenExceptionResponse = async (parsedOutput, context) => {
882
598
  const body = parsedOutput.body;
883
599
  const deserialized = deserializeAws_json1_1InvalidNextTokenException(body, context);
884
- const contents = {
885
- name: "InvalidNextTokenException",
886
- $fault: "client",
600
+ const exception = new models_0_1.InvalidNextTokenException({
887
601
  $metadata: deserializeMetadata(parsedOutput),
888
602
  ...deserialized,
889
- };
890
- return contents;
603
+ });
604
+ return smithy_client_1.decorateServiceException(exception, body);
891
605
  };
892
606
  const deserializeAws_json1_1LimitExceededExceptionResponse = async (parsedOutput, context) => {
893
607
  const body = parsedOutput.body;
894
608
  const deserialized = deserializeAws_json1_1LimitExceededException(body, context);
895
- const contents = {
896
- name: "LimitExceededException",
897
- $fault: "client",
609
+ const exception = new models_0_1.LimitExceededException({
898
610
  $metadata: deserializeMetadata(parsedOutput),
899
611
  ...deserialized,
900
- };
901
- return contents;
612
+ });
613
+ return smithy_client_1.decorateServiceException(exception, body);
902
614
  };
903
615
  const deserializeAws_json1_1ObjectNotFoundExceptionResponse = async (parsedOutput, context) => {
904
616
  const body = parsedOutput.body;
905
617
  const deserialized = deserializeAws_json1_1ObjectNotFoundException(body, context);
906
- const contents = {
907
- name: "ObjectNotFoundException",
908
- $fault: "client",
618
+ const exception = new models_0_1.ObjectNotFoundException({
909
619
  $metadata: deserializeMetadata(parsedOutput),
910
620
  ...deserialized,
911
- };
912
- return contents;
621
+ });
622
+ return smithy_client_1.decorateServiceException(exception, body);
913
623
  };
914
624
  const deserializeAws_json1_1ValidationExceptionResponse = async (parsedOutput, context) => {
915
625
  const body = parsedOutput.body;
916
626
  const deserialized = deserializeAws_json1_1ValidationException(body, context);
917
- const contents = {
918
- name: "ValidationException",
919
- $fault: "client",
627
+ const exception = new models_0_1.ValidationException({
920
628
  $metadata: deserializeMetadata(parsedOutput),
921
629
  ...deserialized,
922
- };
923
- return contents;
630
+ });
631
+ return smithy_client_1.decorateServiceException(exception, body);
924
632
  };
925
633
  const serializeAws_json1_1CustomizedMetricSpecification = (input, context) => {
926
634
  return {
@@ -1188,7 +896,7 @@ const deserializeAws_json1_1Alarm = (output, context) => {
1188
896
  };
1189
897
  };
1190
898
  const deserializeAws_json1_1Alarms = (output, context) => {
1191
- return (output || [])
899
+ const retVal = (output || [])
1192
900
  .filter((e) => e != null)
1193
901
  .map((entry) => {
1194
902
  if (entry === null) {
@@ -1196,6 +904,7 @@ const deserializeAws_json1_1Alarms = (output, context) => {
1196
904
  }
1197
905
  return deserializeAws_json1_1Alarm(entry, context);
1198
906
  });
907
+ return retVal;
1199
908
  };
1200
909
  const deserializeAws_json1_1ConcurrentUpdateException = (output, context) => {
1201
910
  return {
@@ -1281,7 +990,7 @@ const deserializeAws_json1_1MetricDimension = (output, context) => {
1281
990
  };
1282
991
  };
1283
992
  const deserializeAws_json1_1MetricDimensions = (output, context) => {
1284
- return (output || [])
993
+ const retVal = (output || [])
1285
994
  .filter((e) => e != null)
1286
995
  .map((entry) => {
1287
996
  if (entry === null) {
@@ -1289,6 +998,7 @@ const deserializeAws_json1_1MetricDimensions = (output, context) => {
1289
998
  }
1290
999
  return deserializeAws_json1_1MetricDimension(entry, context);
1291
1000
  });
1001
+ return retVal;
1292
1002
  };
1293
1003
  const deserializeAws_json1_1ObjectNotFoundException = (output, context) => {
1294
1004
  return {
@@ -1338,7 +1048,7 @@ const deserializeAws_json1_1ScalableTargetAction = (output, context) => {
1338
1048
  };
1339
1049
  };
1340
1050
  const deserializeAws_json1_1ScalableTargets = (output, context) => {
1341
- return (output || [])
1051
+ const retVal = (output || [])
1342
1052
  .filter((e) => e != null)
1343
1053
  .map((entry) => {
1344
1054
  if (entry === null) {
@@ -1346,9 +1056,10 @@ const deserializeAws_json1_1ScalableTargets = (output, context) => {
1346
1056
  }
1347
1057
  return deserializeAws_json1_1ScalableTarget(entry, context);
1348
1058
  });
1059
+ return retVal;
1349
1060
  };
1350
1061
  const deserializeAws_json1_1ScalingActivities = (output, context) => {
1351
- return (output || [])
1062
+ const retVal = (output || [])
1352
1063
  .filter((e) => e != null)
1353
1064
  .map((entry) => {
1354
1065
  if (entry === null) {
@@ -1356,6 +1067,7 @@ const deserializeAws_json1_1ScalingActivities = (output, context) => {
1356
1067
  }
1357
1068
  return deserializeAws_json1_1ScalingActivity(entry, context);
1358
1069
  });
1070
+ return retVal;
1359
1071
  };
1360
1072
  const deserializeAws_json1_1ScalingActivity = (output, context) => {
1361
1073
  return {
@@ -1377,7 +1089,7 @@ const deserializeAws_json1_1ScalingActivity = (output, context) => {
1377
1089
  };
1378
1090
  };
1379
1091
  const deserializeAws_json1_1ScalingPolicies = (output, context) => {
1380
- return (output || [])
1092
+ const retVal = (output || [])
1381
1093
  .filter((e) => e != null)
1382
1094
  .map((entry) => {
1383
1095
  if (entry === null) {
@@ -1385,6 +1097,7 @@ const deserializeAws_json1_1ScalingPolicies = (output, context) => {
1385
1097
  }
1386
1098
  return deserializeAws_json1_1ScalingPolicy(entry, context);
1387
1099
  });
1100
+ return retVal;
1388
1101
  };
1389
1102
  const deserializeAws_json1_1ScalingPolicy = (output, context) => {
1390
1103
  return {
@@ -1433,7 +1146,7 @@ const deserializeAws_json1_1ScheduledAction = (output, context) => {
1433
1146
  };
1434
1147
  };
1435
1148
  const deserializeAws_json1_1ScheduledActions = (output, context) => {
1436
- return (output || [])
1149
+ const retVal = (output || [])
1437
1150
  .filter((e) => e != null)
1438
1151
  .map((entry) => {
1439
1152
  if (entry === null) {
@@ -1441,6 +1154,7 @@ const deserializeAws_json1_1ScheduledActions = (output, context) => {
1441
1154
  }
1442
1155
  return deserializeAws_json1_1ScheduledAction(entry, context);
1443
1156
  });
1157
+ return retVal;
1444
1158
  };
1445
1159
  const deserializeAws_json1_1StepAdjustment = (output, context) => {
1446
1160
  return {
@@ -1450,7 +1164,7 @@ const deserializeAws_json1_1StepAdjustment = (output, context) => {
1450
1164
  };
1451
1165
  };
1452
1166
  const deserializeAws_json1_1StepAdjustments = (output, context) => {
1453
- return (output || [])
1167
+ const retVal = (output || [])
1454
1168
  .filter((e) => e != null)
1455
1169
  .map((entry) => {
1456
1170
  if (entry === null) {
@@ -1458,6 +1172,7 @@ const deserializeAws_json1_1StepAdjustments = (output, context) => {
1458
1172
  }
1459
1173
  return deserializeAws_json1_1StepAdjustment(entry, context);
1460
1174
  });
1175
+ return retVal;
1461
1176
  };
1462
1177
  const deserializeAws_json1_1StepScalingPolicyConfiguration = (output, context) => {
1463
1178
  return {