@aws-sdk/client-compute-optimizer 3.504.0 → 3.507.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.
@@ -142,7 +142,7 @@ export const se_UpdateEnrollmentStatusCommand = async (input, context) => {
142
142
  };
143
143
  export const de_DeleteRecommendationPreferencesCommand = async (output, context) => {
144
144
  if (output.statusCode >= 300) {
145
- return de_DeleteRecommendationPreferencesCommandError(output, context);
145
+ return de_CommandError(output, context);
146
146
  }
147
147
  const data = await parseBody(output.body, context);
148
148
  let contents = {};
@@ -153,49 +153,9 @@ export const de_DeleteRecommendationPreferencesCommand = async (output, context)
153
153
  };
154
154
  return response;
155
155
  };
156
- const de_DeleteRecommendationPreferencesCommandError = async (output, context) => {
157
- const parsedOutput = {
158
- ...output,
159
- body: await parseErrorBody(output.body, context),
160
- };
161
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
162
- switch (errorCode) {
163
- case "AccessDeniedException":
164
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
165
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
166
- case "InternalServerException":
167
- case "com.amazonaws.computeoptimizer#InternalServerException":
168
- throw await de_InternalServerExceptionRes(parsedOutput, context);
169
- case "InvalidParameterValueException":
170
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
171
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
172
- case "MissingAuthenticationToken":
173
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
174
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
175
- case "OptInRequiredException":
176
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
177
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
178
- case "ResourceNotFoundException":
179
- case "com.amazonaws.computeoptimizer#ResourceNotFoundException":
180
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
181
- case "ServiceUnavailableException":
182
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
183
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
184
- case "ThrottlingException":
185
- case "com.amazonaws.computeoptimizer#ThrottlingException":
186
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
187
- default:
188
- const parsedBody = parsedOutput.body;
189
- return throwDefaultError({
190
- output,
191
- parsedBody,
192
- errorCode,
193
- });
194
- }
195
- };
196
156
  export const de_DescribeRecommendationExportJobsCommand = async (output, context) => {
197
157
  if (output.statusCode >= 300) {
198
- return de_DescribeRecommendationExportJobsCommandError(output, context);
158
+ return de_CommandError(output, context);
199
159
  }
200
160
  const data = await parseBody(output.body, context);
201
161
  let contents = {};
@@ -206,49 +166,9 @@ export const de_DescribeRecommendationExportJobsCommand = async (output, context
206
166
  };
207
167
  return response;
208
168
  };
209
- const de_DescribeRecommendationExportJobsCommandError = async (output, context) => {
210
- const parsedOutput = {
211
- ...output,
212
- body: await parseErrorBody(output.body, context),
213
- };
214
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
215
- switch (errorCode) {
216
- case "AccessDeniedException":
217
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
218
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
219
- case "InternalServerException":
220
- case "com.amazonaws.computeoptimizer#InternalServerException":
221
- throw await de_InternalServerExceptionRes(parsedOutput, context);
222
- case "InvalidParameterValueException":
223
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
224
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
225
- case "MissingAuthenticationToken":
226
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
227
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
228
- case "OptInRequiredException":
229
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
230
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
231
- case "ResourceNotFoundException":
232
- case "com.amazonaws.computeoptimizer#ResourceNotFoundException":
233
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
234
- case "ServiceUnavailableException":
235
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
236
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
237
- case "ThrottlingException":
238
- case "com.amazonaws.computeoptimizer#ThrottlingException":
239
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
240
- default:
241
- const parsedBody = parsedOutput.body;
242
- return throwDefaultError({
243
- output,
244
- parsedBody,
245
- errorCode,
246
- });
247
- }
248
- };
249
169
  export const de_ExportAutoScalingGroupRecommendationsCommand = async (output, context) => {
250
170
  if (output.statusCode >= 300) {
251
- return de_ExportAutoScalingGroupRecommendationsCommandError(output, context);
171
+ return de_CommandError(output, context);
252
172
  }
253
173
  const data = await parseBody(output.body, context);
254
174
  let contents = {};
@@ -259,49 +179,9 @@ export const de_ExportAutoScalingGroupRecommendationsCommand = async (output, co
259
179
  };
260
180
  return response;
261
181
  };
262
- const de_ExportAutoScalingGroupRecommendationsCommandError = async (output, context) => {
263
- const parsedOutput = {
264
- ...output,
265
- body: await parseErrorBody(output.body, context),
266
- };
267
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
268
- switch (errorCode) {
269
- case "AccessDeniedException":
270
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
271
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
272
- case "InternalServerException":
273
- case "com.amazonaws.computeoptimizer#InternalServerException":
274
- throw await de_InternalServerExceptionRes(parsedOutput, context);
275
- case "InvalidParameterValueException":
276
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
277
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
278
- case "LimitExceededException":
279
- case "com.amazonaws.computeoptimizer#LimitExceededException":
280
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
281
- case "MissingAuthenticationToken":
282
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
283
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
284
- case "OptInRequiredException":
285
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
286
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
287
- case "ServiceUnavailableException":
288
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
289
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
290
- case "ThrottlingException":
291
- case "com.amazonaws.computeoptimizer#ThrottlingException":
292
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
293
- default:
294
- const parsedBody = parsedOutput.body;
295
- return throwDefaultError({
296
- output,
297
- parsedBody,
298
- errorCode,
299
- });
300
- }
301
- };
302
182
  export const de_ExportEBSVolumeRecommendationsCommand = async (output, context) => {
303
183
  if (output.statusCode >= 300) {
304
- return de_ExportEBSVolumeRecommendationsCommandError(output, context);
184
+ return de_CommandError(output, context);
305
185
  }
306
186
  const data = await parseBody(output.body, context);
307
187
  let contents = {};
@@ -312,49 +192,9 @@ export const de_ExportEBSVolumeRecommendationsCommand = async (output, context)
312
192
  };
