@aws-sdk/client-auditmanager 3.141.0 → 3.142.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.
@@ -14,16 +14,7 @@ const serializeAws_restJson1AssociateAssessmentReportEvidenceFolderCommand = asy
14
14
  };
15
15
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
16
16
  "/assessments/{assessmentId}/associateToAssessmentReport";
17
- if (input.assessmentId !== undefined) {
18
- const labelValue = input.assessmentId;
19
- if (labelValue.length <= 0) {
20
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
21
- }
22
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
23
- }
24
- else {
25
- throw new Error("No value provided for input HTTP label: assessmentId.");
26
- }
17
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
27
18
  let body;
28
19
  body = JSON.stringify({
29
20
  ...(input.evidenceFolderId != null && { evidenceFolderId: input.evidenceFolderId }),
@@ -46,16 +37,7 @@ const serializeAws_restJson1BatchAssociateAssessmentReportEvidenceCommand = asyn
46
37
  };
47
38
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
48
39
  "/assessments/{assessmentId}/batchAssociateToAssessmentReport";
49
- if (input.assessmentId !== undefined) {
50
- const labelValue = input.assessmentId;
51
- if (labelValue.length <= 0) {
52
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
53
- }
54
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
55
- }
56
- else {
57
- throw new Error("No value provided for input HTTP label: assessmentId.");
58
- }
40
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
59
41
  let body;
60
42
  body = JSON.stringify({
61
43
  ...(input.evidenceFolderId != null && { evidenceFolderId: input.evidenceFolderId }),
@@ -78,16 +60,7 @@ const serializeAws_restJson1BatchCreateDelegationByAssessmentCommand = async (in
78
60
  "content-type": "application/json",
79
61
  };
80
62
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assessments/{assessmentId}/delegations";
81
- if (input.assessmentId !== undefined) {
82
- const labelValue = input.assessmentId;
83
- if (labelValue.length <= 0) {
84
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
85
- }
86
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
87
- }
88
- else {
89
- throw new Error("No value provided for input HTTP label: assessmentId.");
90
- }
63
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
91
64
  let body;
92
65
  body = JSON.stringify({
93
66
  ...(input.createDelegationRequests != null && {
@@ -111,16 +84,7 @@ const serializeAws_restJson1BatchDeleteDelegationByAssessmentCommand = async (in
111
84
  "content-type": "application/json",
112
85
  };
113
86
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assessments/{assessmentId}/delegations";
114
- if (input.assessmentId !== undefined) {
115
- const labelValue = input.assessmentId;
116
- if (labelValue.length <= 0) {
117
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
118
- }
119
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
120
- }
121
- else {
122
- throw new Error("No value provided for input HTTP label: assessmentId.");
123
- }
87
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
124
88
  let body;
125
89
  body = JSON.stringify({
126
90
  ...(input.delegationIds != null && {
@@ -145,16 +109,7 @@ const serializeAws_restJson1BatchDisassociateAssessmentReportEvidenceCommand = a
145
109
  };
146
110
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
147
111
  "/assessments/{assessmentId}/batchDisassociateFromAssessmentReport";
148
- if (input.assessmentId !== undefined) {
149
- const labelValue = input.assessmentId;
150
- if (labelValue.length <= 0) {
151
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
152
- }
153
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
154
- }
155
- else {
156
- throw new Error("No value provided for input HTTP label: assessmentId.");
157
- }
112
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
158
113
  let body;
159
114
  body = JSON.stringify({
160
115
  ...(input.evidenceFolderId != null && { evidenceFolderId: input.evidenceFolderId }),
@@ -178,36 +133,9 @@ const serializeAws_restJson1BatchImportEvidenceToAssessmentControlCommand = asyn
178
133
  };
179
134
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
180
135
  "/assessments/{assessmentId}/controlSets/{controlSetId}/controls/{controlId}/evidence";
181
- if (input.assessmentId !== undefined) {
182
- const labelValue = input.assessmentId;
183
- if (labelValue.length <= 0) {
184
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
185
- }
186
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
187
- }
188
- else {
189
- throw new Error("No value provided for input HTTP label: assessmentId.");
190
- }
191
- if (input.controlSetId !== undefined) {
192
- const labelValue = input.controlSetId;
193
- if (labelValue.length <= 0) {
194
- throw new Error("Empty value provided for input HTTP label: controlSetId.");
195
- }
196
- resolvedPath = resolvedPath.replace("{controlSetId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
197
- }
198
- else {
199
- throw new Error("No value provided for input HTTP label: controlSetId.");
200
- }
201
- if (input.controlId !== undefined) {
202
- const labelValue = input.controlId;
203
- if (labelValue.length <= 0) {
204
- throw new Error("Empty value provided for input HTTP label: controlId.");
205
- }
206
- resolvedPath = resolvedPath.replace("{controlId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
207
- }
208
- else {
209
- throw new Error("No value provided for input HTTP label: controlId.");
210
- }
136
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
137
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "controlSetId", () => input.controlSetId, "{controlSetId}", false);
138
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "controlId", () => input.controlId, "{controlId}", false);
211
139
  let body;
212
140
  body = JSON.stringify({
213
141
  ...(input.manualEvidence != null && {
@@ -287,16 +215,7 @@ const serializeAws_restJson1CreateAssessmentReportCommand = async (input, contex
287
215
  "content-type": "application/json",
288
216
  };
289
217
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assessments/{assessmentId}/reports";
290
- if (input.assessmentId !== undefined) {
291
- const labelValue = input.assessmentId;
292
- if (labelValue.length <= 0) {
293
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
294
- }
295
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
296
- }
297
- else {
298
- throw new Error("No value provided for input HTTP label: assessmentId.");
299
- }
218
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
300
219
  let body;
301
220
  body = JSON.stringify({
302
221
  ...(input.description != null && { description: input.description }),
@@ -346,16 +265,7 @@ const serializeAws_restJson1DeleteAssessmentCommand = async (input, context) =>
346
265
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
347
266
  const headers = {};
348
267
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assessments/{assessmentId}";
349
- if (input.assessmentId !== undefined) {
350
- const labelValue = input.assessmentId;
351
- if (labelValue.length <= 0) {
352
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
353
- }
354
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
355
- }
356
- else {
357
- throw new Error("No value provided for input HTTP label: assessmentId.");
358
- }
268
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
359
269
  let body;
360
270
  return new protocol_http_1.HttpRequest({
361
271
  protocol,
@@ -372,16 +282,7 @@ const serializeAws_restJson1DeleteAssessmentFrameworkCommand = async (input, con
372
282
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
373
283
  const headers = {};
374
284
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assessmentFrameworks/{frameworkId}";
375
- if (input.frameworkId !== undefined) {
376
- const labelValue = input.frameworkId;
377
- if (labelValue.length <= 0) {
378
- throw new Error("Empty value provided for input HTTP label: frameworkId.");
379
- }
380
- resolvedPath = resolvedPath.replace("{frameworkId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
381
- }
382
- else {
383
- throw new Error("No value provided for input HTTP label: frameworkId.");
384
- }
285
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "frameworkId", () => input.frameworkId, "{frameworkId}", false);
385
286
  let body;
386
287
  return new protocol_http_1.HttpRequest({
387
288
  protocol,
@@ -399,19 +300,10 @@ const serializeAws_restJson1DeleteAssessmentFrameworkShareCommand = async (input
399
300
  const headers = {};
400
301
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
401
302
  "/assessmentFrameworkShareRequests/{requestId}";
402
- if (input.requestId !== undefined) {
403
- const labelValue = input.requestId;
404
- if (labelValue.length <= 0) {
405
- throw new Error("Empty value provided for input HTTP label: requestId.");
406
- }
407
- resolvedPath = resolvedPath.replace("{requestId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
408
- }
409
- else {
410
- throw new Error("No value provided for input HTTP label: requestId.");
411
- }
412
- const query = {
413
- ...(input.requestType !== undefined && { requestType: input.requestType }),
414
- };
303
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "requestId", () => input.requestId, "{requestId}", false);
304
+ const query = map({
305
+ requestType: [, input.requestType],
306
+ });
415
307
  let body;
416
308
  return new protocol_http_1.HttpRequest({
417
309
  protocol,
@@ -430,26 +322,8 @@ const serializeAws_restJson1DeleteAssessmentReportCommand = async (input, contex
430
322
  const headers = {};
431
323
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
432
324
  "/assessments/{assessmentId}/reports/{assessmentReportId}";
433
- if (input.assessmentId !== undefined) {
434
- const labelValue = input.assessmentId;
435
- if (labelValue.length <= 0) {
436
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
437
- }
438
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
439
- }
440
- else {
441
- throw new Error("No value provided for input HTTP label: assessmentId.");
442
- }
443
- if (input.assessmentReportId !== undefined) {
444
- const labelValue = input.assessmentReportId;
445
- if (labelValue.length <= 0) {
446
- throw new Error("Empty value provided for input HTTP label: assessmentReportId.");
447
- }
448
- resolvedPath = resolvedPath.replace("{assessmentReportId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
449
- }
450
- else {
451
- throw new Error("No value provided for input HTTP label: assessmentReportId.");
452
- }
325
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
326
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentReportId", () => input.assessmentReportId, "{assessmentReportId}", false);
453
327
  let body;
454
328
  return new protocol_http_1.HttpRequest({
455
329
  protocol,
@@ -466,16 +340,7 @@ const serializeAws_restJson1DeleteControlCommand = async (input, context) => {
466
340
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
467
341
  const headers = {};
468
342
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/controls/{controlId}";
469
- if (input.controlId !== undefined) {
470
- const labelValue = input.controlId;
471
- if (labelValue.length <= 0) {
472
- throw new Error("Empty value provided for input HTTP label: controlId.");
473
- }
474
- resolvedPath = resolvedPath.replace("{controlId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
475
- }
476
- else {
477
- throw new Error("No value provided for input HTTP label: controlId.");
478
- }
343
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "controlId", () => input.controlId, "{controlId}", false);
479
344
  let body;
480
345
  return new protocol_http_1.HttpRequest({
481
346
  protocol,
@@ -536,16 +401,7 @@ const serializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCommand =
536
401
  };
537
402
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
538
403
  "/assessments/{assessmentId}/disassociateFromAssessmentReport";
539
- if (input.assessmentId !== undefined) {
540
- const labelValue = input.assessmentId;
541
- if (labelValue.length <= 0) {
542
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
543
- }
544
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
545
- }
546
- else {
547
- throw new Error("No value provided for input HTTP label: assessmentId.");
548
- }
404
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
549
405
  let body;
550
406
  body = JSON.stringify({
551
407
  ...(input.evidenceFolderId != null && { evidenceFolderId: input.evidenceFolderId }),
@@ -584,16 +440,7 @@ const serializeAws_restJson1GetAssessmentCommand = async (input, context) => {
584
440
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
585
441
  const headers = {};
586
442
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assessments/{assessmentId}";
587
- if (input.assessmentId !== undefined) {
588
- const labelValue = input.assessmentId;
589
- if (labelValue.length <= 0) {
590
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
591
- }
592
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
593
- }
594
- else {
595
- throw new Error("No value provided for input HTTP label: assessmentId.");
596
- }
443
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
597
444
  let body;
598
445
  return new protocol_http_1.HttpRequest({
599
446
  protocol,
@@ -610,16 +457,7 @@ const serializeAws_restJson1GetAssessmentFrameworkCommand = async (input, contex
610
457
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
611
458
  const headers = {};
612
459
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assessmentFrameworks/{frameworkId}";
613
- if (input.frameworkId !== undefined) {
614
- const labelValue = input.frameworkId;
615
- if (labelValue.length <= 0) {
616
- throw new Error("Empty value provided for input HTTP label: frameworkId.");
617
- }
618
- resolvedPath = resolvedPath.replace("{frameworkId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
619
- }
620
- else {
621
- throw new Error("No value provided for input HTTP label: frameworkId.");
622
- }
460
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "frameworkId", () => input.frameworkId, "{frameworkId}", false);
623
461
  let body;
624
462
  return new protocol_http_1.HttpRequest({
625
463
  protocol,
@@ -637,26 +475,8 @@ const serializeAws_restJson1GetAssessmentReportUrlCommand = async (input, contex
637
475
  const headers = {};
638
476
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
639
477
  "/assessments/{assessmentId}/reports/{assessmentReportId}/url";
640
- if (input.assessmentReportId !== undefined) {
641
- const labelValue = input.assessmentReportId;
642
- if (labelValue.length <= 0) {
643
- throw new Error("Empty value provided for input HTTP label: assessmentReportId.");
644
- }
645
- resolvedPath = resolvedPath.replace("{assessmentReportId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
646
- }
647
- else {
648
- throw new Error("No value provided for input HTTP label: assessmentReportId.");
649
- }
650
- if (input.assessmentId !== undefined) {
651
- const labelValue = input.assessmentId;
652
- if (labelValue.length <= 0) {
653
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
654
- }
655
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
656
- }
657
- else {
658
- throw new Error("No value provided for input HTTP label: assessmentId.");
659
- }
478
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentReportId", () => input.assessmentReportId, "{assessmentReportId}", false);
479
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
660
480
  let body;
661
481
  return new protocol_http_1.HttpRequest({
662
482
  protocol,
@@ -673,22 +493,13 @@ const serializeAws_restJson1GetChangeLogsCommand = async (input, context) => {
673
493
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
674
494
  const headers = {};
675
495
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assessments/{assessmentId}/changelogs";
676
- if (input.assessmentId !== undefined) {
677
- const labelValue = input.assessmentId;
678
- if (labelValue.length <= 0) {
679
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
680
- }
681
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
682
- }
683
- else {
684
- throw new Error("No value provided for input HTTP label: assessmentId.");
685
- }
686
- const query = {
687
- ...(input.controlSetId !== undefined && { controlSetId: input.controlSetId }),
688
- ...(input.controlId !== undefined && { controlId: input.controlId }),
689
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
690
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
691
- };
496
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
497
+ const query = map({
498
+ controlSetId: [, input.controlSetId],
499
+ controlId: [, input.controlId],
500
+ nextToken: [, input.nextToken],
501
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
502
+ });
692
503
  let body;
693
504
  return new protocol_http_1.HttpRequest({
694
505
  protocol,
@@ -706,16 +517,7 @@ const serializeAws_restJson1GetControlCommand = async (input, context) => {
706
517
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
707
518
  const headers = {};
708
519
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/controls/{controlId}";
709
- if (input.controlId !== undefined) {
710
- const labelValue = input.controlId;
711
- if (labelValue.length <= 0) {
712
- throw new Error("Empty value provided for input HTTP label: controlId.");
713
- }
714
- resolvedPath = resolvedPath.replace("{controlId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
715
- }
716
- else {
717
- throw new Error("No value provided for input HTTP label: controlId.");
718
- }
520
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "controlId", () => input.controlId, "{controlId}", false);
719
521
  let body;
720
522
  return new protocol_http_1.HttpRequest({
721
523
  protocol,
@@ -732,10 +534,10 @@ const serializeAws_restJson1GetDelegationsCommand = async (input, context) => {
732
534
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
733
535
  const headers = {};
734
536
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/delegations";
735
- const query = {
736
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
737
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
738
- };
537
+ const query = map({
538
+ nextToken: [, input.nextToken],
539
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
540
+ });
739
541
  let body;
740
542
  return new protocol_http_1.HttpRequest({
741
543
  protocol,
@@ -754,46 +556,10 @@ const serializeAws_restJson1GetEvidenceCommand = async (input, context) => {
754
556
  const headers = {};
755
557
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
756
558
  "/assessments/{assessmentId}/controlSets/{controlSetId}/evidenceFolders/{evidenceFolderId}/evidence/{evidenceId}";
757
- if (input.assessmentId !== undefined) {
758
- const labelValue = input.assessmentId;
759
- if (labelValue.length <= 0) {
760
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
761
- }
762
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
763
- }
764
- else {
765
- throw new Error("No value provided for input HTTP label: assessmentId.");
766
- }
767
- if (input.controlSetId !== undefined) {
768
- const labelValue = input.controlSetId;
769
- if (labelValue.length <= 0) {
770
- throw new Error("Empty value provided for input HTTP label: controlSetId.");
771
- }
772
- resolvedPath = resolvedPath.replace("{controlSetId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
773
- }
774
- else {
775
- throw new Error("No value provided for input HTTP label: controlSetId.");
776
- }
777
- if (input.evidenceFolderId !== undefined) {
778
- const labelValue = input.evidenceFolderId;
779
- if (labelValue.length <= 0) {
780
- throw new Error("Empty value provided for input HTTP label: evidenceFolderId.");
781
- }
782
- resolvedPath = resolvedPath.replace("{evidenceFolderId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
783
- }
784
- else {
785
- throw new Error("No value provided for input HTTP label: evidenceFolderId.");
786
- }
787
- if (input.evidenceId !== undefined) {
788
- const labelValue = input.evidenceId;
789
- if (labelValue.length <= 0) {
790
- throw new Error("Empty value provided for input HTTP label: evidenceId.");
791
- }
792
- resolvedPath = resolvedPath.replace("{evidenceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
793
- }
794
- else {
795
- throw new Error("No value provided for input HTTP label: evidenceId.");
796
- }
559
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
560
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "controlSetId", () => input.controlSetId, "{controlSetId}", false);
561
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "evidenceFolderId", () => input.evidenceFolderId, "{evidenceFolderId}", false);
562
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "evidenceId", () => input.evidenceId, "{evidenceId}", false);
797
563
  let body;
798
564
  return new protocol_http_1.HttpRequest({
799
565
  protocol,
@@ -811,40 +577,13 @@ const serializeAws_restJson1GetEvidenceByEvidenceFolderCommand = async (input, c
811
577
  const headers = {};
812
578
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
813
579
  "/assessments/{assessmentId}/controlSets/{controlSetId}/evidenceFolders/{evidenceFolderId}/evidence";
814
- if (input.assessmentId !== undefined) {
815
- const labelValue = input.assessmentId;
816
- if (labelValue.length <= 0) {
817
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
818
- }
819
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
820
- }
821
- else {
822
- throw new Error("No value provided for input HTTP label: assessmentId.");
823
- }
824
- if (input.controlSetId !== undefined) {
825
- const labelValue = input.controlSetId;
826
- if (labelValue.length <= 0) {
827
- throw new Error("Empty value provided for input HTTP label: controlSetId.");
828
- }
829
- resolvedPath = resolvedPath.replace("{controlSetId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
830
- }
831
- else {
832
- throw new Error("No value provided for input HTTP label: controlSetId.");
833
- }
834
- if (input.evidenceFolderId !== undefined) {
835
- const labelValue = input.evidenceFolderId;
836
- if (labelValue.length <= 0) {
837
- throw new Error("Empty value provided for input HTTP label: evidenceFolderId.");
838
- }
839
- resolvedPath = resolvedPath.replace("{evidenceFolderId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
840
- }
841
- else {
842
- throw new Error("No value provided for input HTTP label: evidenceFolderId.");
843
- }
844
- const query = {
845
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
846
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
847
- };
580
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
581
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "controlSetId", () => input.controlSetId, "{controlSetId}", false);
582
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "evidenceFolderId", () => input.evidenceFolderId, "{evidenceFolderId}", false);
583
+ const query = map({
584
+ nextToken: [, input.nextToken],
585
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
586
+ });
848
587
  let body;
849
588
  return new protocol_http_1.HttpRequest({
850
589
  protocol,
@@ -863,36 +602,9 @@ const serializeAws_restJson1GetEvidenceFolderCommand = async (input, context) =>
863
602
  const headers = {};
864
603
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
865
604
  "/assessments/{assessmentId}/controlSets/{controlSetId}/evidenceFolders/{evidenceFolderId}";
866
- if (input.assessmentId !== undefined) {
867
- const labelValue = input.assessmentId;
868
- if (labelValue.length <= 0) {
869
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
870
- }
871
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
872
- }
873
- else {
874
- throw new Error("No value provided for input HTTP label: assessmentId.");
875
- }
876
- if (input.controlSetId !== undefined) {
877
- const labelValue = input.controlSetId;
878
- if (labelValue.length <= 0) {
879
- throw new Error("Empty value provided for input HTTP label: controlSetId.");
880
- }
881
- resolvedPath = resolvedPath.replace("{controlSetId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
882
- }
883
- else {
884
- throw new Error("No value provided for input HTTP label: controlSetId.");
885
- }
886
- if (input.evidenceFolderId !== undefined) {
887
- const labelValue = input.evidenceFolderId;
888
- if (labelValue.length <= 0) {
889
- throw new Error("Empty value provided for input HTTP label: evidenceFolderId.");
890
- }
891
- resolvedPath = resolvedPath.replace("{evidenceFolderId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
892
- }
893
- else {
894
- throw new Error("No value provided for input HTTP label: evidenceFolderId.");
895
- }
605
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
606
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "controlSetId", () => input.controlSetId, "{controlSetId}", false);
607
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "evidenceFolderId", () => input.evidenceFolderId, "{evidenceFolderId}", false);
896
608
  let body;
897
609
  return new protocol_http_1.HttpRequest({
898
610
  protocol,
@@ -910,20 +622,11 @@ const serializeAws_restJson1GetEvidenceFoldersByAssessmentCommand = async (input
910
622
  const headers = {};
911
623
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
912
624
  "/assessments/{assessmentId}/evidenceFolders";
913
- if (input.assessmentId !== undefined) {
914
- const labelValue = input.assessmentId;
915
- if (labelValue.length <= 0) {
916
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
917
- }
918
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
919
- }
920
- else {
921
- throw new Error("No value provided for input HTTP label: assessmentId.");
922
- }
923
- const query = {
924
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
925
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
926
- };
625
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
626
+ const query = map({
627
+ nextToken: [, input.nextToken],
628
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
629
+ });
927
630
  let body;
928
631
  return new protocol_http_1.HttpRequest({
929
632
  protocol,
@@ -942,40 +645,13 @@ const serializeAws_restJson1GetEvidenceFoldersByAssessmentControlCommand = async
942
645
  const headers = {};
943
646
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
944
647
  "/assessments/{assessmentId}/evidenceFolders-by-assessment-control/{controlSetId}/{controlId}";
945
- if (input.assessmentId !== undefined) {
946
- const labelValue = input.assessmentId;
947
- if (labelValue.length <= 0) {
948
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
949
- }
950
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
951
- }
952
- else {
953
- throw new Error("No value provided for input HTTP label: assessmentId.");
954
- }
955
- if (input.controlSetId !== undefined) {
956
- const labelValue = input.controlSetId;
957
- if (labelValue.length <= 0) {
958
- throw new Error("Empty value provided for input HTTP label: controlSetId.");
959
- }
960
- resolvedPath = resolvedPath.replace("{controlSetId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
961
- }
962
- else {
963
- throw new Error("No value provided for input HTTP label: controlSetId.");
964
- }
965
- if (input.controlId !== undefined) {
966
- const labelValue = input.controlId;
967
- if (labelValue.length <= 0) {
968
- throw new Error("Empty value provided for input HTTP label: controlId.");
969
- }
970
- resolvedPath = resolvedPath.replace("{controlId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
971
- }
972
- else {
973
- throw new Error("No value provided for input HTTP label: controlId.");
974
- }
975
- const query = {
976
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
977
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
978
- };
648
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
649
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "controlSetId", () => input.controlSetId, "{controlSetId}", false);
650
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "controlId", () => input.controlId, "{controlId}", false);
651
+ const query = map({
652
+ nextToken: [, input.nextToken],
653
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
654
+ });
979
655
  let body;
980
656
  return new protocol_http_1.HttpRequest({
981
657
  protocol,
@@ -1012,16 +688,7 @@ const serializeAws_restJson1GetInsightsByAssessmentCommand = async (input, conte
1012
688
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1013
689
  const headers = {};
1014
690
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/insights/assessments/{assessmentId}";
1015
- if (input.assessmentId !== undefined) {
1016
- const labelValue = input.assessmentId;
1017
- if (labelValue.length <= 0) {
1018
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
1019
- }
1020
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1021
- }
1022
- else {
1023
- throw new Error("No value provided for input HTTP label: assessmentId.");
1024
- }
691
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
1025
692
  let body;
1026
693
  return new protocol_http_1.HttpRequest({
1027
694
  protocol,
@@ -1076,16 +743,7 @@ const serializeAws_restJson1GetSettingsCommand = async (input, context) => {
1076
743
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1077
744
  const headers = {};
1078
745
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/settings/{attribute}";
1079
- if (input.attribute !== undefined) {
1080
- const labelValue = input.attribute;
1081
- if (labelValue.length <= 0) {
1082
- throw new Error("Empty value provided for input HTTP label: attribute.");
1083
- }
1084
- resolvedPath = resolvedPath.replace("{attribute}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1085
- }
1086
- else {
1087
- throw new Error("No value provided for input HTTP label: attribute.");
1088
- }
746
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "attribute", () => input.attribute, "{attribute}", false);
1089
747
  let body;
1090
748
  return new protocol_http_1.HttpRequest({
1091
749
  protocol,
@@ -1102,12 +760,12 @@ const serializeAws_restJson1ListAssessmentControlInsightsByControlDomainCommand
1102
760
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1103
761
  const headers = {};
1104
762
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/insights/controls-by-assessment";
1105
- const query = {
1106
- ...(input.controlDomainId !== undefined && { controlDomainId: input.controlDomainId }),
1107
- ...(input.assessmentId !== undefined && { assessmentId: input.assessmentId }),
1108
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
1109
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
1110
- };
763
+ const query = map({
764
+ controlDomainId: [, input.controlDomainId],
765
+ assessmentId: [, input.assessmentId],
766
+ nextToken: [, input.nextToken],
767
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
768
+ });
1111
769
  let body;
1112
770
  return new protocol_http_1.HttpRequest({
1113
771
  protocol,
@@ -1125,11 +783,11 @@ const serializeAws_restJson1ListAssessmentFrameworksCommand = async (input, cont
1125
783
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1126
784
  const headers = {};
1127
785
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assessmentFrameworks";
1128
- const query = {
1129
- ...(input.frameworkType !== undefined && { frameworkType: input.frameworkType }),
1130
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
1131
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
1132
- };
786
+ const query = map({
787
+ frameworkType: [, input.frameworkType],
788
+ nextToken: [, input.nextToken],
789
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
790
+ });
1133
791
  let body;
1134
792
  return new protocol_http_1.HttpRequest({
1135
793
  protocol,
@@ -1147,11 +805,11 @@ const serializeAws_restJson1ListAssessmentFrameworkShareRequestsCommand = async
1147
805
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1148
806
  const headers = {};
1149
807
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assessmentFrameworkShareRequests";
1150
- const query = {
1151
- ...(input.requestType !== undefined && { requestType: input.requestType }),
1152
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
1153
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
1154
- };
808
+ const query = map({
809
+ requestType: [, input.requestType],
810
+ nextToken: [, input.nextToken],
811
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
812
+ });
1155
813
  let body;
1156
814
  return new protocol_http_1.HttpRequest({
1157
815
  protocol,
@@ -1169,10 +827,10 @@ const serializeAws_restJson1ListAssessmentReportsCommand = async (input, context
1169
827
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1170
828
  const headers = {};
1171
829
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assessmentReports";
1172
- const query = {
1173
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
1174
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
1175
- };
830
+ const query = map({
831
+ nextToken: [, input.nextToken],
832
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
833
+ });
1176
834
  let body;
1177
835
  return new protocol_http_1.HttpRequest({
1178
836
  protocol,
@@ -1190,11 +848,11 @@ const serializeAws_restJson1ListAssessmentsCommand = async (input, context) => {
1190
848
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1191
849
  const headers = {};
1192
850
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assessments";
1193
- const query = {
1194
- ...(input.status !== undefined && { status: input.status }),
1195
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
1196
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
1197
- };
851
+ const query = map({
852
+ status: [, input.status],
853
+ nextToken: [, input.nextToken],
854
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
855
+ });
1198
856
  let body;
1199
857
  return new protocol_http_1.HttpRequest({
1200
858
  protocol,
@@ -1212,10 +870,10 @@ const serializeAws_restJson1ListControlDomainInsightsCommand = async (input, con
1212
870
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1213
871
  const headers = {};
1214
872
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/insights/control-domains";
1215
- const query = {
1216
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
1217
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
1218
- };
873
+ const query = map({
874
+ nextToken: [, input.nextToken],
875
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
876
+ });
1219
877
  let body;
1220
878
  return new protocol_http_1.HttpRequest({
1221
879
  protocol,
@@ -1233,11 +891,11 @@ const serializeAws_restJson1ListControlDomainInsightsByAssessmentCommand = async
1233
891
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1234
892
  const headers = {};
1235
893
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/insights/control-domains-by-assessment";
1236
- const query = {
1237
- ...(input.assessmentId !== undefined && { assessmentId: input.assessmentId }),
1238
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
1239
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
1240
- };
894
+ const query = map({
895
+ assessmentId: [, input.assessmentId],
896
+ nextToken: [, input.nextToken],
897
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
898
+ });
1241
899
  let body;
1242
900
  return new protocol_http_1.HttpRequest({
1243
901
  protocol,
@@ -1255,11 +913,11 @@ const serializeAws_restJson1ListControlInsightsByControlDomainCommand = async (i
1255
913
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1256
914
  const headers = {};
1257
915
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/insights/controls";
1258
- const query = {
1259
- ...(input.controlDomainId !== undefined && { controlDomainId: input.controlDomainId }),
1260
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
1261
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
1262
- };
916
+ const query = map({
917
+ controlDomainId: [, input.controlDomainId],
918
+ nextToken: [, input.nextToken],
919
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
920
+ });
1263
921
  let body;
1264
922
  return new protocol_http_1.HttpRequest({
1265
923
  protocol,
@@ -1277,11 +935,11 @@ const serializeAws_restJson1ListControlsCommand = async (input, context) => {
1277
935
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1278
936
  const headers = {};
1279
937
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/controls";
1280
- const query = {
1281
- ...(input.controlType !== undefined && { controlType: input.controlType }),
1282
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
1283
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
1284
- };
938
+ const query = map({
939
+ controlType: [, input.controlType],
940
+ nextToken: [, input.nextToken],
941
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
942
+ });
1285
943
  let body;
1286
944
  return new protocol_http_1.HttpRequest({
1287
945
  protocol,
@@ -1299,11 +957,11 @@ const serializeAws_restJson1ListKeywordsForDataSourceCommand = async (input, con
1299
957
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1300
958
  const headers = {};
1301
959
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/dataSourceKeywords";
1302
- const query = {
1303
- ...(input.source !== undefined && { source: input.source }),
1304
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
1305
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
1306
- };
960
+ const query = map({
961
+ source: [, input.source],
962
+ nextToken: [, input.nextToken],
963
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
964
+ });
1307
965
  let body;
1308
966
  return new protocol_http_1.HttpRequest({
1309
967
  protocol,
@@ -1321,10 +979,10 @@ const serializeAws_restJson1ListNotificationsCommand = async (input, context) =>
1321
979
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1322
980
  const headers = {};
1323
981
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/notifications";
1324
- const query = {
1325
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
1326
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
1327
- };
982
+ const query = map({
983
+ nextToken: [, input.nextToken],
984
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
985
+ });
1328
986
  let body;
1329
987
  return new protocol_http_1.HttpRequest({
1330
988
  protocol,
@@ -1342,16 +1000,7 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
1342
1000
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1343
1001
  const headers = {};
1344
1002
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
1345
- if (input.resourceArn !== undefined) {
1346
- const labelValue = input.resourceArn;
1347
- if (labelValue.length <= 0) {
1348
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
1349
- }
1350
- resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1351
- }
1352
- else {
1353
- throw new Error("No value provided for input HTTP label: resourceArn.");
1354
- }
1003
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
1355
1004
  let body;
1356
1005
  return new protocol_http_1.HttpRequest({
1357
1006
  protocol,
@@ -1414,16 +1063,7 @@ const serializeAws_restJson1StartAssessmentFrameworkShareCommand = async (input,
1414
1063
  };
1415
1064
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1416
1065
  "/assessmentFrameworks/{frameworkId}/shareRequests";
1417
- if (input.frameworkId !== undefined) {
1418
- const labelValue = input.frameworkId;
1419
- if (labelValue.length <= 0) {
1420
- throw new Error("Empty value provided for input HTTP label: frameworkId.");
1421
- }
1422
- resolvedPath = resolvedPath.replace("{frameworkId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1423
- }
1424
- else {
1425
- throw new Error("No value provided for input HTTP label: frameworkId.");
1426
- }
1066
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "frameworkId", () => input.frameworkId, "{frameworkId}", false);
1427
1067
  let body;
1428
1068
  body = JSON.stringify({
1429
1069
  ...(input.comment != null && { comment: input.comment }),
@@ -1447,16 +1087,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
1447
1087
  "content-type": "application/json",
1448
1088
  };
1449
1089
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
1450
- if (input.resourceArn !== undefined) {
1451
- const labelValue = input.resourceArn;
1452
- if (labelValue.length <= 0) {
1453
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
1454
- }
1455
- resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1456
- }
1457
- else {
1458
- throw new Error("No value provided for input HTTP label: resourceArn.");
1459
- }
1090
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
1460
1091
  let body;
1461
1092
  body = JSON.stringify({
1462
1093
  ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
@@ -1476,19 +1107,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
1476
1107
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1477
1108
  const headers = {};
1478
1109
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
1479
- if (input.resourceArn !== undefined) {
1480
- const labelValue = input.resourceArn;
1481
- if (labelValue.length <= 0) {
1482
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
1483
- }
1484
- resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1485
- }
1486
- else {
1487
- throw new Error("No value provided for input HTTP label: resourceArn.");
1488
- }
1489
- const query = {
1490
- ...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry) }),
1491
- };
1110
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
1111
+ const query = map({
1112
+ tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
1113
+ });
1492
1114
  let body;
1493
1115
  return new protocol_http_1.HttpRequest({
1494
1116
  protocol,
@@ -1508,16 +1130,7 @@ const serializeAws_restJson1UpdateAssessmentCommand = async (input, context) =>
1508
1130
  "content-type": "application/json",
1509
1131
  };
1510
1132
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assessments/{assessmentId}";
1511
- if (input.assessmentId !== undefined) {
1512
- const labelValue = input.assessmentId;
1513
- if (labelValue.length <= 0) {
1514
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
1515
- }
1516
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1517
- }
1518
- else {
1519
- throw new Error("No value provided for input HTTP label: assessmentId.");
1520
- }
1133
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
1521
1134
  let body;
1522
1135
  body = JSON.stringify({
1523
1136
  ...(input.assessmentDescription != null && { assessmentDescription: input.assessmentDescription }),
@@ -1546,36 +1159,9 @@ const serializeAws_restJson1UpdateAssessmentControlCommand = async (input, conte
1546
1159
  };
1547
1160
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1548
1161
  "/assessments/{assessmentId}/controlSets/{controlSetId}/controls/{controlId}";
1549
- if (input.assessmentId !== undefined) {
1550
- const labelValue = input.assessmentId;
1551
- if (labelValue.length <= 0) {
1552
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
1553
- }
1554
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1555
- }
1556
- else {
1557
- throw new Error("No value provided for input HTTP label: assessmentId.");
1558
- }
1559
- if (input.controlSetId !== undefined) {
1560
- const labelValue = input.controlSetId;
1561
- if (labelValue.length <= 0) {
1562
- throw new Error("Empty value provided for input HTTP label: controlSetId.");
1563
- }
1564
- resolvedPath = resolvedPath.replace("{controlSetId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1565
- }
1566
- else {
1567
- throw new Error("No value provided for input HTTP label: controlSetId.");
1568
- }
1569
- if (input.controlId !== undefined) {
1570
- const labelValue = input.controlId;
1571
- if (labelValue.length <= 0) {
1572
- throw new Error("Empty value provided for input HTTP label: controlId.");
1573
- }
1574
- resolvedPath = resolvedPath.replace("{controlId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1575
- }
1576
- else {
1577
- throw new Error("No value provided for input HTTP label: controlId.");
1578
- }
1162
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
1163
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "controlSetId", () => input.controlSetId, "{controlSetId}", false);
1164
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "controlId", () => input.controlId, "{controlId}", false);
1579
1165
  let body;
1580
1166
  body = JSON.stringify({
1581
1167
  ...(input.commentBody != null && { commentBody: input.commentBody }),
@@ -1599,26 +1185,8 @@ const serializeAws_restJson1UpdateAssessmentControlSetStatusCommand = async (inp
1599
1185
  };
1600
1186
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1601
1187
  "/assessments/{assessmentId}/controlSets/{controlSetId}/status";
1602
- if (input.assessmentId !== undefined) {
1603
- const labelValue = input.assessmentId;
1604
- if (labelValue.length <= 0) {
1605
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
1606
- }
1607
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1608
- }
1609
- else {
1610
- throw new Error("No value provided for input HTTP label: assessmentId.");
1611
- }
1612
- if (input.controlSetId !== undefined) {
1613
- const labelValue = input.controlSetId;
1614
- if (labelValue.length <= 0) {
1615
- throw new Error("Empty value provided for input HTTP label: controlSetId.");
1616
- }
1617
- resolvedPath = resolvedPath.replace("{controlSetId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1618
- }
1619
- else {
1620
- throw new Error("No value provided for input HTTP label: controlSetId.");
1621
- }
1188
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
1189
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "controlSetId", () => input.controlSetId, "{controlSetId}", false);
1622
1190
  let body;
1623
1191
  body = JSON.stringify({
1624
1192
  ...(input.comment != null && { comment: input.comment }),
@@ -1641,16 +1209,7 @@ const serializeAws_restJson1UpdateAssessmentFrameworkCommand = async (input, con
1641
1209
  "content-type": "application/json",
1642
1210
  };
1643
1211
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assessmentFrameworks/{frameworkId}";
1644
- if (input.frameworkId !== undefined) {
1645
- const labelValue = input.frameworkId;
1646
- if (labelValue.length <= 0) {
1647
- throw new Error("Empty value provided for input HTTP label: frameworkId.");
1648
- }
1649
- resolvedPath = resolvedPath.replace("{frameworkId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1650
- }
1651
- else {
1652
- throw new Error("No value provided for input HTTP label: frameworkId.");
1653
- }
1212
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "frameworkId", () => input.frameworkId, "{frameworkId}", false);
1654
1213
  let body;
1655
1214
  body = JSON.stringify({
1656
1215
  ...(input.complianceType != null && { complianceType: input.complianceType }),
@@ -1678,16 +1237,7 @@ const serializeAws_restJson1UpdateAssessmentFrameworkShareCommand = async (input
1678
1237
  };
1679
1238
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1680
1239
  "/assessmentFrameworkShareRequests/{requestId}";
1681
- if (input.requestId !== undefined) {
1682
- const labelValue = input.requestId;
1683
- if (labelValue.length <= 0) {
1684
- throw new Error("Empty value provided for input HTTP label: requestId.");
1685
- }
1686
- resolvedPath = resolvedPath.replace("{requestId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1687
- }
1688
- else {
1689
- throw new Error("No value provided for input HTTP label: requestId.");
1690
- }
1240
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "requestId", () => input.requestId, "{requestId}", false);
1691
1241
  let body;
1692
1242
  body = JSON.stringify({
1693
1243
  ...(input.action != null && { action: input.action }),
@@ -1710,16 +1260,7 @@ const serializeAws_restJson1UpdateAssessmentStatusCommand = async (input, contex
1710
1260
  "content-type": "application/json",
1711
1261
  };
1712
1262
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assessments/{assessmentId}/status";
1713
- if (input.assessmentId !== undefined) {
1714
- const labelValue = input.assessmentId;
1715
- if (labelValue.length <= 0) {
1716
- throw new Error("Empty value provided for input HTTP label: assessmentId.");
1717
- }
1718
- resolvedPath = resolvedPath.replace("{assessmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1719
- }
1720
- else {
1721
- throw new Error("No value provided for input HTTP label: assessmentId.");
1722
- }
1263
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assessmentId", () => input.assessmentId, "{assessmentId}", false);
1723
1264
  let body;
1724
1265
  body = JSON.stringify({
1725
1266
  ...(input.status != null && { status: input.status }),
@@ -1741,16 +1282,7 @@ const serializeAws_restJson1UpdateControlCommand = async (input, context) => {
1741
1282
  "content-type": "application/json",
1742
1283
  };
1743
1284
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/controls/{controlId}";
1744
- if (input.controlId !== undefined) {
1745
- const labelValue = input.controlId;
1746
- if (labelValue.length <= 0) {
1747
- throw new Error("Empty value provided for input HTTP label: controlId.");
1748
- }
1749
- resolvedPath = resolvedPath.replace("{controlId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1750
- }
1751
- else {
1752
- throw new Error("No value provided for input HTTP label: controlId.");
1753
- }
1285
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "controlId", () => input.controlId, "{controlId}", false);
1754
1286
  let body;
1755
1287
  body = JSON.stringify({
1756
1288
  ...(input.actionPlanInstructions != null && { actionPlanInstructions: input.actionPlanInstructions }),
@@ -1826,11 +1358,11 @@ const deserializeAws_restJson1AssociateAssessmentReportEvidenceFolderCommand = a
1826
1358
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1827
1359
  return deserializeAws_restJson1AssociateAssessmentReportEvidenceFolderCommandError(output, context);
1828
1360
  }
1829
- const contents = {
1361
+ const contents = map({
1830
1362
  $metadata: deserializeMetadata(output),
1831
- };
1363
+ });
1832
1364
  await collectBody(output.body, context);
1833
- return Promise.resolve(contents);
1365
+ return contents;
1834
1366
  };
1835
1367
  exports.deserializeAws_restJson1AssociateAssessmentReportEvidenceFolderCommand = deserializeAws_restJson1AssociateAssessmentReportEvidenceFolderCommand;
1836
1368
  const deserializeAws_restJson1AssociateAssessmentReportEvidenceFolderCommandError = async (output, context) => {
@@ -1838,7 +1370,6 @@ const deserializeAws_restJson1AssociateAssessmentReportEvidenceFolderCommandErro
1838
1370
  ...output,
1839
1371
  body: await parseBody(output.body, context),
1840
1372
  };
1841
- let response;
1842
1373
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1843
1374
  switch (errorCode) {
1844
1375
  case "AccessDeniedException":
@@ -1855,33 +1386,29 @@ const deserializeAws_restJson1AssociateAssessmentReportEvidenceFolderCommandErro
1855
1386
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1856
1387
  default:
1857
1388
  const parsedBody = parsedOutput.body;
1858
- const $metadata = deserializeMetadata(output);
1859
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1860
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
1861
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1862
- $fault: "client",
1863
- $metadata,
1389
+ (0, smithy_client_1.throwDefaultError)({
1390
+ output,
1391
+ parsedBody,
1392
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
1393
+ errorCode,
1864
1394
  });
1865
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1866
1395
  }
1867
1396
  };
1868
1397
  const deserializeAws_restJson1BatchAssociateAssessmentReportEvidenceCommand = async (output, context) => {
1869
1398
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1870
1399
  return deserializeAws_restJson1BatchAssociateAssessmentReportEvidenceCommandError(output, context);
1871
1400
  }
1872
- const contents = {
1401
+ const contents = map({
1873
1402
  $metadata: deserializeMetadata(output),
1874
- errors: undefined,
1875
- evidenceIds: undefined,
1876
- };
1403
+ });
1877
1404
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1878
- if (data.errors !== undefined && data.errors !== null) {
1405
+ if (data.errors != null) {
1879
1406
  contents.errors = deserializeAws_restJson1AssessmentReportEvidenceErrors(data.errors, context);
1880
1407
  }
1881
- if (data.evidenceIds !== undefined && data.evidenceIds !== null) {
1408
+ if (data.evidenceIds != null) {
1882
1409
  contents.evidenceIds = deserializeAws_restJson1EvidenceIds(data.evidenceIds, context);
1883
1410
  }
1884
- return Promise.resolve(contents);
1411
+ return contents;
1885
1412
  };
1886
1413
  exports.deserializeAws_restJson1BatchAssociateAssessmentReportEvidenceCommand = deserializeAws_restJson1BatchAssociateAssessmentReportEvidenceCommand;
1887
1414
  const deserializeAws_restJson1BatchAssociateAssessmentReportEvidenceCommandError = async (output, context) => {
@@ -1889,7 +1416,6 @@ const deserializeAws_restJson1BatchAssociateAssessmentReportEvidenceCommandError
1889
1416
  ...output,
1890
1417
  body: await parseBody(output.body, context),
1891
1418
  };
1892
- let response;
1893
1419
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1894
1420
  switch (errorCode) {
1895
1421
  case "AccessDeniedException":
@@ -1906,33 +1432,29 @@ const deserializeAws_restJson1BatchAssociateAssessmentReportEvidenceCommandError
1906
1432
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1907
1433
  default:
1908
1434
  const parsedBody = parsedOutput.body;
1909
- const $metadata = deserializeMetadata(output);
1910
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1911
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
1912
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1913
- $fault: "client",
1914
- $metadata,
1435
+ (0, smithy_client_1.throwDefaultError)({
1436
+ output,
1437
+ parsedBody,
1438
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
1439
+ errorCode,
1915
1440
  });
1916
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1917
1441
  }
1918
1442
  };
1919
1443
  const deserializeAws_restJson1BatchCreateDelegationByAssessmentCommand = async (output, context) => {
1920
1444
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1921
1445
  return deserializeAws_restJson1BatchCreateDelegationByAssessmentCommandError(output, context);
1922
1446
  }
1923
- const contents = {
1447
+ const contents = map({
1924
1448
  $metadata: deserializeMetadata(output),
1925
- delegations: undefined,
1926
- errors: undefined,
1927
- };
1449
+ });
1928
1450
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1929
- if (data.delegations !== undefined && data.delegations !== null) {
1451
+ if (data.delegations != null) {
1930
1452
  contents.delegations = deserializeAws_restJson1Delegations(data.delegations, context);
1931
1453
  }
1932
- if (data.errors !== undefined && data.errors !== null) {
1454
+ if (data.errors != null) {
1933
1455
  contents.errors = deserializeAws_restJson1BatchCreateDelegationByAssessmentErrors(data.errors, context);
1934
1456
  }
1935
- return Promise.resolve(contents);
1457
+ return contents;
1936
1458
  };
1937
1459
  exports.deserializeAws_restJson1BatchCreateDelegationByAssessmentCommand = deserializeAws_restJson1BatchCreateDelegationByAssessmentCommand;
1938
1460
  const deserializeAws_restJson1BatchCreateDelegationByAssessmentCommandError = async (output, context) => {
@@ -1940,7 +1462,6 @@ const deserializeAws_restJson1BatchCreateDelegationByAssessmentCommandError = as
1940
1462
  ...output,
1941
1463
  body: await parseBody(output.body, context),
1942
1464
  };
1943
- let response;
1944
1465
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1945
1466
  switch (errorCode) {
1946
1467
  case "AccessDeniedException":
@@ -1957,29 +1478,26 @@ const deserializeAws_restJson1BatchCreateDelegationByAssessmentCommandError = as
1957
1478
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1958
1479
  default:
1959
1480
  const parsedBody = parsedOutput.body;
1960
- const $metadata = deserializeMetadata(output);
1961
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1962
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
1963
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1964
- $fault: "client",
1965
- $metadata,
1481
+ (0, smithy_client_1.throwDefaultError)({
1482
+ output,
1483
+ parsedBody,
1484
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
1485
+ errorCode,
1966
1486
  });
1967
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1968
1487
  }
1969
1488
  };
1970
1489
  const deserializeAws_restJson1BatchDeleteDelegationByAssessmentCommand = async (output, context) => {
1971
1490
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1972
1491
  return deserializeAws_restJson1BatchDeleteDelegationByAssessmentCommandError(output, context);
1973
1492
  }
1974
- const contents = {
1493
+ const contents = map({
1975
1494
  $metadata: deserializeMetadata(output),
1976
- errors: undefined,
1977
- };
1495
+ });
1978
1496
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1979
- if (data.errors !== undefined && data.errors !== null) {
1497
+ if (data.errors != null) {
1980
1498
  contents.errors = deserializeAws_restJson1BatchDeleteDelegationByAssessmentErrors(data.errors, context);
1981
1499
  }
1982
- return Promise.resolve(contents);
1500
+ return contents;
1983
1501
  };
1984
1502
  exports.deserializeAws_restJson1BatchDeleteDelegationByAssessmentCommand = deserializeAws_restJson1BatchDeleteDelegationByAssessmentCommand;
1985
1503
  const deserializeAws_restJson1BatchDeleteDelegationByAssessmentCommandError = async (output, context) => {
@@ -1987,7 +1505,6 @@ const deserializeAws_restJson1BatchDeleteDelegationByAssessmentCommandError = as
1987
1505
  ...output,
1988
1506
  body: await parseBody(output.body, context),
1989
1507
  };
1990
- let response;
1991
1508
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1992
1509
  switch (errorCode) {
1993
1510
  case "AccessDeniedException":
@@ -2004,33 +1521,29 @@ const deserializeAws_restJson1BatchDeleteDelegationByAssessmentCommandError = as
2004
1521
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2005
1522
  default:
2006
1523
  const parsedBody = parsedOutput.body;
2007
- const $metadata = deserializeMetadata(output);
2008
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2009
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2010
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2011
- $fault: "client",
2012
- $metadata,
1524
+ (0, smithy_client_1.throwDefaultError)({
1525
+ output,
1526
+ parsedBody,
1527
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
1528
+ errorCode,
2013
1529
  });
2014
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2015
1530
  }
2016
1531
  };
2017
1532
  const deserializeAws_restJson1BatchDisassociateAssessmentReportEvidenceCommand = async (output, context) => {
2018
1533
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2019
1534
  return deserializeAws_restJson1BatchDisassociateAssessmentReportEvidenceCommandError(output, context);
2020
1535
  }
2021
- const contents = {
1536
+ const contents = map({
2022
1537
  $metadata: deserializeMetadata(output),
2023
- errors: undefined,
2024
- evidenceIds: undefined,
2025
- };
1538
+ });
2026
1539
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2027
- if (data.errors !== undefined && data.errors !== null) {
1540
+ if (data.errors != null) {
2028
1541
  contents.errors = deserializeAws_restJson1AssessmentReportEvidenceErrors(data.errors, context);
2029
1542
  }
2030
- if (data.evidenceIds !== undefined && data.evidenceIds !== null) {
1543
+ if (data.evidenceIds != null) {
2031
1544
  contents.evidenceIds = deserializeAws_restJson1EvidenceIds(data.evidenceIds, context);
2032
1545
  }
2033
- return Promise.resolve(contents);
1546
+ return contents;
2034
1547
  };
2035
1548
  exports.deserializeAws_restJson1BatchDisassociateAssessmentReportEvidenceCommand = deserializeAws_restJson1BatchDisassociateAssessmentReportEvidenceCommand;
2036
1549
  const deserializeAws_restJson1BatchDisassociateAssessmentReportEvidenceCommandError = async (output, context) => {
@@ -2038,7 +1551,6 @@ const deserializeAws_restJson1BatchDisassociateAssessmentReportEvidenceCommandEr
2038
1551
  ...output,
2039
1552
  body: await parseBody(output.body, context),
2040
1553
  };
2041
- let response;
2042
1554
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2043
1555
  switch (errorCode) {
2044
1556
  case "AccessDeniedException":
@@ -2055,29 +1567,26 @@ const deserializeAws_restJson1BatchDisassociateAssessmentReportEvidenceCommandEr
2055
1567
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2056
1568
  default:
2057
1569
  const parsedBody = parsedOutput.body;
2058
- const $metadata = deserializeMetadata(output);
2059
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2060
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2061
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2062
- $fault: "client",
2063
- $metadata,
1570
+ (0, smithy_client_1.throwDefaultError)({
1571
+ output,
1572
+ parsedBody,
1573
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
1574
+ errorCode,
2064
1575
  });
2065
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2066
1576
  }
2067
1577
  };
2068
1578
  const deserializeAws_restJson1BatchImportEvidenceToAssessmentControlCommand = async (output, context) => {
2069
1579
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2070
1580
  return deserializeAws_restJson1BatchImportEvidenceToAssessmentControlCommandError(output, context);
2071
1581
  }
2072
- const contents = {
1582
+ const contents = map({
2073
1583
  $metadata: deserializeMetadata(output),
2074
- errors: undefined,
2075
- };
1584
+ });
2076
1585
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2077
- if (data.errors !== undefined && data.errors !== null) {
1586
+ if (data.errors != null) {
2078
1587
  contents.errors = deserializeAws_restJson1BatchImportEvidenceToAssessmentControlErrors(data.errors, context);
2079
1588
  }
2080
- return Promise.resolve(contents);
1589
+ return contents;
2081
1590
  };
2082
1591
  exports.deserializeAws_restJson1BatchImportEvidenceToAssessmentControlCommand = deserializeAws_restJson1BatchImportEvidenceToAssessmentControlCommand;
2083
1592
  const deserializeAws_restJson1BatchImportEvidenceToAssessmentControlCommandError = async (output, context) => {
@@ -2085,7 +1594,6 @@ const deserializeAws_restJson1BatchImportEvidenceToAssessmentControlCommandError
2085
1594
  ...output,
2086
1595
  body: await parseBody(output.body, context),
2087
1596
  };
2088
- let response;
2089
1597
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2090
1598
  switch (errorCode) {
2091
1599
  case "AccessDeniedException":
@@ -2102,29 +1610,26 @@ const deserializeAws_restJson1BatchImportEvidenceToAssessmentControlCommandError
2102
1610
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2103
1611
  default:
2104
1612
  const parsedBody = parsedOutput.body;
2105
- const $metadata = deserializeMetadata(output);
2106
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2107
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2108
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2109
- $fault: "client",
2110
- $metadata,
1613
+ (0, smithy_client_1.throwDefaultError)({
1614
+ output,
1615
+ parsedBody,
1616
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
1617
+ errorCode,
2111
1618
  });
2112
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2113
1619
  }
2114
1620
  };
2115
1621
  const deserializeAws_restJson1CreateAssessmentCommand = async (output, context) => {
2116
1622
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2117
1623
  return deserializeAws_restJson1CreateAssessmentCommandError(output, context);
2118
1624
  }
2119
- const contents = {
1625
+ const contents = map({
2120
1626
  $metadata: deserializeMetadata(output),
2121
- assessment: undefined,
2122
- };
1627
+ });
2123
1628
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2124
- if (data.assessment !== undefined && data.assessment !== null) {
1629
+ if (data.assessment != null) {
2125
1630
  contents.assessment = deserializeAws_restJson1Assessment(data.assessment, context);
2126
1631
  }
2127
- return Promise.resolve(contents);
1632
+ return contents;
2128
1633
  };
2129
1634
  exports.deserializeAws_restJson1CreateAssessmentCommand = deserializeAws_restJson1CreateAssessmentCommand;
2130
1635
  const deserializeAws_restJson1CreateAssessmentCommandError = async (output, context) => {
@@ -2132,7 +1637,6 @@ const deserializeAws_restJson1CreateAssessmentCommandError = async (output, cont
2132
1637
  ...output,
2133
1638
  body: await parseBody(output.body, context),
2134
1639
  };
2135
- let response;
2136
1640
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2137
1641
  switch (errorCode) {
2138
1642
  case "AccessDeniedException":
@@ -2152,29 +1656,26 @@ const deserializeAws_restJson1CreateAssessmentCommandError = async (output, cont
2152
1656
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2153
1657
  default:
2154
1658
  const parsedBody = parsedOutput.body;
2155
- const $metadata = deserializeMetadata(output);
2156
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2157
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2158
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2159
- $fault: "client",
2160
- $metadata,
1659
+ (0, smithy_client_1.throwDefaultError)({
1660
+ output,
1661
+ parsedBody,
1662
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
1663
+ errorCode,
2161
1664
  });
2162
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2163
1665
  }
2164
1666
  };
2165
1667
  const deserializeAws_restJson1CreateAssessmentFrameworkCommand = async (output, context) => {
2166
1668
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2167
1669
  return deserializeAws_restJson1CreateAssessmentFrameworkCommandError(output, context);
2168
1670
  }
2169
- const contents = {
1671
+ const contents = map({
2170
1672
  $metadata: deserializeMetadata(output),
2171
- framework: undefined,
2172
- };
1673
+ });
2173
1674
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2174
- if (data.framework !== undefined && data.framework !== null) {
1675
+ if (data.framework != null) {
2175
1676
  contents.framework = deserializeAws_restJson1Framework(data.framework, context);
2176
1677
  }
2177
- return Promise.resolve(contents);
1678
+ return contents;
2178
1679
  };
2179
1680
  exports.deserializeAws_restJson1CreateAssessmentFrameworkCommand = deserializeAws_restJson1CreateAssessmentFrameworkCommand;
2180
1681
  const deserializeAws_restJson1CreateAssessmentFrameworkCommandError = async (output, context) => {
@@ -2182,7 +1683,6 @@ const deserializeAws_restJson1CreateAssessmentFrameworkCommandError = async (out
2182
1683
  ...output,
2183
1684
  body: await parseBody(output.body, context),
2184
1685
  };
2185
- let response;
2186
1686
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2187
1687
  switch (errorCode) {
2188
1688
  case "AccessDeniedException":
@@ -2202,29 +1702,26 @@ const deserializeAws_restJson1CreateAssessmentFrameworkCommandError = async (out
2202
1702
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2203
1703
  default:
2204
1704
  const parsedBody = parsedOutput.body;
2205
- const $metadata = deserializeMetadata(output);
2206
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2207
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2208
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2209
- $fault: "client",
2210
- $metadata,
1705
+ (0, smithy_client_1.throwDefaultError)({
1706
+ output,
1707
+ parsedBody,
1708
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
1709
+ errorCode,
2211
1710
  });
2212
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2213
1711
  }
2214
1712
  };
2215
1713
  const deserializeAws_restJson1CreateAssessmentReportCommand = async (output, context) => {
2216
1714
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2217
1715
  return deserializeAws_restJson1CreateAssessmentReportCommandError(output, context);
2218
1716
  }
2219
- const contents = {
1717
+ const contents = map({
2220
1718
  $metadata: deserializeMetadata(output),
2221
- assessmentReport: undefined,
2222
- };
1719
+ });
2223
1720
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2224
- if (data.assessmentReport !== undefined && data.assessmentReport !== null) {
1721
+ if (data.assessmentReport != null) {
2225
1722
  contents.assessmentReport = deserializeAws_restJson1AssessmentReport(data.assessmentReport, context);
2226
1723
  }
2227
- return Promise.resolve(contents);
1724
+ return contents;
2228
1725
  };
2229
1726
  exports.deserializeAws_restJson1CreateAssessmentReportCommand = deserializeAws_restJson1CreateAssessmentReportCommand;
2230
1727
  const deserializeAws_restJson1CreateAssessmentReportCommandError = async (output, context) => {
@@ -2232,7 +1729,6 @@ const deserializeAws_restJson1CreateAssessmentReportCommandError = async (output
2232
1729
  ...output,
2233
1730
  body: await parseBody(output.body, context),
2234
1731
  };
2235
- let response;
2236
1732
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2237
1733
  switch (errorCode) {
2238
1734
  case "AccessDeniedException":
@@ -2249,29 +1745,26 @@ const deserializeAws_restJson1CreateAssessmentReportCommandError = async (output
2249
1745
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2250
1746
  default:
2251
1747
  const parsedBody = parsedOutput.body;
2252
- const $metadata = deserializeMetadata(output);
2253
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2254
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2255
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2256
- $fault: "client",
2257
- $metadata,
1748
+ (0, smithy_client_1.throwDefaultError)({
1749
+ output,
1750
+ parsedBody,
1751
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
1752
+ errorCode,
2258
1753
  });
2259
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2260
1754
  }
2261
1755
  };
2262
1756
  const deserializeAws_restJson1CreateControlCommand = async (output, context) => {
2263
1757
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2264
1758
  return deserializeAws_restJson1CreateControlCommandError(output, context);
2265
1759
  }
2266
- const contents = {
1760
+ const contents = map({
2267
1761
  $metadata: deserializeMetadata(output),
2268
- control: undefined,
2269
- };
1762
+ });
2270
1763
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2271
- if (data.control !== undefined && data.control !== null) {
1764
+ if (data.control != null) {
2272
1765
  contents.control = deserializeAws_restJson1Control(data.control, context);
2273
1766
  }
2274
- return Promise.resolve(contents);
1767
+ return contents;
2275
1768
  };
2276
1769
  exports.deserializeAws_restJson1CreateControlCommand = deserializeAws_restJson1CreateControlCommand;
2277
1770
  const deserializeAws_restJson1CreateControlCommandError = async (output, context) => {
@@ -2279,7 +1772,6 @@ const deserializeAws_restJson1CreateControlCommandError = async (output, context
2279
1772
  ...output,
2280
1773
  body: await parseBody(output.body, context),
2281
1774
  };
2282
- let response;
2283
1775
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2284
1776
  switch (errorCode) {
2285
1777
  case "AccessDeniedException":
@@ -2299,25 +1791,23 @@ const deserializeAws_restJson1CreateControlCommandError = async (output, context
2299
1791
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2300
1792
  default:
2301
1793
  const parsedBody = parsedOutput.body;
2302
- const $metadata = deserializeMetadata(output);
2303
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2304
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2305
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2306
- $fault: "client",
2307
- $metadata,
1794
+ (0, smithy_client_1.throwDefaultError)({
1795
+ output,
1796
+ parsedBody,
1797
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
1798
+ errorCode,
2308
1799
  });
2309
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2310
1800
  }
2311
1801
  };
2312
1802
  const deserializeAws_restJson1DeleteAssessmentCommand = async (output, context) => {
2313
1803
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2314
1804
  return deserializeAws_restJson1DeleteAssessmentCommandError(output, context);
2315
1805
  }
2316
- const contents = {
1806
+ const contents = map({
2317
1807
  $metadata: deserializeMetadata(output),
2318
- };
1808
+ });
2319
1809
  await collectBody(output.body, context);
2320
- return Promise.resolve(contents);
1810
+ return contents;
2321
1811
  };
2322
1812
  exports.deserializeAws_restJson1DeleteAssessmentCommand = deserializeAws_restJson1DeleteAssessmentCommand;
2323
1813
  const deserializeAws_restJson1DeleteAssessmentCommandError = async (output, context) => {
@@ -2325,7 +1815,6 @@ const deserializeAws_restJson1DeleteAssessmentCommandError = async (output, cont
2325
1815
  ...output,
2326
1816
  body: await parseBody(output.body, context),
2327
1817
  };
2328
- let response;
2329
1818
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2330
1819
  switch (errorCode) {
2331
1820
  case "AccessDeniedException":
@@ -2342,25 +1831,23 @@ const deserializeAws_restJson1DeleteAssessmentCommandError = async (output, cont
2342
1831
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2343
1832
  default:
2344
1833
  const parsedBody = parsedOutput.body;
2345
- const $metadata = deserializeMetadata(output);
2346
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2347
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2348
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2349
- $fault: "client",
2350
- $metadata,
1834
+ (0, smithy_client_1.throwDefaultError)({
1835
+ output,
1836
+ parsedBody,
1837
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
1838
+ errorCode,
2351
1839
  });
2352
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2353
1840
  }
2354
1841
  };
2355
1842
  const deserializeAws_restJson1DeleteAssessmentFrameworkCommand = async (output, context) => {
2356
1843
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2357
1844
  return deserializeAws_restJson1DeleteAssessmentFrameworkCommandError(output, context);
2358
1845
  }
2359
- const contents = {
1846
+ const contents = map({
2360
1847
  $metadata: deserializeMetadata(output),
2361
- };
1848
+ });
2362
1849
  await collectBody(output.body, context);
2363
- return Promise.resolve(contents);
1850
+ return contents;
2364
1851
  };
2365
1852
  exports.deserializeAws_restJson1DeleteAssessmentFrameworkCommand = deserializeAws_restJson1DeleteAssessmentFrameworkCommand;
2366
1853
  const deserializeAws_restJson1DeleteAssessmentFrameworkCommandError = async (output, context) => {
@@ -2368,7 +1855,6 @@ const deserializeAws_restJson1DeleteAssessmentFrameworkCommandError = async (out
2368
1855
  ...output,
2369
1856
  body: await parseBody(output.body, context),
2370
1857
  };
2371
- let response;
2372
1858
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2373
1859
  switch (errorCode) {
2374
1860
  case "AccessDeniedException":
@@ -2385,25 +1871,23 @@ const deserializeAws_restJson1DeleteAssessmentFrameworkCommandError = async (out
2385
1871
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2386
1872
  default:
2387
1873
  const parsedBody = parsedOutput.body;
2388
- const $metadata = deserializeMetadata(output);
2389
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2390
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2391
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2392
- $fault: "client",
2393
- $metadata,
1874
+ (0, smithy_client_1.throwDefaultError)({
1875
+ output,
1876
+ parsedBody,
1877
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
1878
+ errorCode,
2394
1879
  });
2395
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2396
1880
  }
2397
1881
  };
2398
1882
  const deserializeAws_restJson1DeleteAssessmentFrameworkShareCommand = async (output, context) => {
2399
1883
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2400
1884
  return deserializeAws_restJson1DeleteAssessmentFrameworkShareCommandError(output, context);
2401
1885
  }
2402
- const contents = {
1886
+ const contents = map({
2403
1887
  $metadata: deserializeMetadata(output),
2404
- };
1888
+ });
2405
1889
  await collectBody(output.body, context);
2406
- return Promise.resolve(contents);
1890
+ return contents;
2407
1891
  };
2408
1892
  exports.deserializeAws_restJson1DeleteAssessmentFrameworkShareCommand = deserializeAws_restJson1DeleteAssessmentFrameworkShareCommand;
2409
1893
  const deserializeAws_restJson1DeleteAssessmentFrameworkShareCommandError = async (output, context) => {
@@ -2411,7 +1895,6 @@ const deserializeAws_restJson1DeleteAssessmentFrameworkShareCommandError = async
2411
1895
  ...output,
2412
1896
  body: await parseBody(output.body, context),
2413
1897
  };
2414
- let response;
2415
1898
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2416
1899
  switch (errorCode) {
2417
1900
  case "AccessDeniedException":
@@ -2428,25 +1911,23 @@ const deserializeAws_restJson1DeleteAssessmentFrameworkShareCommandError = async
2428
1911
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2429
1912
  default:
2430
1913
  const parsedBody = parsedOutput.body;
2431
- const $metadata = deserializeMetadata(output);
2432
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2433
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2434
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2435
- $fault: "client",
2436
- $metadata,
1914
+ (0, smithy_client_1.throwDefaultError)({
1915
+ output,
1916
+ parsedBody,
1917
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
1918
+ errorCode,
2437
1919
  });
2438
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2439
1920
  }
2440
1921
  };
2441
1922
  const deserializeAws_restJson1DeleteAssessmentReportCommand = async (output, context) => {
2442
1923
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2443
1924
  return deserializeAws_restJson1DeleteAssessmentReportCommandError(output, context);
2444
1925
  }
2445
- const contents = {
1926
+ const contents = map({
2446
1927
  $metadata: deserializeMetadata(output),
2447
- };
1928
+ });
2448
1929
  await collectBody(output.body, context);
2449
- return Promise.resolve(contents);
1930
+ return contents;
2450
1931
  };
2451
1932
  exports.deserializeAws_restJson1DeleteAssessmentReportCommand = deserializeAws_restJson1DeleteAssessmentReportCommand;
2452
1933
  const deserializeAws_restJson1DeleteAssessmentReportCommandError = async (output, context) => {
@@ -2454,7 +1935,6 @@ const deserializeAws_restJson1DeleteAssessmentReportCommandError = async (output
2454
1935
  ...output,
2455
1936
  body: await parseBody(output.body, context),
2456
1937
  };
2457
- let response;
2458
1938
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2459
1939
  switch (errorCode) {
2460
1940
  case "AccessDeniedException":
@@ -2471,25 +1951,23 @@ const deserializeAws_restJson1DeleteAssessmentReportCommandError = async (output
2471
1951
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2472
1952
  default:
2473
1953
  const parsedBody = parsedOutput.body;
2474
- const $metadata = deserializeMetadata(output);
2475
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2476
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2477
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2478
- $fault: "client",
2479
- $metadata,
1954
+ (0, smithy_client_1.throwDefaultError)({
1955
+ output,
1956
+ parsedBody,
1957
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
1958
+ errorCode,
2480
1959
  });
2481
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2482
1960
  }
2483
1961
  };
2484
1962
  const deserializeAws_restJson1DeleteControlCommand = async (output, context) => {
2485
1963
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2486
1964
  return deserializeAws_restJson1DeleteControlCommandError(output, context);
2487
1965
  }
2488
- const contents = {
1966
+ const contents = map({
2489
1967
  $metadata: deserializeMetadata(output),
2490
- };
1968
+ });
2491
1969
  await collectBody(output.body, context);
2492
- return Promise.resolve(contents);
1970
+ return contents;
2493
1971
  };
2494
1972
  exports.deserializeAws_restJson1DeleteControlCommand = deserializeAws_restJson1DeleteControlCommand;
2495
1973
  const deserializeAws_restJson1DeleteControlCommandError = async (output, context) => {
@@ -2497,7 +1975,6 @@ const deserializeAws_restJson1DeleteControlCommandError = async (output, context
2497
1975
  ...output,
2498
1976
  body: await parseBody(output.body, context),
2499
1977
  };
2500
- let response;
2501
1978
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2502
1979
  switch (errorCode) {
2503
1980
  case "AccessDeniedException":
@@ -2514,29 +1991,26 @@ const deserializeAws_restJson1DeleteControlCommandError = async (output, context
2514
1991
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2515
1992
  default:
2516
1993
  const parsedBody = parsedOutput.body;
2517
- const $metadata = deserializeMetadata(output);
2518
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2519
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2520
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2521
- $fault: "client",
2522
- $metadata,
1994
+ (0, smithy_client_1.throwDefaultError)({
1995
+ output,
1996
+ parsedBody,
1997
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
1998
+ errorCode,
2523
1999
  });
2524
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2525
2000
  }
2526
2001
  };
2527
2002
  const deserializeAws_restJson1DeregisterAccountCommand = async (output, context) => {
2528
2003
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2529
2004
  return deserializeAws_restJson1DeregisterAccountCommandError(output, context);
2530
2005
  }
2531
- const contents = {
2006
+ const contents = map({
2532
2007
  $metadata: deserializeMetadata(output),
2533
- status: undefined,
2534
- };
2008
+ });
2535
2009
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2536
- if (data.status !== undefined && data.status !== null) {
2010
+ if (data.status != null) {
2537
2011
  contents.status = (0, smithy_client_1.expectString)(data.status);
2538
2012
  }
2539
- return Promise.resolve(contents);
2013
+ return contents;
2540
2014
  };
2541
2015
  exports.deserializeAws_restJson1DeregisterAccountCommand = deserializeAws_restJson1DeregisterAccountCommand;
2542
2016
  const deserializeAws_restJson1DeregisterAccountCommandError = async (output, context) => {
@@ -2544,7 +2018,6 @@ const deserializeAws_restJson1DeregisterAccountCommandError = async (output, con
2544
2018
  ...output,
2545
2019
  body: await parseBody(output.body, context),
2546
2020
  };
2547
- let response;
2548
2021
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2549
2022
  switch (errorCode) {
2550
2023
  case "AccessDeniedException":
@@ -2561,25 +2034,23 @@ const deserializeAws_restJson1DeregisterAccountCommandError = async (output, con
2561
2034
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2562
2035
  default:
2563
2036
  const parsedBody = parsedOutput.body;
2564
- const $metadata = deserializeMetadata(output);
2565
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2566
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2567
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2568
- $fault: "client",
2569
- $metadata,
2037
+ (0, smithy_client_1.throwDefaultError)({
2038
+ output,
2039
+ parsedBody,
2040
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2041
+ errorCode,
2570
2042
  });
2571
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2572
2043
  }
2573
2044
  };
2574
2045
  const deserializeAws_restJson1DeregisterOrganizationAdminAccountCommand = async (output, context) => {
2575
2046
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2576
2047
  return deserializeAws_restJson1DeregisterOrganizationAdminAccountCommandError(output, context);
2577
2048
  }
2578
- const contents = {
2049
+ const contents = map({
2579
2050
  $metadata: deserializeMetadata(output),
2580
- };
2051
+ });
2581
2052
  await collectBody(output.body, context);
2582
- return Promise.resolve(contents);
2053
+ return contents;
2583
2054
  };
2584
2055
  exports.deserializeAws_restJson1DeregisterOrganizationAdminAccountCommand = deserializeAws_restJson1DeregisterOrganizationAdminAccountCommand;
2585
2056
  const deserializeAws_restJson1DeregisterOrganizationAdminAccountCommandError = async (output, context) => {
@@ -2587,7 +2058,6 @@ const deserializeAws_restJson1DeregisterOrganizationAdminAccountCommandError = a
2587
2058
  ...output,
2588
2059
  body: await parseBody(output.body, context),
2589
2060
  };
2590
- let response;
2591
2061
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2592
2062
  switch (errorCode) {
2593
2063
  case "AccessDeniedException":
@@ -2604,25 +2074,23 @@ const deserializeAws_restJson1DeregisterOrganizationAdminAccountCommandError = a
2604
2074
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2605
2075
  default:
2606
2076
  const parsedBody = parsedOutput.body;
2607
- const $metadata = deserializeMetadata(output);
2608
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2609
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2610
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2611
- $fault: "client",
2612
- $metadata,
2077
+ (0, smithy_client_1.throwDefaultError)({
2078
+ output,
2079
+ parsedBody,
2080
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2081
+ errorCode,
2613
2082
  });
2614
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2615
2083
  }
2616
2084
  };
2617
2085
  const deserializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCommand = async (output, context) => {
2618
2086
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2619
2087
  return deserializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCommandError(output, context);
2620
2088
  }
2621
- const contents = {
2089
+ const contents = map({
2622
2090
  $metadata: deserializeMetadata(output),
2623
- };
2091
+ });
2624
2092
  await collectBody(output.body, context);
2625
- return Promise.resolve(contents);
2093
+ return contents;
2626
2094
  };
2627
2095
  exports.deserializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCommand = deserializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCommand;
2628
2096
  const deserializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCommandError = async (output, context) => {
@@ -2630,7 +2098,6 @@ const deserializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCommandE
2630
2098
  ...output,
2631
2099
  body: await parseBody(output.body, context),
2632
2100
  };
2633
- let response;
2634
2101
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2635
2102
  switch (errorCode) {
2636
2103
  case "AccessDeniedException":
@@ -2647,29 +2114,26 @@ const deserializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCommandE
2647
2114
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2648
2115
  default:
2649
2116
  const parsedBody = parsedOutput.body;
2650
- const $metadata = deserializeMetadata(output);
2651
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2652
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2653
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2654
- $fault: "client",
2655
- $metadata,
2117
+ (0, smithy_client_1.throwDefaultError)({
2118
+ output,
2119
+ parsedBody,
2120
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2121
+ errorCode,
2656
2122
  });
2657
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2658
2123
  }
2659
2124
  };
2660
2125
  const deserializeAws_restJson1GetAccountStatusCommand = async (output, context) => {
2661
2126
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2662
2127
  return deserializeAws_restJson1GetAccountStatusCommandError(output, context);
2663
2128
  }
2664
- const contents = {
2129
+ const contents = map({
2665
2130
  $metadata: deserializeMetadata(output),
2666
- status: undefined,
2667
- };
2131
+ });
2668
2132
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2669
- if (data.status !== undefined && data.status !== null) {
2133
+ if (data.status != null) {
2670
2134
  contents.status = (0, smithy_client_1.expectString)(data.status);
2671
2135
  }
2672
- return Promise.resolve(contents);
2136
+ return contents;
2673
2137
  };
2674
2138
  exports.deserializeAws_restJson1GetAccountStatusCommand = deserializeAws_restJson1GetAccountStatusCommand;
2675
2139
  const deserializeAws_restJson1GetAccountStatusCommandError = async (output, context) => {
@@ -2677,7 +2141,6 @@ const deserializeAws_restJson1GetAccountStatusCommandError = async (output, cont
2677
2141
  ...output,
2678
2142
  body: await parseBody(output.body, context),
2679
2143
  };
2680
- let response;
2681
2144
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2682
2145
  switch (errorCode) {
2683
2146
  case "InternalServerException":
@@ -2685,33 +2148,29 @@ const deserializeAws_restJson1GetAccountStatusCommandError = async (output, cont
2685
2148
  throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2686
2149
  default:
2687
2150
  const parsedBody = parsedOutput.body;
2688
- const $metadata = deserializeMetadata(output);
2689
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2690
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2691
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2692
- $fault: "client",
2693
- $metadata,
2151
+ (0, smithy_client_1.throwDefaultError)({
2152
+ output,
2153
+ parsedBody,
2154
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2155
+ errorCode,
2694
2156
  });
2695
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2696
2157
  }
2697
2158
  };
2698
2159
  const deserializeAws_restJson1GetAssessmentCommand = async (output, context) => {
2699
2160
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2700
2161
  return deserializeAws_restJson1GetAssessmentCommandError(output, context);
2701
2162
  }
2702
- const contents = {
2163
+ const contents = map({
2703
2164
  $metadata: deserializeMetadata(output),
2704
- assessment: undefined,
2705
- userRole: undefined,
2706
- };
2165
+ });
2707
2166
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2708
- if (data.assessment !== undefined && data.assessment !== null) {
2167
+ if (data.assessment != null) {
2709
2168
  contents.assessment = deserializeAws_restJson1Assessment(data.assessment, context);
2710
2169
  }
2711
- if (data.userRole !== undefined && data.userRole !== null) {
2170
+ if (data.userRole != null) {
2712
2171
  contents.userRole = deserializeAws_restJson1Role(data.userRole, context);
2713
2172
  }
2714
- return Promise.resolve(contents);
2173
+ return contents;
2715
2174
  };
2716
2175
  exports.deserializeAws_restJson1GetAssessmentCommand = deserializeAws_restJson1GetAssessmentCommand;
2717
2176
  const deserializeAws_restJson1GetAssessmentCommandError = async (output, context) => {
@@ -2719,7 +2178,6 @@ const deserializeAws_restJson1GetAssessmentCommandError = async (output, context
2719
2178
  ...output,
2720
2179
  body: await parseBody(output.body, context),
2721
2180
  };
2722
- let response;
2723
2181
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2724
2182
  switch (errorCode) {
2725
2183
  case "AccessDeniedException":
@@ -2736,29 +2194,26 @@ const deserializeAws_restJson1GetAssessmentCommandError = async (output, context
2736
2194
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2737
2195
  default:
2738
2196
  const parsedBody = parsedOutput.body;
2739
- const $metadata = deserializeMetadata(output);
2740
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2741
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2742
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2743
- $fault: "client",
2744
- $metadata,
2197
+ (0, smithy_client_1.throwDefaultError)({
2198
+ output,
2199
+ parsedBody,
2200
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2201
+ errorCode,
2745
2202
  });
2746
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2747
2203
  }
2748
2204
  };
2749
2205
  const deserializeAws_restJson1GetAssessmentFrameworkCommand = async (output, context) => {
2750
2206
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2751
2207
  return deserializeAws_restJson1GetAssessmentFrameworkCommandError(output, context);
2752
2208
  }
2753
- const contents = {
2209
+ const contents = map({
2754
2210
  $metadata: deserializeMetadata(output),
2755
- framework: undefined,
2756
- };
2211
+ });
2757
2212
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2758
- if (data.framework !== undefined && data.framework !== null) {
2213
+ if (data.framework != null) {
2759
2214
  contents.framework = deserializeAws_restJson1Framework(data.framework, context);
2760
2215
  }
2761
- return Promise.resolve(contents);
2216
+ return contents;
2762
2217
  };
2763
2218
  exports.deserializeAws_restJson1GetAssessmentFrameworkCommand = deserializeAws_restJson1GetAssessmentFrameworkCommand;
2764
2219
  const deserializeAws_restJson1GetAssessmentFrameworkCommandError = async (output, context) => {
@@ -2766,7 +2221,6 @@ const deserializeAws_restJson1GetAssessmentFrameworkCommandError = async (output
2766
2221
  ...output,
2767
2222
  body: await parseBody(output.body, context),
2768
2223
  };
2769
- let response;
2770
2224
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2771
2225
  switch (errorCode) {
2772
2226
  case "AccessDeniedException":
@@ -2783,29 +2237,26 @@ const deserializeAws_restJson1GetAssessmentFrameworkCommandError = async (output
2783
2237
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2784
2238
  default:
2785
2239
  const parsedBody = parsedOutput.body;
2786
- const $metadata = deserializeMetadata(output);
2787
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2788
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2789
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2790
- $fault: "client",
2791
- $metadata,
2240
+ (0, smithy_client_1.throwDefaultError)({
2241
+ output,
2242
+ parsedBody,
2243
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2244
+ errorCode,
2792
2245
  });
2793
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2794
2246
  }
2795
2247
  };
2796
2248
  const deserializeAws_restJson1GetAssessmentReportUrlCommand = async (output, context) => {
2797
2249
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2798
2250
  return deserializeAws_restJson1GetAssessmentReportUrlCommandError(output, context);
2799
2251
  }
2800
- const contents = {
2252
+ const contents = map({
2801
2253
  $metadata: deserializeMetadata(output),
2802
- preSignedUrl: undefined,
2803
- };
2254
+ });
2804
2255
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2805
- if (data.preSignedUrl !== undefined && data.preSignedUrl !== null) {
2256
+ if (data.preSignedUrl != null) {
2806
2257
  contents.preSignedUrl = deserializeAws_restJson1URL(data.preSignedUrl, context);
2807
2258
  }
2808
- return Promise.resolve(contents);
2259
+ return contents;
2809
2260
  };
2810
2261
  exports.deserializeAws_restJson1GetAssessmentReportUrlCommand = deserializeAws_restJson1GetAssessmentReportUrlCommand;
2811
2262
  const deserializeAws_restJson1GetAssessmentReportUrlCommandError = async (output, context) => {
@@ -2813,7 +2264,6 @@ const deserializeAws_restJson1GetAssessmentReportUrlCommandError = async (output
2813
2264
  ...output,
2814
2265
  body: await parseBody(output.body, context),
2815
2266
  };
2816
- let response;
2817
2267
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2818
2268
  switch (errorCode) {
2819
2269
  case "AccessDeniedException":
@@ -2830,33 +2280,29 @@ const deserializeAws_restJson1GetAssessmentReportUrlCommandError = async (output
2830
2280
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2831
2281
  default:
2832
2282
  const parsedBody = parsedOutput.body;
2833
- const $metadata = deserializeMetadata(output);
2834
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2835
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2836
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2837
- $fault: "client",
2838
- $metadata,
2283
+ (0, smithy_client_1.throwDefaultError)({
2284
+ output,
2285
+ parsedBody,
2286
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2287
+ errorCode,
2839
2288
  });
2840
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2841
2289
  }
2842
2290
  };
2843
2291
  const deserializeAws_restJson1GetChangeLogsCommand = async (output, context) => {
2844
2292
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2845
2293
  return deserializeAws_restJson1GetChangeLogsCommandError(output, context);
2846
2294
  }
2847
- const contents = {
2295
+ const contents = map({
2848
2296
  $metadata: deserializeMetadata(output),
2849
- changeLogs: undefined,
2850
- nextToken: undefined,
2851
- };
2297
+ });
2852
2298
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2853
- if (data.changeLogs !== undefined && data.changeLogs !== null) {
2299
+ if (data.changeLogs != null) {
2854
2300
  contents.changeLogs = deserializeAws_restJson1ChangeLogs(data.changeLogs, context);
2855
2301
  }
2856
- if (data.nextToken !== undefined && data.nextToken !== null) {
2302
+ if (data.nextToken != null) {
2857
2303
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2858
2304
  }
2859
- return Promise.resolve(contents);
2305
+ return contents;
2860
2306
  };
2861
2307
  exports.deserializeAws_restJson1GetChangeLogsCommand = deserializeAws_restJson1GetChangeLogsCommand;
2862
2308
  const deserializeAws_restJson1GetChangeLogsCommandError = async (output, context) => {
@@ -2864,7 +2310,6 @@ const deserializeAws_restJson1GetChangeLogsCommandError = async (output, context
2864
2310
  ...output,
2865
2311
  body: await parseBody(output.body, context),
2866
2312
  };
2867
- let response;
2868
2313
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2869
2314
  switch (errorCode) {
2870
2315
  case "AccessDeniedException":
@@ -2881,29 +2326,26 @@ const deserializeAws_restJson1GetChangeLogsCommandError = async (output, context
2881
2326
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2882
2327
  default:
2883
2328
  const parsedBody = parsedOutput.body;
2884
- const $metadata = deserializeMetadata(output);
2885
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2886
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2887
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2888
- $fault: "client",
2889
- $metadata,
2329
+ (0, smithy_client_1.throwDefaultError)({
2330
+ output,
2331
+ parsedBody,
2332
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2333
+ errorCode,
2890
2334
  });
2891
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2892
2335
  }
2893
2336
  };
2894
2337
  const deserializeAws_restJson1GetControlCommand = async (output, context) => {
2895
2338
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2896
2339
  return deserializeAws_restJson1GetControlCommandError(output, context);
2897
2340
  }
2898
- const contents = {
2341
+ const contents = map({
2899
2342
  $metadata: deserializeMetadata(output),
2900
- control: undefined,
2901
- };
2343
+ });
2902
2344
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2903
- if (data.control !== undefined && data.control !== null) {
2345
+ if (data.control != null) {
2904
2346
  contents.control = deserializeAws_restJson1Control(data.control, context);
2905
2347
  }
2906
- return Promise.resolve(contents);
2348
+ return contents;
2907
2349
  };
2908
2350
  exports.deserializeAws_restJson1GetControlCommand = deserializeAws_restJson1GetControlCommand;
2909
2351
  const deserializeAws_restJson1GetControlCommandError = async (output, context) => {
@@ -2911,7 +2353,6 @@ const deserializeAws_restJson1GetControlCommandError = async (output, context) =
2911
2353
  ...output,
2912
2354
  body: await parseBody(output.body, context),
2913
2355
  };
2914
- let response;
2915
2356
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2916
2357
  switch (errorCode) {
2917
2358
  case "AccessDeniedException":
@@ -2928,33 +2369,29 @@ const deserializeAws_restJson1GetControlCommandError = async (output, context) =
2928
2369
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2929
2370
  default:
2930
2371
  const parsedBody = parsedOutput.body;
2931
- const $metadata = deserializeMetadata(output);
2932
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2933
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2934
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2935
- $fault: "client",
2936
- $metadata,
2372
+ (0, smithy_client_1.throwDefaultError)({
2373
+ output,
2374
+ parsedBody,
2375
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2376
+ errorCode,
2937
2377
  });
2938
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2939
2378
  }
2940
2379
  };
2941
2380
  const deserializeAws_restJson1GetDelegationsCommand = async (output, context) => {
2942
2381
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2943
2382
  return deserializeAws_restJson1GetDelegationsCommandError(output, context);
2944
2383
  }
2945
- const contents = {
2384
+ const contents = map({
2946
2385
  $metadata: deserializeMetadata(output),
2947
- delegations: undefined,
2948
- nextToken: undefined,
2949
- };
2386
+ });
2950
2387
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2951
- if (data.delegations !== undefined && data.delegations !== null) {
2388
+ if (data.delegations != null) {
2952
2389
  contents.delegations = deserializeAws_restJson1DelegationMetadataList(data.delegations, context);
2953
2390
  }
2954
- if (data.nextToken !== undefined && data.nextToken !== null) {
2391
+ if (data.nextToken != null) {
2955
2392
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2956
2393
  }
2957
- return Promise.resolve(contents);
2394
+ return contents;
2958
2395
  };
2959
2396
  exports.deserializeAws_restJson1GetDelegationsCommand = deserializeAws_restJson1GetDelegationsCommand;
2960
2397
  const deserializeAws_restJson1GetDelegationsCommandError = async (output, context) => {
@@ -2962,7 +2399,6 @@ const deserializeAws_restJson1GetDelegationsCommandError = async (output, contex
2962
2399
  ...output,
2963
2400
  body: await parseBody(output.body, context),
2964
2401
  };
2965
- let response;
2966
2402
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2967
2403
  switch (errorCode) {
2968
2404
  case "AccessDeniedException":
@@ -2976,29 +2412,26 @@ const deserializeAws_restJson1GetDelegationsCommandError = async (output, contex
2976
2412
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2977
2413
  default:
2978
2414
  const parsedBody = parsedOutput.body;
2979
- const $metadata = deserializeMetadata(output);
2980
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2981
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
2982
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2983
- $fault: "client",
2984
- $metadata,
2415
+ (0, smithy_client_1.throwDefaultError)({
2416
+ output,
2417
+ parsedBody,
2418
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2419
+ errorCode,
2985
2420
  });
2986
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2987
2421
  }
2988
2422
  };
2989
2423
  const deserializeAws_restJson1GetEvidenceCommand = async (output, context) => {
2990
2424
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2991
2425
  return deserializeAws_restJson1GetEvidenceCommandError(output, context);
2992
2426
  }
2993
- const contents = {
2427
+ const contents = map({
2994
2428
  $metadata: deserializeMetadata(output),
2995
- evidence: undefined,
2996
- };
2429
+ });
2997
2430
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2998
- if (data.evidence !== undefined && data.evidence !== null) {
2431
+ if (data.evidence != null) {
2999
2432
  contents.evidence = deserializeAws_restJson1Evidence(data.evidence, context);
3000
2433
  }
3001
- return Promise.resolve(contents);
2434
+ return contents;
3002
2435
  };
3003
2436
  exports.deserializeAws_restJson1GetEvidenceCommand = deserializeAws_restJson1GetEvidenceCommand;
3004
2437
  const deserializeAws_restJson1GetEvidenceCommandError = async (output, context) => {
@@ -3006,7 +2439,6 @@ const deserializeAws_restJson1GetEvidenceCommandError = async (output, context)
3006
2439
  ...output,
3007
2440
  body: await parseBody(output.body, context),
3008
2441
  };
3009
- let response;
3010
2442
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3011
2443
  switch (errorCode) {
3012
2444
  case "AccessDeniedException":
@@ -3023,33 +2455,29 @@ const deserializeAws_restJson1GetEvidenceCommandError = async (output, context)
3023
2455
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3024
2456
  default:
3025
2457
  const parsedBody = parsedOutput.body;
3026
- const $metadata = deserializeMetadata(output);
3027
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3028
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3029
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3030
- $fault: "client",
3031
- $metadata,
2458
+ (0, smithy_client_1.throwDefaultError)({
2459
+ output,
2460
+ parsedBody,
2461
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2462
+ errorCode,
3032
2463
  });
3033
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3034
2464
  }
3035
2465
  };
3036
2466
  const deserializeAws_restJson1GetEvidenceByEvidenceFolderCommand = async (output, context) => {
3037
2467
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3038
2468
  return deserializeAws_restJson1GetEvidenceByEvidenceFolderCommandError(output, context);
3039
2469
  }
3040
- const contents = {
2470
+ const contents = map({
3041
2471
  $metadata: deserializeMetadata(output),
3042
- evidence: undefined,
3043
- nextToken: undefined,
3044
- };
2472
+ });
3045
2473
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3046
- if (data.evidence !== undefined && data.evidence !== null) {
2474
+ if (data.evidence != null) {
3047
2475
  contents.evidence = deserializeAws_restJson1EvidenceList(data.evidence, context);
3048
2476
  }
3049
- if (data.nextToken !== undefined && data.nextToken !== null) {
2477
+ if (data.nextToken != null) {
3050
2478
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
3051
2479
  }
3052
- return Promise.resolve(contents);
2480
+ return contents;
3053
2481
  };
3054
2482
  exports.deserializeAws_restJson1GetEvidenceByEvidenceFolderCommand = deserializeAws_restJson1GetEvidenceByEvidenceFolderCommand;
3055
2483
  const deserializeAws_restJson1GetEvidenceByEvidenceFolderCommandError = async (output, context) => {
@@ -3057,7 +2485,6 @@ const deserializeAws_restJson1GetEvidenceByEvidenceFolderCommandError = async (o
3057
2485
  ...output,
3058
2486
  body: await parseBody(output.body, context),
3059
2487
  };
3060
- let response;
3061
2488
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3062
2489
  switch (errorCode) {
3063
2490
  case "AccessDeniedException":
@@ -3074,29 +2501,26 @@ const deserializeAws_restJson1GetEvidenceByEvidenceFolderCommandError = async (o
3074
2501
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3075
2502
  default:
3076
2503
  const parsedBody = parsedOutput.body;
3077
- const $metadata = deserializeMetadata(output);
3078
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3079
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3080
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3081
- $fault: "client",
3082
- $metadata,
2504
+ (0, smithy_client_1.throwDefaultError)({
2505
+ output,
2506
+ parsedBody,
2507
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2508
+ errorCode,
3083
2509
  });
3084
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3085
2510
  }
3086
2511
  };
3087
2512
  const deserializeAws_restJson1GetEvidenceFolderCommand = async (output, context) => {
3088
2513
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3089
2514
  return deserializeAws_restJson1GetEvidenceFolderCommandError(output, context);
3090
2515
  }
3091
- const contents = {
2516
+ const contents = map({
3092
2517
  $metadata: deserializeMetadata(output),
3093
- evidenceFolder: undefined,
3094
- };
2518
+ });
3095
2519
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3096
- if (data.evidenceFolder !== undefined && data.evidenceFolder !== null) {
2520
+ if (data.evidenceFolder != null) {
3097
2521
  contents.evidenceFolder = deserializeAws_restJson1AssessmentEvidenceFolder(data.evidenceFolder, context);
3098
2522
  }
3099
- return Promise.resolve(contents);
2523
+ return contents;
3100
2524
  };
3101
2525
  exports.deserializeAws_restJson1GetEvidenceFolderCommand = deserializeAws_restJson1GetEvidenceFolderCommand;
3102
2526
  const deserializeAws_restJson1GetEvidenceFolderCommandError = async (output, context) => {
@@ -3104,7 +2528,6 @@ const deserializeAws_restJson1GetEvidenceFolderCommandError = async (output, con
3104
2528
  ...output,
3105
2529
  body: await parseBody(output.body, context),
3106
2530
  };
3107
- let response;
3108
2531
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3109
2532
  switch (errorCode) {
3110
2533
  case "AccessDeniedException":
@@ -3121,33 +2544,29 @@ const deserializeAws_restJson1GetEvidenceFolderCommandError = async (output, con
3121
2544
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3122
2545
  default:
3123
2546
  const parsedBody = parsedOutput.body;
3124
- const $metadata = deserializeMetadata(output);
3125
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3126
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3127
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3128
- $fault: "client",
3129
- $metadata,
2547
+ (0, smithy_client_1.throwDefaultError)({
2548
+ output,
2549
+ parsedBody,
2550
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2551
+ errorCode,
3130
2552
  });
3131
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3132
2553
  }
3133
2554
  };
3134
2555
  const deserializeAws_restJson1GetEvidenceFoldersByAssessmentCommand = async (output, context) => {
3135
2556
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3136
2557
  return deserializeAws_restJson1GetEvidenceFoldersByAssessmentCommandError(output, context);
3137
2558
  }
3138
- const contents = {
2559
+ const contents = map({
3139
2560
  $metadata: deserializeMetadata(output),
3140
- evidenceFolders: undefined,
3141
- nextToken: undefined,
3142
- };
2561
+ });
3143
2562
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3144
- if (data.evidenceFolders !== undefined && data.evidenceFolders !== null) {
2563
+ if (data.evidenceFolders != null) {
3145
2564
  contents.evidenceFolders = deserializeAws_restJson1AssessmentEvidenceFolders(data.evidenceFolders, context);
3146
2565
  }
3147
- if (data.nextToken !== undefined && data.nextToken !== null) {
2566
+ if (data.nextToken != null) {
3148
2567
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
3149
2568
  }
3150
- return Promise.resolve(contents);
2569
+ return contents;
3151
2570
  };
3152
2571
  exports.deserializeAws_restJson1GetEvidenceFoldersByAssessmentCommand = deserializeAws_restJson1GetEvidenceFoldersByAssessmentCommand;
3153
2572
  const deserializeAws_restJson1GetEvidenceFoldersByAssessmentCommandError = async (output, context) => {
@@ -3155,7 +2574,6 @@ const deserializeAws_restJson1GetEvidenceFoldersByAssessmentCommandError = async
3155
2574
  ...output,
3156
2575
  body: await parseBody(output.body, context),
3157
2576
  };
3158
- let response;
3159
2577
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3160
2578
  switch (errorCode) {
3161
2579
  case "AccessDeniedException":
@@ -3172,33 +2590,29 @@ const deserializeAws_restJson1GetEvidenceFoldersByAssessmentCommandError = async
3172
2590
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3173
2591
  default:
3174
2592
  const parsedBody = parsedOutput.body;
3175
- const $metadata = deserializeMetadata(output);
3176
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3177
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3178
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3179
- $fault: "client",
3180
- $metadata,
2593
+ (0, smithy_client_1.throwDefaultError)({
2594
+ output,
2595
+ parsedBody,
2596
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2597
+ errorCode,
3181
2598
  });
3182
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3183
2599
  }
3184
2600
  };
3185
2601
  const deserializeAws_restJson1GetEvidenceFoldersByAssessmentControlCommand = async (output, context) => {
3186
2602
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3187
2603
  return deserializeAws_restJson1GetEvidenceFoldersByAssessmentControlCommandError(output, context);
3188
2604
  }
3189
- const contents = {
2605
+ const contents = map({
3190
2606
  $metadata: deserializeMetadata(output),
3191
- evidenceFolders: undefined,
3192
- nextToken: undefined,
3193
- };
2607
+ });
3194
2608
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3195
- if (data.evidenceFolders !== undefined && data.evidenceFolders !== null) {
2609
+ if (data.evidenceFolders != null) {
3196
2610
  contents.evidenceFolders = deserializeAws_restJson1AssessmentEvidenceFolders(data.evidenceFolders, context);
3197
2611
  }
3198
- if (data.nextToken !== undefined && data.nextToken !== null) {
2612
+ if (data.nextToken != null) {
3199
2613
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
3200
2614
  }
3201
- return Promise.resolve(contents);
2615
+ return contents;
3202
2616
  };
3203
2617
  exports.deserializeAws_restJson1GetEvidenceFoldersByAssessmentControlCommand = deserializeAws_restJson1GetEvidenceFoldersByAssessmentControlCommand;
3204
2618
  const deserializeAws_restJson1GetEvidenceFoldersByAssessmentControlCommandError = async (output, context) => {
@@ -3206,7 +2620,6 @@ const deserializeAws_restJson1GetEvidenceFoldersByAssessmentControlCommandError
3206
2620
  ...output,
3207
2621
  body: await parseBody(output.body, context),
3208
2622
  };
3209
- let response;
3210
2623
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3211
2624
  switch (errorCode) {
3212
2625
  case "AccessDeniedException":
@@ -3223,29 +2636,26 @@ const deserializeAws_restJson1GetEvidenceFoldersByAssessmentControlCommandError
3223
2636
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3224
2637
  default:
3225
2638
  const parsedBody = parsedOutput.body;
3226
- const $metadata = deserializeMetadata(output);
3227
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3228
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3229
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3230
- $fault: "client",
3231
- $metadata,
2639
+ (0, smithy_client_1.throwDefaultError)({
2640
+ output,
2641
+ parsedBody,
2642
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2643
+ errorCode,
3232
2644
  });
3233
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3234
2645
  }
3235
2646
  };
3236
2647
  const deserializeAws_restJson1GetInsightsCommand = async (output, context) => {
3237
2648
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3238
2649
  return deserializeAws_restJson1GetInsightsCommandError(output, context);
3239
2650
  }
3240
- const contents = {
2651
+ const contents = map({
3241
2652
  $metadata: deserializeMetadata(output),
3242
- insights: undefined,
3243
- };
2653
+ });
3244
2654
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3245
- if (data.insights !== undefined && data.insights !== null) {
2655
+ if (data.insights != null) {
3246
2656
  contents.insights = deserializeAws_restJson1Insights(data.insights, context);
3247
2657
  }
3248
- return Promise.resolve(contents);
2658
+ return contents;
3249
2659
  };
3250
2660
  exports.deserializeAws_restJson1GetInsightsCommand = deserializeAws_restJson1GetInsightsCommand;
3251
2661
  const deserializeAws_restJson1GetInsightsCommandError = async (output, context) => {
@@ -3253,7 +2663,6 @@ const deserializeAws_restJson1GetInsightsCommandError = async (output, context)
3253
2663
  ...output,
3254
2664
  body: await parseBody(output.body, context),
3255
2665
  };
3256
- let response;
3257
2666
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3258
2667
  switch (errorCode) {
3259
2668
  case "AccessDeniedException":
@@ -3264,29 +2673,26 @@ const deserializeAws_restJson1GetInsightsCommandError = async (output, context)
3264
2673
  throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3265
2674
  default:
3266
2675
  const parsedBody = parsedOutput.body;
3267
- const $metadata = deserializeMetadata(output);
3268
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3269
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3270
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3271
- $fault: "client",
3272
- $metadata,
2676
+ (0, smithy_client_1.throwDefaultError)({
2677
+ output,
2678
+ parsedBody,
2679
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2680
+ errorCode,
3273
2681
  });
3274
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3275
2682
  }
3276
2683
  };
3277
2684
  const deserializeAws_restJson1GetInsightsByAssessmentCommand = async (output, context) => {
3278
2685
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3279
2686
  return deserializeAws_restJson1GetInsightsByAssessmentCommandError(output, context);
3280
2687
  }
3281
- const contents = {
2688
+ const contents = map({
3282
2689
  $metadata: deserializeMetadata(output),
3283
- insights: undefined,
3284
- };
2690
+ });
3285
2691
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3286
- if (data.insights !== undefined && data.insights !== null) {
2692
+ if (data.insights != null) {
3287
2693
  contents.insights = deserializeAws_restJson1InsightsByAssessment(data.insights, context);
3288
2694
  }
3289
- return Promise.resolve(contents);
2695
+ return contents;
3290
2696
  };
3291
2697
  exports.deserializeAws_restJson1GetInsightsByAssessmentCommand = deserializeAws_restJson1GetInsightsByAssessmentCommand;
3292
2698
  const deserializeAws_restJson1GetInsightsByAssessmentCommandError = async (output, context) => {
@@ -3294,7 +2700,6 @@ const deserializeAws_restJson1GetInsightsByAssessmentCommandError = async (outpu
3294
2700
  ...output,
3295
2701
  body: await parseBody(output.body, context),
3296
2702
  };
3297
- let response;
3298
2703
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3299
2704
  switch (errorCode) {
3300
2705
  case "AccessDeniedException":
@@ -3311,33 +2716,29 @@ const deserializeAws_restJson1GetInsightsByAssessmentCommandError = async (outpu
3311
2716
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3312
2717
  default:
3313
2718
  const parsedBody = parsedOutput.body;
3314
- const $metadata = deserializeMetadata(output);
3315
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3316
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3317
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3318
- $fault: "client",
3319
- $metadata,
2719
+ (0, smithy_client_1.throwDefaultError)({
2720
+ output,
2721
+ parsedBody,
2722
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2723
+ errorCode,
3320
2724
  });
3321
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3322
2725
  }
3323
2726
  };
3324
2727
  const deserializeAws_restJson1GetOrganizationAdminAccountCommand = async (output, context) => {
3325
2728
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3326
2729
  return deserializeAws_restJson1GetOrganizationAdminAccountCommandError(output, context);
3327
2730
  }
3328
- const contents = {
2731
+ const contents = map({
3329
2732
  $metadata: deserializeMetadata(output),
3330
- adminAccountId: undefined,
3331
- organizationId: undefined,
3332
- };
2733
+ });
3333
2734
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3334
- if (data.adminAccountId !== undefined && data.adminAccountId !== null) {
2735
+ if (data.adminAccountId != null) {
3335
2736
  contents.adminAccountId = (0, smithy_client_1.expectString)(data.adminAccountId);
3336
2737
  }
3337
- if (data.organizationId !== undefined && data.organizationId !== null) {
2738
+ if (data.organizationId != null) {
3338
2739
  contents.organizationId = (0, smithy_client_1.expectString)(data.organizationId);
3339
2740
  }
3340
- return Promise.resolve(contents);
2741
+ return contents;
3341
2742
  };
3342
2743
  exports.deserializeAws_restJson1GetOrganizationAdminAccountCommand = deserializeAws_restJson1GetOrganizationAdminAccountCommand;
3343
2744
  const deserializeAws_restJson1GetOrganizationAdminAccountCommandError = async (output, context) => {
@@ -3345,7 +2746,6 @@ const deserializeAws_restJson1GetOrganizationAdminAccountCommandError = async (o
3345
2746
  ...output,
3346
2747
  body: await parseBody(output.body, context),
3347
2748
  };
3348
- let response;
3349
2749
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3350
2750
  switch (errorCode) {
3351
2751
  case "AccessDeniedException":
@@ -3362,29 +2762,26 @@ const deserializeAws_restJson1GetOrganizationAdminAccountCommandError = async (o
3362
2762
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3363
2763
  default:
3364
2764
  const parsedBody = parsedOutput.body;
3365
- const $metadata = deserializeMetadata(output);
3366
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3367
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3368
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3369
- $fault: "client",
3370
- $metadata,
2765
+ (0, smithy_client_1.throwDefaultError)({
2766
+ output,
2767
+ parsedBody,
2768
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2769
+ errorCode,
3371
2770
  });
3372
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3373
2771
  }
3374
2772
  };
3375
2773
  const deserializeAws_restJson1GetServicesInScopeCommand = async (output, context) => {
3376
2774
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3377
2775
  return deserializeAws_restJson1GetServicesInScopeCommandError(output, context);
3378
2776
  }
3379
- const contents = {
2777
+ const contents = map({
3380
2778
  $metadata: deserializeMetadata(output),
3381
- serviceMetadata: undefined,
3382
- };
2779
+ });
3383
2780
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3384
- if (data.serviceMetadata !== undefined && data.serviceMetadata !== null) {
2781
+ if (data.serviceMetadata != null) {
3385
2782
  contents.serviceMetadata = deserializeAws_restJson1ServiceMetadataList(data.serviceMetadata, context);
3386
2783
  }
3387
- return Promise.resolve(contents);
2784
+ return contents;
3388
2785
  };
3389
2786
  exports.deserializeAws_restJson1GetServicesInScopeCommand = deserializeAws_restJson1GetServicesInScopeCommand;
3390
2787
  const deserializeAws_restJson1GetServicesInScopeCommandError = async (output, context) => {
@@ -3392,7 +2789,6 @@ const deserializeAws_restJson1GetServicesInScopeCommandError = async (output, co
3392
2789
  ...output,
3393
2790
  body: await parseBody(output.body, context),
3394
2791
  };
3395
- let response;
3396
2792
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3397
2793
  switch (errorCode) {
3398
2794
  case "AccessDeniedException":
@@ -3406,29 +2802,26 @@ const deserializeAws_restJson1GetServicesInScopeCommandError = async (output, co
3406
2802
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3407
2803
  default:
3408
2804
  const parsedBody = parsedOutput.body;
3409
- const $metadata = deserializeMetadata(output);
3410
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3411
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3412
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3413
- $fault: "client",
3414
- $metadata,
2805
+ (0, smithy_client_1.throwDefaultError)({
2806
+ output,
2807
+ parsedBody,
2808
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2809
+ errorCode,
3415
2810
  });
3416
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3417
2811
  }
3418
2812
  };
3419
2813
  const deserializeAws_restJson1GetSettingsCommand = async (output, context) => {
3420
2814
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3421
2815
  return deserializeAws_restJson1GetSettingsCommandError(output, context);
3422
2816
  }
3423
- const contents = {
2817
+ const contents = map({
3424
2818
  $metadata: deserializeMetadata(output),
3425
- settings: undefined,
3426
- };
2819
+ });
3427
2820
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3428
- if (data.settings !== undefined && data.settings !== null) {
2821
+ if (data.settings != null) {
3429
2822
  contents.settings = deserializeAws_restJson1Settings(data.settings, context);
3430
2823
  }
3431
- return Promise.resolve(contents);
2824
+ return contents;
3432
2825
  };
3433
2826
  exports.deserializeAws_restJson1GetSettingsCommand = deserializeAws_restJson1GetSettingsCommand;
3434
2827
  const deserializeAws_restJson1GetSettingsCommandError = async (output, context) => {
@@ -3436,7 +2829,6 @@ const deserializeAws_restJson1GetSettingsCommandError = async (output, context)
3436
2829
  ...output,
3437
2830
  body: await parseBody(output.body, context),
3438
2831
  };
3439
- let response;
3440
2832
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3441
2833
  switch (errorCode) {
3442
2834
  case "AccessDeniedException":
@@ -3447,33 +2839,29 @@ const deserializeAws_restJson1GetSettingsCommandError = async (output, context)
3447
2839
  throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3448
2840
  default:
3449
2841
  const parsedBody = parsedOutput.body;
3450
- const $metadata = deserializeMetadata(output);
3451
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3452
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3453
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3454
- $fault: "client",
3455
- $metadata,
2842
+ (0, smithy_client_1.throwDefaultError)({
2843
+ output,
2844
+ parsedBody,
2845
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2846
+ errorCode,
3456
2847
  });
3457
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3458
2848
  }
3459
2849
  };
3460
2850
  const deserializeAws_restJson1ListAssessmentControlInsightsByControlDomainCommand = async (output, context) => {
3461
2851
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3462
2852
  return deserializeAws_restJson1ListAssessmentControlInsightsByControlDomainCommandError(output, context);
3463
2853
  }
3464
- const contents = {
2854
+ const contents = map({
3465
2855
  $metadata: deserializeMetadata(output),
3466
- controlInsightsByAssessment: undefined,
3467
- nextToken: undefined,
3468
- };
2856
+ });
3469
2857
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3470
- if (data.controlInsightsByAssessment !== undefined && data.controlInsightsByAssessment !== null) {
2858
+ if (data.controlInsightsByAssessment != null) {
3471
2859
  contents.controlInsightsByAssessment = deserializeAws_restJson1ControlInsightsMetadataByAssessment(data.controlInsightsByAssessment, context);
3472
2860
  }
3473
- if (data.nextToken !== undefined && data.nextToken !== null) {
2861
+ if (data.nextToken != null) {
3474
2862
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
3475
2863
  }
3476
- return Promise.resolve(contents);
2864
+ return contents;
3477
2865
  };
3478
2866
  exports.deserializeAws_restJson1ListAssessmentControlInsightsByControlDomainCommand = deserializeAws_restJson1ListAssessmentControlInsightsByControlDomainCommand;
3479
2867
  const deserializeAws_restJson1ListAssessmentControlInsightsByControlDomainCommandError = async (output, context) => {
@@ -3481,7 +2869,6 @@ const deserializeAws_restJson1ListAssessmentControlInsightsByControlDomainComman
3481
2869
  ...output,
3482
2870
  body: await parseBody(output.body, context),
3483
2871
  };
3484
- let response;
3485
2872
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3486
2873
  switch (errorCode) {
3487
2874
  case "AccessDeniedException":
@@ -3498,33 +2885,29 @@ const deserializeAws_restJson1ListAssessmentControlInsightsByControlDomainComman
3498
2885
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3499
2886
  default:
3500
2887
  const parsedBody = parsedOutput.body;
3501
- const $metadata = deserializeMetadata(output);
3502
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3503
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3504
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3505
- $fault: "client",
3506
- $metadata,
2888
+ (0, smithy_client_1.throwDefaultError)({
2889
+ output,
2890
+ parsedBody,
2891
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2892
+ errorCode,
3507
2893
  });
3508
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3509
2894
  }
3510
2895
  };
3511
2896
  const deserializeAws_restJson1ListAssessmentFrameworksCommand = async (output, context) => {
3512
2897
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3513
2898
  return deserializeAws_restJson1ListAssessmentFrameworksCommandError(output, context);
3514
2899
  }
3515
- const contents = {
2900
+ const contents = map({
3516
2901
  $metadata: deserializeMetadata(output),
3517
- frameworkMetadataList: undefined,
3518
- nextToken: undefined,
3519
- };
2902
+ });
3520
2903
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3521
- if (data.frameworkMetadataList !== undefined && data.frameworkMetadataList !== null) {
2904
+ if (data.frameworkMetadataList != null) {
3522
2905
  contents.frameworkMetadataList = deserializeAws_restJson1FrameworkMetadataList(data.frameworkMetadataList, context);
3523
2906
  }
3524
- if (data.nextToken !== undefined && data.nextToken !== null) {
2907
+ if (data.nextToken != null) {
3525
2908
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
3526
2909
  }
3527
- return Promise.resolve(contents);
2910
+ return contents;
3528
2911
  };
3529
2912
  exports.deserializeAws_restJson1ListAssessmentFrameworksCommand = deserializeAws_restJson1ListAssessmentFrameworksCommand;
3530
2913
  const deserializeAws_restJson1ListAssessmentFrameworksCommandError = async (output, context) => {
@@ -3532,7 +2915,6 @@ const deserializeAws_restJson1ListAssessmentFrameworksCommandError = async (outp
3532
2915
  ...output,
3533
2916
  body: await parseBody(output.body, context),
3534
2917
  };
3535
- let response;
3536
2918
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3537
2919
  switch (errorCode) {
3538
2920
  case "AccessDeniedException":
@@ -3546,33 +2928,29 @@ const deserializeAws_restJson1ListAssessmentFrameworksCommandError = async (outp
3546
2928
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3547
2929
  default:
3548
2930
  const parsedBody = parsedOutput.body;
3549
- const $metadata = deserializeMetadata(output);
3550
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3551
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3552
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3553
- $fault: "client",
3554
- $metadata,
2931
+ (0, smithy_client_1.throwDefaultError)({
2932
+ output,
2933
+ parsedBody,
2934
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2935
+ errorCode,
3555
2936
  });
3556
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3557
2937
  }
3558
2938
  };
3559
2939
  const deserializeAws_restJson1ListAssessmentFrameworkShareRequestsCommand = async (output, context) => {
3560
2940
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3561
2941
  return deserializeAws_restJson1ListAssessmentFrameworkShareRequestsCommandError(output, context);
3562
2942
  }
3563
- const contents = {
2943
+ const contents = map({
3564
2944
  $metadata: deserializeMetadata(output),
3565
- assessmentFrameworkShareRequests: undefined,
3566
- nextToken: undefined,
3567
- };
2945
+ });
3568
2946
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3569
- if (data.assessmentFrameworkShareRequests !== undefined && data.assessmentFrameworkShareRequests !== null) {
2947
+ if (data.assessmentFrameworkShareRequests != null) {
3570
2948
  contents.assessmentFrameworkShareRequests = deserializeAws_restJson1AssessmentFrameworkShareRequestList(data.assessmentFrameworkShareRequests, context);
3571
2949
  }
3572
- if (data.nextToken !== undefined && data.nextToken !== null) {
2950
+ if (data.nextToken != null) {
3573
2951
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
3574
2952
  }
3575
- return Promise.resolve(contents);
2953
+ return contents;
3576
2954
  };
3577
2955
  exports.deserializeAws_restJson1ListAssessmentFrameworkShareRequestsCommand = deserializeAws_restJson1ListAssessmentFrameworkShareRequestsCommand;
3578
2956
  const deserializeAws_restJson1ListAssessmentFrameworkShareRequestsCommandError = async (output, context) => {
@@ -3580,7 +2958,6 @@ const deserializeAws_restJson1ListAssessmentFrameworkShareRequestsCommandError =
3580
2958
  ...output,
3581
2959
  body: await parseBody(output.body, context),
3582
2960
  };
3583
- let response;
3584
2961
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3585
2962
  switch (errorCode) {
3586
2963
  case "AccessDeniedException":
@@ -3594,33 +2971,29 @@ const deserializeAws_restJson1ListAssessmentFrameworkShareRequestsCommandError =
3594
2971
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3595
2972
  default:
3596
2973
  const parsedBody = parsedOutput.body;
3597
- const $metadata = deserializeMetadata(output);
3598
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3599
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3600
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3601
- $fault: "client",
3602
- $metadata,
2974
+ (0, smithy_client_1.throwDefaultError)({
2975
+ output,
2976
+ parsedBody,
2977
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
2978
+ errorCode,
3603
2979
  });
3604
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3605
2980
  }
3606
2981
  };
3607
2982
  const deserializeAws_restJson1ListAssessmentReportsCommand = async (output, context) => {
3608
2983
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3609
2984
  return deserializeAws_restJson1ListAssessmentReportsCommandError(output, context);
3610
2985
  }
3611
- const contents = {
2986
+ const contents = map({
3612
2987
  $metadata: deserializeMetadata(output),
3613
- assessmentReports: undefined,
3614
- nextToken: undefined,
3615
- };
2988
+ });
3616
2989
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3617
- if (data.assessmentReports !== undefined && data.assessmentReports !== null) {
2990
+ if (data.assessmentReports != null) {
3618
2991
  contents.assessmentReports = deserializeAws_restJson1AssessmentReportsMetadata(data.assessmentReports, context);
3619
2992
  }
3620
- if (data.nextToken !== undefined && data.nextToken !== null) {
2993
+ if (data.nextToken != null) {
3621
2994
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
3622
2995
  }
3623
- return Promise.resolve(contents);
2996
+ return contents;
3624
2997
  };
3625
2998
  exports.deserializeAws_restJson1ListAssessmentReportsCommand = deserializeAws_restJson1ListAssessmentReportsCommand;
3626
2999
  const deserializeAws_restJson1ListAssessmentReportsCommandError = async (output, context) => {
@@ -3628,7 +3001,6 @@ const deserializeAws_restJson1ListAssessmentReportsCommandError = async (output,
3628
3001
  ...output,
3629
3002
  body: await parseBody(output.body, context),
3630
3003
  };
3631
- let response;
3632
3004
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3633
3005
  switch (errorCode) {
3634
3006
  case "AccessDeniedException":
@@ -3642,33 +3014,29 @@ const deserializeAws_restJson1ListAssessmentReportsCommandError = async (output,
3642
3014
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3643
3015
  default:
3644
3016
  const parsedBody = parsedOutput.body;
3645
- const $metadata = deserializeMetadata(output);
3646
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3647
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3648
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3649
- $fault: "client",
3650
- $metadata,
3017
+ (0, smithy_client_1.throwDefaultError)({
3018
+ output,
3019
+ parsedBody,
3020
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3021
+ errorCode,
3651
3022
  });
3652
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3653
3023
  }
3654
3024
  };
3655
3025
  const deserializeAws_restJson1ListAssessmentsCommand = async (output, context) => {
3656
3026
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3657
3027
  return deserializeAws_restJson1ListAssessmentsCommandError(output, context);
3658
3028
  }
3659
- const contents = {
3029
+ const contents = map({
3660
3030
  $metadata: deserializeMetadata(output),
3661
- assessmentMetadata: undefined,
3662
- nextToken: undefined,
3663
- };
3031
+ });
3664
3032
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3665
- if (data.assessmentMetadata !== undefined && data.assessmentMetadata !== null) {
3033
+ if (data.assessmentMetadata != null) {
3666
3034
  contents.assessmentMetadata = deserializeAws_restJson1ListAssessmentMetadata(data.assessmentMetadata, context);
3667
3035
  }
3668
- if (data.nextToken !== undefined && data.nextToken !== null) {
3036
+ if (data.nextToken != null) {
3669
3037
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
3670
3038
  }
3671
- return Promise.resolve(contents);
3039
+ return contents;
3672
3040
  };
3673
3041
  exports.deserializeAws_restJson1ListAssessmentsCommand = deserializeAws_restJson1ListAssessmentsCommand;
3674
3042
  const deserializeAws_restJson1ListAssessmentsCommandError = async (output, context) => {
@@ -3676,7 +3044,6 @@ const deserializeAws_restJson1ListAssessmentsCommandError = async (output, conte
3676
3044
  ...output,
3677
3045
  body: await parseBody(output.body, context),
3678
3046
  };
3679
- let response;
3680
3047
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3681
3048
  switch (errorCode) {
3682
3049
  case "AccessDeniedException":
@@ -3690,33 +3057,29 @@ const deserializeAws_restJson1ListAssessmentsCommandError = async (output, conte
3690
3057
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3691
3058
  default:
3692
3059
  const parsedBody = parsedOutput.body;
3693
- const $metadata = deserializeMetadata(output);
3694
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3695
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3696
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3697
- $fault: "client",
3698
- $metadata,
3060
+ (0, smithy_client_1.throwDefaultError)({
3061
+ output,
3062
+ parsedBody,
3063
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3064
+ errorCode,
3699
3065
  });
3700
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3701
3066
  }
3702
3067
  };
3703
3068
  const deserializeAws_restJson1ListControlDomainInsightsCommand = async (output, context) => {
3704
3069
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3705
3070
  return deserializeAws_restJson1ListControlDomainInsightsCommandError(output, context);
3706
3071
  }
3707
- const contents = {
3072
+ const contents = map({
3708
3073
  $metadata: deserializeMetadata(output),
3709
- controlDomainInsights: undefined,
3710
- nextToken: undefined,
3711
- };
3074
+ });
3712
3075
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3713
- if (data.controlDomainInsights !== undefined && data.controlDomainInsights !== null) {
3076
+ if (data.controlDomainInsights != null) {
3714
3077
  contents.controlDomainInsights = deserializeAws_restJson1ControlDomainInsightsList(data.controlDomainInsights, context);
3715
3078
  }
3716
- if (data.nextToken !== undefined && data.nextToken !== null) {
3079
+ if (data.nextToken != null) {
3717
3080
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
3718
3081
  }
3719
- return Promise.resolve(contents);
3082
+ return contents;
3720
3083
  };
3721
3084
  exports.deserializeAws_restJson1ListControlDomainInsightsCommand = deserializeAws_restJson1ListControlDomainInsightsCommand;
3722
3085
  const deserializeAws_restJson1ListControlDomainInsightsCommandError = async (output, context) => {
@@ -3724,7 +3087,6 @@ const deserializeAws_restJson1ListControlDomainInsightsCommandError = async (out
3724
3087
  ...output,
3725
3088
  body: await parseBody(output.body, context),
3726
3089
  };
3727
- let response;
3728
3090
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3729
3091
  switch (errorCode) {
3730
3092
  case "AccessDeniedException":
@@ -3741,33 +3103,29 @@ const deserializeAws_restJson1ListControlDomainInsightsCommandError = async (out
3741
3103
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3742
3104
  default:
3743
3105
  const parsedBody = parsedOutput.body;
3744
- const $metadata = deserializeMetadata(output);
3745
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3746
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3747
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3748
- $fault: "client",
3749
- $metadata,
3106
+ (0, smithy_client_1.throwDefaultError)({
3107
+ output,
3108
+ parsedBody,
3109
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3110
+ errorCode,
3750
3111
  });
3751
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3752
3112
  }
3753
3113
  };
3754
3114
  const deserializeAws_restJson1ListControlDomainInsightsByAssessmentCommand = async (output, context) => {
3755
3115
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3756
3116
  return deserializeAws_restJson1ListControlDomainInsightsByAssessmentCommandError(output, context);
3757
3117
  }
3758
- const contents = {
3118
+ const contents = map({
3759
3119
  $metadata: deserializeMetadata(output),
3760
- controlDomainInsights: undefined,
3761
- nextToken: undefined,
3762
- };
3120
+ });
3763
3121
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3764
- if (data.controlDomainInsights !== undefined && data.controlDomainInsights !== null) {
3122
+ if (data.controlDomainInsights != null) {
3765
3123
  contents.controlDomainInsights = deserializeAws_restJson1ControlDomainInsightsList(data.controlDomainInsights, context);
3766
3124
  }
3767
- if (data.nextToken !== undefined && data.nextToken !== null) {
3125
+ if (data.nextToken != null) {
3768
3126
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
3769
3127
  }
3770
- return Promise.resolve(contents);
3128
+ return contents;
3771
3129
  };
3772
3130
  exports.deserializeAws_restJson1ListControlDomainInsightsByAssessmentCommand = deserializeAws_restJson1ListControlDomainInsightsByAssessmentCommand;
3773
3131
  const deserializeAws_restJson1ListControlDomainInsightsByAssessmentCommandError = async (output, context) => {
@@ -3775,7 +3133,6 @@ const deserializeAws_restJson1ListControlDomainInsightsByAssessmentCommandError
3775
3133
  ...output,
3776
3134
  body: await parseBody(output.body, context),
3777
3135
  };
3778
- let response;
3779
3136
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3780
3137
  switch (errorCode) {
3781
3138
  case "AccessDeniedException":
@@ -3792,33 +3149,29 @@ const deserializeAws_restJson1ListControlDomainInsightsByAssessmentCommandError
3792
3149
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3793
3150
  default:
3794
3151
  const parsedBody = parsedOutput.body;
3795
- const $metadata = deserializeMetadata(output);
3796
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3797
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3798
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3799
- $fault: "client",
3800
- $metadata,
3152
+ (0, smithy_client_1.throwDefaultError)({
3153
+ output,
3154
+ parsedBody,
3155
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3156
+ errorCode,
3801
3157
  });
3802
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3803
3158
  }
3804
3159
  };
3805
3160
  const deserializeAws_restJson1ListControlInsightsByControlDomainCommand = async (output, context) => {
3806
3161
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3807
3162
  return deserializeAws_restJson1ListControlInsightsByControlDomainCommandError(output, context);
3808
3163
  }
3809
- const contents = {
3164
+ const contents = map({
3810
3165
  $metadata: deserializeMetadata(output),
3811
- controlInsightsMetadata: undefined,
3812
- nextToken: undefined,
3813
- };
3166
+ });
3814
3167
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3815
- if (data.controlInsightsMetadata !== undefined && data.controlInsightsMetadata !== null) {
3168
+ if (data.controlInsightsMetadata != null) {
3816
3169
  contents.controlInsightsMetadata = deserializeAws_restJson1ControlInsightsMetadata(data.controlInsightsMetadata, context);
3817
3170
  }
3818
- if (data.nextToken !== undefined && data.nextToken !== null) {
3171
+ if (data.nextToken != null) {
3819
3172
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
3820
3173
  }
3821
- return Promise.resolve(contents);
3174
+ return contents;
3822
3175
  };
3823
3176
  exports.deserializeAws_restJson1ListControlInsightsByControlDomainCommand = deserializeAws_restJson1ListControlInsightsByControlDomainCommand;
3824
3177
  const deserializeAws_restJson1ListControlInsightsByControlDomainCommandError = async (output, context) => {
@@ -3826,7 +3179,6 @@ const deserializeAws_restJson1ListControlInsightsByControlDomainCommandError = a
3826
3179
  ...output,
3827
3180
  body: await parseBody(output.body, context),
3828
3181
  };
3829
- let response;
3830
3182
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3831
3183
  switch (errorCode) {
3832
3184
  case "AccessDeniedException":
@@ -3843,33 +3195,29 @@ const deserializeAws_restJson1ListControlInsightsByControlDomainCommandError = a
3843
3195
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3844
3196
  default:
3845
3197
  const parsedBody = parsedOutput.body;
3846
- const $metadata = deserializeMetadata(output);
3847
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3848
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3849
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3850
- $fault: "client",
3851
- $metadata,
3198
+ (0, smithy_client_1.throwDefaultError)({
3199
+ output,
3200
+ parsedBody,
3201
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3202
+ errorCode,
3852
3203
  });
3853
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3854
3204
  }
3855
3205
  };
3856
3206
  const deserializeAws_restJson1ListControlsCommand = async (output, context) => {
3857
3207
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3858
3208
  return deserializeAws_restJson1ListControlsCommandError(output, context);
3859
3209
  }
3860
- const contents = {
3210
+ const contents = map({
3861
3211
  $metadata: deserializeMetadata(output),
3862
- controlMetadataList: undefined,
3863
- nextToken: undefined,
3864
- };
3212
+ });
3865
3213
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3866
- if (data.controlMetadataList !== undefined && data.controlMetadataList !== null) {
3214
+ if (data.controlMetadataList != null) {
3867
3215
  contents.controlMetadataList = deserializeAws_restJson1ControlMetadataList(data.controlMetadataList, context);
3868
3216
  }
3869
- if (data.nextToken !== undefined && data.nextToken !== null) {
3217
+ if (data.nextToken != null) {
3870
3218
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
3871
3219
  }
3872
- return Promise.resolve(contents);
3220
+ return contents;
3873
3221
  };
3874
3222
  exports.deserializeAws_restJson1ListControlsCommand = deserializeAws_restJson1ListControlsCommand;
3875
3223
  const deserializeAws_restJson1ListControlsCommandError = async (output, context) => {
@@ -3877,7 +3225,6 @@ const deserializeAws_restJson1ListControlsCommandError = async (output, context)
3877
3225
  ...output,
3878
3226
  body: await parseBody(output.body, context),
3879
3227
  };
3880
- let response;
3881
3228
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3882
3229
  switch (errorCode) {
3883
3230
  case "AccessDeniedException":
@@ -3891,33 +3238,29 @@ const deserializeAws_restJson1ListControlsCommandError = async (output, context)
3891
3238
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3892
3239
  default:
3893
3240
  const parsedBody = parsedOutput.body;
3894
- const $metadata = deserializeMetadata(output);
3895
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3896
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3897
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3898
- $fault: "client",
3899
- $metadata,
3241
+ (0, smithy_client_1.throwDefaultError)({
3242
+ output,
3243
+ parsedBody,
3244
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3245
+ errorCode,
3900
3246
  });
3901
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3902
3247
  }
3903
3248
  };
3904
3249
  const deserializeAws_restJson1ListKeywordsForDataSourceCommand = async (output, context) => {
3905
3250
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3906
3251
  return deserializeAws_restJson1ListKeywordsForDataSourceCommandError(output, context);
3907
3252
  }
3908
- const contents = {
3253
+ const contents = map({
3909
3254
  $metadata: deserializeMetadata(output),
3910
- keywords: undefined,
3911
- nextToken: undefined,
3912
- };
3255
+ });
3913
3256
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3914
- if (data.keywords !== undefined && data.keywords !== null) {
3257
+ if (data.keywords != null) {
3915
3258
  contents.keywords = deserializeAws_restJson1Keywords(data.keywords, context);
3916
3259
  }
3917
- if (data.nextToken !== undefined && data.nextToken !== null) {
3260
+ if (data.nextToken != null) {
3918
3261
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
3919
3262
  }
3920
- return Promise.resolve(contents);
3263
+ return contents;
3921
3264
  };
3922
3265
  exports.deserializeAws_restJson1ListKeywordsForDataSourceCommand = deserializeAws_restJson1ListKeywordsForDataSourceCommand;
3923
3266
  const deserializeAws_restJson1ListKeywordsForDataSourceCommandError = async (output, context) => {
@@ -3925,7 +3268,6 @@ const deserializeAws_restJson1ListKeywordsForDataSourceCommandError = async (out
3925
3268
  ...output,
3926
3269
  body: await parseBody(output.body, context),
3927
3270
  };
3928
- let response;
3929
3271
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3930
3272
  switch (errorCode) {
3931
3273
  case "AccessDeniedException":
@@ -3939,33 +3281,29 @@ const deserializeAws_restJson1ListKeywordsForDataSourceCommandError = async (out
3939
3281
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3940
3282
  default:
3941
3283
  const parsedBody = parsedOutput.body;
3942
- const $metadata = deserializeMetadata(output);
3943
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3944
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3945
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3946
- $fault: "client",
3947
- $metadata,
3284
+ (0, smithy_client_1.throwDefaultError)({
3285
+ output,
3286
+ parsedBody,
3287
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3288
+ errorCode,
3948
3289
  });
3949
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3950
3290
  }
3951
3291
  };
3952
3292
  const deserializeAws_restJson1ListNotificationsCommand = async (output, context) => {
3953
3293
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3954
3294
  return deserializeAws_restJson1ListNotificationsCommandError(output, context);
3955
3295
  }
3956
- const contents = {
3296
+ const contents = map({
3957
3297
  $metadata: deserializeMetadata(output),
3958
- nextToken: undefined,
3959
- notifications: undefined,
3960
- };
3298
+ });
3961
3299
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3962
- if (data.nextToken !== undefined && data.nextToken !== null) {
3300
+ if (data.nextToken != null) {
3963
3301
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
3964
3302
  }
3965
- if (data.notifications !== undefined && data.notifications !== null) {
3303
+ if (data.notifications != null) {
3966
3304
  contents.notifications = deserializeAws_restJson1Notifications(data.notifications, context);
3967
3305
  }
3968
- return Promise.resolve(contents);
3306
+ return contents;
3969
3307
  };
3970
3308
  exports.deserializeAws_restJson1ListNotificationsCommand = deserializeAws_restJson1ListNotificationsCommand;
3971
3309
  const deserializeAws_restJson1ListNotificationsCommandError = async (output, context) => {
@@ -3973,7 +3311,6 @@ const deserializeAws_restJson1ListNotificationsCommandError = async (output, con
3973
3311
  ...output,
3974
3312
  body: await parseBody(output.body, context),
3975
3313
  };
3976
- let response;
3977
3314
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3978
3315
  switch (errorCode) {
3979
3316
  case "AccessDeniedException":
@@ -3987,29 +3324,26 @@ const deserializeAws_restJson1ListNotificationsCommandError = async (output, con
3987
3324
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3988
3325
  default:
3989
3326
  const parsedBody = parsedOutput.body;
3990
- const $metadata = deserializeMetadata(output);
3991
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3992
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
3993
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3994
- $fault: "client",
3995
- $metadata,
3327
+ (0, smithy_client_1.throwDefaultError)({
3328
+ output,
3329
+ parsedBody,
3330
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3331
+ errorCode,
3996
3332
  });
3997
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3998
3333
  }
3999
3334
  };
4000
3335
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
4001
3336
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4002
3337
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
4003
3338
  }
4004
- const contents = {
3339
+ const contents = map({
4005
3340
  $metadata: deserializeMetadata(output),
4006
- tags: undefined,
4007
- };
3341
+ });
4008
3342
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4009
- if (data.tags !== undefined && data.tags !== null) {
3343
+ if (data.tags != null) {
4010
3344
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
4011
3345
  }
4012
- return Promise.resolve(contents);
3346
+ return contents;
4013
3347
  };
4014
3348
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
4015
3349
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -4017,7 +3351,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
4017
3351
  ...output,
4018
3352
  body: await parseBody(output.body, context),
4019
3353
  };
4020
- let response;
4021
3354
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4022
3355
  switch (errorCode) {
4023
3356
  case "InternalServerException":
@@ -4031,29 +3364,26 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
4031
3364
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4032
3365
  default:
4033
3366
  const parsedBody = parsedOutput.body;
4034
- const $metadata = deserializeMetadata(output);
4035
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4036
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
4037
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4038
- $fault: "client",
4039
- $metadata,
3367
+ (0, smithy_client_1.throwDefaultError)({
3368
+ output,
3369
+ parsedBody,
3370
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3371
+ errorCode,
4040
3372
  });
4041
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4042
3373
  }
4043
3374
  };
4044
3375
  const deserializeAws_restJson1RegisterAccountCommand = async (output, context) => {
4045
3376
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4046
3377
  return deserializeAws_restJson1RegisterAccountCommandError(output, context);
4047
3378
  }
4048
- const contents = {
3379
+ const contents = map({
4049
3380
  $metadata: deserializeMetadata(output),
4050
- status: undefined,
4051
- };
3381
+ });
4052
3382
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4053
- if (data.status !== undefined && data.status !== null) {
3383
+ if (data.status != null) {
4054
3384
  contents.status = (0, smithy_client_1.expectString)(data.status);
4055
3385
  }
4056
- return Promise.resolve(contents);
3386
+ return contents;
4057
3387
  };
4058
3388
  exports.deserializeAws_restJson1RegisterAccountCommand = deserializeAws_restJson1RegisterAccountCommand;
4059
3389
  const deserializeAws_restJson1RegisterAccountCommandError = async (output, context) => {
@@ -4061,7 +3391,6 @@ const deserializeAws_restJson1RegisterAccountCommandError = async (output, conte
4061
3391
  ...output,
4062
3392
  body: await parseBody(output.body, context),
4063
3393
  };
4064
- let response;
4065
3394
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4066
3395
  switch (errorCode) {
4067
3396
  case "AccessDeniedException":
@@ -4081,33 +3410,29 @@ const deserializeAws_restJson1RegisterAccountCommandError = async (output, conte
4081
3410
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4082
3411
  default:
4083
3412
  const parsedBody = parsedOutput.body;
4084
- const $metadata = deserializeMetadata(output);
4085
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4086
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
4087
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4088
- $fault: "client",
4089
- $metadata,
3413
+ (0, smithy_client_1.throwDefaultError)({
3414
+ output,
3415
+ parsedBody,
3416
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3417
+ errorCode,
4090
3418
  });
4091
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4092
3419
  }
4093
3420
  };
4094
3421
  const deserializeAws_restJson1RegisterOrganizationAdminAccountCommand = async (output, context) => {
4095
3422
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4096
3423
  return deserializeAws_restJson1RegisterOrganizationAdminAccountCommandError(output, context);
4097
3424
  }
4098
- const contents = {
3425
+ const contents = map({
4099
3426
  $metadata: deserializeMetadata(output),
4100
- adminAccountId: undefined,
4101
- organizationId: undefined,
4102
- };
3427
+ });
4103
3428
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4104
- if (data.adminAccountId !== undefined && data.adminAccountId !== null) {
3429
+ if (data.adminAccountId != null) {
4105
3430
  contents.adminAccountId = (0, smithy_client_1.expectString)(data.adminAccountId);
4106
3431
  }
4107
- if (data.organizationId !== undefined && data.organizationId !== null) {
3432
+ if (data.organizationId != null) {
4108
3433
  contents.organizationId = (0, smithy_client_1.expectString)(data.organizationId);
4109
3434
  }
4110
- return Promise.resolve(contents);
3435
+ return contents;
4111
3436
  };
4112
3437
  exports.deserializeAws_restJson1RegisterOrganizationAdminAccountCommand = deserializeAws_restJson1RegisterOrganizationAdminAccountCommand;
4113
3438
  const deserializeAws_restJson1RegisterOrganizationAdminAccountCommandError = async (output, context) => {
@@ -4115,7 +3440,6 @@ const deserializeAws_restJson1RegisterOrganizationAdminAccountCommandError = asy
4115
3440
  ...output,
4116
3441
  body: await parseBody(output.body, context),
4117
3442
  };
4118
- let response;
4119
3443
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4120
3444
  switch (errorCode) {
4121
3445
  case "AccessDeniedException":
@@ -4132,29 +3456,26 @@ const deserializeAws_restJson1RegisterOrganizationAdminAccountCommandError = asy
4132
3456
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4133
3457
  default:
4134
3458
  const parsedBody = parsedOutput.body;
4135
- const $metadata = deserializeMetadata(output);
4136
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4137
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
4138
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4139
- $fault: "client",
4140
- $metadata,
3459
+ (0, smithy_client_1.throwDefaultError)({
3460
+ output,
3461
+ parsedBody,
3462
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3463
+ errorCode,
4141
3464
  });
4142
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4143
3465
  }
4144
3466
  };
4145
3467
  const deserializeAws_restJson1StartAssessmentFrameworkShareCommand = async (output, context) => {
4146
3468
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4147
3469
  return deserializeAws_restJson1StartAssessmentFrameworkShareCommandError(output, context);
4148
3470
  }
4149
- const contents = {
3471
+ const contents = map({
4150
3472
  $metadata: deserializeMetadata(output),
4151
- assessmentFrameworkShareRequest: undefined,
4152
- };
3473
+ });
4153
3474
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4154
- if (data.assessmentFrameworkShareRequest !== undefined && data.assessmentFrameworkShareRequest !== null) {
3475
+ if (data.assessmentFrameworkShareRequest != null) {
4155
3476
  contents.assessmentFrameworkShareRequest = deserializeAws_restJson1AssessmentFrameworkShareRequest(data.assessmentFrameworkShareRequest, context);
4156
3477
  }
4157
- return Promise.resolve(contents);
3478
+ return contents;
4158
3479
  };
4159
3480
  exports.deserializeAws_restJson1StartAssessmentFrameworkShareCommand = deserializeAws_restJson1StartAssessmentFrameworkShareCommand;
4160
3481
  const deserializeAws_restJson1StartAssessmentFrameworkShareCommandError = async (output, context) => {
@@ -4162,7 +3483,6 @@ const deserializeAws_restJson1StartAssessmentFrameworkShareCommandError = async
4162
3483
  ...output,
4163
3484
  body: await parseBody(output.body, context),
4164
3485
  };
4165
- let response;
4166
3486
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4167
3487
  switch (errorCode) {
4168
3488
  case "AccessDeniedException":
@@ -4179,25 +3499,23 @@ const deserializeAws_restJson1StartAssessmentFrameworkShareCommandError = async
4179
3499
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4180
3500
  default:
4181
3501
  const parsedBody = parsedOutput.body;
4182
- const $metadata = deserializeMetadata(output);
4183
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4184
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
4185
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4186
- $fault: "client",
4187
- $metadata,
3502
+ (0, smithy_client_1.throwDefaultError)({
3503
+ output,
3504
+ parsedBody,
3505
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3506
+ errorCode,
4188
3507
  });
4189
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4190
3508
  }
4191
3509
  };
4192
3510
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
4193
3511
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4194
3512
  return deserializeAws_restJson1TagResourceCommandError(output, context);
4195
3513
  }
4196
- const contents = {
3514
+ const contents = map({
4197
3515
  $metadata: deserializeMetadata(output),
4198
- };
3516
+ });
4199
3517
  await collectBody(output.body, context);
4200
- return Promise.resolve(contents);
3518
+ return contents;
4201
3519
  };
4202
3520
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
4203
3521
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -4205,7 +3523,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
4205
3523
  ...output,
4206
3524
  body: await parseBody(output.body, context),
4207
3525
  };
4208
- let response;
4209
3526
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4210
3527
  switch (errorCode) {
4211
3528
  case "InternalServerException":
@@ -4219,25 +3536,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
4219
3536
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4220
3537
  default:
4221
3538
  const parsedBody = parsedOutput.body;
4222
- const $metadata = deserializeMetadata(output);
4223
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4224
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
4225
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4226
- $fault: "client",
4227
- $metadata,
3539
+ (0, smithy_client_1.throwDefaultError)({
3540
+ output,
3541
+ parsedBody,
3542
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3543
+ errorCode,
4228
3544
  });
4229
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4230
3545
  }
4231
3546
  };
4232
3547
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
4233
3548
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4234
3549
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
4235
3550
  }
4236
- const contents = {
3551
+ const contents = map({
4237
3552
  $metadata: deserializeMetadata(output),
4238
- };
3553
+ });
4239
3554
  await collectBody(output.body, context);
4240
- return Promise.resolve(contents);
3555
+ return contents;
4241
3556
  };
4242
3557
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
4243
3558
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -4245,7 +3560,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
4245
3560
  ...output,
4246
3561
  body: await parseBody(output.body, context),
4247
3562
  };
4248
- let response;
4249
3563
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4250
3564
  switch (errorCode) {
4251
3565
  case "InternalServerException":
@@ -4259,29 +3573,26 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
4259
3573
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4260
3574
  default:
4261
3575
  const parsedBody = parsedOutput.body;
4262
- const $metadata = deserializeMetadata(output);
4263
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4264
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
4265
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4266
- $fault: "client",
4267
- $metadata,
3576
+ (0, smithy_client_1.throwDefaultError)({
3577
+ output,
3578
+ parsedBody,
3579
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3580
+ errorCode,
4268
3581
  });
4269
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4270
3582
  }
4271
3583
  };
4272
3584
  const deserializeAws_restJson1UpdateAssessmentCommand = async (output, context) => {
4273
3585
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4274
3586
  return deserializeAws_restJson1UpdateAssessmentCommandError(output, context);
4275
3587
  }
4276
- const contents = {
3588
+ const contents = map({
4277
3589
  $metadata: deserializeMetadata(output),
4278
- assessment: undefined,
4279
- };
3590
+ });
4280
3591
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4281
- if (data.assessment !== undefined && data.assessment !== null) {
3592
+ if (data.assessment != null) {
4282
3593
  contents.assessment = deserializeAws_restJson1Assessment(data.assessment, context);
4283
3594
  }
4284
- return Promise.resolve(contents);
3595
+ return contents;
4285
3596
  };
4286
3597
  exports.deserializeAws_restJson1UpdateAssessmentCommand = deserializeAws_restJson1UpdateAssessmentCommand;
4287
3598
  const deserializeAws_restJson1UpdateAssessmentCommandError = async (output, context) => {
@@ -4289,7 +3600,6 @@ const deserializeAws_restJson1UpdateAssessmentCommandError = async (output, cont
4289
3600
  ...output,
4290
3601
  body: await parseBody(output.body, context),
4291
3602
  };
4292
- let response;
4293
3603
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4294
3604
  switch (errorCode) {
4295
3605
  case "AccessDeniedException":
@@ -4306,29 +3616,26 @@ const deserializeAws_restJson1UpdateAssessmentCommandError = async (output, cont
4306
3616
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4307
3617
  default:
4308
3618
  const parsedBody = parsedOutput.body;
4309
- const $metadata = deserializeMetadata(output);
4310
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4311
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
4312
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4313
- $fault: "client",
4314
- $metadata,
3619
+ (0, smithy_client_1.throwDefaultError)({
3620
+ output,
3621
+ parsedBody,
3622
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3623
+ errorCode,
4315
3624
  });
4316
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4317
3625
  }
4318
3626
  };
4319
3627
  const deserializeAws_restJson1UpdateAssessmentControlCommand = async (output, context) => {
4320
3628
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4321
3629
  return deserializeAws_restJson1UpdateAssessmentControlCommandError(output, context);
4322
3630
  }
4323
- const contents = {
3631
+ const contents = map({
4324
3632
  $metadata: deserializeMetadata(output),
4325
- control: undefined,
4326
- };
3633
+ });
4327
3634
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4328
- if (data.control !== undefined && data.control !== null) {
3635
+ if (data.control != null) {
4329
3636
  contents.control = deserializeAws_restJson1AssessmentControl(data.control, context);
4330
3637
  }
4331
- return Promise.resolve(contents);
3638
+ return contents;
4332
3639
  };
4333
3640
  exports.deserializeAws_restJson1UpdateAssessmentControlCommand = deserializeAws_restJson1UpdateAssessmentControlCommand;
4334
3641
  const deserializeAws_restJson1UpdateAssessmentControlCommandError = async (output, context) => {
@@ -4336,7 +3643,6 @@ const deserializeAws_restJson1UpdateAssessmentControlCommandError = async (outpu
4336
3643
  ...output,
4337
3644
  body: await parseBody(output.body, context),
4338
3645
  };
4339
- let response;
4340
3646
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4341
3647
  switch (errorCode) {
4342
3648
  case "AccessDeniedException":
@@ -4353,29 +3659,26 @@ const deserializeAws_restJson1UpdateAssessmentControlCommandError = async (outpu
4353
3659
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4354
3660
  default:
4355
3661
  const parsedBody = parsedOutput.body;
4356
- const $metadata = deserializeMetadata(output);
4357
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4358
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
4359
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4360
- $fault: "client",
4361
- $metadata,
3662
+ (0, smithy_client_1.throwDefaultError)({
3663
+ output,
3664
+ parsedBody,
3665
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3666
+ errorCode,
4362
3667
  });
4363
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4364
3668
  }
4365
3669
  };
4366
3670
  const deserializeAws_restJson1UpdateAssessmentControlSetStatusCommand = async (output, context) => {
4367
3671
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4368
3672
  return deserializeAws_restJson1UpdateAssessmentControlSetStatusCommandError(output, context);
4369
3673
  }
4370
- const contents = {
3674
+ const contents = map({
4371
3675
  $metadata: deserializeMetadata(output),
4372
- controlSet: undefined,
4373
- };
3676
+ });
4374
3677
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4375
- if (data.controlSet !== undefined && data.controlSet !== null) {
3678
+ if (data.controlSet != null) {
4376
3679
  contents.controlSet = deserializeAws_restJson1AssessmentControlSet(data.controlSet, context);
4377
3680
  }
4378
- return Promise.resolve(contents);
3681
+ return contents;
4379
3682
  };
4380
3683
  exports.deserializeAws_restJson1UpdateAssessmentControlSetStatusCommand = deserializeAws_restJson1UpdateAssessmentControlSetStatusCommand;
4381
3684
  const deserializeAws_restJson1UpdateAssessmentControlSetStatusCommandError = async (output, context) => {
@@ -4383,7 +3686,6 @@ const deserializeAws_restJson1UpdateAssessmentControlSetStatusCommandError = asy
4383
3686
  ...output,
4384
3687
  body: await parseBody(output.body, context),
4385
3688
  };
4386
- let response;
4387
3689
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4388
3690
  switch (errorCode) {
4389
3691
  case "AccessDeniedException":
@@ -4400,29 +3702,26 @@ const deserializeAws_restJson1UpdateAssessmentControlSetStatusCommandError = asy
4400
3702
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4401
3703
  default:
4402
3704
  const parsedBody = parsedOutput.body;
4403
- const $metadata = deserializeMetadata(output);
4404
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4405
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
4406
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4407
- $fault: "client",
4408
- $metadata,
3705
+ (0, smithy_client_1.throwDefaultError)({
3706
+ output,
3707
+ parsedBody,
3708
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3709
+ errorCode,
4409
3710
  });
4410
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4411
3711
  }
4412
3712
  };
4413
3713
  const deserializeAws_restJson1UpdateAssessmentFrameworkCommand = async (output, context) => {
4414
3714
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4415
3715
  return deserializeAws_restJson1UpdateAssessmentFrameworkCommandError(output, context);
4416
3716
  }
4417
- const contents = {
3717
+ const contents = map({
4418
3718
  $metadata: deserializeMetadata(output),
4419
- framework: undefined,
4420
- };
3719
+ });
4421
3720
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4422
- if (data.framework !== undefined && data.framework !== null) {
3721
+ if (data.framework != null) {
4423
3722
  contents.framework = deserializeAws_restJson1Framework(data.framework, context);
4424
3723
  }
4425
- return Promise.resolve(contents);
3724
+ return contents;
4426
3725
  };
4427
3726
  exports.deserializeAws_restJson1UpdateAssessmentFrameworkCommand = deserializeAws_restJson1UpdateAssessmentFrameworkCommand;
4428
3727
  const deserializeAws_restJson1UpdateAssessmentFrameworkCommandError = async (output, context) => {
@@ -4430,7 +3729,6 @@ const deserializeAws_restJson1UpdateAssessmentFrameworkCommandError = async (out
4430
3729
  ...output,
4431
3730
  body: await parseBody(output.body, context),
4432
3731
  };
4433
- let response;
4434
3732
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4435
3733
  switch (errorCode) {
4436
3734
  case "AccessDeniedException":
@@ -4447,29 +3745,26 @@ const deserializeAws_restJson1UpdateAssessmentFrameworkCommandError = async (out
4447
3745
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4448
3746
  default:
4449
3747
  const parsedBody = parsedOutput.body;
4450
- const $metadata = deserializeMetadata(output);
4451
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4452
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
4453
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4454
- $fault: "client",
4455
- $metadata,
3748
+ (0, smithy_client_1.throwDefaultError)({
3749
+ output,
3750
+ parsedBody,
3751
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3752
+ errorCode,
4456
3753
  });
4457
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4458
3754
  }
4459
3755
  };
4460
3756
  const deserializeAws_restJson1UpdateAssessmentFrameworkShareCommand = async (output, context) => {
4461
3757
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4462
3758
  return deserializeAws_restJson1UpdateAssessmentFrameworkShareCommandError(output, context);
4463
3759
  }
4464
- const contents = {
3760
+ const contents = map({
4465
3761
  $metadata: deserializeMetadata(output),
4466
- assessmentFrameworkShareRequest: undefined,
4467
- };
3762
+ });
4468
3763
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4469
- if (data.assessmentFrameworkShareRequest !== undefined && data.assessmentFrameworkShareRequest !== null) {
3764
+ if (data.assessmentFrameworkShareRequest != null) {
4470
3765
  contents.assessmentFrameworkShareRequest = deserializeAws_restJson1AssessmentFrameworkShareRequest(data.assessmentFrameworkShareRequest, context);
4471
3766
  }
4472
- return Promise.resolve(contents);
3767
+ return contents;
4473
3768
  };
4474
3769
  exports.deserializeAws_restJson1UpdateAssessmentFrameworkShareCommand = deserializeAws_restJson1UpdateAssessmentFrameworkShareCommand;
4475
3770
  const deserializeAws_restJson1UpdateAssessmentFrameworkShareCommandError = async (output, context) => {
@@ -4477,7 +3772,6 @@ const deserializeAws_restJson1UpdateAssessmentFrameworkShareCommandError = async
4477
3772
  ...output,
4478
3773
  body: await parseBody(output.body, context),
4479
3774
  };
4480
- let response;
4481
3775
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4482
3776
  switch (errorCode) {
4483
3777
  case "AccessDeniedException":
@@ -4494,29 +3788,26 @@ const deserializeAws_restJson1UpdateAssessmentFrameworkShareCommandError = async
4494
3788
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4495
3789
  default:
4496
3790
  const parsedBody = parsedOutput.body;
4497
- const $metadata = deserializeMetadata(output);
4498
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4499
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
4500
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4501
- $fault: "client",
4502
- $metadata,
3791
+ (0, smithy_client_1.throwDefaultError)({
3792
+ output,
3793
+ parsedBody,
3794
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3795
+ errorCode,
4503
3796
  });
4504
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4505
3797
  }
4506
3798
  };
4507
3799
  const deserializeAws_restJson1UpdateAssessmentStatusCommand = async (output, context) => {
4508
3800
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4509
3801
  return deserializeAws_restJson1UpdateAssessmentStatusCommandError(output, context);
4510
3802
  }
4511
- const contents = {
3803
+ const contents = map({
4512
3804
  $metadata: deserializeMetadata(output),
4513
- assessment: undefined,
4514
- };
3805
+ });
4515
3806
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4516
- if (data.assessment !== undefined && data.assessment !== null) {
3807
+ if (data.assessment != null) {
4517
3808
  contents.assessment = deserializeAws_restJson1Assessment(data.assessment, context);
4518
3809
  }
4519
- return Promise.resolve(contents);
3810
+ return contents;
4520
3811
  };
4521
3812
  exports.deserializeAws_restJson1UpdateAssessmentStatusCommand = deserializeAws_restJson1UpdateAssessmentStatusCommand;
4522
3813
  const deserializeAws_restJson1UpdateAssessmentStatusCommandError = async (output, context) => {
@@ -4524,7 +3815,6 @@ const deserializeAws_restJson1UpdateAssessmentStatusCommandError = async (output
4524
3815
  ...output,
4525
3816
  body: await parseBody(output.body, context),
4526
3817
  };
4527
- let response;
4528
3818
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4529
3819
  switch (errorCode) {
4530
3820
  case "AccessDeniedException":
@@ -4544,29 +3834,26 @@ const deserializeAws_restJson1UpdateAssessmentStatusCommandError = async (output
4544
3834
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4545
3835
  default:
4546
3836
  const parsedBody = parsedOutput.body;
4547
- const $metadata = deserializeMetadata(output);
4548
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4549
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
4550
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4551
- $fault: "client",
4552
- $metadata,
3837
+ (0, smithy_client_1.throwDefaultError)({
3838
+ output,
3839
+ parsedBody,
3840
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3841
+ errorCode,
4553
3842
  });
4554
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4555
3843
  }
4556
3844
  };
4557
3845
  const deserializeAws_restJson1UpdateControlCommand = async (output, context) => {
4558
3846
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4559
3847
  return deserializeAws_restJson1UpdateControlCommandError(output, context);
4560
3848
  }
4561
- const contents = {
3849
+ const contents = map({
4562
3850
  $metadata: deserializeMetadata(output),
4563
- control: undefined,
4564
- };
3851
+ });
4565
3852
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4566
- if (data.control !== undefined && data.control !== null) {
3853
+ if (data.control != null) {
4567
3854
  contents.control = deserializeAws_restJson1Control(data.control, context);
4568
3855
  }
4569
- return Promise.resolve(contents);
3856
+ return contents;
4570
3857
  };
4571
3858
  exports.deserializeAws_restJson1UpdateControlCommand = deserializeAws_restJson1UpdateControlCommand;
4572
3859
  const deserializeAws_restJson1UpdateControlCommandError = async (output, context) => {
@@ -4574,7 +3861,6 @@ const deserializeAws_restJson1UpdateControlCommandError = async (output, context
4574
3861
  ...output,
4575
3862
  body: await parseBody(output.body, context),
4576
3863
  };
4577
- let response;
4578
3864
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4579
3865
  switch (errorCode) {
4580
3866
  case "AccessDeniedException":
@@ -4591,29 +3877,26 @@ const deserializeAws_restJson1UpdateControlCommandError = async (output, context
4591
3877
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4592
3878
  default:
4593
3879
  const parsedBody = parsedOutput.body;
4594
- const $metadata = deserializeMetadata(output);
4595
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4596
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
4597
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4598
- $fault: "client",
4599
- $metadata,
3880
+ (0, smithy_client_1.throwDefaultError)({
3881
+ output,
3882
+ parsedBody,
3883
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3884
+ errorCode,
4600
3885
  });
4601
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4602
3886
  }
4603
3887
  };
4604
3888
  const deserializeAws_restJson1UpdateSettingsCommand = async (output, context) => {
4605
3889
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4606
3890
  return deserializeAws_restJson1UpdateSettingsCommandError(output, context);
4607
3891
  }
4608
- const contents = {
3892
+ const contents = map({
4609
3893
  $metadata: deserializeMetadata(output),
4610
- settings: undefined,
4611
- };
3894
+ });
4612
3895
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4613
- if (data.settings !== undefined && data.settings !== null) {
3896
+ if (data.settings != null) {
4614
3897
  contents.settings = deserializeAws_restJson1Settings(data.settings, context);
4615
3898
  }
4616
- return Promise.resolve(contents);
3899
+ return contents;
4617
3900
  };
4618
3901
  exports.deserializeAws_restJson1UpdateSettingsCommand = deserializeAws_restJson1UpdateSettingsCommand;
4619
3902
  const deserializeAws_restJson1UpdateSettingsCommandError = async (output, context) => {
@@ -4621,7 +3904,6 @@ const deserializeAws_restJson1UpdateSettingsCommandError = async (output, contex
4621
3904
  ...output,
4622
3905
  body: await parseBody(output.body, context),
4623
3906
  };
4624
- let response;
4625
3907
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4626
3908
  switch (errorCode) {
4627
3909
  case "AccessDeniedException":
@@ -4635,45 +3917,38 @@ const deserializeAws_restJson1UpdateSettingsCommandError = async (output, contex
4635
3917
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4636
3918
  default:
4637
3919
  const parsedBody = parsedOutput.body;
4638
- const $metadata = deserializeMetadata(output);
4639
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4640
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
4641
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4642
- $fault: "client",
4643
- $metadata,
3920
+ (0, smithy_client_1.throwDefaultError)({
3921
+ output,
3922
+ parsedBody,
3923
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3924
+ errorCode,
4644
3925
  });
4645
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4646
3926
  }
4647
3927
  };
4648
3928
  const deserializeAws_restJson1ValidateAssessmentReportIntegrityCommand = async (output, context) => {
4649
3929
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4650
3930
  return deserializeAws_restJson1ValidateAssessmentReportIntegrityCommandError(output, context);
4651
3931
  }
4652
- const contents = {
3932
+ const contents = map({
4653
3933
  $metadata: deserializeMetadata(output),
4654
- signatureAlgorithm: undefined,
4655
- signatureDateTime: undefined,
4656
- signatureKeyId: undefined,
4657
- signatureValid: undefined,
4658
- validationErrors: undefined,
4659
- };
3934
+ });
4660
3935
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4661
- if (data.signatureAlgorithm !== undefined && data.signatureAlgorithm !== null) {
3936
+ if (data.signatureAlgorithm != null) {
4662
3937
  contents.signatureAlgorithm = (0, smithy_client_1.expectString)(data.signatureAlgorithm);
4663
3938
  }
4664
- if (data.signatureDateTime !== undefined && data.signatureDateTime !== null) {
3939
+ if (data.signatureDateTime != null) {
4665
3940
  contents.signatureDateTime = (0, smithy_client_1.expectString)(data.signatureDateTime);
4666
3941
  }
4667
- if (data.signatureKeyId !== undefined && data.signatureKeyId !== null) {
3942
+ if (data.signatureKeyId != null) {
4668
3943
  contents.signatureKeyId = (0, smithy_client_1.expectString)(data.signatureKeyId);
4669
3944
  }
4670
- if (data.signatureValid !== undefined && data.signatureValid !== null) {
3945
+ if (data.signatureValid != null) {
4671
3946
  contents.signatureValid = (0, smithy_client_1.expectBoolean)(data.signatureValid);
4672
3947
  }
4673
- if (data.validationErrors !== undefined && data.validationErrors !== null) {
3948
+ if (data.validationErrors != null) {
4674
3949
  contents.validationErrors = deserializeAws_restJson1ValidationErrors(data.validationErrors, context);
4675
3950
  }
4676
- return Promise.resolve(contents);
3951
+ return contents;
4677
3952
  };
4678
3953
  exports.deserializeAws_restJson1ValidateAssessmentReportIntegrityCommand = deserializeAws_restJson1ValidateAssessmentReportIntegrityCommand;
4679
3954
  const deserializeAws_restJson1ValidateAssessmentReportIntegrityCommandError = async (output, context) => {
@@ -4681,7 +3956,6 @@ const deserializeAws_restJson1ValidateAssessmentReportIntegrityCommandError = as
4681
3956
  ...output,
4682
3957
  body: await parseBody(output.body, context),
4683
3958
  };
4684
- let response;
4685
3959
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4686
3960
  switch (errorCode) {
4687
3961
  case "AccessDeniedException":
@@ -4698,20 +3972,19 @@ const deserializeAws_restJson1ValidateAssessmentReportIntegrityCommandError = as
4698
3972
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4699
3973
  default:
4700
3974
  const parsedBody = parsedOutput.body;
4701
- const $metadata = deserializeMetadata(output);
4702
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4703
- response = new AuditManagerServiceException_1.AuditManagerServiceException({
4704
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4705
- $fault: "client",
4706
- $metadata,
3975
+ (0, smithy_client_1.throwDefaultError)({
3976
+ output,
3977
+ parsedBody,
3978
+ exceptionCtor: AuditManagerServiceException_1.AuditManagerServiceException,
3979
+ errorCode,
4707
3980
  });
4708
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4709
3981
  }
4710
3982
  };
3983
+ const map = smithy_client_1.map;
4711
3984
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
4712
- const contents = {};
3985
+ const contents = map({});
4713
3986
  const data = parsedOutput.body;
4714
- if (data.message !== undefined && data.message !== null) {
3987
+ if (data.message != null) {
4715
3988
  contents.message = (0, smithy_client_1.expectString)(data.message);
4716
3989
  }
4717
3990
  const exception = new models_0_1.AccessDeniedException({
@@ -4721,9 +3994,9 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
4721
3994
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
4722
3995
  };
4723
3996
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
4724
- const contents = {};
3997
+ const contents = map({});
4725
3998
  const data = parsedOutput.body;
4726
- if (data.message !== undefined && data.message !== null) {
3999
+ if (data.message != null) {
4727
4000
  contents.message = (0, smithy_client_1.expectString)(data.message);
4728
4001
  }
4729
4002
  const exception = new models_0_1.InternalServerException({
@@ -4733,15 +4006,15 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
4733
4006
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
4734
4007
  };
4735
4008
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
4736
- const contents = {};
4009
+ const contents = map({});
4737
4010
  const data = parsedOutput.body;
4738
- if (data.message !== undefined && data.message !== null) {
4011
+ if (data.message != null) {
4739
4012
  contents.message = (0, smithy_client_1.expectString)(data.message);
4740
4013
  }
4741
- if (data.resourceId !== undefined && data.resourceId !== null) {
4014
+ if (data.resourceId != null) {
4742
4015
  contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
4743
4016
  }
4744
- if (data.resourceType !== undefined && data.resourceType !== null) {
4017
+ if (data.resourceType != null) {
4745
4018
  contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
4746
4019
  }
4747
4020
  const exception = new models_0_1.ResourceNotFoundException({
@@ -4751,9 +4024,9 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
4751
4024
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
4752
4025
  };
4753
4026
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
4754
- const contents = {};
4027
+ const contents = map({});
4755
4028
  const data = parsedOutput.body;
4756
- if (data.message !== undefined && data.message !== null) {
4029
+ if (data.message != null) {
4757
4030
  contents.message = (0, smithy_client_1.expectString)(data.message);
4758
4031
  }
4759
4032
  const exception = new models_0_1.ServiceQuotaExceededException({
@@ -4763,9 +4036,9 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
4763
4036
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
4764
4037
  };
4765
4038
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
4766
- const contents = {};
4039
+ const contents = map({});
4767
4040
  const data = parsedOutput.body;
4768
- if (data.message !== undefined && data.message !== null) {
4041
+ if (data.message != null) {
4769
4042
  contents.message = (0, smithy_client_1.expectString)(data.message);
4770
4043
  }
4771
4044
  const exception = new models_0_1.ThrottlingException({
@@ -4775,15 +4048,15 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
4775
4048
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
4776
4049
  };
4777
4050
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
4778
- const contents = {};
4051
+ const contents = map({});
4779
4052
  const data = parsedOutput.body;
4780
- if (data.fields !== undefined && data.fields !== null) {
4053
+ if (data.fields != null) {
4781
4054
  contents.fields = deserializeAws_restJson1ValidationExceptionFieldList(data.fields, context);
4782
4055
  }
4783
- if (data.message !== undefined && data.message !== null) {
4056
+ if (data.message != null) {
4784
4057
  contents.message = (0, smithy_client_1.expectString)(data.message);
4785
4058
  }
4786
- if (data.reason !== undefined && data.reason !== null) {
4059
+ if (data.reason != null) {
4787
4060
  contents.reason = (0, smithy_client_1.expectString)(data.reason);
4788
4061
  }
4789
4062
  const exception = new models_0_1.ValidationException({
@@ -4809,9 +4082,6 @@ const serializeAws_restJson1AWSAccounts = (input, context) => {
4809
4082
  return input
4810
4083
  .filter((e) => e != null)
4811
4084
  .map((entry) => {
4812
- if (entry === null) {
4813
- return null;
4814
- }
4815
4085
  return serializeAws_restJson1AWSAccount(entry, context);
4816
4086
  });
4817
4087
  };
@@ -4824,9 +4094,6 @@ const serializeAws_restJson1AWSServices = (input, context) => {
4824
4094
  return input
4825
4095
  .filter((e) => e != null)
4826
4096
  .map((entry) => {
4827
- if (entry === null) {
4828
- return null;
4829
- }
4830
4097
  return serializeAws_restJson1AWSService(entry, context);
4831
4098
  });
4832
4099
  };
@@ -4848,9 +4115,6 @@ const serializeAws_restJson1ControlMappingSources = (input, context) => {
4848
4115
  return input
4849
4116
  .filter((e) => e != null)
4850
4117
  .map((entry) => {
4851
- if (entry === null) {
4852
- return null;
4853
- }
4854
4118
  return serializeAws_restJson1ControlMappingSource(entry, context);
4855
4119
  });
4856
4120
  };
@@ -4863,9 +4127,6 @@ const serializeAws_restJson1CreateAssessmentFrameworkControls = (input, context)
4863
4127
  return input
4864
4128
  .filter((e) => e != null)
4865
4129
  .map((entry) => {
4866
- if (entry === null) {
4867
- return null;
4868
- }
4869
4130
  return serializeAws_restJson1CreateAssessmentFrameworkControl(entry, context);
4870
4131
  });
4871
4132
  };
@@ -4881,9 +4142,6 @@ const serializeAws_restJson1CreateAssessmentFrameworkControlSets = (input, conte
4881
4142
  return input
4882
4143
  .filter((e) => e != null)
4883
4144
  .map((entry) => {
4884
- if (entry === null) {
4885
- return null;
4886
- }
4887
4145
  return serializeAws_restJson1CreateAssessmentFrameworkControlSet(entry, context);
4888
4146
  });
4889
4147
  };
@@ -4904,9 +4162,6 @@ const serializeAws_restJson1CreateControlMappingSources = (input, context) => {
4904
4162
  return input
4905
4163
  .filter((e) => e != null)
4906
4164
  .map((entry) => {
4907
- if (entry === null) {
4908
- return null;
4909
- }
4910
4165
  return serializeAws_restJson1CreateControlMappingSource(entry, context);
4911
4166
  });
4912
4167
  };
@@ -4922,9 +4177,6 @@ const serializeAws_restJson1CreateDelegationRequests = (input, context) => {
4922
4177
  return input
4923
4178
  .filter((e) => e != null)
4924
4179
  .map((entry) => {
4925
- if (entry === null) {
4926
- return null;
4927
- }
4928
4180
  return serializeAws_restJson1CreateDelegationRequest(entry, context);
4929
4181
  });
4930
4182
  };
@@ -4932,9 +4184,6 @@ const serializeAws_restJson1DelegationIds = (input, context) => {
4932
4184
  return input
4933
4185
  .filter((e) => e != null)
4934
4186
  .map((entry) => {
4935
- if (entry === null) {
4936
- return null;
4937
- }
4938
4187
  return entry;
4939
4188
  });
4940
4189
  };
@@ -4942,9 +4191,6 @@ const serializeAws_restJson1EvidenceIds = (input, context) => {
4942
4191
  return input
4943
4192
  .filter((e) => e != null)
4944
4193
  .map((entry) => {
4945
- if (entry === null) {
4946
- return null;
4947
- }
4948
4194
  return entry;
4949
4195
  });
4950
4196
  };
@@ -4957,9 +4203,6 @@ const serializeAws_restJson1ManualEvidenceList = (input, context) => {
4957
4203
  return input
4958
4204
  .filter((e) => e != null)
4959
4205
  .map((entry) => {
4960
- if (entry === null) {
4961
- return null;
4962
- }
4963
4206
  return serializeAws_restJson1ManualEvidence(entry, context);
4964
4207
  });
4965
4208
  };
@@ -4973,9 +4216,6 @@ const serializeAws_restJson1Roles = (input, context) => {
4973
4216
  return input
4974
4217
  .filter((e) => e != null)
4975
4218
  .map((entry) => {
4976
- if (entry === null) {
4977
- return null;
4978
- }
4979
4219
  return serializeAws_restJson1Role(entry, context);
4980
4220
  });
4981
4221
  };
@@ -5015,9 +4255,6 @@ const serializeAws_restJson1UpdateAssessmentFrameworkControlSets = (input, conte
5015
4255
  return input
5016
4256
  .filter((e) => e != null)
5017
4257
  .map((entry) => {
5018
- if (entry === null) {
5019
- return null;
5020
- }
5021
4258
  return serializeAws_restJson1UpdateAssessmentFrameworkControlSet(entry, context);
5022
4259
  });
5023
4260
  };