@aws-sdk/client-wisdom 3.312.0 → 3.316.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, limitedParseDouble as __limitedParseDouble, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, limitedParseDouble as __limitedParseDouble, map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { v4 as generateIdempotencyToken } from "uuid";
4
- import { AccessDeniedException, AssistantAssociationInputData, ConflictException, PreconditionFailedException, ResourceNotFoundException, ServiceQuotaExceededException, SourceConfiguration, TooManyTagsException, ValidationException, } from "../models/models_0";
4
+ import { AccessDeniedException, ConflictException, PreconditionFailedException, ResourceNotFoundException, ServiceQuotaExceededException, TooManyTagsException, ValidationException, } from "../models/models_0";
5
5
  import { WisdomServiceException as __BaseException } from "../models/WisdomServiceException";
6
6
  export const se_CreateAssistantCommand = async (input, context) => {
7
7
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -10,16 +10,14 @@ export const se_CreateAssistantCommand = async (input, context) => {
10
10
  };
11
11
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants";
12
12
  let body;
13
- body = JSON.stringify({
14
- clientToken: input.clientToken ?? generateIdempotencyToken(),
15
- ...(input.description != null && { description: input.description }),
16
- ...(input.name != null && { name: input.name }),
17
- ...(input.serverSideEncryptionConfiguration != null && {
18
- serverSideEncryptionConfiguration: se_ServerSideEncryptionConfiguration(input.serverSideEncryptionConfiguration, context),
19
- }),
20
- ...(input.tags != null && { tags: se_Tags(input.tags, context) }),
21
- ...(input.type != null && { type: input.type }),
22
- });
13
+ body = JSON.stringify(take(input, {
14
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
15
+ description: [],
16
+ name: [],
17
+ serverSideEncryptionConfiguration: (_) => _json(_),
18
+ tags: (_) => _json(_),
19
+ type: [],
20
+ }));
23
21
  return new __HttpRequest({
24
22
  protocol,
25
23
  hostname,
@@ -38,12 +36,12 @@ export const se_CreateAssistantAssociationCommand = async (input, context) => {
38
36
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/associations";
39
37
  resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
40
38
  let body;
41
- body = JSON.stringify({
42
- ...(input.association != null && { association: se_AssistantAssociationInputData(input.association, context) }),
43
- ...(input.associationType != null && { associationType: input.associationType }),
44
- clientToken: input.clientToken ?? generateIdempotencyToken(),
45
- ...(input.tags != null && { tags: se_Tags(input.tags, context) }),
46
- });
39
+ body = JSON.stringify(take(input, {
40
+ association: (_) => _json(_),
41
+ associationType: [],
42
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
43
+ tags: (_) => _json(_),
44
+ }));
47
45
  return new __HttpRequest({
48
46
  protocol,
49
47
  hostname,
@@ -63,15 +61,15 @@ export const se_CreateContentCommand = async (input, context) => {
63
61
  "/knowledgeBases/{knowledgeBaseId}/contents";
64
62
  resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
65
63
  let body;
66
- body = JSON.stringify({
67
- clientToken: input.clientToken ?? generateIdempotencyToken(),
68
- ...(input.metadata != null && { metadata: se_ContentMetadata(input.metadata, context) }),
69
- ...(input.name != null && { name: input.name }),
70
- ...(input.overrideLinkOutUri != null && { overrideLinkOutUri: input.overrideLinkOutUri }),
71
- ...(input.tags != null && { tags: se_Tags(input.tags, context) }),
72
- ...(input.title != null && { title: input.title }),
73
- ...(input.uploadId != null && { uploadId: input.uploadId }),
74
- });
64
+ body = JSON.stringify(take(input, {
65
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
66
+ metadata: (_) => _json(_),
67
+ name: [],
68
+ overrideLinkOutUri: [],
69
+ tags: (_) => _json(_),
70
+ title: [],
71
+ uploadId: [],
72
+ }));
75
73
  return new __HttpRequest({
76
74
  protocol,
77
75
  hostname,
@@ -89,22 +87,16 @@ export const se_CreateKnowledgeBaseCommand = async (input, context) => {
89
87
  };
90
88
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases";
91
89
  let body;
92
- body = JSON.stringify({
93
- clientToken: input.clientToken ?? generateIdempotencyToken(),
94
- ...(input.description != null && { description: input.description }),
95
- ...(input.knowledgeBaseType != null && { knowledgeBaseType: input.knowledgeBaseType }),
96
- ...(input.name != null && { name: input.name }),
97
- ...(input.renderingConfiguration != null && {
98
- renderingConfiguration: se_RenderingConfiguration(input.renderingConfiguration, context),
99
- }),
100
- ...(input.serverSideEncryptionConfiguration != null && {
101
- serverSideEncryptionConfiguration: se_ServerSideEncryptionConfiguration(input.serverSideEncryptionConfiguration, context),
102
- }),
103
- ...(input.sourceConfiguration != null && {
104
- sourceConfiguration: se_SourceConfiguration(input.sourceConfiguration, context),
105
- }),
106
- ...(input.tags != null && { tags: se_Tags(input.tags, context) }),
107
- });
90
+ body = JSON.stringify(take(input, {
91
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
92
+ description: [],
93
+ knowledgeBaseType: [],
94
+ name: [],
95
+ renderingConfiguration: (_) => _json(_),
96
+ serverSideEncryptionConfiguration: (_) => _json(_),
97
+ sourceConfiguration: (_) => _json(_),
98
+ tags: (_) => _json(_),
99
+ }));
108
100
  return new __HttpRequest({
109
101
  protocol,
110
102
  hostname,
@@ -123,12 +115,12 @@ export const se_CreateSessionCommand = async (input, context) => {
123
115
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/sessions";
124
116
  resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
125
117
  let body;
126
- body = JSON.stringify({
127
- clientToken: input.clientToken ?? generateIdempotencyToken(),
128
- ...(input.description != null && { description: input.description }),
129
- ...(input.name != null && { name: input.name }),
130
- ...(input.tags != null && { tags: se_Tags(input.tags, context) }),
131
- });
118
+ body = JSON.stringify(take(input, {
119
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
120
+ description: [],
121
+ name: [],
122
+ tags: (_) => _json(_),
123
+ }));
132
124
  return new __HttpRequest({
133
125
  protocol,
134
126
  hostname,
@@ -443,11 +435,9 @@ export const se_NotifyRecommendationsReceivedCommand = async (input, context) =>
443
435
  resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
444
436
  resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
445
437
  let body;
446
- body = JSON.stringify({
447
- ...(input.recommendationIds != null && {
448
- recommendationIds: se_RecommendationIdList(input.recommendationIds, context),
449
- }),
450
- });
438
+ body = JSON.stringify(take(input, {
439
+ recommendationIds: (_) => _json(_),
440
+ }));
451
441
  return new __HttpRequest({
452
442
  protocol,
453
443
  hostname,
@@ -466,11 +456,11 @@ export const se_QueryAssistantCommand = async (input, context) => {
466
456
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/query";
467
457
  resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
468
458
  let body;
469
- body = JSON.stringify({
470
- ...(input.maxResults != null && { maxResults: input.maxResults }),
471
- ...(input.nextToken != null && { nextToken: input.nextToken }),
472
- ...(input.queryText != null && { queryText: input.queryText }),
473
- });
459
+ body = JSON.stringify(take(input, {
460
+ maxResults: [],
461
+ nextToken: [],
462
+ queryText: [],
463
+ }));
474
464
  return new __HttpRequest({
475
465
  protocol,
476
466
  hostname,
@@ -510,9 +500,9 @@ export const se_SearchContentCommand = async (input, context) => {
510
500
  maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
511
501
  });
512
502
  let body;
513
- body = JSON.stringify({
514
- ...(input.searchExpression != null && { searchExpression: se_SearchExpression(input.searchExpression, context) }),
515
- });
503
+ body = JSON.stringify(take(input, {
504
+ searchExpression: (_) => _json(_),
505
+ }));
516
506
  return new __HttpRequest({
517
507
  protocol,
518
508
  hostname,
@@ -536,9 +526,9 @@ export const se_SearchSessionsCommand = async (input, context) => {
536
526
  maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
537
527
  });
538
528
  let body;
539
- body = JSON.stringify({
540
- ...(input.searchExpression != null && { searchExpression: se_SearchExpression(input.searchExpression, context) }),
541
- });
529
+ body = JSON.stringify(take(input, {
530
+ searchExpression: (_) => _json(_),
531
+ }));
542
532
  return new __HttpRequest({
543
533
  protocol,
544
534
  hostname,
@@ -558,9 +548,9 @@ export const se_StartContentUploadCommand = async (input, context) => {
558
548
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases/{knowledgeBaseId}/upload";
559
549
  resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
560
550
  let body;
561
- body = JSON.stringify({
562
- ...(input.contentType != null && { contentType: input.contentType }),
563
- });
551
+ body = JSON.stringify(take(input, {
552
+ contentType: [],
553
+ }));
564
554
  return new __HttpRequest({
565
555
  protocol,
566
556
  hostname,
@@ -579,9 +569,9 @@ export const se_TagResourceCommand = async (input, context) => {
579
569
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
580
570
  resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
581
571
  let body;
582
- body = JSON.stringify({
583
- ...(input.tags != null && { tags: se_Tags(input.tags, context) }),
584
- });
572
+ body = JSON.stringify(take(input, {
573
+ tags: (_) => _json(_),
574
+ }));
585
575
  return new __HttpRequest({
586
576
  protocol,
587
577
  hostname,
@@ -625,14 +615,14 @@ export const se_UpdateContentCommand = async (input, context) => {
625
615
  resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
626
616
  resolvedPath = __resolvedPath(resolvedPath, input, "contentId", () => input.contentId, "{contentId}", false);
627
617
  let body;
628
- body = JSON.stringify({
629
- ...(input.metadata != null && { metadata: se_ContentMetadata(input.metadata, context) }),
630
- ...(input.overrideLinkOutUri != null && { overrideLinkOutUri: input.overrideLinkOutUri }),
631
- ...(input.removeOverrideLinkOutUri != null && { removeOverrideLinkOutUri: input.removeOverrideLinkOutUri }),
632
- ...(input.revisionId != null && { revisionId: input.revisionId }),
633
- ...(input.title != null && { title: input.title }),
634
- ...(input.uploadId != null && { uploadId: input.uploadId }),
635
- });
618
+ body = JSON.stringify(take(input, {
619
+ metadata: (_) => _json(_),
620
+ overrideLinkOutUri: [],
621
+ removeOverrideLinkOutUri: [],
622
+ revisionId: [],
623
+ title: [],
624
+ uploadId: [],
625
+ }));
636
626
  return new __HttpRequest({
637
627
  protocol,
638
628
  hostname,
@@ -652,9 +642,9 @@ export const se_UpdateKnowledgeBaseTemplateUriCommand = async (input, context) =
652
642
  "/knowledgeBases/{knowledgeBaseId}/templateUri";
653
643
  resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
654
644
  let body;
655
- body = JSON.stringify({
656
- ...(input.templateUri != null && { templateUri: input.templateUri }),
657
- });
645
+ body = JSON.stringify(take(input, {
646
+ templateUri: [],
647
+ }));
658
648
  return new __HttpRequest({
659
649
  protocol,
660
650
  hostname,
@@ -673,9 +663,10 @@ export const de_CreateAssistantCommand = async (output, context) => {
673
663
  $metadata: deserializeMetadata(output),
674
664
  });
675
665
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
676
- if (data.assistant != null) {
677
- contents.assistant = de_AssistantData(data.assistant, context);
678
- }
666
+ const doc = take(data, {
667
+ assistant: _json,
668
+ });
669
+ Object.assign(contents, doc);
679
670
  return contents;
680
671
  };
681
672
  const de_CreateAssistantCommandError = async (output, context) => {
@@ -699,10 +690,9 @@ const de_CreateAssistantCommandError = async (output, context) => {
699
690
  throw await de_ValidationExceptionRes(parsedOutput, context);
700
691
  default:
701
692
  const parsedBody = parsedOutput.body;
702
- throwDefaultError({
693
+ return throwDefaultError({
703
694
  output,
704
695
  parsedBody,
705
- exceptionCtor: __BaseException,
706
696
  errorCode,
707
697
  });
708
698
  }
@@ -715,9 +705,10 @@ export const de_CreateAssistantAssociationCommand = async (output, context) => {
715
705
  $metadata: deserializeMetadata(output),
716
706
  });
717
707
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
718
- if (data.assistantAssociation != null) {
719
- contents.assistantAssociation = de_AssistantAssociationData(data.assistantAssociation, context);
720
- }
708
+ const doc = take(data, {
709
+ assistantAssociation: _json,
710
+ });
711
+ Object.assign(contents, doc);
721
712
  return contents;
722
713
  };
723
714
  const de_CreateAssistantAssociationCommandError = async (output, context) => {
@@ -744,10 +735,9 @@ const de_CreateAssistantAssociationCommandError = async (output, context) => {
744
735
  throw await de_ValidationExceptionRes(parsedOutput, context);
745
736
  default:
746
737
  const parsedBody = parsedOutput.body;
747
- throwDefaultError({
738
+ return throwDefaultError({
748
739
  output,
749
740
  parsedBody,
750
- exceptionCtor: __BaseException,
751
741
  errorCode,
752
742
  });
753
743
  }
@@ -760,9 +750,10 @@ export const de_CreateContentCommand = async (output, context) => {
760
750
  $metadata: deserializeMetadata(output),
761
751
  });
762
752
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
763
- if (data.content != null) {
764
- contents.content = de_ContentData(data.content, context);
765
- }
753
+ const doc = take(data, {
754
+ content: (_) => de_ContentData(_, context),
755
+ });
756
+ Object.assign(contents, doc);
766
757
  return contents;
767
758
  };
768
759
  const de_CreateContentCommandError = async (output, context) => {
@@ -789,10 +780,9 @@ const de_CreateContentCommandError = async (output, context) => {
789
780
  throw await de_ValidationExceptionRes(parsedOutput, context);
790
781
  default:
791
782
  const parsedBody = parsedOutput.body;
792
- throwDefaultError({
783
+ return throwDefaultError({
793
784
  output,
794
785
  parsedBody,
795
- exceptionCtor: __BaseException,
796
786
  errorCode,
797
787
  });
798
788
  }
@@ -805,9 +795,10 @@ export const de_CreateKnowledgeBaseCommand = async (output, context) => {
805
795
  $metadata: deserializeMetadata(output),
806
796
  });
807
797
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
808
- if (data.knowledgeBase != null) {
809
- contents.knowledgeBase = de_KnowledgeBaseData(data.knowledgeBase, context);
810
- }
798
+ const doc = take(data, {
799
+ knowledgeBase: (_) => de_KnowledgeBaseData(_, context),
800
+ });
801
+ Object.assign(contents, doc);
811
802
  return contents;
812
803
  };
813
804
  const de_CreateKnowledgeBaseCommandError = async (output, context) => {
@@ -831,10 +822,9 @@ const de_CreateKnowledgeBaseCommandError = async (output, context) => {
831
822
  throw await de_ValidationExceptionRes(parsedOutput, context);
832
823
  default:
833
824
  const parsedBody = parsedOutput.body;
834
- throwDefaultError({
825
+ return throwDefaultError({
835
826
  output,
836
827
  parsedBody,
837
- exceptionCtor: __BaseException,
838
828
  errorCode,
839
829
  });
840
830
  }
@@ -847,9 +837,10 @@ export const de_CreateSessionCommand = async (output, context) => {
847
837
  $metadata: deserializeMetadata(output),
848
838
  });
849
839
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
850
- if (data.session != null) {
851
- contents.session = de_SessionData(data.session, context);
852
- }
840
+ const doc = take(data, {
841
+ session: _json,
842
+ });
843
+ Object.assign(contents, doc);
853
844
  return contents;
854
845
  };
855
846
  const de_CreateSessionCommandError = async (output, context) => {
@@ -870,10 +861,9 @@ const de_CreateSessionCommandError = async (output, context) => {
870
861
  throw await de_ValidationExceptionRes(parsedOutput, context);
871
862
  default:
872
863
  const parsedBody = parsedOutput.body;
873
- throwDefaultError({
864
+ return throwDefaultError({
874
865
  output,
875
866
  parsedBody,
876
- exceptionCtor: __BaseException,
877
867
  errorCode,
878
868
  });
879
869
  }
@@ -906,10 +896,9 @@ const de_DeleteAssistantCommandError = async (output, context) => {
906
896
  throw await de_ValidationExceptionRes(parsedOutput, context);
907
897
  default:
908
898
  const parsedBody = parsedOutput.body;
909
- throwDefaultError({
899
+ return throwDefaultError({
910
900
  output,
911
901
  parsedBody,
912
- exceptionCtor: __BaseException,
913
902
  errorCode,
914
903
  });
915
904
  }
@@ -942,10 +931,9 @@ const de_DeleteAssistantAssociationCommandError = async (output, context) => {
942
931
  throw await de_ValidationExceptionRes(parsedOutput, context);
943
932
  default:
944
933
  const parsedBody = parsedOutput.body;
945
- throwDefaultError({
934
+ return throwDefaultError({
946
935
  output,
947
936
  parsedBody,
948
- exceptionCtor: __BaseException,
949
937
  errorCode,
950
938
  });
951
939
  }
@@ -978,10 +966,9 @@ const de_DeleteContentCommandError = async (output, context) => {
978
966
  throw await de_ValidationExceptionRes(parsedOutput, context);
979
967
  default:
980
968
  const parsedBody = parsedOutput.body;
981
- throwDefaultError({
969
+ return throwDefaultError({
982
970
  output,
983
971
  parsedBody,
984
- exceptionCtor: __BaseException,
985
972
  errorCode,
986
973
  });
987
974
  }
@@ -1017,10 +1004,9 @@ const de_DeleteKnowledgeBaseCommandError = async (output, context) => {
1017
1004
  throw await de_ValidationExceptionRes(parsedOutput, context);
1018
1005
  default:
1019
1006
  const parsedBody = parsedOutput.body;
1020
- throwDefaultError({
1007
+ return throwDefaultError({
1021
1008
  output,
1022
1009
  parsedBody,
1023
- exceptionCtor: __BaseException,
1024
1010
  errorCode,
1025
1011
  });
1026
1012
  }
@@ -1033,9 +1019,10 @@ export const de_GetAssistantCommand = async (output, context) => {
1033
1019
  $metadata: deserializeMetadata(output),
1034
1020
  });
1035
1021
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1036
- if (data.assistant != null) {
1037
- contents.assistant = de_AssistantData(data.assistant, context);
1038
- }
1022
+ const doc = take(data, {
1023
+ assistant: _json,
1024
+ });
1025
+ Object.assign(contents, doc);
1039
1026
  return contents;
1040
1027
  };
1041
1028
  const de_GetAssistantCommandError = async (output, context) => {
@@ -1056,10 +1043,9 @@ const de_GetAssistantCommandError = async (output, context) => {
1056
1043
  throw await de_ValidationExceptionRes(parsedOutput, context);
1057
1044
  default:
1058
1045
  const parsedBody = parsedOutput.body;
1059
- throwDefaultError({
1046
+ return throwDefaultError({
1060
1047
  output,
1061
1048
  parsedBody,
1062
- exceptionCtor: __BaseException,
1063
1049
  errorCode,
1064
1050
  });
1065
1051
  }
@@ -1072,9 +1058,10 @@ export const de_GetAssistantAssociationCommand = async (output, context) => {
1072
1058
  $metadata: deserializeMetadata(output),
1073
1059
  });
1074
1060
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1075
- if (data.assistantAssociation != null) {
1076
- contents.assistantAssociation = de_AssistantAssociationData(data.assistantAssociation, context);
1077
- }
1061
+ const doc = take(data, {
1062
+ assistantAssociation: _json,
1063
+ });
1064
+ Object.assign(contents, doc);
1078
1065
  return contents;
1079
1066
  };
1080
1067
  const de_GetAssistantAssociationCommandError = async (output, context) => {
@@ -1095,10 +1082,9 @@ const de_GetAssistantAssociationCommandError = async (output, context) => {
1095
1082
  throw await de_ValidationExceptionRes(parsedOutput, context);
1096
1083
  default:
1097
1084
  const parsedBody = parsedOutput.body;
1098
- throwDefaultError({
1085
+ return throwDefaultError({
1099
1086
  output,
1100
1087
  parsedBody,
1101
- exceptionCtor: __BaseException,
1102
1088
  errorCode,
1103
1089
  });
1104
1090
  }
@@ -1111,9 +1097,10 @@ export const de_GetContentCommand = async (output, context) => {
1111
1097
  $metadata: deserializeMetadata(output),
1112
1098
  });
1113
1099
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1114
- if (data.content != null) {
1115
- contents.content = de_ContentData(data.content, context);
1116
- }
1100
+ const doc = take(data, {
1101
+ content: (_) => de_ContentData(_, context),
1102
+ });
1103
+ Object.assign(contents, doc);
1117
1104
  return contents;
1118
1105
  };
1119
1106
  const de_GetContentCommandError = async (output, context) => {
@@ -1134,10 +1121,9 @@ const de_GetContentCommandError = async (output, context) => {
1134
1121
  throw await de_ValidationExceptionRes(parsedOutput, context);
1135
1122
  default:
1136
1123
  const parsedBody = parsedOutput.body;
1137
- throwDefaultError({
1124
+ return throwDefaultError({
1138
1125
  output,
1139
1126
  parsedBody,
1140
- exceptionCtor: __BaseException,
1141
1127
  errorCode,
1142
1128
  });
1143
1129
  }
@@ -1150,9 +1136,10 @@ export const de_GetContentSummaryCommand = async (output, context) => {
1150
1136
  $metadata: deserializeMetadata(output),
1151
1137
  });
1152
1138
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1153
- if (data.contentSummary != null) {
1154
- contents.contentSummary = de_ContentSummary(data.contentSummary, context);
1155
- }
1139
+ const doc = take(data, {
1140
+ contentSummary: _json,
1141
+ });
1142
+ Object.assign(contents, doc);
1156
1143
  return contents;
1157
1144
  };
1158
1145
  const de_GetContentSummaryCommandError = async (output, context) => {
@@ -1173,10 +1160,9 @@ const de_GetContentSummaryCommandError = async (output, context) => {
1173
1160
  throw await de_ValidationExceptionRes(parsedOutput, context);
1174
1161
  default:
1175
1162
  const parsedBody = parsedOutput.body;
1176
- throwDefaultError({
1163
+ return throwDefaultError({
1177
1164
  output,
1178
1165
  parsedBody,
1179
- exceptionCtor: __BaseException,
1180
1166
  errorCode,
1181
1167
  });
1182
1168
  }
@@ -1189,9 +1175,10 @@ export const de_GetKnowledgeBaseCommand = async (output, context) => {
1189
1175
  $metadata: deserializeMetadata(output),
1190
1176
  });
1191
1177
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1192
- if (data.knowledgeBase != null) {
1193
- contents.knowledgeBase = de_KnowledgeBaseData(data.knowledgeBase, context);
1194
- }
1178
+ const doc = take(data, {
1179
+ knowledgeBase: (_) => de_KnowledgeBaseData(_, context),
1180
+ });
1181
+ Object.assign(contents, doc);
1195
1182
  return contents;
1196
1183
  };
1197
1184
  const de_GetKnowledgeBaseCommandError = async (output, context) => {
@@ -1212,10 +1199,9 @@ const de_GetKnowledgeBaseCommandError = async (output, context) => {
1212
1199
  throw await de_ValidationExceptionRes(parsedOutput, context);
1213
1200
  default:
1214
1201
  const parsedBody = parsedOutput.body;
1215
- throwDefaultError({
1202
+ return throwDefaultError({
1216
1203
  output,
1217
1204
  parsedBody,
1218
- exceptionCtor: __BaseException,
1219
1205
  errorCode,
1220
1206
  });
1221
1207
  }
@@ -1228,12 +1214,11 @@ export const de_GetRecommendationsCommand = async (output, context) => {
1228
1214
  $metadata: deserializeMetadata(output),
1229
1215
  });
1230
1216
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1231
- if (data.recommendations != null) {
1232
- contents.recommendations = de_RecommendationList(data.recommendations, context);
1233
- }
1234
- if (data.triggers != null) {
1235
- contents.triggers = de_RecommendationTriggerList(data.triggers, context);
1236
- }
1217
+ const doc = take(data, {
1218
+ recommendations: (_) => de_RecommendationList(_, context),
1219
+ triggers: _json,
1220
+ });
1221
+ Object.assign(contents, doc);
1237
1222
  return contents;
1238
1223
  };
1239
1224
  const de_GetRecommendationsCommandError = async (output, context) => {
@@ -1254,10 +1239,9 @@ const de_GetRecommendationsCommandError = async (output, context) => {
1254
1239
  throw await de_ValidationExceptionRes(parsedOutput, context);
1255
1240
  default:
1256
1241
  const parsedBody = parsedOutput.body;
1257
- throwDefaultError({
1242
+ return throwDefaultError({
1258
1243
  output,
1259
1244
  parsedBody,
1260
- exceptionCtor: __BaseException,
1261
1245
  errorCode,
1262
1246
  });
1263
1247
  }
@@ -1270,9 +1254,10 @@ export const de_GetSessionCommand = async (output, context) => {
1270
1254
  $metadata: deserializeMetadata(output),
1271
1255
  });
1272
1256
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1273
- if (data.session != null) {
1274
- contents.session = de_SessionData(data.session, context);
1275
- }
1257
+ const doc = take(data, {
1258
+ session: _json,
1259
+ });
1260
+ Object.assign(contents, doc);
1276
1261
  return contents;
1277
1262
  };
1278
1263
  const de_GetSessionCommandError = async (output, context) => {
@@ -1293,10 +1278,9 @@ const de_GetSessionCommandError = async (output, context) => {
1293
1278
  throw await de_ValidationExceptionRes(parsedOutput, context);
1294
1279
  default:
1295
1280
  const parsedBody = parsedOutput.body;
1296
- throwDefaultError({
1281
+ return throwDefaultError({
1297
1282
  output,
1298
1283
  parsedBody,
1299
- exceptionCtor: __BaseException,
1300
1284
  errorCode,
1301
1285
  });
1302
1286
  }
@@ -1309,12 +1293,11 @@ export const de_ListAssistantAssociationsCommand = async (output, context) => {
1309
1293
  $metadata: deserializeMetadata(output),
1310
1294
  });
1311
1295
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1312
- if (data.assistantAssociationSummaries != null) {
1313
- contents.assistantAssociationSummaries = de_AssistantAssociationSummaryList(data.assistantAssociationSummaries, context);
1314
- }
1315
- if (data.nextToken != null) {
1316
- contents.nextToken = __expectString(data.nextToken);
1317
- }
1296
+ const doc = take(data, {
1297
+ assistantAssociationSummaries: _json,
1298
+ nextToken: __expectString,
1299
+ });
1300
+ Object.assign(contents, doc);
1318
1301
  return contents;
1319
1302
  };
1320
1303
  const de_ListAssistantAssociationsCommandError = async (output, context) => {
@@ -1335,10 +1318,9 @@ const de_ListAssistantAssociationsCommandError = async (output, context) => {
1335
1318
  throw await de_ValidationExceptionRes(parsedOutput, context);
1336
1319
  default:
1337
1320
  const parsedBody = parsedOutput.body;
1338
- throwDefaultError({
1321
+ return throwDefaultError({
1339
1322
  output,
1340
1323
  parsedBody,
1341
- exceptionCtor: __BaseException,
1342
1324
  errorCode,
1343
1325
  });
1344
1326
  }
@@ -1351,12 +1333,11 @@ export const de_ListAssistantsCommand = async (output, context) => {
1351
1333
  $metadata: deserializeMetadata(output),
1352
1334
  });
1353
1335
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1354
- if (data.assistantSummaries != null) {
1355
- contents.assistantSummaries = de_AssistantList(data.assistantSummaries, context);
1356
- }
1357
- if (data.nextToken != null) {
1358
- contents.nextToken = __expectString(data.nextToken);
1359
- }
1336
+ const doc = take(data, {
1337
+ assistantSummaries: _json,
1338
+ nextToken: __expectString,
1339
+ });
1340
+ Object.assign(contents, doc);
1360
1341
  return contents;
1361
1342
  };
1362
1343
  const de_ListAssistantsCommandError = async (output, context) => {
@@ -1374,10 +1355,9 @@ const de_ListAssistantsCommandError = async (output, context) => {
1374
1355
  throw await de_ValidationExceptionRes(parsedOutput, context);
1375
1356
  default:
1376
1357
  const parsedBody = parsedOutput.body;
1377
- throwDefaultError({
1358
+ return throwDefaultError({
1378
1359
  output,
1379
1360
  parsedBody,
1380
- exceptionCtor: __BaseException,
1381
1361
  errorCode,
1382
1362
  });
1383
1363
  }
@@ -1390,12 +1370,11 @@ export const de_ListContentsCommand = async (output, context) => {
1390
1370
  $metadata: deserializeMetadata(output),
1391
1371
  });
1392
1372
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1393
- if (data.contentSummaries != null) {
1394
- contents.contentSummaries = de_ContentSummaryList(data.contentSummaries, context);
1395
- }
1396
- if (data.nextToken != null) {
1397
- contents.nextToken = __expectString(data.nextToken);
1398
- }
1373
+ const doc = take(data, {
1374
+ contentSummaries: _json,
1375
+ nextToken: __expectString,
1376
+ });
1377
+ Object.assign(contents, doc);
1399
1378
  return contents;
1400
1379
  };
1401
1380
  const de_ListContentsCommandError = async (output, context) => {
@@ -1416,10 +1395,9 @@ const de_ListContentsCommandError = async (output, context) => {
1416
1395
  throw await de_ValidationExceptionRes(parsedOutput, context);
1417
1396
  default:
1418
1397
  const parsedBody = parsedOutput.body;
1419
- throwDefaultError({
1398
+ return throwDefaultError({
1420
1399
  output,
1421
1400
  parsedBody,
1422
- exceptionCtor: __BaseException,
1423
1401
  errorCode,
1424
1402
  });
1425
1403
  }
@@ -1432,12 +1410,11 @@ export const de_ListKnowledgeBasesCommand = async (output, context) => {
1432
1410
  $metadata: deserializeMetadata(output),
1433
1411
  });
1434
1412
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1435
- if (data.knowledgeBaseSummaries != null) {
1436
- contents.knowledgeBaseSummaries = de_KnowledgeBaseList(data.knowledgeBaseSummaries, context);
1437
- }
1438
- if (data.nextToken != null) {
1439
- contents.nextToken = __expectString(data.nextToken);
1440
- }
1413
+ const doc = take(data, {
1414
+ knowledgeBaseSummaries: _json,
1415
+ nextToken: __expectString,
1416
+ });
1417
+ Object.assign(contents, doc);
1441
1418
  return contents;
1442
1419
  };
1443
1420
  const de_ListKnowledgeBasesCommandError = async (output, context) => {
@@ -1455,10 +1432,9 @@ const de_ListKnowledgeBasesCommandError = async (output, context) => {
1455
1432
  throw await de_ValidationExceptionRes(parsedOutput, context);
1456
1433
  default:
1457
1434
  const parsedBody = parsedOutput.body;
1458
- throwDefaultError({
1435
+ return throwDefaultError({
1459
1436
  output,
1460
1437
  parsedBody,
1461
- exceptionCtor: __BaseException,
1462
1438
  errorCode,
1463
1439
  });
1464
1440
  }
@@ -1471,9 +1447,10 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
1471
1447
  $metadata: deserializeMetadata(output),
1472
1448
  });
1473
1449
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1474
- if (data.tags != null) {
1475
- contents.tags = de_Tags(data.tags, context);
1476
- }
1450
+ const doc = take(data, {
1451
+ tags: _json,
1452
+ });
1453
+ Object.assign(contents, doc);
1477
1454
  return contents;
1478
1455
  };
1479
1456
  const de_ListTagsForResourceCommandError = async (output, context) => {
@@ -1488,10 +1465,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
1488
1465
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1489
1466
  default:
1490
1467
  const parsedBody = parsedOutput.body;
1491
- throwDefaultError({
1468
+ return throwDefaultError({
1492
1469
  output,
1493
1470
  parsedBody,
1494
- exceptionCtor: __BaseException,
1495
1471
  errorCode,
1496
1472
  });
1497
1473
  }
@@ -1504,12 +1480,11 @@ export const de_NotifyRecommendationsReceivedCommand = async (output, context) =
1504
1480
  $metadata: deserializeMetadata(output),
1505
1481
  });
1506
1482
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1507
- if (data.errors != null) {
1508
- contents.errors = de_NotifyRecommendationsReceivedErrorList(data.errors, context);
1509
- }
1510
- if (data.recommendationIds != null) {
1511
- contents.recommendationIds = de_RecommendationIdList(data.recommendationIds, context);
1512
- }
1483
+ const doc = take(data, {
1484
+ errors: _json,
1485
+ recommendationIds: _json,
1486
+ });
1487
+ Object.assign(contents, doc);
1513
1488
  return contents;
1514
1489
  };
1515
1490
  const de_NotifyRecommendationsReceivedCommandError = async (output, context) => {
@@ -1530,10 +1505,9 @@ const de_NotifyRecommendationsReceivedCommandError = async (output, context) =>
1530
1505
  throw await de_ValidationExceptionRes(parsedOutput, context);
1531
1506
  default:
1532
1507
  const parsedBody = parsedOutput.body;
1533
- throwDefaultError({
1508
+ return throwDefaultError({
1534
1509
  output,
1535
1510
  parsedBody,
1536
- exceptionCtor: __BaseException,
1537
1511
  errorCode,
1538
1512
  });
1539
1513
  }
@@ -1546,12 +1520,11 @@ export const de_QueryAssistantCommand = async (output, context) => {
1546
1520
  $metadata: deserializeMetadata(output),
1547
1521
  });
1548
1522
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1549
- if (data.nextToken != null) {
1550
- contents.nextToken = __expectString(data.nextToken);
1551
- }
1552
- if (data.results != null) {
1553
- contents.results = de_QueryResultsList(data.results, context);
1554
- }
1523
+ const doc = take(data, {
1524
+ nextToken: __expectString,
1525
+ results: (_) => de_QueryResultsList(_, context),
1526
+ });
1527
+ Object.assign(contents, doc);
1555
1528
  return contents;
1556
1529
  };
1557
1530
  const de_QueryAssistantCommandError = async (output, context) => {
@@ -1572,10 +1545,9 @@ const de_QueryAssistantCommandError = async (output, context) => {
1572
1545
  throw await de_ValidationExceptionRes(parsedOutput, context);
1573
1546
  default:
1574
1547
  const parsedBody = parsedOutput.body;
1575
- throwDefaultError({
1548
+ return throwDefaultError({
1576
1549
  output,
1577
1550
  parsedBody,
1578
- exceptionCtor: __BaseException,
1579
1551
  errorCode,
1580
1552
  });
1581
1553
  }
@@ -1608,10 +1580,9 @@ const de_RemoveKnowledgeBaseTemplateUriCommandError = async (output, context) =>
1608
1580
  throw await de_ValidationExceptionRes(parsedOutput, context);
1609
1581
  default:
1610
1582
  const parsedBody = parsedOutput.body;
1611
- throwDefaultError({
1583
+ return throwDefaultError({
1612
1584
  output,
1613
1585
  parsedBody,
1614
- exceptionCtor: __BaseException,
1615
1586
  errorCode,
1616
1587
  });
1617
1588
  }
@@ -1624,12 +1595,11 @@ export const de_SearchContentCommand = async (output, context) => {
1624
1595
  $metadata: deserializeMetadata(output),
1625
1596
  });
1626
1597
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1627
- if (data.contentSummaries != null) {
1628
- contents.contentSummaries = de_ContentSummaryList(data.contentSummaries, context);
1629
- }
1630
- if (data.nextToken != null) {
1631
- contents.nextToken = __expectString(data.nextToken);
1632
- }
1598
+ const doc = take(data, {
1599
+ contentSummaries: _json,
1600
+ nextToken: __expectString,
1601
+ });
1602
+ Object.assign(contents, doc);
1633
1603
  return contents;
1634
1604
  };
1635
1605
  const de_SearchContentCommandError = async (output, context) => {
@@ -1650,10 +1620,9 @@ const de_SearchContentCommandError = async (output, context) => {
1650
1620
  throw await de_ValidationExceptionRes(parsedOutput, context);
1651
1621
  default:
1652
1622
  const parsedBody = parsedOutput.body;
1653
- throwDefaultError({
1623
+ return throwDefaultError({
1654
1624
  output,
1655
1625
  parsedBody,
1656
- exceptionCtor: __BaseException,
1657
1626
  errorCode,
1658
1627
  });
1659
1628
  }
@@ -1666,12 +1635,11 @@ export const de_SearchSessionsCommand = async (output, context) => {
1666
1635
  $metadata: deserializeMetadata(output),
1667
1636
  });
1668
1637
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1669
- if (data.nextToken != null) {
1670
- contents.nextToken = __expectString(data.nextToken);
1671
- }
1672
- if (data.sessionSummaries != null) {
1673
- contents.sessionSummaries = de_SessionSummaries(data.sessionSummaries, context);
1674
- }
1638
+ const doc = take(data, {
1639
+ nextToken: __expectString,
1640
+ sessionSummaries: _json,
1641
+ });
1642
+ Object.assign(contents, doc);
1675
1643
  return contents;
1676
1644
  };
1677
1645
  const de_SearchSessionsCommandError = async (output, context) => {
@@ -1692,10 +1660,9 @@ const de_SearchSessionsCommandError = async (output, context) => {
1692
1660
  throw await de_ValidationExceptionRes(parsedOutput, context);
1693
1661
  default:
1694
1662
  const parsedBody = parsedOutput.body;
1695
- throwDefaultError({
1663
+ return throwDefaultError({
1696
1664
  output,
1697
1665
  parsedBody,
1698
- exceptionCtor: __BaseException,
1699
1666
  errorCode,
1700
1667
  });
1701
1668
  }
@@ -1708,18 +1675,13 @@ export const de_StartContentUploadCommand = async (output, context) => {
1708
1675
  $metadata: deserializeMetadata(output),
1709
1676
  });
1710
1677
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1711
- if (data.headersToInclude != null) {
1712
- contents.headersToInclude = de_Headers(data.headersToInclude, context);
1713
- }
1714
- if (data.uploadId != null) {
1715
- contents.uploadId = __expectString(data.uploadId);
1716
- }
1717
- if (data.url != null) {
1718
- contents.url = __expectString(data.url);
1719
- }
1720
- if (data.urlExpiry != null) {
1721
- contents.urlExpiry = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.urlExpiry)));
1722
- }
1678
+ const doc = take(data, {
1679
+ headersToInclude: _json,
1680
+ uploadId: __expectString,
1681
+ url: __expectString,
1682
+ urlExpiry: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1683
+ });
1684
+ Object.assign(contents, doc);
1723
1685
  return contents;
1724
1686
  };
1725
1687
  const de_StartContentUploadCommandError = async (output, context) => {
@@ -1740,10 +1702,9 @@ const de_StartContentUploadCommandError = async (output, context) => {
1740
1702
  throw await de_ValidationExceptionRes(parsedOutput, context);
1741
1703
  default:
1742
1704
  const parsedBody = parsedOutput.body;
1743
- throwDefaultError({
1705
+ return throwDefaultError({
1744
1706
  output,
1745
1707
  parsedBody,
1746
- exceptionCtor: __BaseException,
1747
1708
  errorCode,
1748
1709
  });
1749
1710
  }
@@ -1773,10 +1734,9 @@ const de_TagResourceCommandError = async (output, context) => {
1773
1734
  throw await de_TooManyTagsExceptionRes(parsedOutput, context);
1774
1735
  default:
1775
1736
  const parsedBody = parsedOutput.body;
1776
- throwDefaultError({
1737
+ return throwDefaultError({
1777
1738
  output,
1778
1739
  parsedBody,
1779
- exceptionCtor: __BaseException,
1780
1740
  errorCode,
1781
1741
  });
1782
1742
  }
@@ -1803,10 +1763,9 @@ const de_UntagResourceCommandError = async (output, context) => {
1803
1763
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1804
1764
  default:
1805
1765
  const parsedBody = parsedOutput.body;
1806
- throwDefaultError({
1766
+ return throwDefaultError({
1807
1767
  output,
1808
1768
  parsedBody,
1809
- exceptionCtor: __BaseException,
1810
1769
  errorCode,
1811
1770
  });
1812
1771
  }
@@ -1819,9 +1778,10 @@ export const de_UpdateContentCommand = async (output, context) => {
1819
1778
  $metadata: deserializeMetadata(output),
1820
1779
  });
1821
1780
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1822
- if (data.content != null) {
1823
- contents.content = de_ContentData(data.content, context);
1824
- }
1781
+ const doc = take(data, {
1782
+ content: (_) => de_ContentData(_, context),
1783
+ });
1784
+ Object.assign(contents, doc);
1825
1785
  return contents;
1826
1786
  };
1827
1787
  const de_UpdateContentCommandError = async (output, context) => {
@@ -1845,10 +1805,9 @@ const de_UpdateContentCommandError = async (output, context) => {
1845
1805
  throw await de_ValidationExceptionRes(parsedOutput, context);
1846
1806
  default:
1847
1807
  const parsedBody = parsedOutput.body;
1848
- throwDefaultError({
1808
+ return throwDefaultError({
1849
1809
  output,
1850
1810
  parsedBody,
1851
- exceptionCtor: __BaseException,
1852
1811
  errorCode,
1853
1812
  });
1854
1813
  }
@@ -1861,9 +1820,10 @@ export const de_UpdateKnowledgeBaseTemplateUriCommand = async (output, context)
1861
1820
  $metadata: deserializeMetadata(output),
1862
1821
  });
1863
1822
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1864
- if (data.knowledgeBase != null) {
1865
- contents.knowledgeBase = de_KnowledgeBaseData(data.knowledgeBase, context);
1866
- }
1823
+ const doc = take(data, {
1824
+ knowledgeBase: (_) => de_KnowledgeBaseData(_, context),
1825
+ });
1826
+ Object.assign(contents, doc);
1867
1827
  return contents;
1868
1828
  };
1869
1829
  const de_UpdateKnowledgeBaseTemplateUriCommandError = async (output, context) => {
@@ -1884,21 +1844,21 @@ const de_UpdateKnowledgeBaseTemplateUriCommandError = async (output, context) =>
1884
1844
  throw await de_ValidationExceptionRes(parsedOutput, context);
1885
1845
  default:
1886
1846
  const parsedBody = parsedOutput.body;
1887
- throwDefaultError({
1847
+ return throwDefaultError({
1888
1848
  output,
1889
1849
  parsedBody,
1890
- exceptionCtor: __BaseException,
1891
1850
  errorCode,
1892
1851
  });
1893
1852
  }
1894
1853
  };
1895
- const map = __map;
1854
+ const throwDefaultError = withBaseException(__BaseException);
1896
1855
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1897
1856
  const contents = map({});
1898
1857
  const data = parsedOutput.body;
1899
- if (data.message != null) {
1900
- contents.message = __expectString(data.message);
1901
- }
1858
+ const doc = take(data, {
1859
+ message: __expectString,
1860
+ });
1861
+ Object.assign(contents, doc);
1902
1862
  const exception = new AccessDeniedException({
1903
1863
  $metadata: deserializeMetadata(parsedOutput),
1904
1864
  ...contents,
@@ -1908,9 +1868,10 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1908
1868
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
1909
1869
  const contents = map({});
1910
1870
  const data = parsedOutput.body;
1911
- if (data.message != null) {
1912
- contents.message = __expectString(data.message);
1913
- }
1871
+ const doc = take(data, {
1872
+ message: __expectString,
1873
+ });
1874
+ Object.assign(contents, doc);
1914
1875
  const exception = new ConflictException({
1915
1876
  $metadata: deserializeMetadata(parsedOutput),
1916
1877
  ...contents,
@@ -1920,9 +1881,10 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
1920
1881
  const de_PreconditionFailedExceptionRes = async (parsedOutput, context) => {
1921
1882
  const contents = map({});
1922
1883
  const data = parsedOutput.body;
1923
- if (data.message != null) {
1924
- contents.message = __expectString(data.message);
1925
- }
1884
+ const doc = take(data, {
1885
+ message: __expectString,
1886
+ });
1887
+ Object.assign(contents, doc);
1926
1888
  const exception = new PreconditionFailedException({
1927
1889
  $metadata: deserializeMetadata(parsedOutput),
1928
1890
  ...contents,
@@ -1932,12 +1894,11 @@ const de_PreconditionFailedExceptionRes = async (parsedOutput, context) => {
1932
1894
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1933
1895
  const contents = map({});
1934
1896
  const data = parsedOutput.body;
1935
- if (data.message != null) {
1936
- contents.message = __expectString(data.message);
1937
- }
1938
- if (data.resourceName != null) {
1939
- contents.resourceName = __expectString(data.resourceName);
1940
- }
1897
+ const doc = take(data, {
1898
+ message: __expectString,
1899
+ resourceName: __expectString,
1900
+ });
1901
+ Object.assign(contents, doc);
1941
1902
  const exception = new ResourceNotFoundException({
1942
1903
  $metadata: deserializeMetadata(parsedOutput),
1943
1904
  ...contents,
@@ -1947,9 +1908,10 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1947
1908
  const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1948
1909
  const contents = map({});
1949
1910
  const data = parsedOutput.body;
1950
- if (data.message != null) {
1951
- contents.message = __expectString(data.message);
1952
- }
1911
+ const doc = take(data, {
1912
+ message: __expectString,
1913
+ });
1914
+ Object.assign(contents, doc);
1953
1915
  const exception = new ServiceQuotaExceededException({
1954
1916
  $metadata: deserializeMetadata(parsedOutput),
1955
1917
  ...contents,
@@ -1959,12 +1921,11 @@ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1959
1921
  const de_TooManyTagsExceptionRes = async (parsedOutput, context) => {
1960
1922
  const contents = map({});
1961
1923
  const data = parsedOutput.body;
1962
- if (data.message != null) {
1963
- contents.message = __expectString(data.message);
1964
- }
1965
- if (data.resourceName != null) {
1966
- contents.resourceName = __expectString(data.resourceName);
1967
- }
1924
+ const doc = take(data, {
1925
+ message: __expectString,
1926
+ resourceName: __expectString,
1927
+ });
1928
+ Object.assign(contents, doc);
1968
1929
  const exception = new TooManyTagsException({
1969
1930
  $metadata: deserializeMetadata(parsedOutput),
1970
1931
  ...contents,
@@ -1974,508 +1935,80 @@ const de_TooManyTagsExceptionRes = async (parsedOutput, context) => {
1974
1935
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
1975
1936
  const contents = map({});
1976
1937
  const data = parsedOutput.body;
1977
- if (data.message != null) {
1978
- contents.message = __expectString(data.message);
1979
- }
1938
+ const doc = take(data, {
1939
+ message: __expectString,
1940
+ });
1941
+ Object.assign(contents, doc);
1980
1942
  const exception = new ValidationException({
1981
1943
  $metadata: deserializeMetadata(parsedOutput),
1982
1944
  ...contents,
1983
1945
  });
1984
1946
  return __decorateServiceException(exception, parsedOutput.body);
1985
1947
  };
1986
- const se_AppIntegrationsConfiguration = (input, context) => {
1987
- return {
1988
- ...(input.appIntegrationArn != null && { appIntegrationArn: input.appIntegrationArn }),
1989
- ...(input.objectFields != null && { objectFields: se_ObjectFieldsList(input.objectFields, context) }),
1990
- };
1991
- };
1992
- const se_AssistantAssociationInputData = (input, context) => {
1993
- return AssistantAssociationInputData.visit(input, {
1994
- knowledgeBaseId: (value) => ({ knowledgeBaseId: value }),
1995
- _: (name, value) => ({ name: value }),
1996
- });
1997
- };
1998
- const se_ContentMetadata = (input, context) => {
1999
- return Object.entries(input).reduce((acc, [key, value]) => {
2000
- if (value === null) {
2001
- return acc;
2002
- }
2003
- acc[key] = value;
2004
- return acc;
2005
- }, {});
2006
- };
2007
- const se_Filter = (input, context) => {
2008
- return {
2009
- ...(input.field != null && { field: input.field }),
2010
- ...(input.operator != null && { operator: input.operator }),
2011
- ...(input.value != null && { value: input.value }),
2012
- };
2013
- };
2014
- const se_FilterList = (input, context) => {
2015
- return input
2016
- .filter((e) => e != null)
2017
- .map((entry) => {
2018
- return se_Filter(entry, context);
2019
- });
2020
- };
2021
- const se_ObjectFieldsList = (input, context) => {
2022
- return input
2023
- .filter((e) => e != null)
2024
- .map((entry) => {
2025
- return entry;
2026
- });
2027
- };
2028
- const se_RecommendationIdList = (input, context) => {
2029
- return input
2030
- .filter((e) => e != null)
2031
- .map((entry) => {
2032
- return entry;
2033
- });
2034
- };
2035
- const se_RenderingConfiguration = (input, context) => {
2036
- return {
2037
- ...(input.templateUri != null && { templateUri: input.templateUri }),
2038
- };
2039
- };
2040
- const se_SearchExpression = (input, context) => {
2041
- return {
2042
- ...(input.filters != null && { filters: se_FilterList(input.filters, context) }),
2043
- };
2044
- };
2045
- const se_ServerSideEncryptionConfiguration = (input, context) => {
2046
- return {
2047
- ...(input.kmsKeyId != null && { kmsKeyId: input.kmsKeyId }),
2048
- };
2049
- };
2050
- const se_SourceConfiguration = (input, context) => {
2051
- return SourceConfiguration.visit(input, {
2052
- appIntegrations: (value) => ({ appIntegrations: se_AppIntegrationsConfiguration(value, context) }),
2053
- _: (name, value) => ({ name: value }),
2054
- });
2055
- };
2056
- const se_Tags = (input, context) => {
2057
- return Object.entries(input).reduce((acc, [key, value]) => {
2058
- if (value === null) {
2059
- return acc;
2060
- }
2061
- acc[key] = value;
2062
- return acc;
2063
- }, {});
2064
- };
2065
- const de_AppIntegrationsConfiguration = (output, context) => {
2066
- return {
2067
- appIntegrationArn: __expectString(output.appIntegrationArn),
2068
- objectFields: output.objectFields != null ? de_ObjectFieldsList(output.objectFields, context) : undefined,
2069
- };
2070
- };
2071
- const de_AssistantAssociationData = (output, context) => {
2072
- return {
2073
- assistantArn: __expectString(output.assistantArn),
2074
- assistantAssociationArn: __expectString(output.assistantAssociationArn),
2075
- assistantAssociationId: __expectString(output.assistantAssociationId),
2076
- assistantId: __expectString(output.assistantId),
2077
- associationData: output.associationData != null
2078
- ? de_AssistantAssociationOutputData(__expectUnion(output.associationData), context)
2079
- : undefined,
2080
- associationType: __expectString(output.associationType),
2081
- tags: output.tags != null ? de_Tags(output.tags, context) : undefined,
2082
- };
2083
- };
2084
- const de_AssistantAssociationOutputData = (output, context) => {
2085
- if (output.knowledgeBaseAssociation != null) {
2086
- return {
2087
- knowledgeBaseAssociation: de_KnowledgeBaseAssociationData(output.knowledgeBaseAssociation, context),
2088
- };
2089
- }
2090
- return { $unknown: Object.entries(output)[0] };
2091
- };
2092
- const de_AssistantAssociationSummary = (output, context) => {
2093
- return {
2094
- assistantArn: __expectString(output.assistantArn),
2095
- assistantAssociationArn: __expectString(output.assistantAssociationArn),
2096
- assistantAssociationId: __expectString(output.assistantAssociationId),
2097
- assistantId: __expectString(output.assistantId),
2098
- associationData: output.associationData != null
2099
- ? de_AssistantAssociationOutputData(__expectUnion(output.associationData), context)
2100
- : undefined,
2101
- associationType: __expectString(output.associationType),
2102
- tags: output.tags != null ? de_Tags(output.tags, context) : undefined,
2103
- };
2104
- };
2105
- const de_AssistantAssociationSummaryList = (output, context) => {
2106
- const retVal = (output || [])
2107
- .filter((e) => e != null)
2108
- .map((entry) => {
2109
- if (entry === null) {
2110
- return null;
2111
- }
2112
- return de_AssistantAssociationSummary(entry, context);
2113
- });
2114
- return retVal;
2115
- };
2116
- const de_AssistantData = (output, context) => {
2117
- return {
2118
- assistantArn: __expectString(output.assistantArn),
2119
- assistantId: __expectString(output.assistantId),
2120
- description: __expectString(output.description),
2121
- name: __expectString(output.name),
2122
- serverSideEncryptionConfiguration: output.serverSideEncryptionConfiguration != null
2123
- ? de_ServerSideEncryptionConfiguration(output.serverSideEncryptionConfiguration, context)
2124
- : undefined,
2125
- status: __expectString(output.status),
2126
- tags: output.tags != null ? de_Tags(output.tags, context) : undefined,
2127
- type: __expectString(output.type),
2128
- };
2129
- };
2130
- const de_AssistantList = (output, context) => {
2131
- const retVal = (output || [])
2132
- .filter((e) => e != null)
2133
- .map((entry) => {
2134
- if (entry === null) {
2135
- return null;
2136
- }
2137
- return de_AssistantSummary(entry, context);
2138
- });
2139
- return retVal;
2140
- };
2141
- const de_AssistantSummary = (output, context) => {
2142
- return {
2143
- assistantArn: __expectString(output.assistantArn),
2144
- assistantId: __expectString(output.assistantId),
2145
- description: __expectString(output.description),
2146
- name: __expectString(output.name),
2147
- serverSideEncryptionConfiguration: output.serverSideEncryptionConfiguration != null
2148
- ? de_ServerSideEncryptionConfiguration(output.serverSideEncryptionConfiguration, context)
2149
- : undefined,
2150
- status: __expectString(output.status),
2151
- tags: output.tags != null ? de_Tags(output.tags, context) : undefined,
2152
- type: __expectString(output.type),
2153
- };
2154
- };
2155
1948
  const de_ContentData = (output, context) => {
2156
- return {
2157
- contentArn: __expectString(output.contentArn),
2158
- contentId: __expectString(output.contentId),
2159
- contentType: __expectString(output.contentType),
2160
- knowledgeBaseArn: __expectString(output.knowledgeBaseArn),
2161
- knowledgeBaseId: __expectString(output.knowledgeBaseId),
2162
- linkOutUri: __expectString(output.linkOutUri),
2163
- metadata: output.metadata != null ? de_ContentMetadata(output.metadata, context) : undefined,
2164
- name: __expectString(output.name),
2165
- revisionId: __expectString(output.revisionId),
2166
- status: __expectString(output.status),
2167
- tags: output.tags != null ? de_Tags(output.tags, context) : undefined,
2168
- title: __expectString(output.title),
2169
- url: __expectString(output.url),
2170
- urlExpiry: output.urlExpiry != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.urlExpiry))) : undefined,
2171
- };
2172
- };
2173
- const de_ContentMetadata = (output, context) => {
2174
- return Object.entries(output).reduce((acc, [key, value]) => {
2175
- if (value === null) {
2176
- return acc;
2177
- }
2178
- acc[key] = __expectString(value);
2179
- return acc;
2180
- }, {});
2181
- };
2182
- const de_ContentReference = (output, context) => {
2183
- return {
2184
- contentArn: __expectString(output.contentArn),
2185
- contentId: __expectString(output.contentId),
2186
- knowledgeBaseArn: __expectString(output.knowledgeBaseArn),
2187
- knowledgeBaseId: __expectString(output.knowledgeBaseId),
2188
- };
2189
- };
2190
- const de_ContentSummary = (output, context) => {
2191
- return {
2192
- contentArn: __expectString(output.contentArn),
2193
- contentId: __expectString(output.contentId),
2194
- contentType: __expectString(output.contentType),
2195
- knowledgeBaseArn: __expectString(output.knowledgeBaseArn),
2196
- knowledgeBaseId: __expectString(output.knowledgeBaseId),
2197
- metadata: output.metadata != null ? de_ContentMetadata(output.metadata, context) : undefined,
2198
- name: __expectString(output.name),
2199
- revisionId: __expectString(output.revisionId),
2200
- status: __expectString(output.status),
2201
- tags: output.tags != null ? de_Tags(output.tags, context) : undefined,
2202
- title: __expectString(output.title),
2203
- };
2204
- };
2205
- const de_ContentSummaryList = (output, context) => {
2206
- const retVal = (output || [])
2207
- .filter((e) => e != null)
2208
- .map((entry) => {
2209
- if (entry === null) {
2210
- return null;
2211
- }
2212
- return de_ContentSummary(entry, context);
1949
+ return take(output, {
1950
+ contentArn: __expectString,
1951
+ contentId: __expectString,
1952
+ contentType: __expectString,
1953
+ knowledgeBaseArn: __expectString,
1954
+ knowledgeBaseId: __expectString,
1955
+ linkOutUri: __expectString,
1956
+ metadata: _json,
1957
+ name: __expectString,
1958
+ revisionId: __expectString,
1959
+ status: __expectString,
1960
+ tags: _json,
1961
+ title: __expectString,
1962
+ url: __expectString,
1963
+ urlExpiry: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2213
1964
  });
2214
- return retVal;
2215
- };
2216
- const de_Document = (output, context) => {
2217
- return {
2218
- contentReference: output.contentReference != null ? de_ContentReference(output.contentReference, context) : undefined,
2219
- excerpt: output.excerpt != null ? de_DocumentText(output.excerpt, context) : undefined,
2220
- title: output.title != null ? de_DocumentText(output.title, context) : undefined,
2221
- };
2222
- };
2223
- const de_DocumentText = (output, context) => {
2224
- return {
2225
- highlights: output.highlights != null ? de_Highlights(output.highlights, context) : undefined,
2226
- text: __expectString(output.text),
2227
- };
2228
- };
2229
- const de_Headers = (output, context) => {
2230
- return Object.entries(output).reduce((acc, [key, value]) => {
2231
- if (value === null) {
2232
- return acc;
2233
- }
2234
- acc[key] = __expectString(value);
2235
- return acc;
2236
- }, {});
2237
- };
2238
- const de_Highlight = (output, context) => {
2239
- return {
2240
- beginOffsetInclusive: __expectInt32(output.beginOffsetInclusive),
2241
- endOffsetExclusive: __expectInt32(output.endOffsetExclusive),
2242
- };
2243
- };
2244
- const de_Highlights = (output, context) => {
2245
- const retVal = (output || [])
2246
- .filter((e) => e != null)
2247
- .map((entry) => {
2248
- if (entry === null) {
2249
- return null;
2250
- }
2251
- return de_Highlight(entry, context);
2252
- });
2253
- return retVal;
2254
- };
2255
- const de_KnowledgeBaseAssociationData = (output, context) => {
2256
- return {
2257
- knowledgeBaseArn: __expectString(output.knowledgeBaseArn),
2258
- knowledgeBaseId: __expectString(output.knowledgeBaseId),
2259
- };
2260
1965
  };
2261
1966
  const de_KnowledgeBaseData = (output, context) => {
2262
- return {
2263
- description: __expectString(output.description),
2264
- knowledgeBaseArn: __expectString(output.knowledgeBaseArn),
2265
- knowledgeBaseId: __expectString(output.knowledgeBaseId),
2266
- knowledgeBaseType: __expectString(output.knowledgeBaseType),
2267
- lastContentModificationTime: output.lastContentModificationTime != null
2268
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastContentModificationTime)))
2269
- : undefined,
2270
- name: __expectString(output.name),
2271
- renderingConfiguration: output.renderingConfiguration != null
2272
- ? de_RenderingConfiguration(output.renderingConfiguration, context)
2273
- : undefined,
2274
- serverSideEncryptionConfiguration: output.serverSideEncryptionConfiguration != null
2275
- ? de_ServerSideEncryptionConfiguration(output.serverSideEncryptionConfiguration, context)
2276
- : undefined,
2277
- sourceConfiguration: output.sourceConfiguration != null
2278
- ? de_SourceConfiguration(__expectUnion(output.sourceConfiguration), context)
2279
- : undefined,
2280
- status: __expectString(output.status),
2281
- tags: output.tags != null ? de_Tags(output.tags, context) : undefined,
2282
- };
2283
- };
2284
- const de_KnowledgeBaseList = (output, context) => {
2285
- const retVal = (output || [])
2286
- .filter((e) => e != null)
2287
- .map((entry) => {
2288
- if (entry === null) {
2289
- return null;
2290
- }
2291
- return de_KnowledgeBaseSummary(entry, context);
1967
+ return take(output, {
1968
+ description: __expectString,
1969
+ knowledgeBaseArn: __expectString,
1970
+ knowledgeBaseId: __expectString,
1971
+ knowledgeBaseType: __expectString,
1972
+ lastContentModificationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1973
+ name: __expectString,
1974
+ renderingConfiguration: _json,
1975
+ serverSideEncryptionConfiguration: _json,
1976
+ sourceConfiguration: (_) => _json(__expectUnion(_)),
1977
+ status: __expectString,
1978
+ tags: _json,
2292
1979
  });
2293
- return retVal;
2294
- };
2295
- const de_KnowledgeBaseSummary = (output, context) => {
2296
- return {
2297
- description: __expectString(output.description),
2298
- knowledgeBaseArn: __expectString(output.knowledgeBaseArn),
2299
- knowledgeBaseId: __expectString(output.knowledgeBaseId),
2300
- knowledgeBaseType: __expectString(output.knowledgeBaseType),
2301
- name: __expectString(output.name),
2302
- renderingConfiguration: output.renderingConfiguration != null
2303
- ? de_RenderingConfiguration(output.renderingConfiguration, context)
2304
- : undefined,
2305
- serverSideEncryptionConfiguration: output.serverSideEncryptionConfiguration != null
2306
- ? de_ServerSideEncryptionConfiguration(output.serverSideEncryptionConfiguration, context)
2307
- : undefined,
2308
- sourceConfiguration: output.sourceConfiguration != null
2309
- ? de_SourceConfiguration(__expectUnion(output.sourceConfiguration), context)
2310
- : undefined,
2311
- status: __expectString(output.status),
2312
- tags: output.tags != null ? de_Tags(output.tags, context) : undefined,
2313
- };
2314
- };
2315
- const de_NotifyRecommendationsReceivedError = (output, context) => {
2316
- return {
2317
- message: __expectString(output.message),
2318
- recommendationId: __expectString(output.recommendationId),
2319
- };
2320
- };
2321
- const de_NotifyRecommendationsReceivedErrorList = (output, context) => {
2322
- const retVal = (output || [])
2323
- .filter((e) => e != null)
2324
- .map((entry) => {
2325
- if (entry === null) {
2326
- return null;
2327
- }
2328
- return de_NotifyRecommendationsReceivedError(entry, context);
2329
- });
2330
- return retVal;
2331
- };
2332
- const de_ObjectFieldsList = (output, context) => {
2333
- const retVal = (output || [])
2334
- .filter((e) => e != null)
2335
- .map((entry) => {
2336
- if (entry === null) {
2337
- return null;
2338
- }
2339
- return __expectString(entry);
2340
- });
2341
- return retVal;
2342
- };
2343
- const de_QueryRecommendationTriggerData = (output, context) => {
2344
- return {
2345
- text: __expectString(output.text),
2346
- };
2347
1980
  };
2348
1981
  const de_QueryResultsList = (output, context) => {
2349
1982
  const retVal = (output || [])
2350
1983
  .filter((e) => e != null)
2351
1984
  .map((entry) => {
2352
- if (entry === null) {
2353
- return null;
2354
- }
2355
1985
  return de_ResultData(entry, context);
2356
1986
  });
2357
1987
  return retVal;
2358
1988
  };
2359
1989
  const de_RecommendationData = (output, context) => {
2360
- return {
2361
- document: output.document != null ? de_Document(output.document, context) : undefined,
2362
- recommendationId: __expectString(output.recommendationId),
2363
- relevanceLevel: __expectString(output.relevanceLevel),
2364
- relevanceScore: __limitedParseDouble(output.relevanceScore),
2365
- type: __expectString(output.type),
2366
- };
2367
- };
2368
- const de_RecommendationIdList = (output, context) => {
2369
- const retVal = (output || [])
2370
- .filter((e) => e != null)
2371
- .map((entry) => {
2372
- if (entry === null) {
2373
- return null;
2374
- }
2375
- return __expectString(entry);
1990
+ return take(output, {
1991
+ document: _json,
1992
+ recommendationId: __expectString,
1993
+ relevanceLevel: __expectString,
1994
+ relevanceScore: __limitedParseDouble,
1995
+ type: __expectString,
2376
1996
  });
2377
- return retVal;
2378
1997
  };
2379
1998
  const de_RecommendationList = (output, context) => {
2380
1999
  const retVal = (output || [])
2381
2000
  .filter((e) => e != null)
2382
2001
  .map((entry) => {
2383
- if (entry === null) {
2384
- return null;
2385
- }
2386
2002
  return de_RecommendationData(entry, context);
2387
2003
  });
2388
2004
  return retVal;
2389
2005
  };
2390
- const de_RecommendationTrigger = (output, context) => {
2391
- return {
2392
- data: output.data != null ? de_RecommendationTriggerData(__expectUnion(output.data), context) : undefined,
2393
- id: __expectString(output.id),
2394
- recommendationIds: output.recommendationIds != null ? de_RecommendationIdList(output.recommendationIds, context) : undefined,
2395
- source: __expectString(output.source),
2396
- type: __expectString(output.type),
2397
- };
2398
- };
2399
- const de_RecommendationTriggerData = (output, context) => {
2400
- if (output.query != null) {
2401
- return {
2402
- query: de_QueryRecommendationTriggerData(output.query, context),
2403
- };
2404
- }
2405
- return { $unknown: Object.entries(output)[0] };
2406
- };
2407
- const de_RecommendationTriggerList = (output, context) => {
2408
- const retVal = (output || [])
2409
- .filter((e) => e != null)
2410
- .map((entry) => {
2411
- if (entry === null) {
2412
- return null;
2413
- }
2414
- return de_RecommendationTrigger(entry, context);
2415
- });
2416
- return retVal;
2417
- };
2418
- const de_RenderingConfiguration = (output, context) => {
2419
- return {
2420
- templateUri: __expectString(output.templateUri),
2421
- };
2422
- };
2423
2006
  const de_ResultData = (output, context) => {
2424
- return {
2425
- document: output.document != null ? de_Document(output.document, context) : undefined,
2426
- relevanceScore: __limitedParseDouble(output.relevanceScore),
2427
- resultId: __expectString(output.resultId),
2428
- };
2429
- };
2430
- const de_ServerSideEncryptionConfiguration = (output, context) => {
2431
- return {
2432
- kmsKeyId: __expectString(output.kmsKeyId),
2433
- };
2434
- };
2435
- const de_SessionData = (output, context) => {
2436
- return {
2437
- description: __expectString(output.description),
2438
- name: __expectString(output.name),
2439
- sessionArn: __expectString(output.sessionArn),
2440
- sessionId: __expectString(output.sessionId),
2441
- tags: output.tags != null ? de_Tags(output.tags, context) : undefined,
2442
- };
2443
- };
2444
- const de_SessionSummaries = (output, context) => {
2445
- const retVal = (output || [])
2446
- .filter((e) => e != null)
2447
- .map((entry) => {
2448
- if (entry === null) {
2449
- return null;
2450
- }
2451
- return de_SessionSummary(entry, context);
2007
+ return take(output, {
2008
+ document: _json,
2009
+ relevanceScore: __limitedParseDouble,
2010
+ resultId: __expectString,
2452
2011
  });
2453
- return retVal;
2454
- };
2455
- const de_SessionSummary = (output, context) => {
2456
- return {
2457
- assistantArn: __expectString(output.assistantArn),
2458
- assistantId: __expectString(output.assistantId),
2459
- sessionArn: __expectString(output.sessionArn),
2460
- sessionId: __expectString(output.sessionId),
2461
- };
2462
- };
2463
- const de_SourceConfiguration = (output, context) => {
2464
- if (output.appIntegrations != null) {
2465
- return {
2466
- appIntegrations: de_AppIntegrationsConfiguration(output.appIntegrations, context),
2467
- };
2468
- }
2469
- return { $unknown: Object.entries(output)[0] };
2470
- };
2471
- const de_Tags = (output, context) => {
2472
- return Object.entries(output).reduce((acc, [key, value]) => {
2473
- if (value === null) {
2474
- return acc;
2475
- }
2476
- acc[key] = __expectString(value);
2477
- return acc;
2478
- }, {});
2479
2012
  };
2480
2013
  const deserializeMetadata = (output) => ({
2481
2014
  httpStatusCode: output.statusCode,