313
193
  return response;
314
194
  };
315
- const de_ExportEBSVolumeRecommendationsCommandError = async (output, context) => {
316
- const parsedOutput = {
317
- ...output,
318
- body: await parseErrorBody(output.body, context),
319
- };
320
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
321
- switch (errorCode) {
322
- case "AccessDeniedException":
323
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
324
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
325
- case "InternalServerException":
326
- case "com.amazonaws.computeoptimizer#InternalServerException":
327
- throw await de_InternalServerExceptionRes(parsedOutput, context);
328
- case "InvalidParameterValueException":
329
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
330
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
331
- case "LimitExceededException":
332
- case "com.amazonaws.computeoptimizer#LimitExceededException":
333
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
334
- case "MissingAuthenticationToken":
335
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
336
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
337
- case "OptInRequiredException":
338
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
339
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
340
- case "ServiceUnavailableException":
341
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
342
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
343
- case "ThrottlingException":
344
- case "com.amazonaws.computeoptimizer#ThrottlingException":
345
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
346
- default:
347
- const parsedBody = parsedOutput.body;
348
- return throwDefaultError({
349
- output,
350
- parsedBody,
351
- errorCode,
352
- });
353
- }
354
- };
355
195
  export const de_ExportEC2InstanceRecommendationsCommand = async (output, context) => {
356
196
  if (output.statusCode >= 300) {
357
- return de_ExportEC2InstanceRecommendationsCommandError(output, context);
197
+ return de_CommandError(output, context);
358
198
  }
359
199
  const data = await parseBody(output.body, context);
360
200
  let contents = {};
@@ -365,49 +205,9 @@ export const de_ExportEC2InstanceRecommendationsCommand = async (output, context
365
205
  };
366
206
  return response;
367
207
  };
368
- const de_ExportEC2InstanceRecommendationsCommandError = async (output, context) => {
369
- const parsedOutput = {
370
- ...output,
371
- body: await parseErrorBody(output.body, context),
372
- };
373
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
374
- switch (errorCode) {
375
- case "AccessDeniedException":
376
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
377
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
378
- case "InternalServerException":
379
- case "com.amazonaws.computeoptimizer#InternalServerException":
380
- throw await de_InternalServerExceptionRes(parsedOutput, context);
381
- case "InvalidParameterValueException":
382
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
383
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
384
- case "LimitExceededException":
385
- case "com.amazonaws.computeoptimizer#LimitExceededException":
386
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
387
- case "MissingAuthenticationToken":
388
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
389
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
390
- case "OptInRequiredException":
391
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
392
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
393
- case "ServiceUnavailableException":
394
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
395
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
396
- case "ThrottlingException":
397
- case "com.amazonaws.computeoptimizer#ThrottlingException":
398
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
399
- default:
400
- const parsedBody = parsedOutput.body;
401
- return throwDefaultError({
402
- output,
403
- parsedBody,
404
- errorCode,
405
- });
406
- }
407
- };
408
208
  export const de_ExportECSServiceRecommendationsCommand = async (output, context) => {
409
209
  if (output.statusCode >= 300) {
410
- return de_ExportECSServiceRecommendationsCommandError(output, context);
210
+ return de_CommandError(output, context);
411
211
  }
412
212
  const data = await parseBody(output.body, context);
413
213
  let contents = {};
@@ -418,49 +218,22 @@ export const de_ExportECSServiceRecommendationsCommand = async (output, context)
418
218
  };
419
219
  return response;
420
220
  };
