@aws-sdk/client-support 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_1ResolveCaseCommand = exports.deserializeAws_json1_1RefreshTrustedAdvisorCheckCommand = exports.deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommand = exports.deserializeAws_json1_1DescribeTrustedAdvisorChecksCommand = exports.deserializeAws_json1_1DescribeTrustedAdvisorCheckResultCommand = exports.deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommand = exports.deserializeAws_json1_1DescribeSeverityLevelsCommand = exports.deserializeAws_json1_1DescribeServicesCommand = exports.deserializeAws_json1_1DescribeCommunicationsCommand = exports.deserializeAws_json1_1DescribeCasesCommand = exports.deserializeAws_json1_1DescribeAttachmentCommand = exports.deserializeAws_json1_1CreateCaseCommand = exports.deserializeAws_json1_1AddCommunicationToCaseCommand = exports.deserializeAws_json1_1AddAttachmentsToSetCommand = exports.serializeAws_json1_1ResolveCaseCommand = exports.serializeAws_json1_1RefreshTrustedAdvisorCheckCommand = exports.serializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommand = exports.serializeAws_json1_1DescribeTrustedAdvisorChecksCommand = exports.serializeAws_json1_1DescribeTrustedAdvisorCheckResultCommand = exports.serializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommand = exports.serializeAws_json1_1DescribeSeverityLevelsCommand = exports.serializeAws_json1_1DescribeServicesCommand = exports.serializeAws_json1_1DescribeCommunicationsCommand = exports.serializeAws_json1_1DescribeCasesCommand = exports.serializeAws_json1_1DescribeAttachmentCommand = exports.serializeAws_json1_1CreateCaseCommand = exports.serializeAws_json1_1AddCommunicationToCaseCommand = exports.serializeAws_json1_1AddAttachmentsToSetCommand = 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 models_0_1 = require("../models/models_0");
7
+ const SupportServiceException_1 = require("../models/SupportServiceException");
6
8
  const serializeAws_json1_1AddAttachmentsToSetCommand = async (input, context) => {
7
9
  const headers = {
8
10
  "content-type": "application/x-amz-json-1.1",
@@ -168,59 +170,28 @@ const deserializeAws_json1_1AddAttachmentsToSetCommandError = async (output, con
168
170
  switch (errorCode) {
169
171
  case "AttachmentLimitExceeded":
170
172
  case "com.amazonaws.support#AttachmentLimitExceeded":
171
- response = {
172
- ...(await deserializeAws_json1_1AttachmentLimitExceededResponse(parsedOutput, context)),
173
- name: errorCode,
174
- $metadata: deserializeMetadata(output),
175
- };
176
- break;
173
+ throw await deserializeAws_json1_1AttachmentLimitExceededResponse(parsedOutput, context);
177
174
  case "AttachmentSetExpired":
178
175
  case "com.amazonaws.support#AttachmentSetExpired":
179
- response = {
180
- ...(await deserializeAws_json1_1AttachmentSetExpiredResponse(parsedOutput, context)),
181
- name: errorCode,
182
- $metadata: deserializeMetadata(output),
183
- };
184
- break;
176
+ throw await deserializeAws_json1_1AttachmentSetExpiredResponse(parsedOutput, context);
185
177
  case "AttachmentSetIdNotFound":
186
178
  case "com.amazonaws.support#AttachmentSetIdNotFound":
187
- response = {
188
- ...(await deserializeAws_json1_1AttachmentSetIdNotFoundResponse(parsedOutput, context)),
189
- name: errorCode,
190
- $metadata: deserializeMetadata(output),
191
- };
192
- break;
179
+ throw await deserializeAws_json1_1AttachmentSetIdNotFoundResponse(parsedOutput, context);
193
180
  case "AttachmentSetSizeLimitExceeded":
194
181
  case "com.amazonaws.support#AttachmentSetSizeLimitExceeded":
195
- response = {
196
- ...(await deserializeAws_json1_1AttachmentSetSizeLimitExceededResponse(parsedOutput, context)),
197
- name: errorCode,
198
- $metadata: deserializeMetadata(output),
199
- };
200
- break;
182
+ throw await deserializeAws_json1_1AttachmentSetSizeLimitExceededResponse(parsedOutput, context);
201
183
  case "InternalServerError":
202
184
  case "com.amazonaws.support#InternalServerError":
203
- response = {
204
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
205
- name: errorCode,
206
- $metadata: deserializeMetadata(output),
207
- };
208
- break;
185
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
209
186
  default:
210
187
  const parsedBody = parsedOutput.body;
211
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
212
- response = {
213
- ...parsedBody,
214
- name: `${errorCode}`,
215
- message: parsedBody.message || parsedBody.Message || errorCode,
188
+ response = new SupportServiceException_1.SupportServiceException({
189
+ name: parsedBody.code || parsedBody.Code || errorCode,
216
190
  $fault: "client",
217
191
  $metadata: deserializeMetadata(output),
218
- };
192
+ });
193
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
219
194
  }
220
- const message = response.message || response.Message || errorCode;
221
- response.message = message;
222
- delete response.Message;
223
- return Promise.reject(Object.assign(new Error(message), response));
224
195
  };
225
196
  const deserializeAws_json1_1AddCommunicationToCaseCommand = async (output, context) => {
226
197
  if (output.statusCode >= 300) {
@@ -247,51 +218,25 @@ const deserializeAws_json1_1AddCommunicationToCaseCommandError = async (output,
247
218
  switch (errorCode) {
248
219
  case "AttachmentSetExpired":
249
220
  case "com.amazonaws.support#AttachmentSetExpired":
250
- response = {
251
- ...(await deserializeAws_json1_1AttachmentSetExpiredResponse(parsedOutput, context)),
252
- name: errorCode,
253
- $metadata: deserializeMetadata(output),
254
- };
255
- break;
221
+ throw await deserializeAws_json1_1AttachmentSetExpiredResponse(parsedOutput, context);
256
222
  case "AttachmentSetIdNotFound":
257
223
  case "com.amazonaws.support#AttachmentSetIdNotFound":
258
- response = {
259
- ...(await deserializeAws_json1_1AttachmentSetIdNotFoundResponse(parsedOutput, context)),
260
- name: errorCode,
261
- $metadata: deserializeMetadata(output),
262
- };
263
- break;
224
+ throw await deserializeAws_json1_1AttachmentSetIdNotFoundResponse(parsedOutput, context);
264
225
  case "CaseIdNotFound":
265
226
  case "com.amazonaws.support#CaseIdNotFound":
266
- response = {
267
- ...(await deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context)),
268
- name: errorCode,
269
- $metadata: deserializeMetadata(output),
270
- };
271
- break;
227
+ throw await deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context);
272
228
  case "InternalServerError":
273
229
  case "com.amazonaws.support#InternalServerError":
274
- response = {
275
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
276
- name: errorCode,
277
- $metadata: deserializeMetadata(output),
278
- };
279
- break;
230
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
280
231
  default:
281
232
  const parsedBody = parsedOutput.body;
282
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
283
- response = {
284
- ...parsedBody,
285
- name: `${errorCode}`,
286
- message: parsedBody.message || parsedBody.Message || errorCode,
233
+ response = new SupportServiceException_1.SupportServiceException({
234
+ name: parsedBody.code || parsedBody.Code || errorCode,
287
235
  $fault: "client",
288
236
  $metadata: deserializeMetadata(output),
289
- };
237
+ });
238
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
290
239
  }
291
- const message = response.message || response.Message || errorCode;
292
- response.message = message;
293
- delete response.Message;
294
- return Promise.reject(Object.assign(new Error(message), response));
295
240
  };
296
241
  const deserializeAws_json1_1CreateCaseCommand = async (output, context) => {
297
242
  if (output.statusCode >= 300) {
@@ -318,51 +263,25 @@ const deserializeAws_json1_1CreateCaseCommandError = async (output, context) =>
318
263
  switch (errorCode) {
319
264
  case "AttachmentSetExpired":
320
265
  case "com.amazonaws.support#AttachmentSetExpired":
321
- response = {
322
- ...(await deserializeAws_json1_1AttachmentSetExpiredResponse(parsedOutput, context)),
323
- name: errorCode,
324
- $metadata: deserializeMetadata(output),
325
- };
326
- break;
266
+ throw await deserializeAws_json1_1AttachmentSetExpiredResponse(parsedOutput, context);
327
267
  case "AttachmentSetIdNotFound":
328
268
  case "com.amazonaws.support#AttachmentSetIdNotFound":
329
- response = {
330
- ...(await deserializeAws_json1_1AttachmentSetIdNotFoundResponse(parsedOutput, context)),
331
- name: errorCode,
332
- $metadata: deserializeMetadata(output),
333
- };
334
- break;
269
+ throw await deserializeAws_json1_1AttachmentSetIdNotFoundResponse(parsedOutput, context);
335
270
  case "CaseCreationLimitExceeded":
336
271
  case "com.amazonaws.support#CaseCreationLimitExceeded":
337
- response = {
338
- ...(await deserializeAws_json1_1CaseCreationLimitExceededResponse(parsedOutput, context)),
339
- name: errorCode,
340
- $metadata: deserializeMetadata(output),
341
- };
342
- break;
272
+ throw await deserializeAws_json1_1CaseCreationLimitExceededResponse(parsedOutput, context);
343
273
  case "InternalServerError":
344
274
  case "com.amazonaws.support#InternalServerError":
345
- response = {
346
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
347
- name: errorCode,
348
- $metadata: deserializeMetadata(output),
349
- };
350
- break;
275
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
351
276
  default:
352
277
  const parsedBody = parsedOutput.body;
353
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
354
- response = {
355
- ...parsedBody,
356
- name: `${errorCode}`,
357
- message: parsedBody.message || parsedBody.Message || errorCode,
278
+ response = new SupportServiceException_1.SupportServiceException({
279
+ name: parsedBody.code || parsedBody.Code || errorCode,
358
280
  $fault: "client",
359
281
  $metadata: deserializeMetadata(output),
360
- };
282
+ });
283
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
361
284
  }
362
- const message = response.message || response.Message || errorCode;
363
- response.message = message;
364
- delete response.Message;
365
- return Promise.reject(Object.assign(new Error(message), response));
366
285
  };
367
286
  const deserializeAws_json1_1DescribeAttachmentCommand = async (output, context) => {
368
287
  if (output.statusCode >= 300) {
@@ -389,43 +308,22 @@ const deserializeAws_json1_1DescribeAttachmentCommandError = async (output, cont
389
308
  switch (errorCode) {
390
309
  case "AttachmentIdNotFound":
391
310
  case "com.amazonaws.support#AttachmentIdNotFound":
392
- response = {
393
- ...(await deserializeAws_json1_1AttachmentIdNotFoundResponse(parsedOutput, context)),
394
- name: errorCode,
395
- $metadata: deserializeMetadata(output),
396
- };
397
- break;
311
+ throw await deserializeAws_json1_1AttachmentIdNotFoundResponse(parsedOutput, context);
398
312
  case "DescribeAttachmentLimitExceeded":
399
313
  case "com.amazonaws.support#DescribeAttachmentLimitExceeded":
400
- response = {
401
- ...(await deserializeAws_json1_1DescribeAttachmentLimitExceededResponse(parsedOutput, context)),
402
- name: errorCode,
403
- $metadata: deserializeMetadata(output),
404
- };
405
- break;
314
+ throw await deserializeAws_json1_1DescribeAttachmentLimitExceededResponse(parsedOutput, context);
406
315
  case "InternalServerError":
407
316
  case "com.amazonaws.support#InternalServerError":
408
- response = {
409
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
410
- name: errorCode,
411
- $metadata: deserializeMetadata(output),
412
- };
413
- break;
317
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
414
318
  default:
415
319
  const parsedBody = parsedOutput.body;
416
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
417
- response = {
418
- ...parsedBody,
419
- name: `${errorCode}`,
420
- message: parsedBody.message || parsedBody.Message || errorCode,
320
+ response = new SupportServiceException_1.SupportServiceException({
321
+ name: parsedBody.code || parsedBody.Code || errorCode,
421
322
  $fault: "client",
422
323
  $metadata: deserializeMetadata(output),
423
- };
324
+ });
325
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
424
326
  }
425
- const message = response.message || response.Message || errorCode;
426
- response.message = message;
427
- delete response.Message;
428
- return Promise.reject(Object.assign(new Error(message), response));
429
327
  };
430
328
  const deserializeAws_json1_1DescribeCasesCommand = async (output, context) => {
431
329
  if (output.statusCode >= 300) {
@@ -452,35 +350,19 @@ const deserializeAws_json1_1DescribeCasesCommandError = async (output, context)
452
350
  switch (errorCode) {
453
351
  case "CaseIdNotFound":
454
352
  case "com.amazonaws.support#CaseIdNotFound":
455
- response = {
456
- ...(await deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context)),
457
- name: errorCode,
458
- $metadata: deserializeMetadata(output),
459
- };
460
- break;
353
+ throw await deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context);
461
354
  case "InternalServerError":
462
355
  case "com.amazonaws.support#InternalServerError":
463
- response = {
464
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
465
- name: errorCode,
466
- $metadata: deserializeMetadata(output),
467
- };
468
- break;
356
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
469
357
  default:
470
358
  const parsedBody = parsedOutput.body;
471
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
472
- response = {
473
- ...parsedBody,
474
- name: `${errorCode}`,
475
- message: parsedBody.message || parsedBody.Message || errorCode,
359
+ response = new SupportServiceException_1.SupportServiceException({
360
+ name: parsedBody.code || parsedBody.Code || errorCode,
476
361
  $fault: "client",
477
362
  $metadata: deserializeMetadata(output),
478
- };
363
+ });
364
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
479
365
  }
480
- const message = response.message || response.Message || errorCode;
481
- response.message = message;
482
- delete response.Message;
483
- return Promise.reject(Object.assign(new Error(message), response));
484
366
  };
485
367
  const deserializeAws_json1_1DescribeCommunicationsCommand = async (output, context) => {
486
368
  if (output.statusCode >= 300) {
@@ -507,35 +389,19 @@ const deserializeAws_json1_1DescribeCommunicationsCommandError = async (output,
507
389
  switch (errorCode) {
508
390
  case "CaseIdNotFound":
509
391
  case "com.amazonaws.support#CaseIdNotFound":
510
- response = {
511
- ...(await deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context)),
512
- name: errorCode,
513
- $metadata: deserializeMetadata(output),
514
- };
515
- break;
392
+ throw await deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context);
516
393
  case "InternalServerError":
517
394
  case "com.amazonaws.support#InternalServerError":
518
- response = {
519
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
520
- name: errorCode,
521
- $metadata: deserializeMetadata(output),
522
- };
523
- break;
395
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
524
396
  default:
525
397
  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,
398
+ response = new SupportServiceException_1.SupportServiceException({
399
+ name: parsedBody.code || parsedBody.Code || errorCode,
531
400
  $fault: "client",
532
401
  $metadata: deserializeMetadata(output),
533
- };
402
+ });
403
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
534
404
  }
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
405
  };
540
406
  const deserializeAws_json1_1DescribeServicesCommand = async (output, context) => {
541
407
  if (output.statusCode >= 300) {
@@ -562,27 +428,16 @@ const deserializeAws_json1_1DescribeServicesCommandError = async (output, contex
562
428
  switch (errorCode) {
563
429
  case "InternalServerError":
564
430
  case "com.amazonaws.support#InternalServerError":
565
- response = {
566
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
567
- name: errorCode,
568
- $metadata: deserializeMetadata(output),
569
- };
570
- break;
431
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
571
432
  default:
572
433
  const parsedBody = parsedOutput.body;
573
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
574
- response = {
575
- ...parsedBody,
576
- name: `${errorCode}`,
577
- message: parsedBody.message || parsedBody.Message || errorCode,
434
+ response = new SupportServiceException_1.SupportServiceException({
435
+ name: parsedBody.code || parsedBody.Code || errorCode,
578
436
  $fault: "client",
579
437
  $metadata: deserializeMetadata(output),
580
- };
438
+ });
439
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
581
440
  }
582
- const message = response.message || response.Message || errorCode;
583
- response.message = message;
584
- delete response.Message;
585
- return Promise.reject(Object.assign(new Error(message), response));
586
441
  };
587
442
  const deserializeAws_json1_1DescribeSeverityLevelsCommand = async (output, context) => {
588
443
  if (output.statusCode >= 300) {
@@ -609,27 +464,16 @@ const deserializeAws_json1_1DescribeSeverityLevelsCommandError = async (output,
609
464
  switch (errorCode) {
610
465
  case "InternalServerError":
611
466
  case "com.amazonaws.support#InternalServerError":
612
- response = {
613
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
614
- name: errorCode,
615
- $metadata: deserializeMetadata(output),
616
- };
617
- break;
467
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
618
468
  default:
619
469
  const parsedBody = parsedOutput.body;
620
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
621
- response = {
622
- ...parsedBody,
623
- name: `${errorCode}`,
624
- message: parsedBody.message || parsedBody.Message || errorCode,
470
+ response = new SupportServiceException_1.SupportServiceException({
471
+ name: parsedBody.code || parsedBody.Code || errorCode,
625
472
  $fault: "client",
626
473
  $metadata: deserializeMetadata(output),
627
- };
474
+ });
475
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
628
476
  }
629
- const message = response.message || response.Message || errorCode;
630
- response.message = message;
631
- delete response.Message;
632
- return Promise.reject(Object.assign(new Error(message), response));
633
477
  };
634
478
  const deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommand = async (output, context) => {
635
479
  if (output.statusCode >= 300) {
@@ -656,27 +500,16 @@ const deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommandErr
656
500
  switch (errorCode) {
657
501
  case "InternalServerError":
658
502
  case "com.amazonaws.support#InternalServerError":
659
- response = {
660
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
661
- name: errorCode,
662
- $metadata: deserializeMetadata(output),
663
- };
664
- break;
503
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
665
504
  default:
666
505
  const parsedBody = parsedOutput.body;
667
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
668
- response = {
669
- ...parsedBody,
670
- name: `${errorCode}`,
671
- message: parsedBody.message || parsedBody.Message || errorCode,
506
+ response = new SupportServiceException_1.SupportServiceException({
507
+ name: parsedBody.code || parsedBody.Code || errorCode,
672
508
  $fault: "client",
673
509
  $metadata: deserializeMetadata(output),
674
- };
510
+ });
511
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
675
512
  }
676
- const message = response.message || response.Message || errorCode;
677
- response.message = message;
678
- delete response.Message;
679
- return Promise.reject(Object.assign(new Error(message), response));
680
513
  };
681
514
  const deserializeAws_json1_1DescribeTrustedAdvisorCheckResultCommand = async (output, context) => {
682
515
  if (output.statusCode >= 300) {
@@ -703,27 +536,16 @@ const deserializeAws_json1_1DescribeTrustedAdvisorCheckResultCommandError = asyn
703
536
  switch (errorCode) {
704
537
  case "InternalServerError":
705
538
  case "com.amazonaws.support#InternalServerError":
706
- response = {
707
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
708
- name: errorCode,
709
- $metadata: deserializeMetadata(output),
710
- };
711
- break;
539
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
712
540
  default:
713
541
  const parsedBody = parsedOutput.body;
714
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
715
- response = {
716
- ...parsedBody,
717
- name: `${errorCode}`,
718
- message: parsedBody.message || parsedBody.Message || errorCode,
542
+ response = new SupportServiceException_1.SupportServiceException({
543
+ name: parsedBody.code || parsedBody.Code || errorCode,
719
544
  $fault: "client",
720
545
  $metadata: deserializeMetadata(output),
721
- };
546
+ });
547
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
722
548
  }
723
- const message = response.message || response.Message || errorCode;
724
- response.message = message;
725
- delete response.Message;
726
- return Promise.reject(Object.assign(new Error(message), response));
727
549
  };
728
550
  const deserializeAws_json1_1DescribeTrustedAdvisorChecksCommand = async (output, context) => {
729
551
  if (output.statusCode >= 300) {
@@ -750,27 +572,16 @@ const deserializeAws_json1_1DescribeTrustedAdvisorChecksCommandError = async (ou
750
572
  switch (errorCode) {
751
573
  case "InternalServerError":
752
574
  case "com.amazonaws.support#InternalServerError":
753
- response = {
754
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
755
- name: errorCode,
756
- $metadata: deserializeMetadata(output),
757
- };
758
- break;
575
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
759
576
  default:
760
577
  const parsedBody = parsedOutput.body;
761
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
762
- response = {
763
- ...parsedBody,
764
- name: `${errorCode}`,
765
- message: parsedBody.message || parsedBody.Message || errorCode,
578
+ response = new SupportServiceException_1.SupportServiceException({
579
+ name: parsedBody.code || parsedBody.Code || errorCode,
766
580
  $fault: "client",
767
581
  $metadata: deserializeMetadata(output),
768
- };
582
+ });
583
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
769
584
  }
770
- const message = response.message || response.Message || errorCode;
771
- response.message = message;
772
- delete response.Message;
773
- return Promise.reject(Object.assign(new Error(message), response));
774
585
  };
775
586
  const deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommand = async (output, context) => {
776
587
  if (output.statusCode >= 300) {
@@ -797,27 +608,16 @@ const deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommandError = a
797
608
  switch (errorCode) {
798
609
  case "InternalServerError":
799
610
  case "com.amazonaws.support#InternalServerError":
800
- response = {
801
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
802
- name: errorCode,
803
- $metadata: deserializeMetadata(output),
804
- };
805
- break;
611
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
806
612
  default:
807
613
  const parsedBody = parsedOutput.body;
808
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
809
- response = {
810
- ...parsedBody,
811
- name: `${errorCode}`,
812
- message: parsedBody.message || parsedBody.Message || errorCode,
614
+ response = new SupportServiceException_1.SupportServiceException({
615
+ name: parsedBody.code || parsedBody.Code || errorCode,
813
616
  $fault: "client",
814
617
  $metadata: deserializeMetadata(output),
815
- };
618
+ });
619
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
816
620
  }
817
- const message = response.message || response.Message || errorCode;
818
- response.message = message;
819
- delete response.Message;
820
- return Promise.reject(Object.assign(new Error(message), response));
821
621
  };
822
622
  const deserializeAws_json1_1RefreshTrustedAdvisorCheckCommand = async (output, context) => {
823
623
  if (output.statusCode >= 300) {
@@ -844,27 +644,16 @@ const deserializeAws_json1_1RefreshTrustedAdvisorCheckCommandError = async (outp
844
644
  switch (errorCode) {
845
645
  case "InternalServerError":
846
646
  case "com.amazonaws.support#InternalServerError":
847
- response = {
848
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
849
- name: errorCode,
850
- $metadata: deserializeMetadata(output),
851
- };
852
- break;
647
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
853
648
  default:
854
649
  const parsedBody = parsedOutput.body;
855
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
856
- response = {
857
- ...parsedBody,
858
- name: `${errorCode}`,
859
- message: parsedBody.message || parsedBody.Message || errorCode,
650
+ response = new SupportServiceException_1.SupportServiceException({
651
+ name: parsedBody.code || parsedBody.Code || errorCode,
860
652
  $fault: "client",
861
653
  $metadata: deserializeMetadata(output),
862
- };
654
+ });
655
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
863
656
  }
864
- const message = response.message || response.Message || errorCode;
865
- response.message = message;
866
- delete response.Message;
867
- return Promise.reject(Object.assign(new Error(message), response));
868
657
  };
869
658
  const deserializeAws_json1_1ResolveCaseCommand = async (output, context) => {
870
659
  if (output.statusCode >= 300) {
@@ -891,134 +680,100 @@ const deserializeAws_json1_1ResolveCaseCommandError = async (output, context) =>
891
680
  switch (errorCode) {
892
681
  case "CaseIdNotFound":
893
682
  case "com.amazonaws.support#CaseIdNotFound":
894
- response = {
895
- ...(await deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context)),
896
- name: errorCode,
897
- $metadata: deserializeMetadata(output),
898
- };
899
- break;
683
+ throw await deserializeAws_json1_1CaseIdNotFoundResponse(parsedOutput, context);
900
684
  case "InternalServerError":
901
685
  case "com.amazonaws.support#InternalServerError":
902
- response = {
903
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
904
- name: errorCode,
905
- $metadata: deserializeMetadata(output),
906
- };
907
- break;
686
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
908
687
  default:
909
688
  const parsedBody = parsedOutput.body;
910
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
911
- response = {
912
- ...parsedBody,
913
- name: `${errorCode}`,
914
- message: parsedBody.message || parsedBody.Message || errorCode,
689
+ response = new SupportServiceException_1.SupportServiceException({
690
+ name: parsedBody.code || parsedBody.Code || errorCode,
915
691
  $fault: "client",
916
692
  $metadata: deserializeMetadata(output),
917
- };
693
+ });
694
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
918
695
  }
919
- const message = response.message || response.Message || errorCode;
920
- response.message = message;
921
- delete response.Message;
922
- return Promise.reject(Object.assign(new Error(message), response));
923
696
  };
924
697
  const deserializeAws_json1_1AttachmentIdNotFoundResponse = async (parsedOutput, context) => {
925
698
  const body = parsedOutput.body;
926
699
  const deserialized = deserializeAws_json1_1AttachmentIdNotFound(body, context);
927
- const contents = {
928
- name: "AttachmentIdNotFound",
929
- $fault: "client",
700
+ const exception = new models_0_1.AttachmentIdNotFound({
930
701
  $metadata: deserializeMetadata(parsedOutput),
931
702
  ...deserialized,
932
- };
933
- return contents;
703
+ });
704
+ return smithy_client_1.decorateServiceException(exception, body);
934
705
  };
935
706
  const deserializeAws_json1_1AttachmentLimitExceededResponse = async (parsedOutput, context) => {
936
707
  const body = parsedOutput.body;
937
708
  const deserialized = deserializeAws_json1_1AttachmentLimitExceeded(body, context);
938
- const contents = {
939
- name: "AttachmentLimitExceeded",
940
- $fault: "client",
709
+ const exception = new models_0_1.AttachmentLimitExceeded({
941
710
  $metadata: deserializeMetadata(parsedOutput),
942
711
  ...deserialized,
943
- };
944
- return contents;
712
+ });
713
+ return smithy_client_1.decorateServiceException(exception, body);
945
714
  };
946
715
  const deserializeAws_json1_1AttachmentSetExpiredResponse = async (parsedOutput, context) => {
947
716
  const body = parsedOutput.body;
948
717
  const deserialized = deserializeAws_json1_1AttachmentSetExpired(body, context);
949
- const contents = {
950
- name: "AttachmentSetExpired",
951
- $fault: "client",
718
+ const exception = new models_0_1.AttachmentSetExpired({
952
719
  $metadata: deserializeMetadata(parsedOutput),
953
720
  ...deserialized,
954
- };
955
- return contents;
721
+ });
722
+ return smithy_client_1.decorateServiceException(exception, body);
956
723
  };
957
724
  const deserializeAws_json1_1AttachmentSetIdNotFoundResponse = async (parsedOutput, context) => {
958
725
  const body = parsedOutput.body;
959
726
  const deserialized = deserializeAws_json1_1AttachmentSetIdNotFound(body, context);
960
- const contents = {
961
- name: "AttachmentSetIdNotFound",
962
- $fault: "client",
727
+ const exception = new models_0_1.AttachmentSetIdNotFound({
963
728
  $metadata: deserializeMetadata(parsedOutput),
964
729
  ...deserialized,
965
- };
966
- return contents;
730
+ });
731
+ return smithy_client_1.decorateServiceException(exception, body);
967
732
  };
968
733
  const deserializeAws_json1_1AttachmentSetSizeLimitExceededResponse = async (parsedOutput, context) => {
969
734
  const body = parsedOutput.body;
970
735
  const deserialized = deserializeAws_json1_1AttachmentSetSizeLimitExceeded(body, context);
971
- const contents = {
972
- name: "AttachmentSetSizeLimitExceeded",
973
- $fault: "client",
736
+ const exception = new models_0_1.AttachmentSetSizeLimitExceeded({
974
737
  $metadata: deserializeMetadata(parsedOutput),
975
738
  ...deserialized,
976
- };
977
- return contents;
739
+ });
740
+ return smithy_client_1.decorateServiceException(exception, body);
978
741
  };
979
742
  const deserializeAws_json1_1CaseCreationLimitExceededResponse = async (parsedOutput, context) => {
980
743
  const body = parsedOutput.body;
981
744
  const deserialized = deserializeAws_json1_1CaseCreationLimitExceeded(body, context);
982
- const contents = {
983
- name: "CaseCreationLimitExceeded",
984
- $fault: "client",
745
+ const exception = new models_0_1.CaseCreationLimitExceeded({
985
746
  $metadata: deserializeMetadata(parsedOutput),
986
747
  ...deserialized,
987
- };
988
- return contents;
748
+ });
749
+ return smithy_client_1.decorateServiceException(exception, body);
989
750
  };
990
751
  const deserializeAws_json1_1CaseIdNotFoundResponse = async (parsedOutput, context) => {
991
752
  const body = parsedOutput.body;
992
753
  const deserialized = deserializeAws_json1_1CaseIdNotFound(body, context);
993
- const contents = {
994
- name: "CaseIdNotFound",
995
- $fault: "client",
754
+ const exception = new models_0_1.CaseIdNotFound({
996
755
  $metadata: deserializeMetadata(parsedOutput),
997
756
  ...deserialized,
998
- };
999
- return contents;
757
+ });
758
+ return smithy_client_1.decorateServiceException(exception, body);
1000
759
  };
1001
760
  const deserializeAws_json1_1DescribeAttachmentLimitExceededResponse = async (parsedOutput, context) => {
1002
761
  const body = parsedOutput.body;
1003
762
  const deserialized = deserializeAws_json1_1DescribeAttachmentLimitExceeded(body, context);
1004
- const contents = {
1005
- name: "DescribeAttachmentLimitExceeded",
1006
- $fault: "client",
763
+ const exception = new models_0_1.DescribeAttachmentLimitExceeded({
1007
764
  $metadata: deserializeMetadata(parsedOutput),
1008
765
  ...deserialized,
1009
- };
1010
- return contents;
766
+ });
767
+ return smithy_client_1.decorateServiceException(exception, body);
1011
768
  };
1012
769
  const deserializeAws_json1_1InternalServerErrorResponse = async (parsedOutput, context) => {
1013
770
  const body = parsedOutput.body;
1014
771
  const deserialized = deserializeAws_json1_1InternalServerError(body, context);
1015
- const contents = {
1016
- name: "InternalServerError",
1017
- $fault: "server",
772
+ const exception = new models_0_1.InternalServerError({
1018
773
  $metadata: deserializeMetadata(parsedOutput),
1019
774
  ...deserialized,
1020
- };
1021
- return contents;
775
+ });
776
+ return smithy_client_1.decorateServiceException(exception, body);
1022
777
  };
1023
778
  const serializeAws_json1_1AddAttachmentsToSetRequest = (input, context) => {
1024
779
  return {
@@ -1226,7 +981,7 @@ const deserializeAws_json1_1AttachmentLimitExceeded = (output, context) => {
1226
981
  };
1227
982
  };
1228
983
  const deserializeAws_json1_1AttachmentSet = (output, context) => {
1229
- return (output || [])
984
+ const retVal = (output || [])
1230
985
  .filter((e) => e != null)
1231
986
  .map((entry) => {
1232
987
  if (entry === null) {
@@ -1234,6 +989,7 @@ const deserializeAws_json1_1AttachmentSet = (output, context) => {
1234
989
  }
1235
990
  return deserializeAws_json1_1AttachmentDetails(entry, context);
1236
991
  });
992
+ return retVal;
1237
993
  };
1238
994
  const deserializeAws_json1_1AttachmentSetExpired = (output, context) => {
1239
995
  return {
@@ -1281,7 +1037,7 @@ const deserializeAws_json1_1CaseIdNotFound = (output, context) => {
1281
1037
  };
1282
1038
  };
1283
1039
  const deserializeAws_json1_1CaseList = (output, context) => {
1284
- return (output || [])
1040
+ const retVal = (output || [])
1285
1041
  .filter((e) => e != null)
1286
1042
  .map((entry) => {
1287
1043
  if (entry === null) {
@@ -1289,6 +1045,7 @@ const deserializeAws_json1_1CaseList = (output, context) => {
1289
1045
  }
1290
1046
  return deserializeAws_json1_1CaseDetails(entry, context);
1291
1047
  });
1048
+ return retVal;
1292
1049
  };
1293
1050
  const deserializeAws_json1_1Category = (output, context) => {
1294
1051
  return {
@@ -1297,7 +1054,7 @@ const deserializeAws_json1_1Category = (output, context) => {
1297
1054
  };
1298
1055
  };
1299
1056
  const deserializeAws_json1_1CategoryList = (output, context) => {
1300
- return (output || [])
1057
+ const retVal = (output || [])
1301
1058
  .filter((e) => e != null)
1302
1059
  .map((entry) => {
1303
1060
  if (entry === null) {
@@ -1305,9 +1062,10 @@ const deserializeAws_json1_1CategoryList = (output, context) => {
1305
1062
  }
1306
1063
  return deserializeAws_json1_1Category(entry, context);
1307
1064
  });
1065
+ return retVal;
1308
1066
  };
1309
1067
  const deserializeAws_json1_1CcEmailAddressList = (output, context) => {
1310
- return (output || [])
1068
+ const retVal = (output || [])
1311
1069
  .filter((e) => e != null)
1312
1070
  .map((entry) => {
1313
1071
  if (entry === null) {
@@ -1315,6 +1073,7 @@ const deserializeAws_json1_1CcEmailAddressList = (output, context) => {
1315
1073
  }
1316
1074
  return smithy_client_1.expectString(entry);
1317
1075
  });
1076
+ return retVal;
1318
1077
  };
1319
1078
  const deserializeAws_json1_1Communication = (output, context) => {
1320
1079
  return {
@@ -1328,7 +1087,7 @@ const deserializeAws_json1_1Communication = (output, context) => {
1328
1087
  };
1329
1088
  };
1330
1089
  const deserializeAws_json1_1CommunicationList = (output, context) => {
1331
- return (output || [])
1090
+ const retVal = (output || [])
1332
1091
  .filter((e) => e != null)
1333
1092
  .map((entry) => {
1334
1093
  if (entry === null) {
@@ -1336,6 +1095,7 @@ const deserializeAws_json1_1CommunicationList = (output, context) => {
1336
1095
  }
1337
1096
  return deserializeAws_json1_1Communication(entry, context);
1338
1097
  });
1098
+ return retVal;
1339
1099
  };
1340
1100
  const deserializeAws_json1_1CreateCaseResponse = (output, context) => {
1341
1101
  return {
@@ -1448,7 +1208,7 @@ const deserializeAws_json1_1Service = (output, context) => {
1448
1208
  };
1449
1209
  };
1450
1210
  const deserializeAws_json1_1ServiceList = (output, context) => {
1451
- return (output || [])
1211
+ const retVal = (output || [])
1452
1212
  .filter((e) => e != null)
1453
1213
  .map((entry) => {
1454
1214
  if (entry === null) {
@@ -1456,6 +1216,7 @@ const deserializeAws_json1_1ServiceList = (output, context) => {
1456
1216
  }
1457
1217
  return deserializeAws_json1_1Service(entry, context);
1458
1218
  });
1219
+ return retVal;
1459
1220
  };
1460
1221
  const deserializeAws_json1_1SeverityLevel = (output, context) => {
1461
1222
  return {
@@ -1464,7 +1225,7 @@ const deserializeAws_json1_1SeverityLevel = (output, context) => {
1464
1225
  };
1465
1226
  };
1466
1227
  const deserializeAws_json1_1SeverityLevelsList = (output, context) => {
1467
- return (output || [])
1228
+ const retVal = (output || [])
1468
1229
  .filter((e) => e != null)
1469
1230
  .map((entry) => {
1470
1231
  if (entry === null) {
@@ -1472,9 +1233,10 @@ const deserializeAws_json1_1SeverityLevelsList = (output, context) => {
1472
1233
  }
1473
1234
  return deserializeAws_json1_1SeverityLevel(entry, context);
1474
1235
  });
1236
+ return retVal;
1475
1237
  };
1476
1238
  const deserializeAws_json1_1StringList = (output, context) => {
1477
- return (output || [])
1239
+ const retVal = (output || [])
1478
1240
  .filter((e) => e != null)
1479
1241
  .map((entry) => {
1480
1242
  if (entry === null) {
@@ -1482,6 +1244,7 @@ const deserializeAws_json1_1StringList = (output, context) => {
1482
1244
  }
1483
1245
  return smithy_client_1.expectString(entry);
1484
1246
  });
1247
+ return retVal;
1485
1248
  };
1486
1249
  const deserializeAws_json1_1TrustedAdvisorCategorySpecificSummary = (output, context) => {
1487
1250
  return {
@@ -1502,7 +1265,7 @@ const deserializeAws_json1_1TrustedAdvisorCheckDescription = (output, context) =
1502
1265
  };
1503
1266
  };
1504
1267
  const deserializeAws_json1_1TrustedAdvisorCheckList = (output, context) => {
1505
- return (output || [])
1268
+ const retVal = (output || [])
1506
1269
  .filter((e) => e != null)
1507
1270
  .map((entry) => {
1508
1271
  if (entry === null) {
@@ -1510,6 +1273,7 @@ const deserializeAws_json1_1TrustedAdvisorCheckList = (output, context) => {
1510
1273
  }
1511
1274
  return deserializeAws_json1_1TrustedAdvisorCheckDescription(entry, context);
1512
1275
  });
1276
+ return retVal;
1513
1277
  };
1514
1278
  const deserializeAws_json1_1TrustedAdvisorCheckRefreshStatus = (output, context) => {
1515
1279
  return {
@@ -1519,7 +1283,7 @@ const deserializeAws_json1_1TrustedAdvisorCheckRefreshStatus = (output, context)
1519
1283
  };
1520
1284
  };
1521
1285
  const deserializeAws_json1_1TrustedAdvisorCheckRefreshStatusList = (output, context) => {
1522
- return (output || [])
1286
+ const retVal = (output || [])
1523
1287
  .filter((e) => e != null)
1524
1288
  .map((entry) => {
1525
1289
  if (entry === null) {
@@ -1527,6 +1291,7 @@ const deserializeAws_json1_1TrustedAdvisorCheckRefreshStatusList = (output, cont
1527
1291
  }
1528
1292
  return deserializeAws_json1_1TrustedAdvisorCheckRefreshStatus(entry, context);
1529
1293
  });
1294
+ return retVal;
1530
1295
  };
1531
1296
  const deserializeAws_json1_1TrustedAdvisorCheckResult = (output, context) => {
1532
1297
  return {
@@ -1559,7 +1324,7 @@ const deserializeAws_json1_1TrustedAdvisorCheckSummary = (output, context) => {
1559
1324
  };
1560
1325
  };
1561
1326
  const deserializeAws_json1_1TrustedAdvisorCheckSummaryList = (output, context) => {
1562
- return (output || [])
1327
+ const retVal = (output || [])
1563
1328
  .filter((e) => e != null)
1564
1329
  .map((entry) => {
1565
1330
  if (entry === null) {
@@ -1567,6 +1332,7 @@ const deserializeAws_json1_1TrustedAdvisorCheckSummaryList = (output, context) =
1567
1332
  }
1568
1333
  return deserializeAws_json1_1TrustedAdvisorCheckSummary(entry, context);
1569
1334
  });
1335
+ return retVal;
1570
1336
  };
1571
1337
  const deserializeAws_json1_1TrustedAdvisorCostOptimizingSummary = (output, context) => {
1572
1338
  return {
@@ -1586,7 +1352,7 @@ const deserializeAws_json1_1TrustedAdvisorResourceDetail = (output, context) =>
1586
1352
  };
1587
1353
  };
1588
1354
  const deserializeAws_json1_1TrustedAdvisorResourceDetailList = (output, context) => {
1589
- return (output || [])
1355
+ const retVal = (output || [])
1590
1356
  .filter((e) => e != null)
1591
1357
  .map((entry) => {
1592
1358
  if (entry === null) {
@@ -1594,6 +1360,7 @@ const deserializeAws_json1_1TrustedAdvisorResourceDetailList = (output, context)
1594
1360
  }
1595
1361
  return deserializeAws_json1_1TrustedAdvisorResourceDetail(entry, context);
1596
1362
  });
1363
+ return retVal;
1597
1364
  };
1598
1365
  const deserializeAws_json1_1TrustedAdvisorResourcesSummary = (output, context) => {
1599
1366
  return {