421
- const de_ExportECSServiceRecommendationsCommandError = async (output, context) => {
422
- const parsedOutput = {
423
- ...output,
424
- body: await parseErrorBody(output.body, context),
425
- };
426
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
427
- switch (errorCode) {
428
- case "AccessDeniedException":
429
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
430
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
431
- case "InternalServerException":
432
- case "com.amazonaws.computeoptimizer#InternalServerException":
433
- throw await de_InternalServerExceptionRes(parsedOutput, context);
434
- case "InvalidParameterValueException":
435
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
436
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
437
- case "LimitExceededException":
438
- case "com.amazonaws.computeoptimizer#LimitExceededException":
439
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
440
- case "MissingAuthenticationToken":
441
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
442
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
443
- case "OptInRequiredException":
444
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
445
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
446
- case "ServiceUnavailableException":
447
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
448
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
449
- case "ThrottlingException":
450
- case "com.amazonaws.computeoptimizer#ThrottlingException":
451
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
452
- default:
453
- const parsedBody = parsedOutput.body;
454
- return throwDefaultError({
455
- output,
456
- parsedBody,
457
- errorCode,
458
- });
221
+ export const de_ExportLambdaFunctionRecommendationsCommand = async (output, context) => {
222
+ if (output.statusCode >= 300) {
223
+ return de_CommandError(output, context);
459
224
  }
225
+ const data = await parseBody(output.body, context);
226
+ let contents = {};
227
+ contents = _json(data);
228
+ const response = {
229
+ $metadata: deserializeMetadata(output),
230
+ ...contents,
231
+ };
232
+ return response;
460
233
  };
461
- export const de_ExportLambdaFunctionRecommendationsCommand = async (output, context) => {
234
+ export const de_ExportLicenseRecommendationsCommand = async (output, context) => {
462
235
  if (output.statusCode >= 300) {
463
- return de_ExportLambdaFunctionRecommendationsCommandError(output, context);
236
+ return de_CommandError(output, context);
464
237
  }
465
238
  const data = await parseBody(output.body, context);
466
239
  let contents = {};
@@ -471,155 +244,22 @@ export const de_ExportLambdaFunctionRecommendationsCommand = async (output, cont
471
244
  };
472
245
  return response;
473
246
  };
474
- const de_ExportLambdaFunctionRecommendationsCommandError = async (output, context) => {
475
- const parsedOutput = {
476
- ...output,
477
- body: await parseErrorBody(output.body, context),
478
- };
479
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
480
- switch (errorCode) {
481
- case "AccessDeniedException":
482
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
483
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
484
- case "InternalServerException":
485
- case "com.amazonaws.computeoptimizer#InternalServerException":
486
- throw await de_InternalServerExceptionRes(parsedOutput, context);
487
- case "InvalidParameterValueException":
488
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
489
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
490
- case "LimitExceededException":
491
- case "com.amazonaws.computeoptimizer#LimitExceededException":
492
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
493
- case "MissingAuthenticationToken":
494
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
495
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
496
- case "OptInRequiredException":
497
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
498
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
499
- case "ServiceUnavailableException":
500
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
501
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
502
- case "ThrottlingException":
503
- case "com.amazonaws.computeoptimizer#ThrottlingException":
504
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
505
- default:
506
- const parsedBody = parsedOutput.body;
507
- return throwDefaultError({
508
- output,
509
- parsedBody,
510
- errorCode,
511
- });
512
- }
513
- };
514
- export const de_ExportLicenseRecommendationsCommand = async (output, context) => {
515
- if (output.statusCode >= 300) {
516
- return de_ExportLicenseRecommendationsCommandError(output, context);
517
- }
518
- const data = await parseBody(output.body, context);
519
- let contents = {};
520
- contents = _json(data);
521
- const response = {
522
- $metadata: deserializeMetadata(output),
523
- ...contents,
247
+ export const de_GetAutoScalingGroupRecommendationsCommand = async (output, context) => {
248
+ if (output.statusCode >= 300) {
249
+ return de_CommandError(output, context);
250
+ }
251
+ const data = await parseBody(output.body, context);
252
+ let contents = {};
253
+ contents = de_GetAutoScalingGroupRecommendationsResponse(data, context);
254
+ const response = {
255
+ $metadata: deserializeMetadata(output),
256
+ ...contents,
524
257
  };
525
258
  return response;
526
259
  };
527
- const de_ExportLicenseRecommendationsCommandError = async (output, context) => {
528
- const parsedOutput = {
529
- ...output,
530
- body: await parseErrorBody(output.body, context),
531
- };
532
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
533
- switch (errorCode) {
534
- case "AccessDeniedException":
535
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
536
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
537
- case "InternalServerException":
538
- case "com.amazonaws.computeoptimizer#InternalServerException":
539
- throw await de_InternalServerExceptionRes(parsedOutput, context);
540
- case "InvalidParameterValueException":
541
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
542
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
543
- case "LimitExceededException":
544
- case "com.amazonaws.computeoptimizer#LimitExceededException":
545
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
546
- case "MissingAuthenticationToken":
547
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
548
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
549
- case "OptInRequiredException":
550
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
551
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
552
- case "ServiceUnavailableException":
553
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
554
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
555
- case "ThrottlingException":
556
- case "com.amazonaws.computeoptimizer#ThrottlingException":
557
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
558
- default:
559
- const parsedBody = parsedOutput.body;
560
- return throwDefaultError({
561
- output,
562
- parsedBody,
563
- errorCode,
564
- });
565
- }
566
- };
567
- export const de_GetAutoScalingGroupRecommendationsCommand = async (output, context) => {
568
- if (output.statusCode >= 300) {
569
- return de_GetAutoScalingGroupRecommendationsCommandError(output, context);
570
- }
571
- const data = await parseBody(output.body, context);
572
- let contents = {};
573
- contents = de_GetAutoScalingGroupRecommendationsResponse(data, context);
574
- const response = {
575
- $metadata: deserializeMetadata(output),
576
- ...contents,
577
- };
578
- return response;
579
- };
580
- const de_GetAutoScalingGroupRecommendationsCommandError = async (output, context) => {
581
- const parsedOutput = {
582
- ...output,
583
- body: await parseErrorBody(output.body, context),
584
- };
585
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
586
- switch (errorCode) {
587
- case "AccessDeniedException":
588
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
589
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
590
- case "InternalServerException":
591
- case "com.amazonaws.computeoptimizer#InternalServerException":
592
- throw await de_InternalServerExceptionRes(parsedOutput, context);
593
- case "InvalidParameterValueException":
594
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
595
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
596
- case "MissingAuthenticationToken":
597
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
598
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
599
- case "OptInRequiredException":
600
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
601
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
602
- case "ResourceNotFoundException":
603
- case "com.amazonaws.computeoptimizer#ResourceNotFoundException":
604
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
605
- case "ServiceUnavailableException":
606
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
607
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
608
- case "ThrottlingException":
609
- case "com.amazonaws.computeoptimizer#ThrottlingException":
610
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
611
- default:
612
- const parsedBody = parsedOutput.body;
613
- return throwDefaultError({
614
- output,
615
- parsedBody,
616
- errorCode,
617
- });
618
- }
619
- };
620
260
  export const de_GetEBSVolumeRecommendationsCommand = async (output, context) => {
621
261
  if (output.statusCode >= 300) {
622
- return de_GetEBSVolumeRecommendationsCommandError(output, context);
262
+ return de_CommandError(output, context);
623
263
  }
624
264
  const data = await parseBody(output.body, context);
625
265
  let contents = {};
@@ -630,49 +270,9 @@ export const de_GetEBSVolumeRecommendationsCommand = async (output, context) =>
630
270
  };
631
271
  return response;
632
272
  };
633
- const de_GetEBSVolumeRecommendationsCommandError = async (output, context) => {
634
- const parsedOutput = {
635
- ...output,
636
- body: await parseErrorBody(output.body, context),
637
- };
638
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
639
- switch (errorCode) {
640
- case "AccessDeniedException":
641
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
642
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
643
- case "InternalServerException":
644
- case "com.amazonaws.computeoptimizer#InternalServerException":
645
- throw await de_InternalServerExceptionRes(parsedOutput, context);
646
- case "InvalidParameterValueException":
647
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
648
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
649
- case "MissingAuthenticationToken":
650
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
651
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
652
- case "OptInRequiredException":
653
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
654
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
655
- case "ResourceNotFoundException":
656
- case "com.amazonaws.computeoptimizer#ResourceNotFoundException":
657
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
658
- case "ServiceUnavailableException":
659
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
660
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
661
- case "ThrottlingException":
662
- case "com.amazonaws.computeoptimizer#ThrottlingException":
663
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
664
- default:
665
- const parsedBody = parsedOutput.body;
666
- return throwDefaultError({
667
- output,
668
- parsedBody,
669
- errorCode,
670
- });
671
- }
672
- };
673
273
  export const de_GetEC2InstanceRecommendationsCommand = async (output, context) => {
674
274
  if (output.statusCode >= 300) {
675
- return de_GetEC2InstanceRecommendationsCommandError(output, context);
275
+ return de_CommandError(output, context);
676
276
  }
677
277
  const data = await parseBody(output.body, context);
678
278
  let contents = {};
@@ -683,49 +283,9 @@ export const de_GetEC2InstanceRecommendationsCommand = async (output, context) =
683
283
  };
684
284
  return response;
685
285
  };
686
- const de_GetEC2InstanceRecommendationsCommandError = async (output, context) => {
687
- const parsedOutput = {
688
- ...output,
689
- body: await parseErrorBody(output.body, context),
690
- };
691
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
692
- switch (errorCode) {
693
- case "AccessDeniedException":
694
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
695
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
696
- case "InternalServerException":
697
- case "com.amazonaws.computeoptimizer#InternalServerException":
698
- throw await de_InternalServerExceptionRes(parsedOutput, context);
699
- case "InvalidParameterValueException":
700
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
701
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
702
- case "MissingAuthenticationToken":
703
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
704
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
705
- case "OptInRequiredException":
706
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
707
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
708
- case "ResourceNotFoundException":
709
- case "com.amazonaws.computeoptimizer#ResourceNotFoundException":
710
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
711
- case "ServiceUnavailableException":
712
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
713
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
714
- case "ThrottlingException":
715
- case "com.amazonaws.computeoptimizer#ThrottlingException":
716
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
717
- default:
718
- const parsedBody = parsedOutput.body;
719
- return throwDefaultError({
720
- output,
721
- parsedBody,
722
- errorCode,
723
- });
724
- }
725
- };
726
286
  export const de_GetEC2RecommendationProjectedMetricsCommand = async (output, context) => {
727
287
  if (output.statusCode >= 300) {
728
- return de_GetEC2RecommendationProjectedMetricsCommandError(output, context);
288
+ return de_CommandError(output, context);
729
289
  }
730
290
  const data = await parseBody(output.body, context);
731
291
  let contents = {};
@@ -736,49 +296,9 @@ export const de_GetEC2RecommendationProjectedMetricsCommand = async (output, con
736
296
  };
737
297
  return response;
738
298
  };
739
- const de_GetEC2RecommendationProjectedMetricsCommandError = async (output, context) => {
740
- const parsedOutput = {
741
- ...output,
742
- body: await parseErrorBody(output.body, context),
743
- };
744
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
745
- switch (errorCode) {
746
- case "AccessDeniedException":
747
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
748
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
749
- case "InternalServerException":
750
- case "com.amazonaws.computeoptimizer#InternalServerException":
751
- throw await de_InternalServerExceptionRes(parsedOutput, context);
752
- case "InvalidParameterValueException":
753
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
754
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
755
- case "MissingAuthenticationToken":
756
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
757
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
758
- case "OptInRequiredException":
759
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
760
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
761
- case "ResourceNotFoundException":
762
- case "com.amazonaws.computeoptimizer#ResourceNotFoundException":
763
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
764
- case "ServiceUnavailableException":
765
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
766
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
767
- case "ThrottlingException":
768
- case "com.amazonaws.computeoptimizer#ThrottlingException":
769
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
770
- default:
771
- const parsedBody = parsedOutput.body;
772
- return throwDefaultError({
773
- output,
774
- parsedBody,
775
- errorCode,
776
- });
777
- }
778
- };
779
299
  export const de_GetECSServiceRecommendationProjectedMetricsCommand = async (output, context) => {
780
300
  if (output.statusCode >= 300) {
781
- return de_GetECSServiceRecommendationProjectedMetricsCommandError(output, context);
301
+ return de_CommandError(output, context);
782
302
  }
783
303
  const data = await parseBody(output.body, context);
784
304
  let contents = {};
@@ -789,49 +309,9 @@ export const de_GetECSServiceRecommendationProjectedMetricsCommand = async (outp
789
309
  };
790
310
  return response;
791
311
  };
792
- const de_GetECSServiceRecommendationProjectedMetricsCommandError = async (output, context) => {
793
- const parsedOutput = {
794
- ...output,
795
- body: await parseErrorBody(output.body, context),
796
- };
797
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
798
- switch (errorCode) {
799
- case "AccessDeniedException":
800
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
801
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
802
- case "InternalServerException":
803
- case "com.amazonaws.computeoptimizer#InternalServerException":
804
- throw await de_InternalServerExceptionRes(parsedOutput, context);
805
- case "InvalidParameterValueException":
806
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
807
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
808
- case "MissingAuthenticationToken":
809
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
810
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
811
- case "OptInRequiredException":
812
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
813
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
814
- case "ResourceNotFoundException":
815
- case "com.amazonaws.computeoptimizer#ResourceNotFoundException":
816
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
817
- case "ServiceUnavailableException":
818
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
819
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
820
- case "ThrottlingException":
821
- case "com.amazonaws.computeoptimizer#ThrottlingException":
822
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
823
- default:
824
- const parsedBody = parsedOutput.body;
825
- return throwDefaultError({
826
- output,
827
- parsedBody,
828
- errorCode,
829
- });
830
- }
831
- };
832
312
  export const de_GetECSServiceRecommendationsCommand = async (output, context) => {
833
313
  if (output.statusCode >= 300) {
834
- return de_GetECSServiceRecommendationsCommandError(output, context);
314
+ return de_CommandError(output, context);
835
315
  }
836
316
  const data = await parseBody(output.body, context);
837
317
  let contents = {};
@@ -842,196 +322,48 @@ export const de_GetECSServiceRecommendationsCommand = async (output, context) =>
842
322
  };
843
323
  return response;
844
324
  };
845
- const de_GetECSServiceRecommendationsCommandError = async (output, context) => {
846
- const parsedOutput = {
847
- ...output,
848
- body: await parseErrorBody(output.body, context),
849
- };
850
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
851
- switch (errorCode) {
852
- case "AccessDeniedException":
853
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
854
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
855
- case "InternalServerException":
856
- case "com.amazonaws.computeoptimizer#InternalServerException":
857
- throw await de_InternalServerExceptionRes(parsedOutput, context);
858
- case "InvalidParameterValueException":
859
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
860
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
861
- case "MissingAuthenticationToken":
862
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
863
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
864
- case "OptInRequiredException":
865
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
866
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
867
- case "ResourceNotFoundException":
868
- case "com.amazonaws.computeoptimizer#ResourceNotFoundException":
869
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
870
- case "ServiceUnavailableException":
871
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
872
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
873
- case "ThrottlingException":
874
- case "com.amazonaws.computeoptimizer#ThrottlingException":
875
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
876
- default:
877
- const parsedBody = parsedOutput.body;
878
- return throwDefaultError({
879
- output,
880
- parsedBody,
881
- errorCode,
882
- });
883
- }
884
- };
885
- export const de_GetEffectiveRecommendationPreferencesCommand = async (output, context) => {
886
- if (output.statusCode >= 300) {
887
- return de_GetEffectiveRecommendationPreferencesCommandError(output, context);
888
- }
889
- const data = await parseBody(output.body, context);
890
- let contents = {};
891
- contents = _json(data);
892
- const response = {
893
- $metadata: deserializeMetadata(output),
894
- ...contents,
895
- };
896
- return response;
897
- };
898
- const de_GetEffectiveRecommendationPreferencesCommandError = async (output, context) => {
899
- const parsedOutput = {
900
- ...output,
901
- body: await parseErrorBody(output.body, context),
902
- };
903
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
904
- switch (errorCode) {
905
- case "AccessDeniedException":
906
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
907
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
908
- case "InternalServerException":
909
- case "com.amazonaws.computeoptimizer#InternalServerException":
910
- throw await de_InternalServerExceptionRes(parsedOutput, context);
911
- case "InvalidParameterValueException":
912
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
913
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
914
- case "MissingAuthenticationToken":
915
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
916
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
917
- case "OptInRequiredException":
918
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
919
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
920
- case "ResourceNotFoundException":
921
- case "com.amazonaws.computeoptimizer#ResourceNotFoundException":
922
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
923
- case "ServiceUnavailableException":
924
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
925
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
926
- case "ThrottlingException":
927
- case "com.amazonaws.computeoptimizer#ThrottlingException":
928
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
929
- default:
930
- const parsedBody = parsedOutput.body;
931
- return throwDefaultError({
932
- output,
933
- parsedBody,
934
- errorCode,
935
- });
936
- }
937
- };
938
- export const de_GetEnrollmentStatusCommand = async (output, context) => {
939
- if (output.statusCode >= 300) {
940
- return de_GetEnrollmentStatusCommandError(output, context);
941
- }
942
- const data = await parseBody(output.body, context);
943
- let contents = {};
944
- contents = de_GetEnrollmentStatusResponse(data, context);
945
- const response = {
946
- $metadata: deserializeMetadata(output),
947
- ...contents,
948
- };
949
- return response;
950
- };
951
- const de_GetEnrollmentStatusCommandError = async (output, context) => {
952
- const parsedOutput = {
953
- ...output,
954
- body: await parseErrorBody(output.body, context),
955
- };
956
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
957
- switch (errorCode) {
958
- case "AccessDeniedException":
959
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
960
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
961
- case "InternalServerException":
962
- case "com.amazonaws.computeoptimizer#InternalServerException":
963
- throw await de_InternalServerExceptionRes(parsedOutput, context);
964
- case "InvalidParameterValueException":
965
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
966
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
967
- case "MissingAuthenticationToken":
968
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
969
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
970
- case "ServiceUnavailableException":
971
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
972
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
973
- case "ThrottlingException":
974
- case "com.amazonaws.computeoptimizer#ThrottlingException":
975
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
976
- default:
977
- const parsedBody = parsedOutput.body;
978
- return throwDefaultError({
979
- output,
980
- parsedBody,
981
- errorCode,
982
- });
983
- }
984
- };
985
- export const de_GetEnrollmentStatusesForOrganizationCommand = async (output, context) => {
325
+ export const de_GetEffectiveRecommendationPreferencesCommand = async (output, context) => {
986
326
  if (output.statusCode >= 300) {
987
- return de_GetEnrollmentStatusesForOrganizationCommandError(output, context);
327
+ return de_CommandError(output, context);
988
328
  }
989
329
  const data = await parseBody(output.body, context);
990
330
  let contents = {};
991
- contents = de_GetEnrollmentStatusesForOrganizationResponse(data, context);
331
+ contents = _json(data);
992
332
  const response = {
993
333
  $metadata: deserializeMetadata(output),
994
334
  ...contents,
995
335
  };
996
336
  return response;
997
337
  };
998
- const de_GetEnrollmentStatusesForOrganizationCommandError = async (output, context) => {
999
- const parsedOutput = {
1000
- ...output,
1001
- body: await parseErrorBody(output.body, context),
338
+ export const de_GetEnrollmentStatusCommand = async (output, context) => {
339
+ if (output.statusCode >= 300) {
340
+ return de_CommandError(output, context);
341
+ }
342
+ const data = await parseBody(output.body, context);
343
+ let contents = {};
344
+ contents = de_GetEnrollmentStatusResponse(data, context);
345
+ const response = {
346
+ $metadata: deserializeMetadata(output),
347
+ ...contents,
1002
348
  };
1003
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1004
- switch (errorCode) {
1005
- case "AccessDeniedException":
1006
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
1007
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1008
- case "InternalServerException":
1009
- case "com.amazonaws.computeoptimizer#InternalServerException":
1010
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1011
- case "InvalidParameterValueException":
1012
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
1013
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1014
- case "MissingAuthenticationToken":
1015
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
1016
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
1017
- case "ServiceUnavailableException":
1018
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
1019
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1020
- case "ThrottlingException":
1021
- case "com.amazonaws.computeoptimizer#ThrottlingException":
1022
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1023
- default:
1024
- const parsedBody = parsedOutput.body;
1025
- return throwDefaultError({
1026
- output,
1027
- parsedBody,
1028
- errorCode,
1029
- });
349
+ return response;
350
+ };
351
+ export const de_GetEnrollmentStatusesForOrganizationCommand = async (output, context) => {
352
+ if (output.statusCode >= 300) {
353
+ return de_CommandError(output, context);
1030
354
  }
355
+ const data = await parseBody(output.body, context);
356
+ let contents = {};
357
+ contents = de_GetEnrollmentStatusesForOrganizationResponse(data, context);
358
+ const response = {
359
+ $metadata: deserializeMetadata(output),
360
+ ...contents,
361
+ };
362
+ return response;
1031
363
  };
1032
364
  export const de_GetLambdaFunctionRecommendationsCommand = async (output, context) => {
1033
365
  if (output.statusCode >= 300) {
1034
- return de_GetLambdaFunctionRecommendationsCommandError(output, context);
366
+ return de_CommandError(output, context);
1035
367
  }
1036
368
  const data = await parseBody(output.body, context);
1037
369
  let contents = {};
@@ -1042,49 +374,9 @@ export const de_GetLambdaFunctionRecommendationsCommand = async (output, context
1042
374
  };
1043
375
  return response;
1044
376
  };
1045
- const de_GetLambdaFunctionRecommendationsCommandError = async (output, context) => {
1046
- const parsedOutput = {
1047
- ...output,
1048
- body: await parseErrorBody(output.body, context),
1049
- };
1050
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1051
- switch (errorCode) {
1052
- case "AccessDeniedException":
1053
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
1054
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1055
- case "InternalServerException":
1056
- case "com.amazonaws.computeoptimizer#InternalServerException":
1057
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1058
- case "InvalidParameterValueException":
1059
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
1060
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1061
- case "LimitExceededException":
1062
- case "com.amazonaws.computeoptimizer#LimitExceededException":
1063
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
1064
- case "MissingAuthenticationToken":
1065
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
1066
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
1067
- case "OptInRequiredException":
1068
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
1069
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
1070
- case "ServiceUnavailableException":
1071
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
1072
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1073
- case "ThrottlingException":
1074
- case "com.amazonaws.computeoptimizer#ThrottlingException":
1075
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1076
- default:
1077
- const parsedBody = parsedOutput.body;
1078
- return throwDefaultError({
1079
- output,
1080
- parsedBody,
1081
- errorCode,
1082
- });
1083
- }
1084
- };
1085
377
  export const de_GetLicenseRecommendationsCommand = async (output, context) => {
1086
378
  if (output.statusCode >= 300) {
1087
- return de_GetLicenseRecommendationsCommandError(output, context);
379
+ return de_CommandError(output, context);
1088
380
  }
1089
381
  const data = await parseBody(output.body, context);
1090
382
  let contents = {};
@@ -1095,49 +387,9 @@ export const de_GetLicenseRecommendationsCommand = async (output, context) => {
1095
387
  };
1096
388
  return response;
1097
389
  };
1098
- const de_GetLicenseRecommendationsCommandError = async (output, context) => {
1099
- const parsedOutput = {
1100
- ...output,
1101
- body: await parseErrorBody(output.body, context),
1102
- };
1103
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1104
- switch (errorCode) {
1105
- case "AccessDeniedException":
1106
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
1107
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1108
- case "InternalServerException":
1109
- case "com.amazonaws.computeoptimizer#InternalServerException":
1110
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1111
- case "InvalidParameterValueException":
1112
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
1113
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1114
- case "MissingAuthenticationToken":
1115
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
1116
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
1117
- case "OptInRequiredException":
1118
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
1119
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
1120
- case "ResourceNotFoundException":
1121
- case "com.amazonaws.computeoptimizer#ResourceNotFoundException":
1122
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1123
- case "ServiceUnavailableException":
1124
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
1125
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1126
- case "ThrottlingException":
1127
- case "com.amazonaws.computeoptimizer#ThrottlingException":
1128
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1129
- default:
1130
- const parsedBody = parsedOutput.body;
1131
- return throwDefaultError({
1132
- output,
1133
- parsedBody,
1134
- errorCode,
1135
- });
1136
- }
1137
- };
1138
390
  export const de_GetRecommendationPreferencesCommand = async (output, context) => {
1139
391
  if (output.statusCode >= 300) {
1140
- return de_GetRecommendationPreferencesCommandError(output, context);
392
+ return de_CommandError(output, context);
1141
393
  }
1142
394
  const data = await parseBody(output.body, context);
1143
395
  let contents = {};
@@ -1148,49 +400,9 @@ export const de_GetRecommendationPreferencesCommand = async (output, context) =>
1148
400
  };
1149
401
  return response;
1150
402
  };
1151
- const de_GetRecommendationPreferencesCommandError = async (output, context) => {
1152
- const parsedOutput = {
1153
- ...output,
1154
- body: await parseErrorBody(output.body, context),
1155
- };
1156
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1157
- switch (errorCode) {
1158
- case "AccessDeniedException":
1159
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
1160
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1161
- case "InternalServerException":
1162
- case "com.amazonaws.computeoptimizer#InternalServerException":
1163
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1164
- case "InvalidParameterValueException":
1165
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
1166
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1167
- case "MissingAuthenticationToken":
1168
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
1169
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
1170
- case "OptInRequiredException":
1171
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
1172
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
1173
- case "ResourceNotFoundException":
1174
- case "com.amazonaws.computeoptimizer#ResourceNotFoundException":
1175
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1176
- case "ServiceUnavailableException":
1177
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
1178
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1179
- case "ThrottlingException":
1180
- case "com.amazonaws.computeoptimizer#ThrottlingException":
1181
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1182
- default:
1183
- const parsedBody = parsedOutput.body;
1184
- return throwDefaultError({
1185
- output,
1186
- parsedBody,
1187
- errorCode,
1188
- });
1189
- }
1190
- };
1191
403
  export const de_GetRecommendationSummariesCommand = async (output, context) => {
1192
404
  if (output.statusCode >= 300) {
1193
- return de_GetRecommendationSummariesCommandError(output, context);
405
+ return de_CommandError(output, context);
1194
406
  }
1195
407
  const data = await parseBody(output.body, context);
1196
408
  let contents = {};
@@ -1201,46 +413,9 @@ export const de_GetRecommendationSummariesCommand = async (output, context) => {
1201
413
  };
1202
414
  return response;
1203
415
  };
1204
- const de_GetRecommendationSummariesCommandError = async (output, context) => {
1205
- const parsedOutput = {
1206
- ...output,
1207
- body: await parseErrorBody(output.body, context),
1208
- };
1209
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1210
- switch (errorCode) {
1211
- case "AccessDeniedException":
1212
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
1213
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1214
- case "InternalServerException":
1215
- case "com.amazonaws.computeoptimizer#InternalServerException":
1216
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1217
- case "InvalidParameterValueException":
1218
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
1219
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1220
- case "MissingAuthenticationToken":
1221
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
1222
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
1223
- case "OptInRequiredException":
1224
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
1225
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
1226
- case "ServiceUnavailableException":
1227
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
1228
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1229
- case "ThrottlingException":
1230
- case "com.amazonaws.computeoptimizer#ThrottlingException":
1231
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1232
- default:
1233
- const parsedBody = parsedOutput.body;
1234
- return throwDefaultError({
1235
- output,
1236
- parsedBody,
1237
- errorCode,
1238
- });
1239
- }
1240
- };
1241
416
  export const de_PutRecommendationPreferencesCommand = async (output, context) => {
1242
417
  if (output.statusCode >= 300) {
1243
- return de_PutRecommendationPreferencesCommandError(output, context);
418
+ return de_CommandError(output, context);
1244
419
  }
1245
420
  const data = await parseBody(output.body, context);
1246
421
  let contents = {};
@@ -1251,49 +426,9 @@ export const de_PutRecommendationPreferencesCommand = async (output, context) =>
1251
426
  };
1252
427
  return response;
1253
428
  };
1254
- const de_PutRecommendationPreferencesCommandError = async (output, context) => {
1255
- const parsedOutput = {
1256
- ...output,
1257
- body: await parseErrorBody(output.body, context),
1258
- };
1259
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1260
- switch (errorCode) {
1261
- case "AccessDeniedException":
1262
- case "com.amazonaws.computeoptimizer#AccessDeniedException":
1263
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1264
- case "InternalServerException":
1265
- case "com.amazonaws.computeoptimizer#InternalServerException":
1266
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1267
- case "InvalidParameterValueException":
1268
- case "com.amazonaws.computeoptimizer#InvalidParameterValueException":
1269
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1270
- case "MissingAuthenticationToken":
1271
- case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
1272
- throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
1273
- case "OptInRequiredException":
1274
- case "com.amazonaws.computeoptimizer#OptInRequiredException":
1275
- throw await de_OptInRequiredExceptionRes(parsedOutput, context);
1276
- case "ResourceNotFoundException":
1277
- case "com.amazonaws.computeoptimizer#ResourceNotFoundException":
1278
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1279
- case "ServiceUnavailableException":
1280
- case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
1281
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1282
- case "ThrottlingException":
1283
- case "com.amazonaws.computeoptimizer#ThrottlingException":
1284
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1285
- default:
1286
- const parsedBody = parsedOutput.body;
1287
- return throwDefaultError({
1288
- output,
1289
- parsedBody,
1290
- errorCode,
1291
- });
1292
- }
1293
- };
1294
429
  export const de_UpdateEnrollmentStatusCommand = async (output, context) => {
1295
430
  if (output.statusCode >= 300) {
1296
- return de_UpdateEnrollmentStatusCommandError(output, context);
431
+ return de_CommandError(output, context);
1297
432
  }
1298
433
  const data = await parseBody(output.body, context);
1299
434
  let contents = {};
@@ -1304,7 +439,7 @@ export const de_UpdateEnrollmentStatusCommand = async (output, context) => {
1304
439
  };
1305
440
  return response;
1306
441
  };
1307
- const de_UpdateEnrollmentStatusCommandError = async (output, context) => {
442
+ const de_CommandError = async (output, context) => {
1308
443
  const parsedOutput = {
1309
444
  ...output,
1310
445
  body: await parseErrorBody(output.body, context),
@@ -1323,12 +458,21 @@ const de_UpdateEnrollmentStatusCommandError = async (output, context) => {
1323
458
  case "MissingAuthenticationToken":
1324
459
  case "com.amazonaws.computeoptimizer#MissingAuthenticationToken":
1325
460
  throw await de_MissingAuthenticationTokenRes(parsedOutput, context);
461
+ case "OptInRequiredException":
462
+ case "com.amazonaws.computeoptimizer#OptInRequiredException":
463
+ throw await de_OptInRequiredExceptionRes(parsedOutput, context);
464
+ case "ResourceNotFoundException":
465
+ case "com.amazonaws.computeoptimizer#ResourceNotFoundException":
466
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1326
467
  case "ServiceUnavailableException":
1327
468
  case "com.amazonaws.computeoptimizer#ServiceUnavailableException":
1328
469
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1329
470
  case "ThrottlingException":
1330
471
  case "com.amazonaws.computeoptimizer#ThrottlingException":
1331
472
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
473
+ case "LimitExceededException":
474
+ case "com.amazonaws.computeoptimizer#LimitExceededException":
475
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
1332
476
  default:
1333
477
  const parsedBody = parsedOutput.body;
1334
478
  return throwDefaultError({