@aws-sdk/client-wisdom 3.35.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.
- package/CHANGELOG.md +8 -0
- package/LICENSE +201 -0
- package/README.md +207 -0
- package/dist-cjs/Wisdom.js +480 -0
- package/dist-cjs/Wisdom.js.map +1 -0
- package/dist-cjs/WisdomClient.js +48 -0
- package/dist-cjs/WisdomClient.js.map +1 -0
- package/dist-cjs/commands/CreateAssistantAssociationCommand.js +63 -0
- package/dist-cjs/commands/CreateAssistantAssociationCommand.js.map +1 -0
- package/dist-cjs/commands/CreateAssistantCommand.js +61 -0
- package/dist-cjs/commands/CreateAssistantCommand.js.map +1 -0
- package/dist-cjs/commands/CreateContentCommand.js +62 -0
- package/dist-cjs/commands/CreateContentCommand.js.map +1 -0
- package/dist-cjs/commands/CreateKnowledgeBaseCommand.js +85 -0
- package/dist-cjs/commands/CreateKnowledgeBaseCommand.js.map +1 -0
- package/dist-cjs/commands/CreateSessionCommand.js +63 -0
- package/dist-cjs/commands/CreateSessionCommand.js.map +1 -0
- package/dist-cjs/commands/DeleteAssistantAssociationCommand.js +61 -0
- package/dist-cjs/commands/DeleteAssistantAssociationCommand.js.map +1 -0
- package/dist-cjs/commands/DeleteAssistantCommand.js +61 -0
- package/dist-cjs/commands/DeleteAssistantCommand.js.map +1 -0
- package/dist-cjs/commands/DeleteContentCommand.js +61 -0
- package/dist-cjs/commands/DeleteContentCommand.js.map +1 -0
- package/dist-cjs/commands/DeleteKnowledgeBaseCommand.js +68 -0
- package/dist-cjs/commands/DeleteKnowledgeBaseCommand.js.map +1 -0
- package/dist-cjs/commands/GetAssistantAssociationCommand.js +61 -0
- package/dist-cjs/commands/GetAssistantAssociationCommand.js.map +1 -0
- package/dist-cjs/commands/GetAssistantCommand.js +61 -0
- package/dist-cjs/commands/GetAssistantCommand.js.map +1 -0
- package/dist-cjs/commands/GetContentCommand.js +61 -0
- package/dist-cjs/commands/GetContentCommand.js.map +1 -0
- package/dist-cjs/commands/GetContentSummaryCommand.js +61 -0
- package/dist-cjs/commands/GetContentSummaryCommand.js.map +1 -0
- package/dist-cjs/commands/GetKnowledgeBaseCommand.js +61 -0
- package/dist-cjs/commands/GetKnowledgeBaseCommand.js.map +1 -0
- package/dist-cjs/commands/GetRecommendationsCommand.js +64 -0
- package/dist-cjs/commands/GetRecommendationsCommand.js.map +1 -0
- package/dist-cjs/commands/GetSessionCommand.js +61 -0
- package/dist-cjs/commands/GetSessionCommand.js.map +1 -0
- package/dist-cjs/commands/ListAssistantAssociationsCommand.js +61 -0
- package/dist-cjs/commands/ListAssistantAssociationsCommand.js.map +1 -0
- package/dist-cjs/commands/ListAssistantsCommand.js +61 -0
- package/dist-cjs/commands/ListAssistantsCommand.js.map +1 -0
- package/dist-cjs/commands/ListContentsCommand.js +61 -0
- package/dist-cjs/commands/ListContentsCommand.js.map +1 -0
- package/dist-cjs/commands/ListKnowledgeBasesCommand.js +61 -0
- package/dist-cjs/commands/ListKnowledgeBasesCommand.js.map +1 -0
- package/dist-cjs/commands/ListTagsForResourceCommand.js +61 -0
- package/dist-cjs/commands/ListTagsForResourceCommand.js.map +1 -0
- package/dist-cjs/commands/NotifyRecommendationsReceivedCommand.js +63 -0
- package/dist-cjs/commands/NotifyRecommendationsReceivedCommand.js.map +1 -0
- package/dist-cjs/commands/QueryAssistantCommand.js +63 -0
- package/dist-cjs/commands/QueryAssistantCommand.js.map +1 -0
- package/dist-cjs/commands/RemoveKnowledgeBaseTemplateUriCommand.js +61 -0
- package/dist-cjs/commands/RemoveKnowledgeBaseTemplateUriCommand.js.map +1 -0
- package/dist-cjs/commands/SearchContentCommand.js +62 -0
- package/dist-cjs/commands/SearchContentCommand.js.map +1 -0
- package/dist-cjs/commands/SearchSessionsCommand.js +61 -0
- package/dist-cjs/commands/SearchSessionsCommand.js.map +1 -0
- package/dist-cjs/commands/StartContentUploadCommand.js +64 -0
- package/dist-cjs/commands/StartContentUploadCommand.js.map +1 -0
- package/dist-cjs/commands/TagResourceCommand.js +61 -0
- package/dist-cjs/commands/TagResourceCommand.js.map +1 -0
- package/dist-cjs/commands/UntagResourceCommand.js +61 -0
- package/dist-cjs/commands/UntagResourceCommand.js.map +1 -0
- package/dist-cjs/commands/UpdateContentCommand.js +61 -0
- package/dist-cjs/commands/UpdateContentCommand.js.map +1 -0
- package/dist-cjs/commands/UpdateKnowledgeBaseTemplateUriCommand.js +66 -0
- package/dist-cjs/commands/UpdateKnowledgeBaseTemplateUriCommand.js.map +1 -0
- package/dist-cjs/endpoints.js +57 -0
- package/dist-cjs/endpoints.js.map +1 -0
- package/dist-cjs/index.js +46 -0
- package/dist-cjs/index.js.map +1 -0
- package/dist-cjs/models/index.js +5 -0
- package/dist-cjs/models/index.js.map +1 -0
- package/dist-cjs/models/models_0.js +989 -0
- package/dist-cjs/models/models_0.js.map +1 -0
- package/dist-cjs/pagination/Interfaces.js +3 -0
- package/dist-cjs/pagination/Interfaces.js.map +1 -0
- package/dist-cjs/pagination/ListAssistantAssociationsPaginator.js +46 -0
- package/dist-cjs/pagination/ListAssistantAssociationsPaginator.js.map +1 -0
- package/dist-cjs/pagination/ListAssistantsPaginator.js +46 -0
- package/dist-cjs/pagination/ListAssistantsPaginator.js.map +1 -0
- package/dist-cjs/pagination/ListContentsPaginator.js +46 -0
- package/dist-cjs/pagination/ListContentsPaginator.js.map +1 -0
- package/dist-cjs/pagination/ListKnowledgeBasesPaginator.js +46 -0
- package/dist-cjs/pagination/ListKnowledgeBasesPaginator.js.map +1 -0
- package/dist-cjs/pagination/QueryAssistantPaginator.js +46 -0
- package/dist-cjs/pagination/QueryAssistantPaginator.js.map +1 -0
- package/dist-cjs/pagination/SearchContentPaginator.js +46 -0
- package/dist-cjs/pagination/SearchContentPaginator.js.map +1 -0
- package/dist-cjs/pagination/SearchSessionsPaginator.js +46 -0
- package/dist-cjs/pagination/SearchSessionsPaginator.js.map +1 -0
- package/dist-cjs/protocols/Aws_restJson1.js +3717 -0
- package/dist-cjs/protocols/Aws_restJson1.js.map +1 -0
- package/dist-cjs/runtimeConfig.browser.js +42 -0
- package/dist-cjs/runtimeConfig.browser.js.map +1 -0
- package/dist-cjs/runtimeConfig.js +47 -0
- package/dist-cjs/runtimeConfig.js.map +1 -0
- package/dist-cjs/runtimeConfig.native.js +20 -0
- package/dist-cjs/runtimeConfig.native.js.map +1 -0
- package/dist-cjs/runtimeConfig.shared.js +21 -0
- package/dist-cjs/runtimeConfig.shared.js.map +1 -0
- package/dist-es/Wisdom.js +476 -0
- package/dist-es/Wisdom.js.map +1 -0
- package/dist-es/WisdomClient.js +38 -0
- package/dist-es/WisdomClient.js.map +1 -0
- package/dist-es/commands/CreateAssistantAssociationCommand.js +40 -0
- package/dist-es/commands/CreateAssistantAssociationCommand.js.map +1 -0
- package/dist-es/commands/CreateAssistantCommand.js +40 -0
- package/dist-es/commands/CreateAssistantCommand.js.map +1 -0
- package/dist-es/commands/CreateContentCommand.js +40 -0
- package/dist-es/commands/CreateContentCommand.js.map +1 -0
- package/dist-es/commands/CreateKnowledgeBaseCommand.js +40 -0
- package/dist-es/commands/CreateKnowledgeBaseCommand.js.map +1 -0
- package/dist-es/commands/CreateSessionCommand.js +40 -0
- package/dist-es/commands/CreateSessionCommand.js.map +1 -0
- package/dist-es/commands/DeleteAssistantAssociationCommand.js +40 -0
- package/dist-es/commands/DeleteAssistantAssociationCommand.js.map +1 -0
- package/dist-es/commands/DeleteAssistantCommand.js +40 -0
- package/dist-es/commands/DeleteAssistantCommand.js.map +1 -0
- package/dist-es/commands/DeleteContentCommand.js +40 -0
- package/dist-es/commands/DeleteContentCommand.js.map +1 -0
- package/dist-es/commands/DeleteKnowledgeBaseCommand.js +40 -0
- package/dist-es/commands/DeleteKnowledgeBaseCommand.js.map +1 -0
- package/dist-es/commands/GetAssistantAssociationCommand.js +40 -0
- package/dist-es/commands/GetAssistantAssociationCommand.js.map +1 -0
- package/dist-es/commands/GetAssistantCommand.js +40 -0
- package/dist-es/commands/GetAssistantCommand.js.map +1 -0
- package/dist-es/commands/GetContentCommand.js +40 -0
- package/dist-es/commands/GetContentCommand.js.map +1 -0
- package/dist-es/commands/GetContentSummaryCommand.js +40 -0
- package/dist-es/commands/GetContentSummaryCommand.js.map +1 -0
- package/dist-es/commands/GetKnowledgeBaseCommand.js +40 -0
- package/dist-es/commands/GetKnowledgeBaseCommand.js.map +1 -0
- package/dist-es/commands/GetRecommendationsCommand.js +40 -0
- package/dist-es/commands/GetRecommendationsCommand.js.map +1 -0
- package/dist-es/commands/GetSessionCommand.js +40 -0
- package/dist-es/commands/GetSessionCommand.js.map +1 -0
- package/dist-es/commands/ListAssistantAssociationsCommand.js +40 -0
- package/dist-es/commands/ListAssistantAssociationsCommand.js.map +1 -0
- package/dist-es/commands/ListAssistantsCommand.js +40 -0
- package/dist-es/commands/ListAssistantsCommand.js.map +1 -0
- package/dist-es/commands/ListContentsCommand.js +40 -0
- package/dist-es/commands/ListContentsCommand.js.map +1 -0
- package/dist-es/commands/ListKnowledgeBasesCommand.js +40 -0
- package/dist-es/commands/ListKnowledgeBasesCommand.js.map +1 -0
- package/dist-es/commands/ListTagsForResourceCommand.js +40 -0
- package/dist-es/commands/ListTagsForResourceCommand.js.map +1 -0
- package/dist-es/commands/NotifyRecommendationsReceivedCommand.js +40 -0
- package/dist-es/commands/NotifyRecommendationsReceivedCommand.js.map +1 -0
- package/dist-es/commands/QueryAssistantCommand.js +40 -0
- package/dist-es/commands/QueryAssistantCommand.js.map +1 -0
- package/dist-es/commands/RemoveKnowledgeBaseTemplateUriCommand.js +40 -0
- package/dist-es/commands/RemoveKnowledgeBaseTemplateUriCommand.js.map +1 -0
- package/dist-es/commands/SearchContentCommand.js +40 -0
- package/dist-es/commands/SearchContentCommand.js.map +1 -0
- package/dist-es/commands/SearchSessionsCommand.js +40 -0
- package/dist-es/commands/SearchSessionsCommand.js.map +1 -0
- package/dist-es/commands/StartContentUploadCommand.js +40 -0
- package/dist-es/commands/StartContentUploadCommand.js.map +1 -0
- package/dist-es/commands/TagResourceCommand.js +40 -0
- package/dist-es/commands/TagResourceCommand.js.map +1 -0
- package/dist-es/commands/UntagResourceCommand.js +40 -0
- package/dist-es/commands/UntagResourceCommand.js.map +1 -0
- package/dist-es/commands/UpdateContentCommand.js +40 -0
- package/dist-es/commands/UpdateContentCommand.js.map +1 -0
- package/dist-es/commands/UpdateKnowledgeBaseTemplateUriCommand.js +40 -0
- package/dist-es/commands/UpdateKnowledgeBaseTemplateUriCommand.js.map +1 -0
- package/dist-es/endpoints.js +53 -0
- package/dist-es/endpoints.js.map +1 -0
- package/dist-es/index.js +43 -0
- package/dist-es/index.js.map +1 -0
- package/dist-es/models/index.js +2 -0
- package/dist-es/models/index.js.map +1 -0
- package/dist-es/models/models_0.js +495 -0
- package/dist-es/models/models_0.js.map +1 -0
- package/dist-es/pagination/Interfaces.js +2 -0
- package/dist-es/pagination/Interfaces.js.map +1 -0
- package/dist-es/pagination/ListAssistantAssociationsPaginator.js +75 -0
- package/dist-es/pagination/ListAssistantAssociationsPaginator.js.map +1 -0
- package/dist-es/pagination/ListAssistantsPaginator.js +75 -0
- package/dist-es/pagination/ListAssistantsPaginator.js.map +1 -0
- package/dist-es/pagination/ListContentsPaginator.js +75 -0
- package/dist-es/pagination/ListContentsPaginator.js.map +1 -0
- package/dist-es/pagination/ListKnowledgeBasesPaginator.js +75 -0
- package/dist-es/pagination/ListKnowledgeBasesPaginator.js.map +1 -0
- package/dist-es/pagination/QueryAssistantPaginator.js +75 -0
- package/dist-es/pagination/QueryAssistantPaginator.js.map +1 -0
- package/dist-es/pagination/SearchContentPaginator.js +75 -0
- package/dist-es/pagination/SearchContentPaginator.js.map +1 -0
- package/dist-es/pagination/SearchSessionsPaginator.js +75 -0
- package/dist-es/pagination/SearchSessionsPaginator.js.map +1 -0
- package/dist-es/protocols/Aws_restJson1.js +4214 -0
- package/dist-es/protocols/Aws_restJson1.js.map +1 -0
- package/dist-es/runtimeConfig.browser.js +17 -0
- package/dist-es/runtimeConfig.browser.js.map +1 -0
- package/dist-es/runtimeConfig.js +22 -0
- package/dist-es/runtimeConfig.js.map +1 -0
- package/dist-es/runtimeConfig.native.js +9 -0
- package/dist-es/runtimeConfig.native.js.map +1 -0
- package/dist-es/runtimeConfig.shared.js +14 -0
- package/dist-es/runtimeConfig.shared.js.map +1 -0
- package/dist-types/Wisdom.d.ts +280 -0
- package/dist-types/WisdomClient.d.ts +167 -0
- package/dist-types/commands/CreateAssistantAssociationCommand.d.ts +37 -0
- package/dist-types/commands/CreateAssistantCommand.d.ts +35 -0
- package/dist-types/commands/CreateContentCommand.d.ts +36 -0
- package/dist-types/commands/CreateKnowledgeBaseCommand.d.ts +59 -0
- package/dist-types/commands/CreateSessionCommand.d.ts +37 -0
- package/dist-types/commands/DeleteAssistantAssociationCommand.d.ts +35 -0
- package/dist-types/commands/DeleteAssistantCommand.d.ts +35 -0
- package/dist-types/commands/DeleteContentCommand.d.ts +35 -0
- package/dist-types/commands/DeleteKnowledgeBaseCommand.d.ts +42 -0
- package/dist-types/commands/GetAssistantAssociationCommand.d.ts +35 -0
- package/dist-types/commands/GetAssistantCommand.d.ts +35 -0
- package/dist-types/commands/GetContentCommand.d.ts +35 -0
- package/dist-types/commands/GetContentSummaryCommand.d.ts +35 -0
- package/dist-types/commands/GetKnowledgeBaseCommand.d.ts +35 -0
- package/dist-types/commands/GetRecommendationsCommand.d.ts +38 -0
- package/dist-types/commands/GetSessionCommand.d.ts +35 -0
- package/dist-types/commands/ListAssistantAssociationsCommand.d.ts +35 -0
- package/dist-types/commands/ListAssistantsCommand.d.ts +35 -0
- package/dist-types/commands/ListContentsCommand.d.ts +35 -0
- package/dist-types/commands/ListKnowledgeBasesCommand.d.ts +35 -0
- package/dist-types/commands/ListTagsForResourceCommand.d.ts +35 -0
- package/dist-types/commands/NotifyRecommendationsReceivedCommand.d.ts +37 -0
- package/dist-types/commands/QueryAssistantCommand.d.ts +37 -0
- package/dist-types/commands/RemoveKnowledgeBaseTemplateUriCommand.d.ts +35 -0
- package/dist-types/commands/SearchContentCommand.d.ts +36 -0
- package/dist-types/commands/SearchSessionsCommand.d.ts +35 -0
- package/dist-types/commands/StartContentUploadCommand.d.ts +38 -0
- package/dist-types/commands/TagResourceCommand.d.ts +35 -0
- package/dist-types/commands/UntagResourceCommand.d.ts +35 -0
- package/dist-types/commands/UpdateContentCommand.d.ts +35 -0
- package/dist-types/commands/UpdateKnowledgeBaseTemplateUriCommand.d.ts +40 -0
- package/dist-types/endpoints.d.ts +2 -0
- package/dist-types/index.d.ts +42 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +2073 -0
- package/dist-types/pagination/Interfaces.d.ts +6 -0
- package/dist-types/pagination/ListAssistantAssociationsPaginator.d.ts +4 -0
- package/dist-types/pagination/ListAssistantsPaginator.d.ts +4 -0
- package/dist-types/pagination/ListContentsPaginator.d.ts +4 -0
- package/dist-types/pagination/ListKnowledgeBasesPaginator.d.ts +4 -0
- package/dist-types/pagination/QueryAssistantPaginator.d.ts +4 -0
- package/dist-types/pagination/SearchContentPaginator.d.ts +4 -0
- package/dist-types/pagination/SearchSessionsPaginator.d.ts +4 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +95 -0
- package/dist-types/runtimeConfig.browser.d.ts +37 -0
- package/dist-types/runtimeConfig.d.ts +37 -0
- package/dist-types/runtimeConfig.native.d.ts +36 -0
- package/dist-types/runtimeConfig.shared.d.ts +13 -0
- package/dist-types/ts3.4/Wisdom.d.ts +280 -0
- package/dist-types/ts3.4/WisdomClient.d.ts +167 -0
- package/dist-types/ts3.4/commands/CreateAssistantAssociationCommand.d.ts +37 -0
- package/dist-types/ts3.4/commands/CreateAssistantCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/CreateContentCommand.d.ts +36 -0
- package/dist-types/ts3.4/commands/CreateKnowledgeBaseCommand.d.ts +59 -0
- package/dist-types/ts3.4/commands/CreateSessionCommand.d.ts +37 -0
- package/dist-types/ts3.4/commands/DeleteAssistantAssociationCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/DeleteAssistantCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/DeleteContentCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/DeleteKnowledgeBaseCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/GetAssistantAssociationCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/GetAssistantCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/GetContentCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/GetContentSummaryCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/GetKnowledgeBaseCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/GetRecommendationsCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/GetSessionCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/ListAssistantAssociationsCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/ListAssistantsCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/ListContentsCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/ListKnowledgeBasesCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/NotifyRecommendationsReceivedCommand.d.ts +37 -0
- package/dist-types/ts3.4/commands/QueryAssistantCommand.d.ts +37 -0
- package/dist-types/ts3.4/commands/RemoveKnowledgeBaseTemplateUriCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/SearchContentCommand.d.ts +36 -0
- package/dist-types/ts3.4/commands/SearchSessionsCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/StartContentUploadCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/UpdateContentCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/UpdateKnowledgeBaseTemplateUriCommand.d.ts +40 -0
- package/dist-types/ts3.4/endpoints.d.ts +2 -0
- package/dist-types/ts3.4/index.d.ts +42 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +2082 -0
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
- package/dist-types/ts3.4/pagination/ListAssistantAssociationsPaginator.d.ts +4 -0
- package/dist-types/ts3.4/pagination/ListAssistantsPaginator.d.ts +4 -0
- package/dist-types/ts3.4/pagination/ListContentsPaginator.d.ts +4 -0
- package/dist-types/ts3.4/pagination/ListKnowledgeBasesPaginator.d.ts +4 -0
- package/dist-types/ts3.4/pagination/QueryAssistantPaginator.d.ts +4 -0
- package/dist-types/ts3.4/pagination/SearchContentPaginator.d.ts +4 -0
- package/dist-types/ts3.4/pagination/SearchSessionsPaginator.d.ts +4 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +95 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +37 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +37 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +36 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +13 -0
- package/jest.config.js +4 -0
- package/package.json +93 -0
- package/src/Wisdom.ts +1175 -0
- package/src/WisdomClient.ts +363 -0
- package/src/commands/CreateAssistantAssociationCommand.ts +100 -0
- package/src/commands/CreateAssistantCommand.ts +95 -0
- package/src/commands/CreateContentCommand.ts +96 -0
- package/src/commands/CreateKnowledgeBaseCommand.ts +119 -0
- package/src/commands/CreateSessionCommand.ts +97 -0
- package/src/commands/DeleteAssistantAssociationCommand.ts +98 -0
- package/src/commands/DeleteAssistantCommand.ts +95 -0
- package/src/commands/DeleteContentCommand.ts +95 -0
- package/src/commands/DeleteKnowledgeBaseCommand.ts +102 -0
- package/src/commands/GetAssistantAssociationCommand.ts +95 -0
- package/src/commands/GetAssistantCommand.ts +95 -0
- package/src/commands/GetContentCommand.ts +95 -0
- package/src/commands/GetContentSummaryCommand.ts +95 -0
- package/src/commands/GetKnowledgeBaseCommand.ts +95 -0
- package/src/commands/GetRecommendationsCommand.ts +98 -0
- package/src/commands/GetSessionCommand.ts +95 -0
- package/src/commands/ListAssistantAssociationsCommand.ts +98 -0
- package/src/commands/ListAssistantsCommand.ts +95 -0
- package/src/commands/ListContentsCommand.ts +95 -0
- package/src/commands/ListKnowledgeBasesCommand.ts +95 -0
- package/src/commands/ListTagsForResourceCommand.ts +95 -0
- package/src/commands/NotifyRecommendationsReceivedCommand.ts +102 -0
- package/src/commands/QueryAssistantCommand.ts +97 -0
- package/src/commands/RemoveKnowledgeBaseTemplateUriCommand.ts +103 -0
- package/src/commands/SearchContentCommand.ts +96 -0
- package/src/commands/SearchSessionsCommand.ts +95 -0
- package/src/commands/StartContentUploadCommand.ts +98 -0
- package/src/commands/TagResourceCommand.ts +95 -0
- package/src/commands/UntagResourceCommand.ts +95 -0
- package/src/commands/UpdateContentCommand.ts +95 -0
- package/src/commands/UpdateKnowledgeBaseTemplateUriCommand.ts +108 -0
- package/src/endpoints.ts +57 -0
- package/src/index.ts +42 -0
- package/src/models/index.ts +1 -0
- package/src/models/models_0.ts +2662 -0
- package/src/pagination/Interfaces.ts +8 -0
- package/src/pagination/ListAssistantAssociationsPaginator.ts +59 -0
- package/src/pagination/ListAssistantsPaginator.ts +59 -0
- package/src/pagination/ListContentsPaginator.ts +59 -0
- package/src/pagination/ListKnowledgeBasesPaginator.ts +59 -0
- package/src/pagination/QueryAssistantPaginator.ts +59 -0
- package/src/pagination/SearchContentPaginator.ts +59 -0
- package/src/pagination/SearchSessionsPaginator.ts +59 -0
- package/src/protocols/Aws_restJson1.ts +4293 -0
- package/src/runtimeConfig.browser.ts +41 -0
- package/src/runtimeConfig.native.ts +17 -0
- package/src/runtimeConfig.shared.ts +17 -0
- package/src/runtimeConfig.ts +46 -0
- package/tsconfig.es.json +10 -0
- package/tsconfig.json +33 -0
- package/tsconfig.types.json +9 -0
|
@@ -0,0 +1,3717 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeAws_restJson1ListContentsCommand = exports.deserializeAws_restJson1ListAssistantsCommand = exports.deserializeAws_restJson1ListAssistantAssociationsCommand = exports.deserializeAws_restJson1GetSessionCommand = exports.deserializeAws_restJson1GetRecommendationsCommand = exports.deserializeAws_restJson1GetKnowledgeBaseCommand = exports.deserializeAws_restJson1GetContentSummaryCommand = exports.deserializeAws_restJson1GetContentCommand = exports.deserializeAws_restJson1GetAssistantAssociationCommand = exports.deserializeAws_restJson1GetAssistantCommand = exports.deserializeAws_restJson1DeleteKnowledgeBaseCommand = exports.deserializeAws_restJson1DeleteContentCommand = exports.deserializeAws_restJson1DeleteAssistantAssociationCommand = exports.deserializeAws_restJson1DeleteAssistantCommand = exports.deserializeAws_restJson1CreateSessionCommand = exports.deserializeAws_restJson1CreateKnowledgeBaseCommand = exports.deserializeAws_restJson1CreateContentCommand = exports.deserializeAws_restJson1CreateAssistantAssociationCommand = exports.deserializeAws_restJson1CreateAssistantCommand = exports.serializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommand = exports.serializeAws_restJson1UpdateContentCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1StartContentUploadCommand = exports.serializeAws_restJson1SearchSessionsCommand = exports.serializeAws_restJson1SearchContentCommand = exports.serializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand = exports.serializeAws_restJson1QueryAssistantCommand = exports.serializeAws_restJson1NotifyRecommendationsReceivedCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListKnowledgeBasesCommand = exports.serializeAws_restJson1ListContentsCommand = exports.serializeAws_restJson1ListAssistantsCommand = exports.serializeAws_restJson1ListAssistantAssociationsCommand = exports.serializeAws_restJson1GetSessionCommand = exports.serializeAws_restJson1GetRecommendationsCommand = exports.serializeAws_restJson1GetKnowledgeBaseCommand = exports.serializeAws_restJson1GetContentSummaryCommand = exports.serializeAws_restJson1GetContentCommand = exports.serializeAws_restJson1GetAssistantAssociationCommand = exports.serializeAws_restJson1GetAssistantCommand = exports.serializeAws_restJson1DeleteKnowledgeBaseCommand = exports.serializeAws_restJson1DeleteContentCommand = exports.serializeAws_restJson1DeleteAssistantAssociationCommand = exports.serializeAws_restJson1DeleteAssistantCommand = exports.serializeAws_restJson1CreateSessionCommand = exports.serializeAws_restJson1CreateKnowledgeBaseCommand = exports.serializeAws_restJson1CreateContentCommand = exports.serializeAws_restJson1CreateAssistantAssociationCommand = exports.serializeAws_restJson1CreateAssistantCommand = void 0;
|
|
4
|
+
exports.deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommand = exports.deserializeAws_restJson1UpdateContentCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1StartContentUploadCommand = exports.deserializeAws_restJson1SearchSessionsCommand = exports.deserializeAws_restJson1SearchContentCommand = exports.deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand = exports.deserializeAws_restJson1QueryAssistantCommand = exports.deserializeAws_restJson1NotifyRecommendationsReceivedCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListKnowledgeBasesCommand = void 0;
|
|
5
|
+
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
6
|
+
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
7
|
+
const uuid_1 = require("uuid");
|
|
8
|
+
const models_0_1 = require("../models/models_0");
|
|
9
|
+
const serializeAws_restJson1CreateAssistantCommand = async (input, context) => {
|
|
10
|
+
var _a;
|
|
11
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
12
|
+
const headers = {
|
|
13
|
+
"content-type": "application/json",
|
|
14
|
+
};
|
|
15
|
+
const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assistants";
|
|
16
|
+
let body;
|
|
17
|
+
body = JSON.stringify({
|
|
18
|
+
clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : uuid_1.v4(),
|
|
19
|
+
...(input.description !== undefined && input.description !== null && { description: input.description }),
|
|
20
|
+
...(input.name !== undefined && input.name !== null && { name: input.name }),
|
|
21
|
+
...(input.serverSideEncryptionConfiguration !== undefined &&
|
|
22
|
+
input.serverSideEncryptionConfiguration !== null && {
|
|
23
|
+
serverSideEncryptionConfiguration: serializeAws_restJson1ServerSideEncryptionConfiguration(input.serverSideEncryptionConfiguration, context),
|
|
24
|
+
}),
|
|
25
|
+
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }),
|
|
26
|
+
...(input.type !== undefined && input.type !== null && { type: input.type }),
|
|
27
|
+
});
|
|
28
|
+
return new protocol_http_1.HttpRequest({
|
|
29
|
+
protocol,
|
|
30
|
+
hostname,
|
|
31
|
+
port,
|
|
32
|
+
method: "POST",
|
|
33
|
+
headers,
|
|
34
|
+
path: resolvedPath,
|
|
35
|
+
body,
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
exports.serializeAws_restJson1CreateAssistantCommand = serializeAws_restJson1CreateAssistantCommand;
|
|
39
|
+
const serializeAws_restJson1CreateAssistantAssociationCommand = async (input, context) => {
|
|
40
|
+
var _a;
|
|
41
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
42
|
+
const headers = {
|
|
43
|
+
"content-type": "application/json",
|
|
44
|
+
};
|
|
45
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/associations";
|
|
46
|
+
if (input.assistantId !== undefined) {
|
|
47
|
+
const labelValue = input.assistantId;
|
|
48
|
+
if (labelValue.length <= 0) {
|
|
49
|
+
throw new Error("Empty value provided for input HTTP label: assistantId.");
|
|
50
|
+
}
|
|
51
|
+
resolvedPath = resolvedPath.replace("{assistantId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
throw new Error("No value provided for input HTTP label: assistantId.");
|
|
55
|
+
}
|
|
56
|
+
let body;
|
|
57
|
+
body = JSON.stringify({
|
|
58
|
+
...(input.association !== undefined &&
|
|
59
|
+
input.association !== null && {
|
|
60
|
+
association: serializeAws_restJson1AssistantAssociationInputData(input.association, context),
|
|
61
|
+
}),
|
|
62
|
+
...(input.associationType !== undefined &&
|
|
63
|
+
input.associationType !== null && { associationType: input.associationType }),
|
|
64
|
+
clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : uuid_1.v4(),
|
|
65
|
+
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }),
|
|
66
|
+
});
|
|
67
|
+
return new protocol_http_1.HttpRequest({
|
|
68
|
+
protocol,
|
|
69
|
+
hostname,
|
|
70
|
+
port,
|
|
71
|
+
method: "POST",
|
|
72
|
+
headers,
|
|
73
|
+
path: resolvedPath,
|
|
74
|
+
body,
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
exports.serializeAws_restJson1CreateAssistantAssociationCommand = serializeAws_restJson1CreateAssistantAssociationCommand;
|
|
78
|
+
const serializeAws_restJson1CreateContentCommand = async (input, context) => {
|
|
79
|
+
var _a;
|
|
80
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
81
|
+
const headers = {
|
|
82
|
+
"content-type": "application/json",
|
|
83
|
+
};
|
|
84
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
85
|
+
"/knowledgeBases/{knowledgeBaseId}/contents";
|
|
86
|
+
if (input.knowledgeBaseId !== undefined) {
|
|
87
|
+
const labelValue = input.knowledgeBaseId;
|
|
88
|
+
if (labelValue.length <= 0) {
|
|
89
|
+
throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
|
|
90
|
+
}
|
|
91
|
+
resolvedPath = resolvedPath.replace("{knowledgeBaseId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
|
|
95
|
+
}
|
|
96
|
+
let body;
|
|
97
|
+
body = JSON.stringify({
|
|
98
|
+
clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : uuid_1.v4(),
|
|
99
|
+
...(input.metadata !== undefined &&
|
|
100
|
+
input.metadata !== null && { metadata: serializeAws_restJson1ContentMetadata(input.metadata, context) }),
|
|
101
|
+
...(input.name !== undefined && input.name !== null && { name: input.name }),
|
|
102
|
+
...(input.overrideLinkOutUri !== undefined &&
|
|
103
|
+
input.overrideLinkOutUri !== null && { overrideLinkOutUri: input.overrideLinkOutUri }),
|
|
104
|
+
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }),
|
|
105
|
+
...(input.title !== undefined && input.title !== null && { title: input.title }),
|
|
106
|
+
...(input.uploadId !== undefined && input.uploadId !== null && { uploadId: input.uploadId }),
|
|
107
|
+
});
|
|
108
|
+
return new protocol_http_1.HttpRequest({
|
|
109
|
+
protocol,
|
|
110
|
+
hostname,
|
|
111
|
+
port,
|
|
112
|
+
method: "POST",
|
|
113
|
+
headers,
|
|
114
|
+
path: resolvedPath,
|
|
115
|
+
body,
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
exports.serializeAws_restJson1CreateContentCommand = serializeAws_restJson1CreateContentCommand;
|
|
119
|
+
const serializeAws_restJson1CreateKnowledgeBaseCommand = async (input, context) => {
|
|
120
|
+
var _a;
|
|
121
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
122
|
+
const headers = {
|
|
123
|
+
"content-type": "application/json",
|
|
124
|
+
};
|
|
125
|
+
const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases";
|
|
126
|
+
let body;
|
|
127
|
+
body = JSON.stringify({
|
|
128
|
+
clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : uuid_1.v4(),
|
|
129
|
+
...(input.description !== undefined && input.description !== null && { description: input.description }),
|
|
130
|
+
...(input.knowledgeBaseType !== undefined &&
|
|
131
|
+
input.knowledgeBaseType !== null && { knowledgeBaseType: input.knowledgeBaseType }),
|
|
132
|
+
...(input.name !== undefined && input.name !== null && { name: input.name }),
|
|
133
|
+
...(input.renderingConfiguration !== undefined &&
|
|
134
|
+
input.renderingConfiguration !== null && {
|
|
135
|
+
renderingConfiguration: serializeAws_restJson1RenderingConfiguration(input.renderingConfiguration, context),
|
|
136
|
+
}),
|
|
137
|
+
...(input.serverSideEncryptionConfiguration !== undefined &&
|
|
138
|
+
input.serverSideEncryptionConfiguration !== null && {
|
|
139
|
+
serverSideEncryptionConfiguration: serializeAws_restJson1ServerSideEncryptionConfiguration(input.serverSideEncryptionConfiguration, context),
|
|
140
|
+
}),
|
|
141
|
+
...(input.sourceConfiguration !== undefined &&
|
|
142
|
+
input.sourceConfiguration !== null && {
|
|
143
|
+
sourceConfiguration: serializeAws_restJson1SourceConfiguration(input.sourceConfiguration, context),
|
|
144
|
+
}),
|
|
145
|
+
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }),
|
|
146
|
+
});
|
|
147
|
+
return new protocol_http_1.HttpRequest({
|
|
148
|
+
protocol,
|
|
149
|
+
hostname,
|
|
150
|
+
port,
|
|
151
|
+
method: "POST",
|
|
152
|
+
headers,
|
|
153
|
+
path: resolvedPath,
|
|
154
|
+
body,
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
exports.serializeAws_restJson1CreateKnowledgeBaseCommand = serializeAws_restJson1CreateKnowledgeBaseCommand;
|
|
158
|
+
const serializeAws_restJson1CreateSessionCommand = async (input, context) => {
|
|
159
|
+
var _a;
|
|
160
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
161
|
+
const headers = {
|
|
162
|
+
"content-type": "application/json",
|
|
163
|
+
};
|
|
164
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/sessions";
|
|
165
|
+
if (input.assistantId !== undefined) {
|
|
166
|
+
const labelValue = input.assistantId;
|
|
167
|
+
if (labelValue.length <= 0) {
|
|
168
|
+
throw new Error("Empty value provided for input HTTP label: assistantId.");
|
|
169
|
+
}
|
|
170
|
+
resolvedPath = resolvedPath.replace("{assistantId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
throw new Error("No value provided for input HTTP label: assistantId.");
|
|
174
|
+
}
|
|
175
|
+
let body;
|
|
176
|
+
body = JSON.stringify({
|
|
177
|
+
clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : uuid_1.v4(),
|
|
178
|
+
...(input.description !== undefined && input.description !== null && { description: input.description }),
|
|
179
|
+
...(input.name !== undefined && input.name !== null && { name: input.name }),
|
|
180
|
+
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }),
|
|
181
|
+
});
|
|
182
|
+
return new protocol_http_1.HttpRequest({
|
|
183
|
+
protocol,
|
|
184
|
+
hostname,
|
|
185
|
+
port,
|
|
186
|
+
method: "POST",
|
|
187
|
+
headers,
|
|
188
|
+
path: resolvedPath,
|
|
189
|
+
body,
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
exports.serializeAws_restJson1CreateSessionCommand = serializeAws_restJson1CreateSessionCommand;
|
|
193
|
+
const serializeAws_restJson1DeleteAssistantCommand = async (input, context) => {
|
|
194
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
195
|
+
const headers = {};
|
|
196
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}";
|
|
197
|
+
if (input.assistantId !== undefined) {
|
|
198
|
+
const labelValue = input.assistantId;
|
|
199
|
+
if (labelValue.length <= 0) {
|
|
200
|
+
throw new Error("Empty value provided for input HTTP label: assistantId.");
|
|
201
|
+
}
|
|
202
|
+
resolvedPath = resolvedPath.replace("{assistantId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
throw new Error("No value provided for input HTTP label: assistantId.");
|
|
206
|
+
}
|
|
207
|
+
let body;
|
|
208
|
+
return new protocol_http_1.HttpRequest({
|
|
209
|
+
protocol,
|
|
210
|
+
hostname,
|
|
211
|
+
port,
|
|
212
|
+
method: "DELETE",
|
|
213
|
+
headers,
|
|
214
|
+
path: resolvedPath,
|
|
215
|
+
body,
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
exports.serializeAws_restJson1DeleteAssistantCommand = serializeAws_restJson1DeleteAssistantCommand;
|
|
219
|
+
const serializeAws_restJson1DeleteAssistantAssociationCommand = async (input, context) => {
|
|
220
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
221
|
+
const headers = {};
|
|
222
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
223
|
+
"/assistants/{assistantId}/associations/{assistantAssociationId}";
|
|
224
|
+
if (input.assistantAssociationId !== undefined) {
|
|
225
|
+
const labelValue = input.assistantAssociationId;
|
|
226
|
+
if (labelValue.length <= 0) {
|
|
227
|
+
throw new Error("Empty value provided for input HTTP label: assistantAssociationId.");
|
|
228
|
+
}
|
|
229
|
+
resolvedPath = resolvedPath.replace("{assistantAssociationId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
throw new Error("No value provided for input HTTP label: assistantAssociationId.");
|
|
233
|
+
}
|
|
234
|
+
if (input.assistantId !== undefined) {
|
|
235
|
+
const labelValue = input.assistantId;
|
|
236
|
+
if (labelValue.length <= 0) {
|
|
237
|
+
throw new Error("Empty value provided for input HTTP label: assistantId.");
|
|
238
|
+
}
|
|
239
|
+
resolvedPath = resolvedPath.replace("{assistantId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
throw new Error("No value provided for input HTTP label: assistantId.");
|
|
243
|
+
}
|
|
244
|
+
let body;
|
|
245
|
+
return new protocol_http_1.HttpRequest({
|
|
246
|
+
protocol,
|
|
247
|
+
hostname,
|
|
248
|
+
port,
|
|
249
|
+
method: "DELETE",
|
|
250
|
+
headers,
|
|
251
|
+
path: resolvedPath,
|
|
252
|
+
body,
|
|
253
|
+
});
|
|
254
|
+
};
|
|
255
|
+
exports.serializeAws_restJson1DeleteAssistantAssociationCommand = serializeAws_restJson1DeleteAssistantAssociationCommand;
|
|
256
|
+
const serializeAws_restJson1DeleteContentCommand = async (input, context) => {
|
|
257
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
258
|
+
const headers = {};
|
|
259
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
260
|
+
"/knowledgeBases/{knowledgeBaseId}/contents/{contentId}";
|
|
261
|
+
if (input.knowledgeBaseId !== undefined) {
|
|
262
|
+
const labelValue = input.knowledgeBaseId;
|
|
263
|
+
if (labelValue.length <= 0) {
|
|
264
|
+
throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
|
|
265
|
+
}
|
|
266
|
+
resolvedPath = resolvedPath.replace("{knowledgeBaseId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
|
|
270
|
+
}
|
|
271
|
+
if (input.contentId !== undefined) {
|
|
272
|
+
const labelValue = input.contentId;
|
|
273
|
+
if (labelValue.length <= 0) {
|
|
274
|
+
throw new Error("Empty value provided for input HTTP label: contentId.");
|
|
275
|
+
}
|
|
276
|
+
resolvedPath = resolvedPath.replace("{contentId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
throw new Error("No value provided for input HTTP label: contentId.");
|
|
280
|
+
}
|
|
281
|
+
let body;
|
|
282
|
+
return new protocol_http_1.HttpRequest({
|
|
283
|
+
protocol,
|
|
284
|
+
hostname,
|
|
285
|
+
port,
|
|
286
|
+
method: "DELETE",
|
|
287
|
+
headers,
|
|
288
|
+
path: resolvedPath,
|
|
289
|
+
body,
|
|
290
|
+
});
|
|
291
|
+
};
|
|
292
|
+
exports.serializeAws_restJson1DeleteContentCommand = serializeAws_restJson1DeleteContentCommand;
|
|
293
|
+
const serializeAws_restJson1DeleteKnowledgeBaseCommand = async (input, context) => {
|
|
294
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
295
|
+
const headers = {};
|
|
296
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases/{knowledgeBaseId}";
|
|
297
|
+
if (input.knowledgeBaseId !== undefined) {
|
|
298
|
+
const labelValue = input.knowledgeBaseId;
|
|
299
|
+
if (labelValue.length <= 0) {
|
|
300
|
+
throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
|
|
301
|
+
}
|
|
302
|
+
resolvedPath = resolvedPath.replace("{knowledgeBaseId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
|
|
306
|
+
}
|
|
307
|
+
let body;
|
|
308
|
+
return new protocol_http_1.HttpRequest({
|
|
309
|
+
protocol,
|
|
310
|
+
hostname,
|
|
311
|
+
port,
|
|
312
|
+
method: "DELETE",
|
|
313
|
+
headers,
|
|
314
|
+
path: resolvedPath,
|
|
315
|
+
body,
|
|
316
|
+
});
|
|
317
|
+
};
|
|
318
|
+
exports.serializeAws_restJson1DeleteKnowledgeBaseCommand = serializeAws_restJson1DeleteKnowledgeBaseCommand;
|
|
319
|
+
const serializeAws_restJson1GetAssistantCommand = async (input, context) => {
|
|
320
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
321
|
+
const headers = {};
|
|
322
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}";
|
|
323
|
+
if (input.assistantId !== undefined) {
|
|
324
|
+
const labelValue = input.assistantId;
|
|
325
|
+
if (labelValue.length <= 0) {
|
|
326
|
+
throw new Error("Empty value provided for input HTTP label: assistantId.");
|
|
327
|
+
}
|
|
328
|
+
resolvedPath = resolvedPath.replace("{assistantId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
throw new Error("No value provided for input HTTP label: assistantId.");
|
|
332
|
+
}
|
|
333
|
+
let body;
|
|
334
|
+
return new protocol_http_1.HttpRequest({
|
|
335
|
+
protocol,
|
|
336
|
+
hostname,
|
|
337
|
+
port,
|
|
338
|
+
method: "GET",
|
|
339
|
+
headers,
|
|
340
|
+
path: resolvedPath,
|
|
341
|
+
body,
|
|
342
|
+
});
|
|
343
|
+
};
|
|
344
|
+
exports.serializeAws_restJson1GetAssistantCommand = serializeAws_restJson1GetAssistantCommand;
|
|
345
|
+
const serializeAws_restJson1GetAssistantAssociationCommand = async (input, context) => {
|
|
346
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
347
|
+
const headers = {};
|
|
348
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
349
|
+
"/assistants/{assistantId}/associations/{assistantAssociationId}";
|
|
350
|
+
if (input.assistantAssociationId !== undefined) {
|
|
351
|
+
const labelValue = input.assistantAssociationId;
|
|
352
|
+
if (labelValue.length <= 0) {
|
|
353
|
+
throw new Error("Empty value provided for input HTTP label: assistantAssociationId.");
|
|
354
|
+
}
|
|
355
|
+
resolvedPath = resolvedPath.replace("{assistantAssociationId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
throw new Error("No value provided for input HTTP label: assistantAssociationId.");
|
|
359
|
+
}
|
|
360
|
+
if (input.assistantId !== undefined) {
|
|
361
|
+
const labelValue = input.assistantId;
|
|
362
|
+
if (labelValue.length <= 0) {
|
|
363
|
+
throw new Error("Empty value provided for input HTTP label: assistantId.");
|
|
364
|
+
}
|
|
365
|
+
resolvedPath = resolvedPath.replace("{assistantId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
throw new Error("No value provided for input HTTP label: assistantId.");
|
|
369
|
+
}
|
|
370
|
+
let body;
|
|
371
|
+
return new protocol_http_1.HttpRequest({
|
|
372
|
+
protocol,
|
|
373
|
+
hostname,
|
|
374
|
+
port,
|
|
375
|
+
method: "GET",
|
|
376
|
+
headers,
|
|
377
|
+
path: resolvedPath,
|
|
378
|
+
body,
|
|
379
|
+
});
|
|
380
|
+
};
|
|
381
|
+
exports.serializeAws_restJson1GetAssistantAssociationCommand = serializeAws_restJson1GetAssistantAssociationCommand;
|
|
382
|
+
const serializeAws_restJson1GetContentCommand = async (input, context) => {
|
|
383
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
384
|
+
const headers = {};
|
|
385
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
386
|
+
"/knowledgeBases/{knowledgeBaseId}/contents/{contentId}";
|
|
387
|
+
if (input.contentId !== undefined) {
|
|
388
|
+
const labelValue = input.contentId;
|
|
389
|
+
if (labelValue.length <= 0) {
|
|
390
|
+
throw new Error("Empty value provided for input HTTP label: contentId.");
|
|
391
|
+
}
|
|
392
|
+
resolvedPath = resolvedPath.replace("{contentId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
throw new Error("No value provided for input HTTP label: contentId.");
|
|
396
|
+
}
|
|
397
|
+
if (input.knowledgeBaseId !== undefined) {
|
|
398
|
+
const labelValue = input.knowledgeBaseId;
|
|
399
|
+
if (labelValue.length <= 0) {
|
|
400
|
+
throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
|
|
401
|
+
}
|
|
402
|
+
resolvedPath = resolvedPath.replace("{knowledgeBaseId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
403
|
+
}
|
|
404
|
+
else {
|
|
405
|
+
throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
|
|
406
|
+
}
|
|
407
|
+
let body;
|
|
408
|
+
return new protocol_http_1.HttpRequest({
|
|
409
|
+
protocol,
|
|
410
|
+
hostname,
|
|
411
|
+
port,
|
|
412
|
+
method: "GET",
|
|
413
|
+
headers,
|
|
414
|
+
path: resolvedPath,
|
|
415
|
+
body,
|
|
416
|
+
});
|
|
417
|
+
};
|
|
418
|
+
exports.serializeAws_restJson1GetContentCommand = serializeAws_restJson1GetContentCommand;
|
|
419
|
+
const serializeAws_restJson1GetContentSummaryCommand = async (input, context) => {
|
|
420
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
421
|
+
const headers = {};
|
|
422
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
423
|
+
"/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/summary";
|
|
424
|
+
if (input.contentId !== undefined) {
|
|
425
|
+
const labelValue = input.contentId;
|
|
426
|
+
if (labelValue.length <= 0) {
|
|
427
|
+
throw new Error("Empty value provided for input HTTP label: contentId.");
|
|
428
|
+
}
|
|
429
|
+
resolvedPath = resolvedPath.replace("{contentId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
throw new Error("No value provided for input HTTP label: contentId.");
|
|
433
|
+
}
|
|
434
|
+
if (input.knowledgeBaseId !== undefined) {
|
|
435
|
+
const labelValue = input.knowledgeBaseId;
|
|
436
|
+
if (labelValue.length <= 0) {
|
|
437
|
+
throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
|
|
438
|
+
}
|
|
439
|
+
resolvedPath = resolvedPath.replace("{knowledgeBaseId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
440
|
+
}
|
|
441
|
+
else {
|
|
442
|
+
throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
|
|
443
|
+
}
|
|
444
|
+
let body;
|
|
445
|
+
return new protocol_http_1.HttpRequest({
|
|
446
|
+
protocol,
|
|
447
|
+
hostname,
|
|
448
|
+
port,
|
|
449
|
+
method: "GET",
|
|
450
|
+
headers,
|
|
451
|
+
path: resolvedPath,
|
|
452
|
+
body,
|
|
453
|
+
});
|
|
454
|
+
};
|
|
455
|
+
exports.serializeAws_restJson1GetContentSummaryCommand = serializeAws_restJson1GetContentSummaryCommand;
|
|
456
|
+
const serializeAws_restJson1GetKnowledgeBaseCommand = async (input, context) => {
|
|
457
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
458
|
+
const headers = {};
|
|
459
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases/{knowledgeBaseId}";
|
|
460
|
+
if (input.knowledgeBaseId !== undefined) {
|
|
461
|
+
const labelValue = input.knowledgeBaseId;
|
|
462
|
+
if (labelValue.length <= 0) {
|
|
463
|
+
throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
|
|
464
|
+
}
|
|
465
|
+
resolvedPath = resolvedPath.replace("{knowledgeBaseId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
|
|
469
|
+
}
|
|
470
|
+
let body;
|
|
471
|
+
return new protocol_http_1.HttpRequest({
|
|
472
|
+
protocol,
|
|
473
|
+
hostname,
|
|
474
|
+
port,
|
|
475
|
+
method: "GET",
|
|
476
|
+
headers,
|
|
477
|
+
path: resolvedPath,
|
|
478
|
+
body,
|
|
479
|
+
});
|
|
480
|
+
};
|
|
481
|
+
exports.serializeAws_restJson1GetKnowledgeBaseCommand = serializeAws_restJson1GetKnowledgeBaseCommand;
|
|
482
|
+
const serializeAws_restJson1GetRecommendationsCommand = async (input, context) => {
|
|
483
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
484
|
+
const headers = {};
|
|
485
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
486
|
+
"/assistants/{assistantId}/sessions/{sessionId}/recommendations";
|
|
487
|
+
if (input.assistantId !== undefined) {
|
|
488
|
+
const labelValue = input.assistantId;
|
|
489
|
+
if (labelValue.length <= 0) {
|
|
490
|
+
throw new Error("Empty value provided for input HTTP label: assistantId.");
|
|
491
|
+
}
|
|
492
|
+
resolvedPath = resolvedPath.replace("{assistantId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
throw new Error("No value provided for input HTTP label: assistantId.");
|
|
496
|
+
}
|
|
497
|
+
if (input.sessionId !== undefined) {
|
|
498
|
+
const labelValue = input.sessionId;
|
|
499
|
+
if (labelValue.length <= 0) {
|
|
500
|
+
throw new Error("Empty value provided for input HTTP label: sessionId.");
|
|
501
|
+
}
|
|
502
|
+
resolvedPath = resolvedPath.replace("{sessionId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
503
|
+
}
|
|
504
|
+
else {
|
|
505
|
+
throw new Error("No value provided for input HTTP label: sessionId.");
|
|
506
|
+
}
|
|
507
|
+
const query = {
|
|
508
|
+
...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
|
|
509
|
+
...(input.waitTimeSeconds !== undefined && { waitTimeSeconds: input.waitTimeSeconds.toString() }),
|
|
510
|
+
};
|
|
511
|
+
let body;
|
|
512
|
+
return new protocol_http_1.HttpRequest({
|
|
513
|
+
protocol,
|
|
514
|
+
hostname,
|
|
515
|
+
port,
|
|
516
|
+
method: "GET",
|
|
517
|
+
headers,
|
|
518
|
+
path: resolvedPath,
|
|
519
|
+
query,
|
|
520
|
+
body,
|
|
521
|
+
});
|
|
522
|
+
};
|
|
523
|
+
exports.serializeAws_restJson1GetRecommendationsCommand = serializeAws_restJson1GetRecommendationsCommand;
|
|
524
|
+
const serializeAws_restJson1GetSessionCommand = async (input, context) => {
|
|
525
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
526
|
+
const headers = {};
|
|
527
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
528
|
+
"/assistants/{assistantId}/sessions/{sessionId}";
|
|
529
|
+
if (input.assistantId !== undefined) {
|
|
530
|
+
const labelValue = input.assistantId;
|
|
531
|
+
if (labelValue.length <= 0) {
|
|
532
|
+
throw new Error("Empty value provided for input HTTP label: assistantId.");
|
|
533
|
+
}
|
|
534
|
+
resolvedPath = resolvedPath.replace("{assistantId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
535
|
+
}
|
|
536
|
+
else {
|
|
537
|
+
throw new Error("No value provided for input HTTP label: assistantId.");
|
|
538
|
+
}
|
|
539
|
+
if (input.sessionId !== undefined) {
|
|
540
|
+
const labelValue = input.sessionId;
|
|
541
|
+
if (labelValue.length <= 0) {
|
|
542
|
+
throw new Error("Empty value provided for input HTTP label: sessionId.");
|
|
543
|
+
}
|
|
544
|
+
resolvedPath = resolvedPath.replace("{sessionId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
545
|
+
}
|
|
546
|
+
else {
|
|
547
|
+
throw new Error("No value provided for input HTTP label: sessionId.");
|
|
548
|
+
}
|
|
549
|
+
let body;
|
|
550
|
+
return new protocol_http_1.HttpRequest({
|
|
551
|
+
protocol,
|
|
552
|
+
hostname,
|
|
553
|
+
port,
|
|
554
|
+
method: "GET",
|
|
555
|
+
headers,
|
|
556
|
+
path: resolvedPath,
|
|
557
|
+
body,
|
|
558
|
+
});
|
|
559
|
+
};
|
|
560
|
+
exports.serializeAws_restJson1GetSessionCommand = serializeAws_restJson1GetSessionCommand;
|
|
561
|
+
const serializeAws_restJson1ListAssistantAssociationsCommand = async (input, context) => {
|
|
562
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
563
|
+
const headers = {};
|
|
564
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/associations";
|
|
565
|
+
if (input.assistantId !== undefined) {
|
|
566
|
+
const labelValue = input.assistantId;
|
|
567
|
+
if (labelValue.length <= 0) {
|
|
568
|
+
throw new Error("Empty value provided for input HTTP label: assistantId.");
|
|
569
|
+
}
|
|
570
|
+
resolvedPath = resolvedPath.replace("{assistantId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
571
|
+
}
|
|
572
|
+
else {
|
|
573
|
+
throw new Error("No value provided for input HTTP label: assistantId.");
|
|
574
|
+
}
|
|
575
|
+
const query = {
|
|
576
|
+
...(input.nextToken !== undefined && { nextToken: input.nextToken }),
|
|
577
|
+
...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
|
|
578
|
+
};
|
|
579
|
+
let body;
|
|
580
|
+
return new protocol_http_1.HttpRequest({
|
|
581
|
+
protocol,
|
|
582
|
+
hostname,
|
|
583
|
+
port,
|
|
584
|
+
method: "GET",
|
|
585
|
+
headers,
|
|
586
|
+
path: resolvedPath,
|
|
587
|
+
query,
|
|
588
|
+
body,
|
|
589
|
+
});
|
|
590
|
+
};
|
|
591
|
+
exports.serializeAws_restJson1ListAssistantAssociationsCommand = serializeAws_restJson1ListAssistantAssociationsCommand;
|
|
592
|
+
const serializeAws_restJson1ListAssistantsCommand = async (input, context) => {
|
|
593
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
594
|
+
const headers = {};
|
|
595
|
+
const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assistants";
|
|
596
|
+
const query = {
|
|
597
|
+
...(input.nextToken !== undefined && { nextToken: input.nextToken }),
|
|
598
|
+
...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
|
|
599
|
+
};
|
|
600
|
+
let body;
|
|
601
|
+
return new protocol_http_1.HttpRequest({
|
|
602
|
+
protocol,
|
|
603
|
+
hostname,
|
|
604
|
+
port,
|
|
605
|
+
method: "GET",
|
|
606
|
+
headers,
|
|
607
|
+
path: resolvedPath,
|
|
608
|
+
query,
|
|
609
|
+
body,
|
|
610
|
+
});
|
|
611
|
+
};
|
|
612
|
+
exports.serializeAws_restJson1ListAssistantsCommand = serializeAws_restJson1ListAssistantsCommand;
|
|
613
|
+
const serializeAws_restJson1ListContentsCommand = async (input, context) => {
|
|
614
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
615
|
+
const headers = {};
|
|
616
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
617
|
+
"/knowledgeBases/{knowledgeBaseId}/contents";
|
|
618
|
+
if (input.knowledgeBaseId !== undefined) {
|
|
619
|
+
const labelValue = input.knowledgeBaseId;
|
|
620
|
+
if (labelValue.length <= 0) {
|
|
621
|
+
throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
|
|
622
|
+
}
|
|
623
|
+
resolvedPath = resolvedPath.replace("{knowledgeBaseId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
624
|
+
}
|
|
625
|
+
else {
|
|
626
|
+
throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
|
|
627
|
+
}
|
|
628
|
+
const query = {
|
|
629
|
+
...(input.nextToken !== undefined && { nextToken: input.nextToken }),
|
|
630
|
+
...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
|
|
631
|
+
};
|
|
632
|
+
let body;
|
|
633
|
+
return new protocol_http_1.HttpRequest({
|
|
634
|
+
protocol,
|
|
635
|
+
hostname,
|
|
636
|
+
port,
|
|
637
|
+
method: "GET",
|
|
638
|
+
headers,
|
|
639
|
+
path: resolvedPath,
|
|
640
|
+
query,
|
|
641
|
+
body,
|
|
642
|
+
});
|
|
643
|
+
};
|
|
644
|
+
exports.serializeAws_restJson1ListContentsCommand = serializeAws_restJson1ListContentsCommand;
|
|
645
|
+
const serializeAws_restJson1ListKnowledgeBasesCommand = async (input, context) => {
|
|
646
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
647
|
+
const headers = {};
|
|
648
|
+
const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases";
|
|
649
|
+
const query = {
|
|
650
|
+
...(input.nextToken !== undefined && { nextToken: input.nextToken }),
|
|
651
|
+
...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
|
|
652
|
+
};
|
|
653
|
+
let body;
|
|
654
|
+
return new protocol_http_1.HttpRequest({
|
|
655
|
+
protocol,
|
|
656
|
+
hostname,
|
|
657
|
+
port,
|
|
658
|
+
method: "GET",
|
|
659
|
+
headers,
|
|
660
|
+
path: resolvedPath,
|
|
661
|
+
query,
|
|
662
|
+
body,
|
|
663
|
+
});
|
|
664
|
+
};
|
|
665
|
+
exports.serializeAws_restJson1ListKnowledgeBasesCommand = serializeAws_restJson1ListKnowledgeBasesCommand;
|
|
666
|
+
const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
|
|
667
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
668
|
+
const headers = {};
|
|
669
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
|
|
670
|
+
if (input.resourceArn !== undefined) {
|
|
671
|
+
const labelValue = input.resourceArn;
|
|
672
|
+
if (labelValue.length <= 0) {
|
|
673
|
+
throw new Error("Empty value provided for input HTTP label: resourceArn.");
|
|
674
|
+
}
|
|
675
|
+
resolvedPath = resolvedPath.replace("{resourceArn}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
676
|
+
}
|
|
677
|
+
else {
|
|
678
|
+
throw new Error("No value provided for input HTTP label: resourceArn.");
|
|
679
|
+
}
|
|
680
|
+
let body;
|
|
681
|
+
return new protocol_http_1.HttpRequest({
|
|
682
|
+
protocol,
|
|
683
|
+
hostname,
|
|
684
|
+
port,
|
|
685
|
+
method: "GET",
|
|
686
|
+
headers,
|
|
687
|
+
path: resolvedPath,
|
|
688
|
+
body,
|
|
689
|
+
});
|
|
690
|
+
};
|
|
691
|
+
exports.serializeAws_restJson1ListTagsForResourceCommand = serializeAws_restJson1ListTagsForResourceCommand;
|
|
692
|
+
const serializeAws_restJson1NotifyRecommendationsReceivedCommand = async (input, context) => {
|
|
693
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
694
|
+
const headers = {
|
|
695
|
+
"content-type": "application/json",
|
|
696
|
+
};
|
|
697
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
698
|
+
"/assistants/{assistantId}/sessions/{sessionId}/recommendations/notify";
|
|
699
|
+
if (input.assistantId !== undefined) {
|
|
700
|
+
const labelValue = input.assistantId;
|
|
701
|
+
if (labelValue.length <= 0) {
|
|
702
|
+
throw new Error("Empty value provided for input HTTP label: assistantId.");
|
|
703
|
+
}
|
|
704
|
+
resolvedPath = resolvedPath.replace("{assistantId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
705
|
+
}
|
|
706
|
+
else {
|
|
707
|
+
throw new Error("No value provided for input HTTP label: assistantId.");
|
|
708
|
+
}
|
|
709
|
+
if (input.sessionId !== undefined) {
|
|
710
|
+
const labelValue = input.sessionId;
|
|
711
|
+
if (labelValue.length <= 0) {
|
|
712
|
+
throw new Error("Empty value provided for input HTTP label: sessionId.");
|
|
713
|
+
}
|
|
714
|
+
resolvedPath = resolvedPath.replace("{sessionId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
715
|
+
}
|
|
716
|
+
else {
|
|
717
|
+
throw new Error("No value provided for input HTTP label: sessionId.");
|
|
718
|
+
}
|
|
719
|
+
let body;
|
|
720
|
+
body = JSON.stringify({
|
|
721
|
+
...(input.recommendationIds !== undefined &&
|
|
722
|
+
input.recommendationIds !== null && {
|
|
723
|
+
recommendationIds: serializeAws_restJson1RecommendationIdList(input.recommendationIds, context),
|
|
724
|
+
}),
|
|
725
|
+
});
|
|
726
|
+
return new protocol_http_1.HttpRequest({
|
|
727
|
+
protocol,
|
|
728
|
+
hostname,
|
|
729
|
+
port,
|
|
730
|
+
method: "POST",
|
|
731
|
+
headers,
|
|
732
|
+
path: resolvedPath,
|
|
733
|
+
body,
|
|
734
|
+
});
|
|
735
|
+
};
|
|
736
|
+
exports.serializeAws_restJson1NotifyRecommendationsReceivedCommand = serializeAws_restJson1NotifyRecommendationsReceivedCommand;
|
|
737
|
+
const serializeAws_restJson1QueryAssistantCommand = async (input, context) => {
|
|
738
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
739
|
+
const headers = {
|
|
740
|
+
"content-type": "application/json",
|
|
741
|
+
};
|
|
742
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/query";
|
|
743
|
+
if (input.assistantId !== undefined) {
|
|
744
|
+
const labelValue = input.assistantId;
|
|
745
|
+
if (labelValue.length <= 0) {
|
|
746
|
+
throw new Error("Empty value provided for input HTTP label: assistantId.");
|
|
747
|
+
}
|
|
748
|
+
resolvedPath = resolvedPath.replace("{assistantId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
749
|
+
}
|
|
750
|
+
else {
|
|
751
|
+
throw new Error("No value provided for input HTTP label: assistantId.");
|
|
752
|
+
}
|
|
753
|
+
let body;
|
|
754
|
+
body = JSON.stringify({
|
|
755
|
+
...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
|
|
756
|
+
...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
|
|
757
|
+
...(input.queryText !== undefined && input.queryText !== null && { queryText: input.queryText }),
|
|
758
|
+
});
|
|
759
|
+
return new protocol_http_1.HttpRequest({
|
|
760
|
+
protocol,
|
|
761
|
+
hostname,
|
|
762
|
+
port,
|
|
763
|
+
method: "POST",
|
|
764
|
+
headers,
|
|
765
|
+
path: resolvedPath,
|
|
766
|
+
body,
|
|
767
|
+
});
|
|
768
|
+
};
|
|
769
|
+
exports.serializeAws_restJson1QueryAssistantCommand = serializeAws_restJson1QueryAssistantCommand;
|
|
770
|
+
const serializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand = async (input, context) => {
|
|
771
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
772
|
+
const headers = {};
|
|
773
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
774
|
+
"/knowledgeBases/{knowledgeBaseId}/templateUri";
|
|
775
|
+
if (input.knowledgeBaseId !== undefined) {
|
|
776
|
+
const labelValue = input.knowledgeBaseId;
|
|
777
|
+
if (labelValue.length <= 0) {
|
|
778
|
+
throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
|
|
779
|
+
}
|
|
780
|
+
resolvedPath = resolvedPath.replace("{knowledgeBaseId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
781
|
+
}
|
|
782
|
+
else {
|
|
783
|
+
throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
|
|
784
|
+
}
|
|
785
|
+
let body;
|
|
786
|
+
return new protocol_http_1.HttpRequest({
|
|
787
|
+
protocol,
|
|
788
|
+
hostname,
|
|
789
|
+
port,
|
|
790
|
+
method: "DELETE",
|
|
791
|
+
headers,
|
|
792
|
+
path: resolvedPath,
|
|
793
|
+
body,
|
|
794
|
+
});
|
|
795
|
+
};
|
|
796
|
+
exports.serializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand = serializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand;
|
|
797
|
+
const serializeAws_restJson1SearchContentCommand = async (input, context) => {
|
|
798
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
799
|
+
const headers = {
|
|
800
|
+
"content-type": "application/json",
|
|
801
|
+
};
|
|
802
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases/{knowledgeBaseId}/search";
|
|
803
|
+
if (input.knowledgeBaseId !== undefined) {
|
|
804
|
+
const labelValue = input.knowledgeBaseId;
|
|
805
|
+
if (labelValue.length <= 0) {
|
|
806
|
+
throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
|
|
807
|
+
}
|
|
808
|
+
resolvedPath = resolvedPath.replace("{knowledgeBaseId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
809
|
+
}
|
|
810
|
+
else {
|
|
811
|
+
throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
|
|
812
|
+
}
|
|
813
|
+
const query = {
|
|
814
|
+
...(input.nextToken !== undefined && { nextToken: input.nextToken }),
|
|
815
|
+
...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
|
|
816
|
+
};
|
|
817
|
+
let body;
|
|
818
|
+
body = JSON.stringify({
|
|
819
|
+
...(input.searchExpression !== undefined &&
|
|
820
|
+
input.searchExpression !== null && {
|
|
821
|
+
searchExpression: serializeAws_restJson1SearchExpression(input.searchExpression, context),
|
|
822
|
+
}),
|
|
823
|
+
});
|
|
824
|
+
return new protocol_http_1.HttpRequest({
|
|
825
|
+
protocol,
|
|
826
|
+
hostname,
|
|
827
|
+
port,
|
|
828
|
+
method: "POST",
|
|
829
|
+
headers,
|
|
830
|
+
path: resolvedPath,
|
|
831
|
+
query,
|
|
832
|
+
body,
|
|
833
|
+
});
|
|
834
|
+
};
|
|
835
|
+
exports.serializeAws_restJson1SearchContentCommand = serializeAws_restJson1SearchContentCommand;
|
|
836
|
+
const serializeAws_restJson1SearchSessionsCommand = async (input, context) => {
|
|
837
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
838
|
+
const headers = {
|
|
839
|
+
"content-type": "application/json",
|
|
840
|
+
};
|
|
841
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/searchSessions";
|
|
842
|
+
if (input.assistantId !== undefined) {
|
|
843
|
+
const labelValue = input.assistantId;
|
|
844
|
+
if (labelValue.length <= 0) {
|
|
845
|
+
throw new Error("Empty value provided for input HTTP label: assistantId.");
|
|
846
|
+
}
|
|
847
|
+
resolvedPath = resolvedPath.replace("{assistantId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
848
|
+
}
|
|
849
|
+
else {
|
|
850
|
+
throw new Error("No value provided for input HTTP label: assistantId.");
|
|
851
|
+
}
|
|
852
|
+
const query = {
|
|
853
|
+
...(input.nextToken !== undefined && { nextToken: input.nextToken }),
|
|
854
|
+
...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
|
|
855
|
+
};
|
|
856
|
+
let body;
|
|
857
|
+
body = JSON.stringify({
|
|
858
|
+
...(input.searchExpression !== undefined &&
|
|
859
|
+
input.searchExpression !== null && {
|
|
860
|
+
searchExpression: serializeAws_restJson1SearchExpression(input.searchExpression, context),
|
|
861
|
+
}),
|
|
862
|
+
});
|
|
863
|
+
return new protocol_http_1.HttpRequest({
|
|
864
|
+
protocol,
|
|
865
|
+
hostname,
|
|
866
|
+
port,
|
|
867
|
+
method: "POST",
|
|
868
|
+
headers,
|
|
869
|
+
path: resolvedPath,
|
|
870
|
+
query,
|
|
871
|
+
body,
|
|
872
|
+
});
|
|
873
|
+
};
|
|
874
|
+
exports.serializeAws_restJson1SearchSessionsCommand = serializeAws_restJson1SearchSessionsCommand;
|
|
875
|
+
const serializeAws_restJson1StartContentUploadCommand = async (input, context) => {
|
|
876
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
877
|
+
const headers = {
|
|
878
|
+
"content-type": "application/json",
|
|
879
|
+
};
|
|
880
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases/{knowledgeBaseId}/upload";
|
|
881
|
+
if (input.knowledgeBaseId !== undefined) {
|
|
882
|
+
const labelValue = input.knowledgeBaseId;
|
|
883
|
+
if (labelValue.length <= 0) {
|
|
884
|
+
throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
|
|
885
|
+
}
|
|
886
|
+
resolvedPath = resolvedPath.replace("{knowledgeBaseId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
887
|
+
}
|
|
888
|
+
else {
|
|
889
|
+
throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
|
|
890
|
+
}
|
|
891
|
+
let body;
|
|
892
|
+
body = JSON.stringify({
|
|
893
|
+
...(input.contentType !== undefined && input.contentType !== null && { contentType: input.contentType }),
|
|
894
|
+
});
|
|
895
|
+
return new protocol_http_1.HttpRequest({
|
|
896
|
+
protocol,
|
|
897
|
+
hostname,
|
|
898
|
+
port,
|
|
899
|
+
method: "POST",
|
|
900
|
+
headers,
|
|
901
|
+
path: resolvedPath,
|
|
902
|
+
body,
|
|
903
|
+
});
|
|
904
|
+
};
|
|
905
|
+
exports.serializeAws_restJson1StartContentUploadCommand = serializeAws_restJson1StartContentUploadCommand;
|
|
906
|
+
const serializeAws_restJson1TagResourceCommand = async (input, context) => {
|
|
907
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
908
|
+
const headers = {
|
|
909
|
+
"content-type": "application/json",
|
|
910
|
+
};
|
|
911
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
|
|
912
|
+
if (input.resourceArn !== undefined) {
|
|
913
|
+
const labelValue = input.resourceArn;
|
|
914
|
+
if (labelValue.length <= 0) {
|
|
915
|
+
throw new Error("Empty value provided for input HTTP label: resourceArn.");
|
|
916
|
+
}
|
|
917
|
+
resolvedPath = resolvedPath.replace("{resourceArn}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
918
|
+
}
|
|
919
|
+
else {
|
|
920
|
+
throw new Error("No value provided for input HTTP label: resourceArn.");
|
|
921
|
+
}
|
|
922
|
+
let body;
|
|
923
|
+
body = JSON.stringify({
|
|
924
|
+
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }),
|
|
925
|
+
});
|
|
926
|
+
return new protocol_http_1.HttpRequest({
|
|
927
|
+
protocol,
|
|
928
|
+
hostname,
|
|
929
|
+
port,
|
|
930
|
+
method: "POST",
|
|
931
|
+
headers,
|
|
932
|
+
path: resolvedPath,
|
|
933
|
+
body,
|
|
934
|
+
});
|
|
935
|
+
};
|
|
936
|
+
exports.serializeAws_restJson1TagResourceCommand = serializeAws_restJson1TagResourceCommand;
|
|
937
|
+
const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
|
|
938
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
939
|
+
const headers = {};
|
|
940
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
|
|
941
|
+
if (input.resourceArn !== undefined) {
|
|
942
|
+
const labelValue = input.resourceArn;
|
|
943
|
+
if (labelValue.length <= 0) {
|
|
944
|
+
throw new Error("Empty value provided for input HTTP label: resourceArn.");
|
|
945
|
+
}
|
|
946
|
+
resolvedPath = resolvedPath.replace("{resourceArn}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
947
|
+
}
|
|
948
|
+
else {
|
|
949
|
+
throw new Error("No value provided for input HTTP label: resourceArn.");
|
|
950
|
+
}
|
|
951
|
+
const query = {
|
|
952
|
+
...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry) }),
|
|
953
|
+
};
|
|
954
|
+
let body;
|
|
955
|
+
return new protocol_http_1.HttpRequest({
|
|
956
|
+
protocol,
|
|
957
|
+
hostname,
|
|
958
|
+
port,
|
|
959
|
+
method: "DELETE",
|
|
960
|
+
headers,
|
|
961
|
+
path: resolvedPath,
|
|
962
|
+
query,
|
|
963
|
+
body,
|
|
964
|
+
});
|
|
965
|
+
};
|
|
966
|
+
exports.serializeAws_restJson1UntagResourceCommand = serializeAws_restJson1UntagResourceCommand;
|
|
967
|
+
const serializeAws_restJson1UpdateContentCommand = async (input, context) => {
|
|
968
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
969
|
+
const headers = {
|
|
970
|
+
"content-type": "application/json",
|
|
971
|
+
};
|
|
972
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
973
|
+
"/knowledgeBases/{knowledgeBaseId}/contents/{contentId}";
|
|
974
|
+
if (input.knowledgeBaseId !== undefined) {
|
|
975
|
+
const labelValue = input.knowledgeBaseId;
|
|
976
|
+
if (labelValue.length <= 0) {
|
|
977
|
+
throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
|
|
978
|
+
}
|
|
979
|
+
resolvedPath = resolvedPath.replace("{knowledgeBaseId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
980
|
+
}
|
|
981
|
+
else {
|
|
982
|
+
throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
|
|
983
|
+
}
|
|
984
|
+
if (input.contentId !== undefined) {
|
|
985
|
+
const labelValue = input.contentId;
|
|
986
|
+
if (labelValue.length <= 0) {
|
|
987
|
+
throw new Error("Empty value provided for input HTTP label: contentId.");
|
|
988
|
+
}
|
|
989
|
+
resolvedPath = resolvedPath.replace("{contentId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
990
|
+
}
|
|
991
|
+
else {
|
|
992
|
+
throw new Error("No value provided for input HTTP label: contentId.");
|
|
993
|
+
}
|
|
994
|
+
let body;
|
|
995
|
+
body = JSON.stringify({
|
|
996
|
+
...(input.metadata !== undefined &&
|
|
997
|
+
input.metadata !== null && { metadata: serializeAws_restJson1ContentMetadata(input.metadata, context) }),
|
|
998
|
+
...(input.overrideLinkOutUri !== undefined &&
|
|
999
|
+
input.overrideLinkOutUri !== null && { overrideLinkOutUri: input.overrideLinkOutUri }),
|
|
1000
|
+
...(input.removeOverrideLinkOutUri !== undefined &&
|
|
1001
|
+
input.removeOverrideLinkOutUri !== null && { removeOverrideLinkOutUri: input.removeOverrideLinkOutUri }),
|
|
1002
|
+
...(input.revisionId !== undefined && input.revisionId !== null && { revisionId: input.revisionId }),
|
|
1003
|
+
...(input.title !== undefined && input.title !== null && { title: input.title }),
|
|
1004
|
+
...(input.uploadId !== undefined && input.uploadId !== null && { uploadId: input.uploadId }),
|
|
1005
|
+
});
|
|
1006
|
+
return new protocol_http_1.HttpRequest({
|
|
1007
|
+
protocol,
|
|
1008
|
+
hostname,
|
|
1009
|
+
port,
|
|
1010
|
+
method: "POST",
|
|
1011
|
+
headers,
|
|
1012
|
+
path: resolvedPath,
|
|
1013
|
+
body,
|
|
1014
|
+
});
|
|
1015
|
+
};
|
|
1016
|
+
exports.serializeAws_restJson1UpdateContentCommand = serializeAws_restJson1UpdateContentCommand;
|
|
1017
|
+
const serializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommand = async (input, context) => {
|
|
1018
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
1019
|
+
const headers = {
|
|
1020
|
+
"content-type": "application/json",
|
|
1021
|
+
};
|
|
1022
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
1023
|
+
"/knowledgeBases/{knowledgeBaseId}/templateUri";
|
|
1024
|
+
if (input.knowledgeBaseId !== undefined) {
|
|
1025
|
+
const labelValue = input.knowledgeBaseId;
|
|
1026
|
+
if (labelValue.length <= 0) {
|
|
1027
|
+
throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
|
|
1028
|
+
}
|
|
1029
|
+
resolvedPath = resolvedPath.replace("{knowledgeBaseId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
1030
|
+
}
|
|
1031
|
+
else {
|
|
1032
|
+
throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
|
|
1033
|
+
}
|
|
1034
|
+
let body;
|
|
1035
|
+
body = JSON.stringify({
|
|
1036
|
+
...(input.templateUri !== undefined && input.templateUri !== null && { templateUri: input.templateUri }),
|
|
1037
|
+
});
|
|
1038
|
+
return new protocol_http_1.HttpRequest({
|
|
1039
|
+
protocol,
|
|
1040
|
+
hostname,
|
|
1041
|
+
port,
|
|
1042
|
+
method: "POST",
|
|
1043
|
+
headers,
|
|
1044
|
+
path: resolvedPath,
|
|
1045
|
+
body,
|
|
1046
|
+
});
|
|
1047
|
+
};
|
|
1048
|
+
exports.serializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommand = serializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommand;
|
|
1049
|
+
const deserializeAws_restJson1CreateAssistantCommand = async (output, context) => {
|
|
1050
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1051
|
+
return deserializeAws_restJson1CreateAssistantCommandError(output, context);
|
|
1052
|
+
}
|
|
1053
|
+
const contents = {
|
|
1054
|
+
$metadata: deserializeMetadata(output),
|
|
1055
|
+
assistant: undefined,
|
|
1056
|
+
};
|
|
1057
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1058
|
+
if (data.assistant !== undefined && data.assistant !== null) {
|
|
1059
|
+
contents.assistant = deserializeAws_restJson1AssistantData(data.assistant, context);
|
|
1060
|
+
}
|
|
1061
|
+
return Promise.resolve(contents);
|
|
1062
|
+
};
|
|
1063
|
+
exports.deserializeAws_restJson1CreateAssistantCommand = deserializeAws_restJson1CreateAssistantCommand;
|
|
1064
|
+
const deserializeAws_restJson1CreateAssistantCommandError = async (output, context) => {
|
|
1065
|
+
const parsedOutput = {
|
|
1066
|
+
...output,
|
|
1067
|
+
body: await parseBody(output.body, context),
|
|
1068
|
+
};
|
|
1069
|
+
let response;
|
|
1070
|
+
let errorCode = "UnknownError";
|
|
1071
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1072
|
+
switch (errorCode) {
|
|
1073
|
+
case "AccessDeniedException":
|
|
1074
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
1075
|
+
response = {
|
|
1076
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1077
|
+
name: errorCode,
|
|
1078
|
+
$metadata: deserializeMetadata(output),
|
|
1079
|
+
};
|
|
1080
|
+
break;
|
|
1081
|
+
case "ConflictException":
|
|
1082
|
+
case "com.amazonaws.wisdom#ConflictException":
|
|
1083
|
+
response = {
|
|
1084
|
+
...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
|
|
1085
|
+
name: errorCode,
|
|
1086
|
+
$metadata: deserializeMetadata(output),
|
|
1087
|
+
};
|
|
1088
|
+
break;
|
|
1089
|
+
case "ServiceQuotaExceededException":
|
|
1090
|
+
case "com.amazonaws.wisdom#ServiceQuotaExceededException":
|
|
1091
|
+
response = {
|
|
1092
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
1093
|
+
name: errorCode,
|
|
1094
|
+
$metadata: deserializeMetadata(output),
|
|
1095
|
+
};
|
|
1096
|
+
break;
|
|
1097
|
+
case "ValidationException":
|
|
1098
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
1099
|
+
response = {
|
|
1100
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1101
|
+
name: errorCode,
|
|
1102
|
+
$metadata: deserializeMetadata(output),
|
|
1103
|
+
};
|
|
1104
|
+
break;
|
|
1105
|
+
default:
|
|
1106
|
+
const parsedBody = parsedOutput.body;
|
|
1107
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1108
|
+
response = {
|
|
1109
|
+
...parsedBody,
|
|
1110
|
+
name: `${errorCode}`,
|
|
1111
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1112
|
+
$fault: "client",
|
|
1113
|
+
$metadata: deserializeMetadata(output),
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
const message = response.message || response.Message || errorCode;
|
|
1117
|
+
response.message = message;
|
|
1118
|
+
delete response.Message;
|
|
1119
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1120
|
+
};
|
|
1121
|
+
const deserializeAws_restJson1CreateAssistantAssociationCommand = async (output, context) => {
|
|
1122
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1123
|
+
return deserializeAws_restJson1CreateAssistantAssociationCommandError(output, context);
|
|
1124
|
+
}
|
|
1125
|
+
const contents = {
|
|
1126
|
+
$metadata: deserializeMetadata(output),
|
|
1127
|
+
assistantAssociation: undefined,
|
|
1128
|
+
};
|
|
1129
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1130
|
+
if (data.assistantAssociation !== undefined && data.assistantAssociation !== null) {
|
|
1131
|
+
contents.assistantAssociation = deserializeAws_restJson1AssistantAssociationData(data.assistantAssociation, context);
|
|
1132
|
+
}
|
|
1133
|
+
return Promise.resolve(contents);
|
|
1134
|
+
};
|
|
1135
|
+
exports.deserializeAws_restJson1CreateAssistantAssociationCommand = deserializeAws_restJson1CreateAssistantAssociationCommand;
|
|
1136
|
+
const deserializeAws_restJson1CreateAssistantAssociationCommandError = async (output, context) => {
|
|
1137
|
+
const parsedOutput = {
|
|
1138
|
+
...output,
|
|
1139
|
+
body: await parseBody(output.body, context),
|
|
1140
|
+
};
|
|
1141
|
+
let response;
|
|
1142
|
+
let errorCode = "UnknownError";
|
|
1143
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1144
|
+
switch (errorCode) {
|
|
1145
|
+
case "AccessDeniedException":
|
|
1146
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
1147
|
+
response = {
|
|
1148
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1149
|
+
name: errorCode,
|
|
1150
|
+
$metadata: deserializeMetadata(output),
|
|
1151
|
+
};
|
|
1152
|
+
break;
|
|
1153
|
+
case "ConflictException":
|
|
1154
|
+
case "com.amazonaws.wisdom#ConflictException":
|
|
1155
|
+
response = {
|
|
1156
|
+
...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
|
|
1157
|
+
name: errorCode,
|
|
1158
|
+
$metadata: deserializeMetadata(output),
|
|
1159
|
+
};
|
|
1160
|
+
break;
|
|
1161
|
+
case "ResourceNotFoundException":
|
|
1162
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
1163
|
+
response = {
|
|
1164
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1165
|
+
name: errorCode,
|
|
1166
|
+
$metadata: deserializeMetadata(output),
|
|
1167
|
+
};
|
|
1168
|
+
break;
|
|
1169
|
+
case "ServiceQuotaExceededException":
|
|
1170
|
+
case "com.amazonaws.wisdom#ServiceQuotaExceededException":
|
|
1171
|
+
response = {
|
|
1172
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
1173
|
+
name: errorCode,
|
|
1174
|
+
$metadata: deserializeMetadata(output),
|
|
1175
|
+
};
|
|
1176
|
+
break;
|
|
1177
|
+
case "ValidationException":
|
|
1178
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
1179
|
+
response = {
|
|
1180
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1181
|
+
name: errorCode,
|
|
1182
|
+
$metadata: deserializeMetadata(output),
|
|
1183
|
+
};
|
|
1184
|
+
break;
|
|
1185
|
+
default:
|
|
1186
|
+
const parsedBody = parsedOutput.body;
|
|
1187
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1188
|
+
response = {
|
|
1189
|
+
...parsedBody,
|
|
1190
|
+
name: `${errorCode}`,
|
|
1191
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1192
|
+
$fault: "client",
|
|
1193
|
+
$metadata: deserializeMetadata(output),
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
const message = response.message || response.Message || errorCode;
|
|
1197
|
+
response.message = message;
|
|
1198
|
+
delete response.Message;
|
|
1199
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1200
|
+
};
|
|
1201
|
+
const deserializeAws_restJson1CreateContentCommand = async (output, context) => {
|
|
1202
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1203
|
+
return deserializeAws_restJson1CreateContentCommandError(output, context);
|
|
1204
|
+
}
|
|
1205
|
+
const contents = {
|
|
1206
|
+
$metadata: deserializeMetadata(output),
|
|
1207
|
+
content: undefined,
|
|
1208
|
+
};
|
|
1209
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1210
|
+
if (data.content !== undefined && data.content !== null) {
|
|
1211
|
+
contents.content = deserializeAws_restJson1ContentData(data.content, context);
|
|
1212
|
+
}
|
|
1213
|
+
return Promise.resolve(contents);
|
|
1214
|
+
};
|
|
1215
|
+
exports.deserializeAws_restJson1CreateContentCommand = deserializeAws_restJson1CreateContentCommand;
|
|
1216
|
+
const deserializeAws_restJson1CreateContentCommandError = async (output, context) => {
|
|
1217
|
+
const parsedOutput = {
|
|
1218
|
+
...output,
|
|
1219
|
+
body: await parseBody(output.body, context),
|
|
1220
|
+
};
|
|
1221
|
+
let response;
|
|
1222
|
+
let errorCode = "UnknownError";
|
|
1223
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1224
|
+
switch (errorCode) {
|
|
1225
|
+
case "AccessDeniedException":
|
|
1226
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
1227
|
+
response = {
|
|
1228
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1229
|
+
name: errorCode,
|
|
1230
|
+
$metadata: deserializeMetadata(output),
|
|
1231
|
+
};
|
|
1232
|
+
break;
|
|
1233
|
+
case "ConflictException":
|
|
1234
|
+
case "com.amazonaws.wisdom#ConflictException":
|
|
1235
|
+
response = {
|
|
1236
|
+
...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
|
|
1237
|
+
name: errorCode,
|
|
1238
|
+
$metadata: deserializeMetadata(output),
|
|
1239
|
+
};
|
|
1240
|
+
break;
|
|
1241
|
+
case "ResourceNotFoundException":
|
|
1242
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
1243
|
+
response = {
|
|
1244
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1245
|
+
name: errorCode,
|
|
1246
|
+
$metadata: deserializeMetadata(output),
|
|
1247
|
+
};
|
|
1248
|
+
break;
|
|
1249
|
+
case "ServiceQuotaExceededException":
|
|
1250
|
+
case "com.amazonaws.wisdom#ServiceQuotaExceededException":
|
|
1251
|
+
response = {
|
|
1252
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
1253
|
+
name: errorCode,
|
|
1254
|
+
$metadata: deserializeMetadata(output),
|
|
1255
|
+
};
|
|
1256
|
+
break;
|
|
1257
|
+
case "ValidationException":
|
|
1258
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
1259
|
+
response = {
|
|
1260
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1261
|
+
name: errorCode,
|
|
1262
|
+
$metadata: deserializeMetadata(output),
|
|
1263
|
+
};
|
|
1264
|
+
break;
|
|
1265
|
+
default:
|
|
1266
|
+
const parsedBody = parsedOutput.body;
|
|
1267
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1268
|
+
response = {
|
|
1269
|
+
...parsedBody,
|
|
1270
|
+
name: `${errorCode}`,
|
|
1271
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1272
|
+
$fault: "client",
|
|
1273
|
+
$metadata: deserializeMetadata(output),
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
const message = response.message || response.Message || errorCode;
|
|
1277
|
+
response.message = message;
|
|
1278
|
+
delete response.Message;
|
|
1279
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1280
|
+
};
|
|
1281
|
+
const deserializeAws_restJson1CreateKnowledgeBaseCommand = async (output, context) => {
|
|
1282
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1283
|
+
return deserializeAws_restJson1CreateKnowledgeBaseCommandError(output, context);
|
|
1284
|
+
}
|
|
1285
|
+
const contents = {
|
|
1286
|
+
$metadata: deserializeMetadata(output),
|
|
1287
|
+
knowledgeBase: undefined,
|
|
1288
|
+
};
|
|
1289
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1290
|
+
if (data.knowledgeBase !== undefined && data.knowledgeBase !== null) {
|
|
1291
|
+
contents.knowledgeBase = deserializeAws_restJson1KnowledgeBaseData(data.knowledgeBase, context);
|
|
1292
|
+
}
|
|
1293
|
+
return Promise.resolve(contents);
|
|
1294
|
+
};
|
|
1295
|
+
exports.deserializeAws_restJson1CreateKnowledgeBaseCommand = deserializeAws_restJson1CreateKnowledgeBaseCommand;
|
|
1296
|
+
const deserializeAws_restJson1CreateKnowledgeBaseCommandError = async (output, context) => {
|
|
1297
|
+
const parsedOutput = {
|
|
1298
|
+
...output,
|
|
1299
|
+
body: await parseBody(output.body, context),
|
|
1300
|
+
};
|
|
1301
|
+
let response;
|
|
1302
|
+
let errorCode = "UnknownError";
|
|
1303
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1304
|
+
switch (errorCode) {
|
|
1305
|
+
case "AccessDeniedException":
|
|
1306
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
1307
|
+
response = {
|
|
1308
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1309
|
+
name: errorCode,
|
|
1310
|
+
$metadata: deserializeMetadata(output),
|
|
1311
|
+
};
|
|
1312
|
+
break;
|
|
1313
|
+
case "ConflictException":
|
|
1314
|
+
case "com.amazonaws.wisdom#ConflictException":
|
|
1315
|
+
response = {
|
|
1316
|
+
...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
|
|
1317
|
+
name: errorCode,
|
|
1318
|
+
$metadata: deserializeMetadata(output),
|
|
1319
|
+
};
|
|
1320
|
+
break;
|
|
1321
|
+
case "ServiceQuotaExceededException":
|
|
1322
|
+
case "com.amazonaws.wisdom#ServiceQuotaExceededException":
|
|
1323
|
+
response = {
|
|
1324
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
1325
|
+
name: errorCode,
|
|
1326
|
+
$metadata: deserializeMetadata(output),
|
|
1327
|
+
};
|
|
1328
|
+
break;
|
|
1329
|
+
case "ValidationException":
|
|
1330
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
1331
|
+
response = {
|
|
1332
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1333
|
+
name: errorCode,
|
|
1334
|
+
$metadata: deserializeMetadata(output),
|
|
1335
|
+
};
|
|
1336
|
+
break;
|
|
1337
|
+
default:
|
|
1338
|
+
const parsedBody = parsedOutput.body;
|
|
1339
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1340
|
+
response = {
|
|
1341
|
+
...parsedBody,
|
|
1342
|
+
name: `${errorCode}`,
|
|
1343
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1344
|
+
$fault: "client",
|
|
1345
|
+
$metadata: deserializeMetadata(output),
|
|
1346
|
+
};
|
|
1347
|
+
}
|
|
1348
|
+
const message = response.message || response.Message || errorCode;
|
|
1349
|
+
response.message = message;
|
|
1350
|
+
delete response.Message;
|
|
1351
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1352
|
+
};
|
|
1353
|
+
const deserializeAws_restJson1CreateSessionCommand = async (output, context) => {
|
|
1354
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1355
|
+
return deserializeAws_restJson1CreateSessionCommandError(output, context);
|
|
1356
|
+
}
|
|
1357
|
+
const contents = {
|
|
1358
|
+
$metadata: deserializeMetadata(output),
|
|
1359
|
+
session: undefined,
|
|
1360
|
+
};
|
|
1361
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1362
|
+
if (data.session !== undefined && data.session !== null) {
|
|
1363
|
+
contents.session = deserializeAws_restJson1SessionData(data.session, context);
|
|
1364
|
+
}
|
|
1365
|
+
return Promise.resolve(contents);
|
|
1366
|
+
};
|
|
1367
|
+
exports.deserializeAws_restJson1CreateSessionCommand = deserializeAws_restJson1CreateSessionCommand;
|
|
1368
|
+
const deserializeAws_restJson1CreateSessionCommandError = async (output, context) => {
|
|
1369
|
+
const parsedOutput = {
|
|
1370
|
+
...output,
|
|
1371
|
+
body: await parseBody(output.body, context),
|
|
1372
|
+
};
|
|
1373
|
+
let response;
|
|
1374
|
+
let errorCode = "UnknownError";
|
|
1375
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1376
|
+
switch (errorCode) {
|
|
1377
|
+
case "ConflictException":
|
|
1378
|
+
case "com.amazonaws.wisdom#ConflictException":
|
|
1379
|
+
response = {
|
|
1380
|
+
...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
|
|
1381
|
+
name: errorCode,
|
|
1382
|
+
$metadata: deserializeMetadata(output),
|
|
1383
|
+
};
|
|
1384
|
+
break;
|
|
1385
|
+
case "ResourceNotFoundException":
|
|
1386
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
1387
|
+
response = {
|
|
1388
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1389
|
+
name: errorCode,
|
|
1390
|
+
$metadata: deserializeMetadata(output),
|
|
1391
|
+
};
|
|
1392
|
+
break;
|
|
1393
|
+
case "ValidationException":
|
|
1394
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
1395
|
+
response = {
|
|
1396
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1397
|
+
name: errorCode,
|
|
1398
|
+
$metadata: deserializeMetadata(output),
|
|
1399
|
+
};
|
|
1400
|
+
break;
|
|
1401
|
+
default:
|
|
1402
|
+
const parsedBody = parsedOutput.body;
|
|
1403
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1404
|
+
response = {
|
|
1405
|
+
...parsedBody,
|
|
1406
|
+
name: `${errorCode}`,
|
|
1407
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1408
|
+
$fault: "client",
|
|
1409
|
+
$metadata: deserializeMetadata(output),
|
|
1410
|
+
};
|
|
1411
|
+
}
|
|
1412
|
+
const message = response.message || response.Message || errorCode;
|
|
1413
|
+
response.message = message;
|
|
1414
|
+
delete response.Message;
|
|
1415
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1416
|
+
};
|
|
1417
|
+
const deserializeAws_restJson1DeleteAssistantCommand = async (output, context) => {
|
|
1418
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
1419
|
+
return deserializeAws_restJson1DeleteAssistantCommandError(output, context);
|
|
1420
|
+
}
|
|
1421
|
+
const contents = {
|
|
1422
|
+
$metadata: deserializeMetadata(output),
|
|
1423
|
+
};
|
|
1424
|
+
await collectBody(output.body, context);
|
|
1425
|
+
return Promise.resolve(contents);
|
|
1426
|
+
};
|
|
1427
|
+
exports.deserializeAws_restJson1DeleteAssistantCommand = deserializeAws_restJson1DeleteAssistantCommand;
|
|
1428
|
+
const deserializeAws_restJson1DeleteAssistantCommandError = async (output, context) => {
|
|
1429
|
+
const parsedOutput = {
|
|
1430
|
+
...output,
|
|
1431
|
+
body: await parseBody(output.body, context),
|
|
1432
|
+
};
|
|
1433
|
+
let response;
|
|
1434
|
+
let errorCode = "UnknownError";
|
|
1435
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1436
|
+
switch (errorCode) {
|
|
1437
|
+
case "AccessDeniedException":
|
|
1438
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
1439
|
+
response = {
|
|
1440
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1441
|
+
name: errorCode,
|
|
1442
|
+
$metadata: deserializeMetadata(output),
|
|
1443
|
+
};
|
|
1444
|
+
break;
|
|
1445
|
+
case "ResourceNotFoundException":
|
|
1446
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
1447
|
+
response = {
|
|
1448
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1449
|
+
name: errorCode,
|
|
1450
|
+
$metadata: deserializeMetadata(output),
|
|
1451
|
+
};
|
|
1452
|
+
break;
|
|
1453
|
+
case "ValidationException":
|
|
1454
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
1455
|
+
response = {
|
|
1456
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1457
|
+
name: errorCode,
|
|
1458
|
+
$metadata: deserializeMetadata(output),
|
|
1459
|
+
};
|
|
1460
|
+
break;
|
|
1461
|
+
default:
|
|
1462
|
+
const parsedBody = parsedOutput.body;
|
|
1463
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1464
|
+
response = {
|
|
1465
|
+
...parsedBody,
|
|
1466
|
+
name: `${errorCode}`,
|
|
1467
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1468
|
+
$fault: "client",
|
|
1469
|
+
$metadata: deserializeMetadata(output),
|
|
1470
|
+
};
|
|
1471
|
+
}
|
|
1472
|
+
const message = response.message || response.Message || errorCode;
|
|
1473
|
+
response.message = message;
|
|
1474
|
+
delete response.Message;
|
|
1475
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1476
|
+
};
|
|
1477
|
+
const deserializeAws_restJson1DeleteAssistantAssociationCommand = async (output, context) => {
|
|
1478
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
1479
|
+
return deserializeAws_restJson1DeleteAssistantAssociationCommandError(output, context);
|
|
1480
|
+
}
|
|
1481
|
+
const contents = {
|
|
1482
|
+
$metadata: deserializeMetadata(output),
|
|
1483
|
+
};
|
|
1484
|
+
await collectBody(output.body, context);
|
|
1485
|
+
return Promise.resolve(contents);
|
|
1486
|
+
};
|
|
1487
|
+
exports.deserializeAws_restJson1DeleteAssistantAssociationCommand = deserializeAws_restJson1DeleteAssistantAssociationCommand;
|
|
1488
|
+
const deserializeAws_restJson1DeleteAssistantAssociationCommandError = async (output, context) => {
|
|
1489
|
+
const parsedOutput = {
|
|
1490
|
+
...output,
|
|
1491
|
+
body: await parseBody(output.body, context),
|
|
1492
|
+
};
|
|
1493
|
+
let response;
|
|
1494
|
+
let errorCode = "UnknownError";
|
|
1495
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1496
|
+
switch (errorCode) {
|
|
1497
|
+
case "AccessDeniedException":
|
|
1498
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
1499
|
+
response = {
|
|
1500
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1501
|
+
name: errorCode,
|
|
1502
|
+
$metadata: deserializeMetadata(output),
|
|
1503
|
+
};
|
|
1504
|
+
break;
|
|
1505
|
+
case "ResourceNotFoundException":
|
|
1506
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
1507
|
+
response = {
|
|
1508
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1509
|
+
name: errorCode,
|
|
1510
|
+
$metadata: deserializeMetadata(output),
|
|
1511
|
+
};
|
|
1512
|
+
break;
|
|
1513
|
+
case "ValidationException":
|
|
1514
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
1515
|
+
response = {
|
|
1516
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1517
|
+
name: errorCode,
|
|
1518
|
+
$metadata: deserializeMetadata(output),
|
|
1519
|
+
};
|
|
1520
|
+
break;
|
|
1521
|
+
default:
|
|
1522
|
+
const parsedBody = parsedOutput.body;
|
|
1523
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1524
|
+
response = {
|
|
1525
|
+
...parsedBody,
|
|
1526
|
+
name: `${errorCode}`,
|
|
1527
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1528
|
+
$fault: "client",
|
|
1529
|
+
$metadata: deserializeMetadata(output),
|
|
1530
|
+
};
|
|
1531
|
+
}
|
|
1532
|
+
const message = response.message || response.Message || errorCode;
|
|
1533
|
+
response.message = message;
|
|
1534
|
+
delete response.Message;
|
|
1535
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1536
|
+
};
|
|
1537
|
+
const deserializeAws_restJson1DeleteContentCommand = async (output, context) => {
|
|
1538
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
1539
|
+
return deserializeAws_restJson1DeleteContentCommandError(output, context);
|
|
1540
|
+
}
|
|
1541
|
+
const contents = {
|
|
1542
|
+
$metadata: deserializeMetadata(output),
|
|
1543
|
+
};
|
|
1544
|
+
await collectBody(output.body, context);
|
|
1545
|
+
return Promise.resolve(contents);
|
|
1546
|
+
};
|
|
1547
|
+
exports.deserializeAws_restJson1DeleteContentCommand = deserializeAws_restJson1DeleteContentCommand;
|
|
1548
|
+
const deserializeAws_restJson1DeleteContentCommandError = async (output, context) => {
|
|
1549
|
+
const parsedOutput = {
|
|
1550
|
+
...output,
|
|
1551
|
+
body: await parseBody(output.body, context),
|
|
1552
|
+
};
|
|
1553
|
+
let response;
|
|
1554
|
+
let errorCode = "UnknownError";
|
|
1555
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1556
|
+
switch (errorCode) {
|
|
1557
|
+
case "AccessDeniedException":
|
|
1558
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
1559
|
+
response = {
|
|
1560
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1561
|
+
name: errorCode,
|
|
1562
|
+
$metadata: deserializeMetadata(output),
|
|
1563
|
+
};
|
|
1564
|
+
break;
|
|
1565
|
+
case "ResourceNotFoundException":
|
|
1566
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
1567
|
+
response = {
|
|
1568
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1569
|
+
name: errorCode,
|
|
1570
|
+
$metadata: deserializeMetadata(output),
|
|
1571
|
+
};
|
|
1572
|
+
break;
|
|
1573
|
+
case "ValidationException":
|
|
1574
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
1575
|
+
response = {
|
|
1576
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1577
|
+
name: errorCode,
|
|
1578
|
+
$metadata: deserializeMetadata(output),
|
|
1579
|
+
};
|
|
1580
|
+
break;
|
|
1581
|
+
default:
|
|
1582
|
+
const parsedBody = parsedOutput.body;
|
|
1583
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1584
|
+
response = {
|
|
1585
|
+
...parsedBody,
|
|
1586
|
+
name: `${errorCode}`,
|
|
1587
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1588
|
+
$fault: "client",
|
|
1589
|
+
$metadata: deserializeMetadata(output),
|
|
1590
|
+
};
|
|
1591
|
+
}
|
|
1592
|
+
const message = response.message || response.Message || errorCode;
|
|
1593
|
+
response.message = message;
|
|
1594
|
+
delete response.Message;
|
|
1595
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1596
|
+
};
|
|
1597
|
+
const deserializeAws_restJson1DeleteKnowledgeBaseCommand = async (output, context) => {
|
|
1598
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
1599
|
+
return deserializeAws_restJson1DeleteKnowledgeBaseCommandError(output, context);
|
|
1600
|
+
}
|
|
1601
|
+
const contents = {
|
|
1602
|
+
$metadata: deserializeMetadata(output),
|
|
1603
|
+
};
|
|
1604
|
+
await collectBody(output.body, context);
|
|
1605
|
+
return Promise.resolve(contents);
|
|
1606
|
+
};
|
|
1607
|
+
exports.deserializeAws_restJson1DeleteKnowledgeBaseCommand = deserializeAws_restJson1DeleteKnowledgeBaseCommand;
|
|
1608
|
+
const deserializeAws_restJson1DeleteKnowledgeBaseCommandError = async (output, context) => {
|
|
1609
|
+
const parsedOutput = {
|
|
1610
|
+
...output,
|
|
1611
|
+
body: await parseBody(output.body, context),
|
|
1612
|
+
};
|
|
1613
|
+
let response;
|
|
1614
|
+
let errorCode = "UnknownError";
|
|
1615
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1616
|
+
switch (errorCode) {
|
|
1617
|
+
case "AccessDeniedException":
|
|
1618
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
1619
|
+
response = {
|
|
1620
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1621
|
+
name: errorCode,
|
|
1622
|
+
$metadata: deserializeMetadata(output),
|
|
1623
|
+
};
|
|
1624
|
+
break;
|
|
1625
|
+
case "ConflictException":
|
|
1626
|
+
case "com.amazonaws.wisdom#ConflictException":
|
|
1627
|
+
response = {
|
|
1628
|
+
...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
|
|
1629
|
+
name: errorCode,
|
|
1630
|
+
$metadata: deserializeMetadata(output),
|
|
1631
|
+
};
|
|
1632
|
+
break;
|
|
1633
|
+
case "ResourceNotFoundException":
|
|
1634
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
1635
|
+
response = {
|
|
1636
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1637
|
+
name: errorCode,
|
|
1638
|
+
$metadata: deserializeMetadata(output),
|
|
1639
|
+
};
|
|
1640
|
+
break;
|
|
1641
|
+
default:
|
|
1642
|
+
const parsedBody = parsedOutput.body;
|
|
1643
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1644
|
+
response = {
|
|
1645
|
+
...parsedBody,
|
|
1646
|
+
name: `${errorCode}`,
|
|
1647
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1648
|
+
$fault: "client",
|
|
1649
|
+
$metadata: deserializeMetadata(output),
|
|
1650
|
+
};
|
|
1651
|
+
}
|
|
1652
|
+
const message = response.message || response.Message || errorCode;
|
|
1653
|
+
response.message = message;
|
|
1654
|
+
delete response.Message;
|
|
1655
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1656
|
+
};
|
|
1657
|
+
const deserializeAws_restJson1GetAssistantCommand = async (output, context) => {
|
|
1658
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1659
|
+
return deserializeAws_restJson1GetAssistantCommandError(output, context);
|
|
1660
|
+
}
|
|
1661
|
+
const contents = {
|
|
1662
|
+
$metadata: deserializeMetadata(output),
|
|
1663
|
+
assistant: undefined,
|
|
1664
|
+
};
|
|
1665
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1666
|
+
if (data.assistant !== undefined && data.assistant !== null) {
|
|
1667
|
+
contents.assistant = deserializeAws_restJson1AssistantData(data.assistant, context);
|
|
1668
|
+
}
|
|
1669
|
+
return Promise.resolve(contents);
|
|
1670
|
+
};
|
|
1671
|
+
exports.deserializeAws_restJson1GetAssistantCommand = deserializeAws_restJson1GetAssistantCommand;
|
|
1672
|
+
const deserializeAws_restJson1GetAssistantCommandError = async (output, context) => {
|
|
1673
|
+
const parsedOutput = {
|
|
1674
|
+
...output,
|
|
1675
|
+
body: await parseBody(output.body, context),
|
|
1676
|
+
};
|
|
1677
|
+
let response;
|
|
1678
|
+
let errorCode = "UnknownError";
|
|
1679
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1680
|
+
switch (errorCode) {
|
|
1681
|
+
case "AccessDeniedException":
|
|
1682
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
1683
|
+
response = {
|
|
1684
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1685
|
+
name: errorCode,
|
|
1686
|
+
$metadata: deserializeMetadata(output),
|
|
1687
|
+
};
|
|
1688
|
+
break;
|
|
1689
|
+
case "ResourceNotFoundException":
|
|
1690
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
1691
|
+
response = {
|
|
1692
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1693
|
+
name: errorCode,
|
|
1694
|
+
$metadata: deserializeMetadata(output),
|
|
1695
|
+
};
|
|
1696
|
+
break;
|
|
1697
|
+
case "ValidationException":
|
|
1698
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
1699
|
+
response = {
|
|
1700
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1701
|
+
name: errorCode,
|
|
1702
|
+
$metadata: deserializeMetadata(output),
|
|
1703
|
+
};
|
|
1704
|
+
break;
|
|
1705
|
+
default:
|
|
1706
|
+
const parsedBody = parsedOutput.body;
|
|
1707
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1708
|
+
response = {
|
|
1709
|
+
...parsedBody,
|
|
1710
|
+
name: `${errorCode}`,
|
|
1711
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1712
|
+
$fault: "client",
|
|
1713
|
+
$metadata: deserializeMetadata(output),
|
|
1714
|
+
};
|
|
1715
|
+
}
|
|
1716
|
+
const message = response.message || response.Message || errorCode;
|
|
1717
|
+
response.message = message;
|
|
1718
|
+
delete response.Message;
|
|
1719
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1720
|
+
};
|
|
1721
|
+
const deserializeAws_restJson1GetAssistantAssociationCommand = async (output, context) => {
|
|
1722
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1723
|
+
return deserializeAws_restJson1GetAssistantAssociationCommandError(output, context);
|
|
1724
|
+
}
|
|
1725
|
+
const contents = {
|
|
1726
|
+
$metadata: deserializeMetadata(output),
|
|
1727
|
+
assistantAssociation: undefined,
|
|
1728
|
+
};
|
|
1729
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1730
|
+
if (data.assistantAssociation !== undefined && data.assistantAssociation !== null) {
|
|
1731
|
+
contents.assistantAssociation = deserializeAws_restJson1AssistantAssociationData(data.assistantAssociation, context);
|
|
1732
|
+
}
|
|
1733
|
+
return Promise.resolve(contents);
|
|
1734
|
+
};
|
|
1735
|
+
exports.deserializeAws_restJson1GetAssistantAssociationCommand = deserializeAws_restJson1GetAssistantAssociationCommand;
|
|
1736
|
+
const deserializeAws_restJson1GetAssistantAssociationCommandError = async (output, context) => {
|
|
1737
|
+
const parsedOutput = {
|
|
1738
|
+
...output,
|
|
1739
|
+
body: await parseBody(output.body, context),
|
|
1740
|
+
};
|
|
1741
|
+
let response;
|
|
1742
|
+
let errorCode = "UnknownError";
|
|
1743
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1744
|
+
switch (errorCode) {
|
|
1745
|
+
case "AccessDeniedException":
|
|
1746
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
1747
|
+
response = {
|
|
1748
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1749
|
+
name: errorCode,
|
|
1750
|
+
$metadata: deserializeMetadata(output),
|
|
1751
|
+
};
|
|
1752
|
+
break;
|
|
1753
|
+
case "ResourceNotFoundException":
|
|
1754
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
1755
|
+
response = {
|
|
1756
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1757
|
+
name: errorCode,
|
|
1758
|
+
$metadata: deserializeMetadata(output),
|
|
1759
|
+
};
|
|
1760
|
+
break;
|
|
1761
|
+
case "ValidationException":
|
|
1762
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
1763
|
+
response = {
|
|
1764
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1765
|
+
name: errorCode,
|
|
1766
|
+
$metadata: deserializeMetadata(output),
|
|
1767
|
+
};
|
|
1768
|
+
break;
|
|
1769
|
+
default:
|
|
1770
|
+
const parsedBody = parsedOutput.body;
|
|
1771
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1772
|
+
response = {
|
|
1773
|
+
...parsedBody,
|
|
1774
|
+
name: `${errorCode}`,
|
|
1775
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1776
|
+
$fault: "client",
|
|
1777
|
+
$metadata: deserializeMetadata(output),
|
|
1778
|
+
};
|
|
1779
|
+
}
|
|
1780
|
+
const message = response.message || response.Message || errorCode;
|
|
1781
|
+
response.message = message;
|
|
1782
|
+
delete response.Message;
|
|
1783
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1784
|
+
};
|
|
1785
|
+
const deserializeAws_restJson1GetContentCommand = async (output, context) => {
|
|
1786
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1787
|
+
return deserializeAws_restJson1GetContentCommandError(output, context);
|
|
1788
|
+
}
|
|
1789
|
+
const contents = {
|
|
1790
|
+
$metadata: deserializeMetadata(output),
|
|
1791
|
+
content: undefined,
|
|
1792
|
+
};
|
|
1793
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1794
|
+
if (data.content !== undefined && data.content !== null) {
|
|
1795
|
+
contents.content = deserializeAws_restJson1ContentData(data.content, context);
|
|
1796
|
+
}
|
|
1797
|
+
return Promise.resolve(contents);
|
|
1798
|
+
};
|
|
1799
|
+
exports.deserializeAws_restJson1GetContentCommand = deserializeAws_restJson1GetContentCommand;
|
|
1800
|
+
const deserializeAws_restJson1GetContentCommandError = async (output, context) => {
|
|
1801
|
+
const parsedOutput = {
|
|
1802
|
+
...output,
|
|
1803
|
+
body: await parseBody(output.body, context),
|
|
1804
|
+
};
|
|
1805
|
+
let response;
|
|
1806
|
+
let errorCode = "UnknownError";
|
|
1807
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1808
|
+
switch (errorCode) {
|
|
1809
|
+
case "AccessDeniedException":
|
|
1810
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
1811
|
+
response = {
|
|
1812
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1813
|
+
name: errorCode,
|
|
1814
|
+
$metadata: deserializeMetadata(output),
|
|
1815
|
+
};
|
|
1816
|
+
break;
|
|
1817
|
+
case "ResourceNotFoundException":
|
|
1818
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
1819
|
+
response = {
|
|
1820
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1821
|
+
name: errorCode,
|
|
1822
|
+
$metadata: deserializeMetadata(output),
|
|
1823
|
+
};
|
|
1824
|
+
break;
|
|
1825
|
+
case "ValidationException":
|
|
1826
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
1827
|
+
response = {
|
|
1828
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1829
|
+
name: errorCode,
|
|
1830
|
+
$metadata: deserializeMetadata(output),
|
|
1831
|
+
};
|
|
1832
|
+
break;
|
|
1833
|
+
default:
|
|
1834
|
+
const parsedBody = parsedOutput.body;
|
|
1835
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1836
|
+
response = {
|
|
1837
|
+
...parsedBody,
|
|
1838
|
+
name: `${errorCode}`,
|
|
1839
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1840
|
+
$fault: "client",
|
|
1841
|
+
$metadata: deserializeMetadata(output),
|
|
1842
|
+
};
|
|
1843
|
+
}
|
|
1844
|
+
const message = response.message || response.Message || errorCode;
|
|
1845
|
+
response.message = message;
|
|
1846
|
+
delete response.Message;
|
|
1847
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1848
|
+
};
|
|
1849
|
+
const deserializeAws_restJson1GetContentSummaryCommand = async (output, context) => {
|
|
1850
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1851
|
+
return deserializeAws_restJson1GetContentSummaryCommandError(output, context);
|
|
1852
|
+
}
|
|
1853
|
+
const contents = {
|
|
1854
|
+
$metadata: deserializeMetadata(output),
|
|
1855
|
+
contentSummary: undefined,
|
|
1856
|
+
};
|
|
1857
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1858
|
+
if (data.contentSummary !== undefined && data.contentSummary !== null) {
|
|
1859
|
+
contents.contentSummary = deserializeAws_restJson1ContentSummary(data.contentSummary, context);
|
|
1860
|
+
}
|
|
1861
|
+
return Promise.resolve(contents);
|
|
1862
|
+
};
|
|
1863
|
+
exports.deserializeAws_restJson1GetContentSummaryCommand = deserializeAws_restJson1GetContentSummaryCommand;
|
|
1864
|
+
const deserializeAws_restJson1GetContentSummaryCommandError = async (output, context) => {
|
|
1865
|
+
const parsedOutput = {
|
|
1866
|
+
...output,
|
|
1867
|
+
body: await parseBody(output.body, context),
|
|
1868
|
+
};
|
|
1869
|
+
let response;
|
|
1870
|
+
let errorCode = "UnknownError";
|
|
1871
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1872
|
+
switch (errorCode) {
|
|
1873
|
+
case "AccessDeniedException":
|
|
1874
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
1875
|
+
response = {
|
|
1876
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1877
|
+
name: errorCode,
|
|
1878
|
+
$metadata: deserializeMetadata(output),
|
|
1879
|
+
};
|
|
1880
|
+
break;
|
|
1881
|
+
case "ResourceNotFoundException":
|
|
1882
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
1883
|
+
response = {
|
|
1884
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1885
|
+
name: errorCode,
|
|
1886
|
+
$metadata: deserializeMetadata(output),
|
|
1887
|
+
};
|
|
1888
|
+
break;
|
|
1889
|
+
case "ValidationException":
|
|
1890
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
1891
|
+
response = {
|
|
1892
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1893
|
+
name: errorCode,
|
|
1894
|
+
$metadata: deserializeMetadata(output),
|
|
1895
|
+
};
|
|
1896
|
+
break;
|
|
1897
|
+
default:
|
|
1898
|
+
const parsedBody = parsedOutput.body;
|
|
1899
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1900
|
+
response = {
|
|
1901
|
+
...parsedBody,
|
|
1902
|
+
name: `${errorCode}`,
|
|
1903
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1904
|
+
$fault: "client",
|
|
1905
|
+
$metadata: deserializeMetadata(output),
|
|
1906
|
+
};
|
|
1907
|
+
}
|
|
1908
|
+
const message = response.message || response.Message || errorCode;
|
|
1909
|
+
response.message = message;
|
|
1910
|
+
delete response.Message;
|
|
1911
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1912
|
+
};
|
|
1913
|
+
const deserializeAws_restJson1GetKnowledgeBaseCommand = async (output, context) => {
|
|
1914
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1915
|
+
return deserializeAws_restJson1GetKnowledgeBaseCommandError(output, context);
|
|
1916
|
+
}
|
|
1917
|
+
const contents = {
|
|
1918
|
+
$metadata: deserializeMetadata(output),
|
|
1919
|
+
knowledgeBase: undefined,
|
|
1920
|
+
};
|
|
1921
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1922
|
+
if (data.knowledgeBase !== undefined && data.knowledgeBase !== null) {
|
|
1923
|
+
contents.knowledgeBase = deserializeAws_restJson1KnowledgeBaseData(data.knowledgeBase, context);
|
|
1924
|
+
}
|
|
1925
|
+
return Promise.resolve(contents);
|
|
1926
|
+
};
|
|
1927
|
+
exports.deserializeAws_restJson1GetKnowledgeBaseCommand = deserializeAws_restJson1GetKnowledgeBaseCommand;
|
|
1928
|
+
const deserializeAws_restJson1GetKnowledgeBaseCommandError = async (output, context) => {
|
|
1929
|
+
const parsedOutput = {
|
|
1930
|
+
...output,
|
|
1931
|
+
body: await parseBody(output.body, context),
|
|
1932
|
+
};
|
|
1933
|
+
let response;
|
|
1934
|
+
let errorCode = "UnknownError";
|
|
1935
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1936
|
+
switch (errorCode) {
|
|
1937
|
+
case "AccessDeniedException":
|
|
1938
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
1939
|
+
response = {
|
|
1940
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1941
|
+
name: errorCode,
|
|
1942
|
+
$metadata: deserializeMetadata(output),
|
|
1943
|
+
};
|
|
1944
|
+
break;
|
|
1945
|
+
case "ResourceNotFoundException":
|
|
1946
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
1947
|
+
response = {
|
|
1948
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1949
|
+
name: errorCode,
|
|
1950
|
+
$metadata: deserializeMetadata(output),
|
|
1951
|
+
};
|
|
1952
|
+
break;
|
|
1953
|
+
case "ValidationException":
|
|
1954
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
1955
|
+
response = {
|
|
1956
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1957
|
+
name: errorCode,
|
|
1958
|
+
$metadata: deserializeMetadata(output),
|
|
1959
|
+
};
|
|
1960
|
+
break;
|
|
1961
|
+
default:
|
|
1962
|
+
const parsedBody = parsedOutput.body;
|
|
1963
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1964
|
+
response = {
|
|
1965
|
+
...parsedBody,
|
|
1966
|
+
name: `${errorCode}`,
|
|
1967
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1968
|
+
$fault: "client",
|
|
1969
|
+
$metadata: deserializeMetadata(output),
|
|
1970
|
+
};
|
|
1971
|
+
}
|
|
1972
|
+
const message = response.message || response.Message || errorCode;
|
|
1973
|
+
response.message = message;
|
|
1974
|
+
delete response.Message;
|
|
1975
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1976
|
+
};
|
|
1977
|
+
const deserializeAws_restJson1GetRecommendationsCommand = async (output, context) => {
|
|
1978
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1979
|
+
return deserializeAws_restJson1GetRecommendationsCommandError(output, context);
|
|
1980
|
+
}
|
|
1981
|
+
const contents = {
|
|
1982
|
+
$metadata: deserializeMetadata(output),
|
|
1983
|
+
recommendations: undefined,
|
|
1984
|
+
};
|
|
1985
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1986
|
+
if (data.recommendations !== undefined && data.recommendations !== null) {
|
|
1987
|
+
contents.recommendations = deserializeAws_restJson1RecommendationList(data.recommendations, context);
|
|
1988
|
+
}
|
|
1989
|
+
return Promise.resolve(contents);
|
|
1990
|
+
};
|
|
1991
|
+
exports.deserializeAws_restJson1GetRecommendationsCommand = deserializeAws_restJson1GetRecommendationsCommand;
|
|
1992
|
+
const deserializeAws_restJson1GetRecommendationsCommandError = async (output, context) => {
|
|
1993
|
+
const parsedOutput = {
|
|
1994
|
+
...output,
|
|
1995
|
+
body: await parseBody(output.body, context),
|
|
1996
|
+
};
|
|
1997
|
+
let response;
|
|
1998
|
+
let errorCode = "UnknownError";
|
|
1999
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2000
|
+
switch (errorCode) {
|
|
2001
|
+
case "AccessDeniedException":
|
|
2002
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
2003
|
+
response = {
|
|
2004
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2005
|
+
name: errorCode,
|
|
2006
|
+
$metadata: deserializeMetadata(output),
|
|
2007
|
+
};
|
|
2008
|
+
break;
|
|
2009
|
+
case "ResourceNotFoundException":
|
|
2010
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
2011
|
+
response = {
|
|
2012
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2013
|
+
name: errorCode,
|
|
2014
|
+
$metadata: deserializeMetadata(output),
|
|
2015
|
+
};
|
|
2016
|
+
break;
|
|
2017
|
+
case "ValidationException":
|
|
2018
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
2019
|
+
response = {
|
|
2020
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2021
|
+
name: errorCode,
|
|
2022
|
+
$metadata: deserializeMetadata(output),
|
|
2023
|
+
};
|
|
2024
|
+
break;
|
|
2025
|
+
default:
|
|
2026
|
+
const parsedBody = parsedOutput.body;
|
|
2027
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2028
|
+
response = {
|
|
2029
|
+
...parsedBody,
|
|
2030
|
+
name: `${errorCode}`,
|
|
2031
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2032
|
+
$fault: "client",
|
|
2033
|
+
$metadata: deserializeMetadata(output),
|
|
2034
|
+
};
|
|
2035
|
+
}
|
|
2036
|
+
const message = response.message || response.Message || errorCode;
|
|
2037
|
+
response.message = message;
|
|
2038
|
+
delete response.Message;
|
|
2039
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2040
|
+
};
|
|
2041
|
+
const deserializeAws_restJson1GetSessionCommand = async (output, context) => {
|
|
2042
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2043
|
+
return deserializeAws_restJson1GetSessionCommandError(output, context);
|
|
2044
|
+
}
|
|
2045
|
+
const contents = {
|
|
2046
|
+
$metadata: deserializeMetadata(output),
|
|
2047
|
+
session: undefined,
|
|
2048
|
+
};
|
|
2049
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2050
|
+
if (data.session !== undefined && data.session !== null) {
|
|
2051
|
+
contents.session = deserializeAws_restJson1SessionData(data.session, context);
|
|
2052
|
+
}
|
|
2053
|
+
return Promise.resolve(contents);
|
|
2054
|
+
};
|
|
2055
|
+
exports.deserializeAws_restJson1GetSessionCommand = deserializeAws_restJson1GetSessionCommand;
|
|
2056
|
+
const deserializeAws_restJson1GetSessionCommandError = async (output, context) => {
|
|
2057
|
+
const parsedOutput = {
|
|
2058
|
+
...output,
|
|
2059
|
+
body: await parseBody(output.body, context),
|
|
2060
|
+
};
|
|
2061
|
+
let response;
|
|
2062
|
+
let errorCode = "UnknownError";
|
|
2063
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2064
|
+
switch (errorCode) {
|
|
2065
|
+
case "AccessDeniedException":
|
|
2066
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
2067
|
+
response = {
|
|
2068
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2069
|
+
name: errorCode,
|
|
2070
|
+
$metadata: deserializeMetadata(output),
|
|
2071
|
+
};
|
|
2072
|
+
break;
|
|
2073
|
+
case "ResourceNotFoundException":
|
|
2074
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
2075
|
+
response = {
|
|
2076
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2077
|
+
name: errorCode,
|
|
2078
|
+
$metadata: deserializeMetadata(output),
|
|
2079
|
+
};
|
|
2080
|
+
break;
|
|
2081
|
+
case "ValidationException":
|
|
2082
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
2083
|
+
response = {
|
|
2084
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2085
|
+
name: errorCode,
|
|
2086
|
+
$metadata: deserializeMetadata(output),
|
|
2087
|
+
};
|
|
2088
|
+
break;
|
|
2089
|
+
default:
|
|
2090
|
+
const parsedBody = parsedOutput.body;
|
|
2091
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2092
|
+
response = {
|
|
2093
|
+
...parsedBody,
|
|
2094
|
+
name: `${errorCode}`,
|
|
2095
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2096
|
+
$fault: "client",
|
|
2097
|
+
$metadata: deserializeMetadata(output),
|
|
2098
|
+
};
|
|
2099
|
+
}
|
|
2100
|
+
const message = response.message || response.Message || errorCode;
|
|
2101
|
+
response.message = message;
|
|
2102
|
+
delete response.Message;
|
|
2103
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2104
|
+
};
|
|
2105
|
+
const deserializeAws_restJson1ListAssistantAssociationsCommand = async (output, context) => {
|
|
2106
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2107
|
+
return deserializeAws_restJson1ListAssistantAssociationsCommandError(output, context);
|
|
2108
|
+
}
|
|
2109
|
+
const contents = {
|
|
2110
|
+
$metadata: deserializeMetadata(output),
|
|
2111
|
+
assistantAssociationSummaries: undefined,
|
|
2112
|
+
nextToken: undefined,
|
|
2113
|
+
};
|
|
2114
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2115
|
+
if (data.assistantAssociationSummaries !== undefined && data.assistantAssociationSummaries !== null) {
|
|
2116
|
+
contents.assistantAssociationSummaries = deserializeAws_restJson1AssistantAssociationSummaryList(data.assistantAssociationSummaries, context);
|
|
2117
|
+
}
|
|
2118
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
2119
|
+
contents.nextToken = smithy_client_1.expectString(data.nextToken);
|
|
2120
|
+
}
|
|
2121
|
+
return Promise.resolve(contents);
|
|
2122
|
+
};
|
|
2123
|
+
exports.deserializeAws_restJson1ListAssistantAssociationsCommand = deserializeAws_restJson1ListAssistantAssociationsCommand;
|
|
2124
|
+
const deserializeAws_restJson1ListAssistantAssociationsCommandError = async (output, context) => {
|
|
2125
|
+
const parsedOutput = {
|
|
2126
|
+
...output,
|
|
2127
|
+
body: await parseBody(output.body, context),
|
|
2128
|
+
};
|
|
2129
|
+
let response;
|
|
2130
|
+
let errorCode = "UnknownError";
|
|
2131
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2132
|
+
switch (errorCode) {
|
|
2133
|
+
case "AccessDeniedException":
|
|
2134
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
2135
|
+
response = {
|
|
2136
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2137
|
+
name: errorCode,
|
|
2138
|
+
$metadata: deserializeMetadata(output),
|
|
2139
|
+
};
|
|
2140
|
+
break;
|
|
2141
|
+
case "ResourceNotFoundException":
|
|
2142
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
2143
|
+
response = {
|
|
2144
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2145
|
+
name: errorCode,
|
|
2146
|
+
$metadata: deserializeMetadata(output),
|
|
2147
|
+
};
|
|
2148
|
+
break;
|
|
2149
|
+
case "ValidationException":
|
|
2150
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
2151
|
+
response = {
|
|
2152
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2153
|
+
name: errorCode,
|
|
2154
|
+
$metadata: deserializeMetadata(output),
|
|
2155
|
+
};
|
|
2156
|
+
break;
|
|
2157
|
+
default:
|
|
2158
|
+
const parsedBody = parsedOutput.body;
|
|
2159
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2160
|
+
response = {
|
|
2161
|
+
...parsedBody,
|
|
2162
|
+
name: `${errorCode}`,
|
|
2163
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2164
|
+
$fault: "client",
|
|
2165
|
+
$metadata: deserializeMetadata(output),
|
|
2166
|
+
};
|
|
2167
|
+
}
|
|
2168
|
+
const message = response.message || response.Message || errorCode;
|
|
2169
|
+
response.message = message;
|
|
2170
|
+
delete response.Message;
|
|
2171
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2172
|
+
};
|
|
2173
|
+
const deserializeAws_restJson1ListAssistantsCommand = async (output, context) => {
|
|
2174
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2175
|
+
return deserializeAws_restJson1ListAssistantsCommandError(output, context);
|
|
2176
|
+
}
|
|
2177
|
+
const contents = {
|
|
2178
|
+
$metadata: deserializeMetadata(output),
|
|
2179
|
+
assistantSummaries: undefined,
|
|
2180
|
+
nextToken: undefined,
|
|
2181
|
+
};
|
|
2182
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2183
|
+
if (data.assistantSummaries !== undefined && data.assistantSummaries !== null) {
|
|
2184
|
+
contents.assistantSummaries = deserializeAws_restJson1AssistantList(data.assistantSummaries, context);
|
|
2185
|
+
}
|
|
2186
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
2187
|
+
contents.nextToken = smithy_client_1.expectString(data.nextToken);
|
|
2188
|
+
}
|
|
2189
|
+
return Promise.resolve(contents);
|
|
2190
|
+
};
|
|
2191
|
+
exports.deserializeAws_restJson1ListAssistantsCommand = deserializeAws_restJson1ListAssistantsCommand;
|
|
2192
|
+
const deserializeAws_restJson1ListAssistantsCommandError = async (output, context) => {
|
|
2193
|
+
const parsedOutput = {
|
|
2194
|
+
...output,
|
|
2195
|
+
body: await parseBody(output.body, context),
|
|
2196
|
+
};
|
|
2197
|
+
let response;
|
|
2198
|
+
let errorCode = "UnknownError";
|
|
2199
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2200
|
+
switch (errorCode) {
|
|
2201
|
+
case "AccessDeniedException":
|
|
2202
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
2203
|
+
response = {
|
|
2204
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2205
|
+
name: errorCode,
|
|
2206
|
+
$metadata: deserializeMetadata(output),
|
|
2207
|
+
};
|
|
2208
|
+
break;
|
|
2209
|
+
case "ValidationException":
|
|
2210
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
2211
|
+
response = {
|
|
2212
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2213
|
+
name: errorCode,
|
|
2214
|
+
$metadata: deserializeMetadata(output),
|
|
2215
|
+
};
|
|
2216
|
+
break;
|
|
2217
|
+
default:
|
|
2218
|
+
const parsedBody = parsedOutput.body;
|
|
2219
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2220
|
+
response = {
|
|
2221
|
+
...parsedBody,
|
|
2222
|
+
name: `${errorCode}`,
|
|
2223
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2224
|
+
$fault: "client",
|
|
2225
|
+
$metadata: deserializeMetadata(output),
|
|
2226
|
+
};
|
|
2227
|
+
}
|
|
2228
|
+
const message = response.message || response.Message || errorCode;
|
|
2229
|
+
response.message = message;
|
|
2230
|
+
delete response.Message;
|
|
2231
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2232
|
+
};
|
|
2233
|
+
const deserializeAws_restJson1ListContentsCommand = async (output, context) => {
|
|
2234
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2235
|
+
return deserializeAws_restJson1ListContentsCommandError(output, context);
|
|
2236
|
+
}
|
|
2237
|
+
const contents = {
|
|
2238
|
+
$metadata: deserializeMetadata(output),
|
|
2239
|
+
contentSummaries: undefined,
|
|
2240
|
+
nextToken: undefined,
|
|
2241
|
+
};
|
|
2242
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2243
|
+
if (data.contentSummaries !== undefined && data.contentSummaries !== null) {
|
|
2244
|
+
contents.contentSummaries = deserializeAws_restJson1ContentSummaryList(data.contentSummaries, context);
|
|
2245
|
+
}
|
|
2246
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
2247
|
+
contents.nextToken = smithy_client_1.expectString(data.nextToken);
|
|
2248
|
+
}
|
|
2249
|
+
return Promise.resolve(contents);
|
|
2250
|
+
};
|
|
2251
|
+
exports.deserializeAws_restJson1ListContentsCommand = deserializeAws_restJson1ListContentsCommand;
|
|
2252
|
+
const deserializeAws_restJson1ListContentsCommandError = async (output, context) => {
|
|
2253
|
+
const parsedOutput = {
|
|
2254
|
+
...output,
|
|
2255
|
+
body: await parseBody(output.body, context),
|
|
2256
|
+
};
|
|
2257
|
+
let response;
|
|
2258
|
+
let errorCode = "UnknownError";
|
|
2259
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2260
|
+
switch (errorCode) {
|
|
2261
|
+
case "AccessDeniedException":
|
|
2262
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
2263
|
+
response = {
|
|
2264
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2265
|
+
name: errorCode,
|
|
2266
|
+
$metadata: deserializeMetadata(output),
|
|
2267
|
+
};
|
|
2268
|
+
break;
|
|
2269
|
+
case "ResourceNotFoundException":
|
|
2270
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
2271
|
+
response = {
|
|
2272
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2273
|
+
name: errorCode,
|
|
2274
|
+
$metadata: deserializeMetadata(output),
|
|
2275
|
+
};
|
|
2276
|
+
break;
|
|
2277
|
+
case "ValidationException":
|
|
2278
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
2279
|
+
response = {
|
|
2280
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2281
|
+
name: errorCode,
|
|
2282
|
+
$metadata: deserializeMetadata(output),
|
|
2283
|
+
};
|
|
2284
|
+
break;
|
|
2285
|
+
default:
|
|
2286
|
+
const parsedBody = parsedOutput.body;
|
|
2287
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2288
|
+
response = {
|
|
2289
|
+
...parsedBody,
|
|
2290
|
+
name: `${errorCode}`,
|
|
2291
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2292
|
+
$fault: "client",
|
|
2293
|
+
$metadata: deserializeMetadata(output),
|
|
2294
|
+
};
|
|
2295
|
+
}
|
|
2296
|
+
const message = response.message || response.Message || errorCode;
|
|
2297
|
+
response.message = message;
|
|
2298
|
+
delete response.Message;
|
|
2299
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2300
|
+
};
|
|
2301
|
+
const deserializeAws_restJson1ListKnowledgeBasesCommand = async (output, context) => {
|
|
2302
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2303
|
+
return deserializeAws_restJson1ListKnowledgeBasesCommandError(output, context);
|
|
2304
|
+
}
|
|
2305
|
+
const contents = {
|
|
2306
|
+
$metadata: deserializeMetadata(output),
|
|
2307
|
+
knowledgeBaseSummaries: undefined,
|
|
2308
|
+
nextToken: undefined,
|
|
2309
|
+
};
|
|
2310
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2311
|
+
if (data.knowledgeBaseSummaries !== undefined && data.knowledgeBaseSummaries !== null) {
|
|
2312
|
+
contents.knowledgeBaseSummaries = deserializeAws_restJson1KnowledgeBaseList(data.knowledgeBaseSummaries, context);
|
|
2313
|
+
}
|
|
2314
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
2315
|
+
contents.nextToken = smithy_client_1.expectString(data.nextToken);
|
|
2316
|
+
}
|
|
2317
|
+
return Promise.resolve(contents);
|
|
2318
|
+
};
|
|
2319
|
+
exports.deserializeAws_restJson1ListKnowledgeBasesCommand = deserializeAws_restJson1ListKnowledgeBasesCommand;
|
|
2320
|
+
const deserializeAws_restJson1ListKnowledgeBasesCommandError = async (output, context) => {
|
|
2321
|
+
const parsedOutput = {
|
|
2322
|
+
...output,
|
|
2323
|
+
body: await parseBody(output.body, context),
|
|
2324
|
+
};
|
|
2325
|
+
let response;
|
|
2326
|
+
let errorCode = "UnknownError";
|
|
2327
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2328
|
+
switch (errorCode) {
|
|
2329
|
+
case "AccessDeniedException":
|
|
2330
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
2331
|
+
response = {
|
|
2332
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2333
|
+
name: errorCode,
|
|
2334
|
+
$metadata: deserializeMetadata(output),
|
|
2335
|
+
};
|
|
2336
|
+
break;
|
|
2337
|
+
case "ValidationException":
|
|
2338
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
2339
|
+
response = {
|
|
2340
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2341
|
+
name: errorCode,
|
|
2342
|
+
$metadata: deserializeMetadata(output),
|
|
2343
|
+
};
|
|
2344
|
+
break;
|
|
2345
|
+
default:
|
|
2346
|
+
const parsedBody = parsedOutput.body;
|
|
2347
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2348
|
+
response = {
|
|
2349
|
+
...parsedBody,
|
|
2350
|
+
name: `${errorCode}`,
|
|
2351
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2352
|
+
$fault: "client",
|
|
2353
|
+
$metadata: deserializeMetadata(output),
|
|
2354
|
+
};
|
|
2355
|
+
}
|
|
2356
|
+
const message = response.message || response.Message || errorCode;
|
|
2357
|
+
response.message = message;
|
|
2358
|
+
delete response.Message;
|
|
2359
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2360
|
+
};
|
|
2361
|
+
const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
|
|
2362
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2363
|
+
return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
|
|
2364
|
+
}
|
|
2365
|
+
const contents = {
|
|
2366
|
+
$metadata: deserializeMetadata(output),
|
|
2367
|
+
tags: undefined,
|
|
2368
|
+
};
|
|
2369
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2370
|
+
if (data.tags !== undefined && data.tags !== null) {
|
|
2371
|
+
contents.tags = deserializeAws_restJson1Tags(data.tags, context);
|
|
2372
|
+
}
|
|
2373
|
+
return Promise.resolve(contents);
|
|
2374
|
+
};
|
|
2375
|
+
exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
|
|
2376
|
+
const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
|
|
2377
|
+
const parsedOutput = {
|
|
2378
|
+
...output,
|
|
2379
|
+
body: await parseBody(output.body, context),
|
|
2380
|
+
};
|
|
2381
|
+
let response;
|
|
2382
|
+
let errorCode = "UnknownError";
|
|
2383
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2384
|
+
switch (errorCode) {
|
|
2385
|
+
case "ResourceNotFoundException":
|
|
2386
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
2387
|
+
response = {
|
|
2388
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2389
|
+
name: errorCode,
|
|
2390
|
+
$metadata: deserializeMetadata(output),
|
|
2391
|
+
};
|
|
2392
|
+
break;
|
|
2393
|
+
default:
|
|
2394
|
+
const parsedBody = parsedOutput.body;
|
|
2395
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2396
|
+
response = {
|
|
2397
|
+
...parsedBody,
|
|
2398
|
+
name: `${errorCode}`,
|
|
2399
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2400
|
+
$fault: "client",
|
|
2401
|
+
$metadata: deserializeMetadata(output),
|
|
2402
|
+
};
|
|
2403
|
+
}
|
|
2404
|
+
const message = response.message || response.Message || errorCode;
|
|
2405
|
+
response.message = message;
|
|
2406
|
+
delete response.Message;
|
|
2407
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2408
|
+
};
|
|
2409
|
+
const deserializeAws_restJson1NotifyRecommendationsReceivedCommand = async (output, context) => {
|
|
2410
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2411
|
+
return deserializeAws_restJson1NotifyRecommendationsReceivedCommandError(output, context);
|
|
2412
|
+
}
|
|
2413
|
+
const contents = {
|
|
2414
|
+
$metadata: deserializeMetadata(output),
|
|
2415
|
+
errors: undefined,
|
|
2416
|
+
recommendationIds: undefined,
|
|
2417
|
+
};
|
|
2418
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2419
|
+
if (data.errors !== undefined && data.errors !== null) {
|
|
2420
|
+
contents.errors = deserializeAws_restJson1NotifyRecommendationsReceivedErrorList(data.errors, context);
|
|
2421
|
+
}
|
|
2422
|
+
if (data.recommendationIds !== undefined && data.recommendationIds !== null) {
|
|
2423
|
+
contents.recommendationIds = deserializeAws_restJson1RecommendationIdList(data.recommendationIds, context);
|
|
2424
|
+
}
|
|
2425
|
+
return Promise.resolve(contents);
|
|
2426
|
+
};
|
|
2427
|
+
exports.deserializeAws_restJson1NotifyRecommendationsReceivedCommand = deserializeAws_restJson1NotifyRecommendationsReceivedCommand;
|
|
2428
|
+
const deserializeAws_restJson1NotifyRecommendationsReceivedCommandError = async (output, context) => {
|
|
2429
|
+
const parsedOutput = {
|
|
2430
|
+
...output,
|
|
2431
|
+
body: await parseBody(output.body, context),
|
|
2432
|
+
};
|
|
2433
|
+
let response;
|
|
2434
|
+
let errorCode = "UnknownError";
|
|
2435
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2436
|
+
switch (errorCode) {
|
|
2437
|
+
case "AccessDeniedException":
|
|
2438
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
2439
|
+
response = {
|
|
2440
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2441
|
+
name: errorCode,
|
|
2442
|
+
$metadata: deserializeMetadata(output),
|
|
2443
|
+
};
|
|
2444
|
+
break;
|
|
2445
|
+
case "ResourceNotFoundException":
|
|
2446
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
2447
|
+
response = {
|
|
2448
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2449
|
+
name: errorCode,
|
|
2450
|
+
$metadata: deserializeMetadata(output),
|
|
2451
|
+
};
|
|
2452
|
+
break;
|
|
2453
|
+
case "ValidationException":
|
|
2454
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
2455
|
+
response = {
|
|
2456
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2457
|
+
name: errorCode,
|
|
2458
|
+
$metadata: deserializeMetadata(output),
|
|
2459
|
+
};
|
|
2460
|
+
break;
|
|
2461
|
+
default:
|
|
2462
|
+
const parsedBody = parsedOutput.body;
|
|
2463
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2464
|
+
response = {
|
|
2465
|
+
...parsedBody,
|
|
2466
|
+
name: `${errorCode}`,
|
|
2467
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2468
|
+
$fault: "client",
|
|
2469
|
+
$metadata: deserializeMetadata(output),
|
|
2470
|
+
};
|
|
2471
|
+
}
|
|
2472
|
+
const message = response.message || response.Message || errorCode;
|
|
2473
|
+
response.message = message;
|
|
2474
|
+
delete response.Message;
|
|
2475
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2476
|
+
};
|
|
2477
|
+
const deserializeAws_restJson1QueryAssistantCommand = async (output, context) => {
|
|
2478
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2479
|
+
return deserializeAws_restJson1QueryAssistantCommandError(output, context);
|
|
2480
|
+
}
|
|
2481
|
+
const contents = {
|
|
2482
|
+
$metadata: deserializeMetadata(output),
|
|
2483
|
+
nextToken: undefined,
|
|
2484
|
+
results: undefined,
|
|
2485
|
+
};
|
|
2486
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2487
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
2488
|
+
contents.nextToken = smithy_client_1.expectString(data.nextToken);
|
|
2489
|
+
}
|
|
2490
|
+
if (data.results !== undefined && data.results !== null) {
|
|
2491
|
+
contents.results = deserializeAws_restJson1QueryResultsList(data.results, context);
|
|
2492
|
+
}
|
|
2493
|
+
return Promise.resolve(contents);
|
|
2494
|
+
};
|
|
2495
|
+
exports.deserializeAws_restJson1QueryAssistantCommand = deserializeAws_restJson1QueryAssistantCommand;
|
|
2496
|
+
const deserializeAws_restJson1QueryAssistantCommandError = async (output, context) => {
|
|
2497
|
+
const parsedOutput = {
|
|
2498
|
+
...output,
|
|
2499
|
+
body: await parseBody(output.body, context),
|
|
2500
|
+
};
|
|
2501
|
+
let response;
|
|
2502
|
+
let errorCode = "UnknownError";
|
|
2503
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2504
|
+
switch (errorCode) {
|
|
2505
|
+
case "AccessDeniedException":
|
|
2506
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
2507
|
+
response = {
|
|
2508
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2509
|
+
name: errorCode,
|
|
2510
|
+
$metadata: deserializeMetadata(output),
|
|
2511
|
+
};
|
|
2512
|
+
break;
|
|
2513
|
+
case "ResourceNotFoundException":
|
|
2514
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
2515
|
+
response = {
|
|
2516
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2517
|
+
name: errorCode,
|
|
2518
|
+
$metadata: deserializeMetadata(output),
|
|
2519
|
+
};
|
|
2520
|
+
break;
|
|
2521
|
+
case "ValidationException":
|
|
2522
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
2523
|
+
response = {
|
|
2524
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2525
|
+
name: errorCode,
|
|
2526
|
+
$metadata: deserializeMetadata(output),
|
|
2527
|
+
};
|
|
2528
|
+
break;
|
|
2529
|
+
default:
|
|
2530
|
+
const parsedBody = parsedOutput.body;
|
|
2531
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2532
|
+
response = {
|
|
2533
|
+
...parsedBody,
|
|
2534
|
+
name: `${errorCode}`,
|
|
2535
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2536
|
+
$fault: "client",
|
|
2537
|
+
$metadata: deserializeMetadata(output),
|
|
2538
|
+
};
|
|
2539
|
+
}
|
|
2540
|
+
const message = response.message || response.Message || errorCode;
|
|
2541
|
+
response.message = message;
|
|
2542
|
+
delete response.Message;
|
|
2543
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2544
|
+
};
|
|
2545
|
+
const deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand = async (output, context) => {
|
|
2546
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
2547
|
+
return deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommandError(output, context);
|
|
2548
|
+
}
|
|
2549
|
+
const contents = {
|
|
2550
|
+
$metadata: deserializeMetadata(output),
|
|
2551
|
+
};
|
|
2552
|
+
await collectBody(output.body, context);
|
|
2553
|
+
return Promise.resolve(contents);
|
|
2554
|
+
};
|
|
2555
|
+
exports.deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand = deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand;
|
|
2556
|
+
const deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommandError = async (output, context) => {
|
|
2557
|
+
const parsedOutput = {
|
|
2558
|
+
...output,
|
|
2559
|
+
body: await parseBody(output.body, context),
|
|
2560
|
+
};
|
|
2561
|
+
let response;
|
|
2562
|
+
let errorCode = "UnknownError";
|
|
2563
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2564
|
+
switch (errorCode) {
|
|
2565
|
+
case "AccessDeniedException":
|
|
2566
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
2567
|
+
response = {
|
|
2568
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2569
|
+
name: errorCode,
|
|
2570
|
+
$metadata: deserializeMetadata(output),
|
|
2571
|
+
};
|
|
2572
|
+
break;
|
|
2573
|
+
case "ResourceNotFoundException":
|
|
2574
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
2575
|
+
response = {
|
|
2576
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2577
|
+
name: errorCode,
|
|
2578
|
+
$metadata: deserializeMetadata(output),
|
|
2579
|
+
};
|
|
2580
|
+
break;
|
|
2581
|
+
case "ValidationException":
|
|
2582
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
2583
|
+
response = {
|
|
2584
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2585
|
+
name: errorCode,
|
|
2586
|
+
$metadata: deserializeMetadata(output),
|
|
2587
|
+
};
|
|
2588
|
+
break;
|
|
2589
|
+
default:
|
|
2590
|
+
const parsedBody = parsedOutput.body;
|
|
2591
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2592
|
+
response = {
|
|
2593
|
+
...parsedBody,
|
|
2594
|
+
name: `${errorCode}`,
|
|
2595
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2596
|
+
$fault: "client",
|
|
2597
|
+
$metadata: deserializeMetadata(output),
|
|
2598
|
+
};
|
|
2599
|
+
}
|
|
2600
|
+
const message = response.message || response.Message || errorCode;
|
|
2601
|
+
response.message = message;
|
|
2602
|
+
delete response.Message;
|
|
2603
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2604
|
+
};
|
|
2605
|
+
const deserializeAws_restJson1SearchContentCommand = async (output, context) => {
|
|
2606
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2607
|
+
return deserializeAws_restJson1SearchContentCommandError(output, context);
|
|
2608
|
+
}
|
|
2609
|
+
const contents = {
|
|
2610
|
+
$metadata: deserializeMetadata(output),
|
|
2611
|
+
contentSummaries: undefined,
|
|
2612
|
+
nextToken: undefined,
|
|
2613
|
+
};
|
|
2614
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2615
|
+
if (data.contentSummaries !== undefined && data.contentSummaries !== null) {
|
|
2616
|
+
contents.contentSummaries = deserializeAws_restJson1ContentSummaryList(data.contentSummaries, context);
|
|
2617
|
+
}
|
|
2618
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
2619
|
+
contents.nextToken = smithy_client_1.expectString(data.nextToken);
|
|
2620
|
+
}
|
|
2621
|
+
return Promise.resolve(contents);
|
|
2622
|
+
};
|
|
2623
|
+
exports.deserializeAws_restJson1SearchContentCommand = deserializeAws_restJson1SearchContentCommand;
|
|
2624
|
+
const deserializeAws_restJson1SearchContentCommandError = async (output, context) => {
|
|
2625
|
+
const parsedOutput = {
|
|
2626
|
+
...output,
|
|
2627
|
+
body: await parseBody(output.body, context),
|
|
2628
|
+
};
|
|
2629
|
+
let response;
|
|
2630
|
+
let errorCode = "UnknownError";
|
|
2631
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2632
|
+
switch (errorCode) {
|
|
2633
|
+
case "AccessDeniedException":
|
|
2634
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
2635
|
+
response = {
|
|
2636
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2637
|
+
name: errorCode,
|
|
2638
|
+
$metadata: deserializeMetadata(output),
|
|
2639
|
+
};
|
|
2640
|
+
break;
|
|
2641
|
+
case "ResourceNotFoundException":
|
|
2642
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
2643
|
+
response = {
|
|
2644
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2645
|
+
name: errorCode,
|
|
2646
|
+
$metadata: deserializeMetadata(output),
|
|
2647
|
+
};
|
|
2648
|
+
break;
|
|
2649
|
+
case "ValidationException":
|
|
2650
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
2651
|
+
response = {
|
|
2652
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2653
|
+
name: errorCode,
|
|
2654
|
+
$metadata: deserializeMetadata(output),
|
|
2655
|
+
};
|
|
2656
|
+
break;
|
|
2657
|
+
default:
|
|
2658
|
+
const parsedBody = parsedOutput.body;
|
|
2659
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2660
|
+
response = {
|
|
2661
|
+
...parsedBody,
|
|
2662
|
+
name: `${errorCode}`,
|
|
2663
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2664
|
+
$fault: "client",
|
|
2665
|
+
$metadata: deserializeMetadata(output),
|
|
2666
|
+
};
|
|
2667
|
+
}
|
|
2668
|
+
const message = response.message || response.Message || errorCode;
|
|
2669
|
+
response.message = message;
|
|
2670
|
+
delete response.Message;
|
|
2671
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2672
|
+
};
|
|
2673
|
+
const deserializeAws_restJson1SearchSessionsCommand = async (output, context) => {
|
|
2674
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2675
|
+
return deserializeAws_restJson1SearchSessionsCommandError(output, context);
|
|
2676
|
+
}
|
|
2677
|
+
const contents = {
|
|
2678
|
+
$metadata: deserializeMetadata(output),
|
|
2679
|
+
nextToken: undefined,
|
|
2680
|
+
sessionSummaries: undefined,
|
|
2681
|
+
};
|
|
2682
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2683
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
2684
|
+
contents.nextToken = smithy_client_1.expectString(data.nextToken);
|
|
2685
|
+
}
|
|
2686
|
+
if (data.sessionSummaries !== undefined && data.sessionSummaries !== null) {
|
|
2687
|
+
contents.sessionSummaries = deserializeAws_restJson1SessionSummaries(data.sessionSummaries, context);
|
|
2688
|
+
}
|
|
2689
|
+
return Promise.resolve(contents);
|
|
2690
|
+
};
|
|
2691
|
+
exports.deserializeAws_restJson1SearchSessionsCommand = deserializeAws_restJson1SearchSessionsCommand;
|
|
2692
|
+
const deserializeAws_restJson1SearchSessionsCommandError = async (output, context) => {
|
|
2693
|
+
const parsedOutput = {
|
|
2694
|
+
...output,
|
|
2695
|
+
body: await parseBody(output.body, context),
|
|
2696
|
+
};
|
|
2697
|
+
let response;
|
|
2698
|
+
let errorCode = "UnknownError";
|
|
2699
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2700
|
+
switch (errorCode) {
|
|
2701
|
+
case "AccessDeniedException":
|
|
2702
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
2703
|
+
response = {
|
|
2704
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2705
|
+
name: errorCode,
|
|
2706
|
+
$metadata: deserializeMetadata(output),
|
|
2707
|
+
};
|
|
2708
|
+
break;
|
|
2709
|
+
case "ResourceNotFoundException":
|
|
2710
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
2711
|
+
response = {
|
|
2712
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2713
|
+
name: errorCode,
|
|
2714
|
+
$metadata: deserializeMetadata(output),
|
|
2715
|
+
};
|
|
2716
|
+
break;
|
|
2717
|
+
case "ValidationException":
|
|
2718
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
2719
|
+
response = {
|
|
2720
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2721
|
+
name: errorCode,
|
|
2722
|
+
$metadata: deserializeMetadata(output),
|
|
2723
|
+
};
|
|
2724
|
+
break;
|
|
2725
|
+
default:
|
|
2726
|
+
const parsedBody = parsedOutput.body;
|
|
2727
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2728
|
+
response = {
|
|
2729
|
+
...parsedBody,
|
|
2730
|
+
name: `${errorCode}`,
|
|
2731
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2732
|
+
$fault: "client",
|
|
2733
|
+
$metadata: deserializeMetadata(output),
|
|
2734
|
+
};
|
|
2735
|
+
}
|
|
2736
|
+
const message = response.message || response.Message || errorCode;
|
|
2737
|
+
response.message = message;
|
|
2738
|
+
delete response.Message;
|
|
2739
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2740
|
+
};
|
|
2741
|
+
const deserializeAws_restJson1StartContentUploadCommand = async (output, context) => {
|
|
2742
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2743
|
+
return deserializeAws_restJson1StartContentUploadCommandError(output, context);
|
|
2744
|
+
}
|
|
2745
|
+
const contents = {
|
|
2746
|
+
$metadata: deserializeMetadata(output),
|
|
2747
|
+
headersToInclude: undefined,
|
|
2748
|
+
uploadId: undefined,
|
|
2749
|
+
url: undefined,
|
|
2750
|
+
urlExpiry: undefined,
|
|
2751
|
+
};
|
|
2752
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2753
|
+
if (data.headersToInclude !== undefined && data.headersToInclude !== null) {
|
|
2754
|
+
contents.headersToInclude = deserializeAws_restJson1Headers(data.headersToInclude, context);
|
|
2755
|
+
}
|
|
2756
|
+
if (data.uploadId !== undefined && data.uploadId !== null) {
|
|
2757
|
+
contents.uploadId = smithy_client_1.expectString(data.uploadId);
|
|
2758
|
+
}
|
|
2759
|
+
if (data.url !== undefined && data.url !== null) {
|
|
2760
|
+
contents.url = smithy_client_1.expectString(data.url);
|
|
2761
|
+
}
|
|
2762
|
+
if (data.urlExpiry !== undefined && data.urlExpiry !== null) {
|
|
2763
|
+
contents.urlExpiry = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.urlExpiry)));
|
|
2764
|
+
}
|
|
2765
|
+
return Promise.resolve(contents);
|
|
2766
|
+
};
|
|
2767
|
+
exports.deserializeAws_restJson1StartContentUploadCommand = deserializeAws_restJson1StartContentUploadCommand;
|
|
2768
|
+
const deserializeAws_restJson1StartContentUploadCommandError = async (output, context) => {
|
|
2769
|
+
const parsedOutput = {
|
|
2770
|
+
...output,
|
|
2771
|
+
body: await parseBody(output.body, context),
|
|
2772
|
+
};
|
|
2773
|
+
let response;
|
|
2774
|
+
let errorCode = "UnknownError";
|
|
2775
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2776
|
+
switch (errorCode) {
|
|
2777
|
+
case "AccessDeniedException":
|
|
2778
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
2779
|
+
response = {
|
|
2780
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2781
|
+
name: errorCode,
|
|
2782
|
+
$metadata: deserializeMetadata(output),
|
|
2783
|
+
};
|
|
2784
|
+
break;
|
|
2785
|
+
case "ResourceNotFoundException":
|
|
2786
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
2787
|
+
response = {
|
|
2788
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2789
|
+
name: errorCode,
|
|
2790
|
+
$metadata: deserializeMetadata(output),
|
|
2791
|
+
};
|
|
2792
|
+
break;
|
|
2793
|
+
case "ValidationException":
|
|
2794
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
2795
|
+
response = {
|
|
2796
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2797
|
+
name: errorCode,
|
|
2798
|
+
$metadata: deserializeMetadata(output),
|
|
2799
|
+
};
|
|
2800
|
+
break;
|
|
2801
|
+
default:
|
|
2802
|
+
const parsedBody = parsedOutput.body;
|
|
2803
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2804
|
+
response = {
|
|
2805
|
+
...parsedBody,
|
|
2806
|
+
name: `${errorCode}`,
|
|
2807
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2808
|
+
$fault: "client",
|
|
2809
|
+
$metadata: deserializeMetadata(output),
|
|
2810
|
+
};
|
|
2811
|
+
}
|
|
2812
|
+
const message = response.message || response.Message || errorCode;
|
|
2813
|
+
response.message = message;
|
|
2814
|
+
delete response.Message;
|
|
2815
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2816
|
+
};
|
|
2817
|
+
const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
|
|
2818
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2819
|
+
return deserializeAws_restJson1TagResourceCommandError(output, context);
|
|
2820
|
+
}
|
|
2821
|
+
const contents = {
|
|
2822
|
+
$metadata: deserializeMetadata(output),
|
|
2823
|
+
};
|
|
2824
|
+
await collectBody(output.body, context);
|
|
2825
|
+
return Promise.resolve(contents);
|
|
2826
|
+
};
|
|
2827
|
+
exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
|
|
2828
|
+
const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
|
|
2829
|
+
const parsedOutput = {
|
|
2830
|
+
...output,
|
|
2831
|
+
body: await parseBody(output.body, context),
|
|
2832
|
+
};
|
|
2833
|
+
let response;
|
|
2834
|
+
let errorCode = "UnknownError";
|
|
2835
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2836
|
+
switch (errorCode) {
|
|
2837
|
+
case "ResourceNotFoundException":
|
|
2838
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
2839
|
+
response = {
|
|
2840
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2841
|
+
name: errorCode,
|
|
2842
|
+
$metadata: deserializeMetadata(output),
|
|
2843
|
+
};
|
|
2844
|
+
break;
|
|
2845
|
+
case "TooManyTagsException":
|
|
2846
|
+
case "com.amazonaws.wisdom#TooManyTagsException":
|
|
2847
|
+
response = {
|
|
2848
|
+
...(await deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context)),
|
|
2849
|
+
name: errorCode,
|
|
2850
|
+
$metadata: deserializeMetadata(output),
|
|
2851
|
+
};
|
|
2852
|
+
break;
|
|
2853
|
+
default:
|
|
2854
|
+
const parsedBody = parsedOutput.body;
|
|
2855
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2856
|
+
response = {
|
|
2857
|
+
...parsedBody,
|
|
2858
|
+
name: `${errorCode}`,
|
|
2859
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2860
|
+
$fault: "client",
|
|
2861
|
+
$metadata: deserializeMetadata(output),
|
|
2862
|
+
};
|
|
2863
|
+
}
|
|
2864
|
+
const message = response.message || response.Message || errorCode;
|
|
2865
|
+
response.message = message;
|
|
2866
|
+
delete response.Message;
|
|
2867
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2868
|
+
};
|
|
2869
|
+
const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
|
|
2870
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2871
|
+
return deserializeAws_restJson1UntagResourceCommandError(output, context);
|
|
2872
|
+
}
|
|
2873
|
+
const contents = {
|
|
2874
|
+
$metadata: deserializeMetadata(output),
|
|
2875
|
+
};
|
|
2876
|
+
await collectBody(output.body, context);
|
|
2877
|
+
return Promise.resolve(contents);
|
|
2878
|
+
};
|
|
2879
|
+
exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
|
|
2880
|
+
const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
|
|
2881
|
+
const parsedOutput = {
|
|
2882
|
+
...output,
|
|
2883
|
+
body: await parseBody(output.body, context),
|
|
2884
|
+
};
|
|
2885
|
+
let response;
|
|
2886
|
+
let errorCode = "UnknownError";
|
|
2887
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2888
|
+
switch (errorCode) {
|
|
2889
|
+
case "ResourceNotFoundException":
|
|
2890
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
2891
|
+
response = {
|
|
2892
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2893
|
+
name: errorCode,
|
|
2894
|
+
$metadata: deserializeMetadata(output),
|
|
2895
|
+
};
|
|
2896
|
+
break;
|
|
2897
|
+
default:
|
|
2898
|
+
const parsedBody = parsedOutput.body;
|
|
2899
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2900
|
+
response = {
|
|
2901
|
+
...parsedBody,
|
|
2902
|
+
name: `${errorCode}`,
|
|
2903
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2904
|
+
$fault: "client",
|
|
2905
|
+
$metadata: deserializeMetadata(output),
|
|
2906
|
+
};
|
|
2907
|
+
}
|
|
2908
|
+
const message = response.message || response.Message || errorCode;
|
|
2909
|
+
response.message = message;
|
|
2910
|
+
delete response.Message;
|
|
2911
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2912
|
+
};
|
|
2913
|
+
const deserializeAws_restJson1UpdateContentCommand = async (output, context) => {
|
|
2914
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2915
|
+
return deserializeAws_restJson1UpdateContentCommandError(output, context);
|
|
2916
|
+
}
|
|
2917
|
+
const contents = {
|
|
2918
|
+
$metadata: deserializeMetadata(output),
|
|
2919
|
+
content: undefined,
|
|
2920
|
+
};
|
|
2921
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2922
|
+
if (data.content !== undefined && data.content !== null) {
|
|
2923
|
+
contents.content = deserializeAws_restJson1ContentData(data.content, context);
|
|
2924
|
+
}
|
|
2925
|
+
return Promise.resolve(contents);
|
|
2926
|
+
};
|
|
2927
|
+
exports.deserializeAws_restJson1UpdateContentCommand = deserializeAws_restJson1UpdateContentCommand;
|
|
2928
|
+
const deserializeAws_restJson1UpdateContentCommandError = async (output, context) => {
|
|
2929
|
+
const parsedOutput = {
|
|
2930
|
+
...output,
|
|
2931
|
+
body: await parseBody(output.body, context),
|
|
2932
|
+
};
|
|
2933
|
+
let response;
|
|
2934
|
+
let errorCode = "UnknownError";
|
|
2935
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2936
|
+
switch (errorCode) {
|
|
2937
|
+
case "AccessDeniedException":
|
|
2938
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
2939
|
+
response = {
|
|
2940
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2941
|
+
name: errorCode,
|
|
2942
|
+
$metadata: deserializeMetadata(output),
|
|
2943
|
+
};
|
|
2944
|
+
break;
|
|
2945
|
+
case "PreconditionFailedException":
|
|
2946
|
+
case "com.amazonaws.wisdom#PreconditionFailedException":
|
|
2947
|
+
response = {
|
|
2948
|
+
...(await deserializeAws_restJson1PreconditionFailedExceptionResponse(parsedOutput, context)),
|
|
2949
|
+
name: errorCode,
|
|
2950
|
+
$metadata: deserializeMetadata(output),
|
|
2951
|
+
};
|
|
2952
|
+
break;
|
|
2953
|
+
case "ResourceNotFoundException":
|
|
2954
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
2955
|
+
response = {
|
|
2956
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2957
|
+
name: errorCode,
|
|
2958
|
+
$metadata: deserializeMetadata(output),
|
|
2959
|
+
};
|
|
2960
|
+
break;
|
|
2961
|
+
case "ValidationException":
|
|
2962
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
2963
|
+
response = {
|
|
2964
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2965
|
+
name: errorCode,
|
|
2966
|
+
$metadata: deserializeMetadata(output),
|
|
2967
|
+
};
|
|
2968
|
+
break;
|
|
2969
|
+
default:
|
|
2970
|
+
const parsedBody = parsedOutput.body;
|
|
2971
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2972
|
+
response = {
|
|
2973
|
+
...parsedBody,
|
|
2974
|
+
name: `${errorCode}`,
|
|
2975
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2976
|
+
$fault: "client",
|
|
2977
|
+
$metadata: deserializeMetadata(output),
|
|
2978
|
+
};
|
|
2979
|
+
}
|
|
2980
|
+
const message = response.message || response.Message || errorCode;
|
|
2981
|
+
response.message = message;
|
|
2982
|
+
delete response.Message;
|
|
2983
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2984
|
+
};
|
|
2985
|
+
const deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommand = async (output, context) => {
|
|
2986
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2987
|
+
return deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommandError(output, context);
|
|
2988
|
+
}
|
|
2989
|
+
const contents = {
|
|
2990
|
+
$metadata: deserializeMetadata(output),
|
|
2991
|
+
knowledgeBase: undefined,
|
|
2992
|
+
};
|
|
2993
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2994
|
+
if (data.knowledgeBase !== undefined && data.knowledgeBase !== null) {
|
|
2995
|
+
contents.knowledgeBase = deserializeAws_restJson1KnowledgeBaseData(data.knowledgeBase, context);
|
|
2996
|
+
}
|
|
2997
|
+
return Promise.resolve(contents);
|
|
2998
|
+
};
|
|
2999
|
+
exports.deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommand = deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommand;
|
|
3000
|
+
const deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommandError = async (output, context) => {
|
|
3001
|
+
const parsedOutput = {
|
|
3002
|
+
...output,
|
|
3003
|
+
body: await parseBody(output.body, context),
|
|
3004
|
+
};
|
|
3005
|
+
let response;
|
|
3006
|
+
let errorCode = "UnknownError";
|
|
3007
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
3008
|
+
switch (errorCode) {
|
|
3009
|
+
case "AccessDeniedException":
|
|
3010
|
+
case "com.amazonaws.wisdom#AccessDeniedException":
|
|
3011
|
+
response = {
|
|
3012
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
3013
|
+
name: errorCode,
|
|
3014
|
+
$metadata: deserializeMetadata(output),
|
|
3015
|
+
};
|
|
3016
|
+
break;
|
|
3017
|
+
case "ResourceNotFoundException":
|
|
3018
|
+
case "com.amazonaws.wisdom#ResourceNotFoundException":
|
|
3019
|
+
response = {
|
|
3020
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
3021
|
+
name: errorCode,
|
|
3022
|
+
$metadata: deserializeMetadata(output),
|
|
3023
|
+
};
|
|
3024
|
+
break;
|
|
3025
|
+
case "ValidationException":
|
|
3026
|
+
case "com.amazonaws.wisdom#ValidationException":
|
|
3027
|
+
response = {
|
|
3028
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
3029
|
+
name: errorCode,
|
|
3030
|
+
$metadata: deserializeMetadata(output),
|
|
3031
|
+
};
|
|
3032
|
+
break;
|
|
3033
|
+
default:
|
|
3034
|
+
const parsedBody = parsedOutput.body;
|
|
3035
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
3036
|
+
response = {
|
|
3037
|
+
...parsedBody,
|
|
3038
|
+
name: `${errorCode}`,
|
|
3039
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
3040
|
+
$fault: "client",
|
|
3041
|
+
$metadata: deserializeMetadata(output),
|
|
3042
|
+
};
|
|
3043
|
+
}
|
|
3044
|
+
const message = response.message || response.Message || errorCode;
|
|
3045
|
+
response.message = message;
|
|
3046
|
+
delete response.Message;
|
|
3047
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
3048
|
+
};
|
|
3049
|
+
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
3050
|
+
const contents = {
|
|
3051
|
+
name: "AccessDeniedException",
|
|
3052
|
+
$fault: "client",
|
|
3053
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3054
|
+
message: undefined,
|
|
3055
|
+
};
|
|
3056
|
+
const data = parsedOutput.body;
|
|
3057
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3058
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3059
|
+
}
|
|
3060
|
+
return contents;
|
|
3061
|
+
};
|
|
3062
|
+
const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
3063
|
+
const contents = {
|
|
3064
|
+
name: "ConflictException",
|
|
3065
|
+
$fault: "client",
|
|
3066
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3067
|
+
message: undefined,
|
|
3068
|
+
};
|
|
3069
|
+
const data = parsedOutput.body;
|
|
3070
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3071
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3072
|
+
}
|
|
3073
|
+
return contents;
|
|
3074
|
+
};
|
|
3075
|
+
const deserializeAws_restJson1PreconditionFailedExceptionResponse = async (parsedOutput, context) => {
|
|
3076
|
+
const contents = {
|
|
3077
|
+
name: "PreconditionFailedException",
|
|
3078
|
+
$fault: "client",
|
|
3079
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3080
|
+
message: undefined,
|
|
3081
|
+
};
|
|
3082
|
+
const data = parsedOutput.body;
|
|
3083
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3084
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3085
|
+
}
|
|
3086
|
+
return contents;
|
|
3087
|
+
};
|
|
3088
|
+
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
3089
|
+
const contents = {
|
|
3090
|
+
name: "ResourceNotFoundException",
|
|
3091
|
+
$fault: "client",
|
|
3092
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3093
|
+
message: undefined,
|
|
3094
|
+
resourceName: undefined,
|
|
3095
|
+
};
|
|
3096
|
+
const data = parsedOutput.body;
|
|
3097
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3098
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3099
|
+
}
|
|
3100
|
+
if (data.resourceName !== undefined && data.resourceName !== null) {
|
|
3101
|
+
contents.resourceName = smithy_client_1.expectString(data.resourceName);
|
|
3102
|
+
}
|
|
3103
|
+
return contents;
|
|
3104
|
+
};
|
|
3105
|
+
const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
|
|
3106
|
+
const contents = {
|
|
3107
|
+
name: "ServiceQuotaExceededException",
|
|
3108
|
+
$fault: "client",
|
|
3109
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3110
|
+
message: undefined,
|
|
3111
|
+
};
|
|
3112
|
+
const data = parsedOutput.body;
|
|
3113
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3114
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3115
|
+
}
|
|
3116
|
+
return contents;
|
|
3117
|
+
};
|
|
3118
|
+
const deserializeAws_restJson1TooManyTagsExceptionResponse = async (parsedOutput, context) => {
|
|
3119
|
+
const contents = {
|
|
3120
|
+
name: "TooManyTagsException",
|
|
3121
|
+
$fault: "client",
|
|
3122
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3123
|
+
message: undefined,
|
|
3124
|
+
resourceName: undefined,
|
|
3125
|
+
};
|
|
3126
|
+
const data = parsedOutput.body;
|
|
3127
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3128
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3129
|
+
}
|
|
3130
|
+
if (data.resourceName !== undefined && data.resourceName !== null) {
|
|
3131
|
+
contents.resourceName = smithy_client_1.expectString(data.resourceName);
|
|
3132
|
+
}
|
|
3133
|
+
return contents;
|
|
3134
|
+
};
|
|
3135
|
+
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
3136
|
+
const contents = {
|
|
3137
|
+
name: "ValidationException",
|
|
3138
|
+
$fault: "client",
|
|
3139
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3140
|
+
message: undefined,
|
|
3141
|
+
};
|
|
3142
|
+
const data = parsedOutput.body;
|
|
3143
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3144
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3145
|
+
}
|
|
3146
|
+
return contents;
|
|
3147
|
+
};
|
|
3148
|
+
const serializeAws_restJson1AppIntegrationsConfiguration = (input, context) => {
|
|
3149
|
+
return {
|
|
3150
|
+
...(input.appIntegrationArn !== undefined &&
|
|
3151
|
+
input.appIntegrationArn !== null && { appIntegrationArn: input.appIntegrationArn }),
|
|
3152
|
+
...(input.objectFields !== undefined &&
|
|
3153
|
+
input.objectFields !== null && {
|
|
3154
|
+
objectFields: serializeAws_restJson1ObjectFieldsList(input.objectFields, context),
|
|
3155
|
+
}),
|
|
3156
|
+
};
|
|
3157
|
+
};
|
|
3158
|
+
const serializeAws_restJson1AssistantAssociationInputData = (input, context) => {
|
|
3159
|
+
return models_0_1.AssistantAssociationInputData.visit(input, {
|
|
3160
|
+
knowledgeBaseId: (value) => ({ knowledgeBaseId: value }),
|
|
3161
|
+
_: (name, value) => ({ name: value }),
|
|
3162
|
+
});
|
|
3163
|
+
};
|
|
3164
|
+
const serializeAws_restJson1ContentMetadata = (input, context) => {
|
|
3165
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
3166
|
+
if (value === null) {
|
|
3167
|
+
return acc;
|
|
3168
|
+
}
|
|
3169
|
+
return {
|
|
3170
|
+
...acc,
|
|
3171
|
+
[key]: value,
|
|
3172
|
+
};
|
|
3173
|
+
}, {});
|
|
3174
|
+
};
|
|
3175
|
+
const serializeAws_restJson1Filter = (input, context) => {
|
|
3176
|
+
return {
|
|
3177
|
+
...(input.field !== undefined && input.field !== null && { field: input.field }),
|
|
3178
|
+
...(input.operator !== undefined && input.operator !== null && { operator: input.operator }),
|
|
3179
|
+
...(input.value !== undefined && input.value !== null && { value: input.value }),
|
|
3180
|
+
};
|
|
3181
|
+
};
|
|
3182
|
+
const serializeAws_restJson1FilterList = (input, context) => {
|
|
3183
|
+
return input
|
|
3184
|
+
.filter((e) => e != null)
|
|
3185
|
+
.map((entry) => {
|
|
3186
|
+
if (entry === null) {
|
|
3187
|
+
return null;
|
|
3188
|
+
}
|
|
3189
|
+
return serializeAws_restJson1Filter(entry, context);
|
|
3190
|
+
});
|
|
3191
|
+
};
|
|
3192
|
+
const serializeAws_restJson1ObjectFieldsList = (input, context) => {
|
|
3193
|
+
return input
|
|
3194
|
+
.filter((e) => e != null)
|
|
3195
|
+
.map((entry) => {
|
|
3196
|
+
if (entry === null) {
|
|
3197
|
+
return null;
|
|
3198
|
+
}
|
|
3199
|
+
return entry;
|
|
3200
|
+
});
|
|
3201
|
+
};
|
|
3202
|
+
const serializeAws_restJson1RecommendationIdList = (input, context) => {
|
|
3203
|
+
return input
|
|
3204
|
+
.filter((e) => e != null)
|
|
3205
|
+
.map((entry) => {
|
|
3206
|
+
if (entry === null) {
|
|
3207
|
+
return null;
|
|
3208
|
+
}
|
|
3209
|
+
return entry;
|
|
3210
|
+
});
|
|
3211
|
+
};
|
|
3212
|
+
const serializeAws_restJson1RenderingConfiguration = (input, context) => {
|
|
3213
|
+
return {
|
|
3214
|
+
...(input.templateUri !== undefined && input.templateUri !== null && { templateUri: input.templateUri }),
|
|
3215
|
+
};
|
|
3216
|
+
};
|
|
3217
|
+
const serializeAws_restJson1SearchExpression = (input, context) => {
|
|
3218
|
+
return {
|
|
3219
|
+
...(input.filters !== undefined &&
|
|
3220
|
+
input.filters !== null && { filters: serializeAws_restJson1FilterList(input.filters, context) }),
|
|
3221
|
+
};
|
|
3222
|
+
};
|
|
3223
|
+
const serializeAws_restJson1ServerSideEncryptionConfiguration = (input, context) => {
|
|
3224
|
+
return {
|
|
3225
|
+
...(input.kmsKeyId !== undefined && input.kmsKeyId !== null && { kmsKeyId: input.kmsKeyId }),
|
|
3226
|
+
};
|
|
3227
|
+
};
|
|
3228
|
+
const serializeAws_restJson1SourceConfiguration = (input, context) => {
|
|
3229
|
+
return models_0_1.SourceConfiguration.visit(input, {
|
|
3230
|
+
appIntegrations: (value) => ({
|
|
3231
|
+
appIntegrations: serializeAws_restJson1AppIntegrationsConfiguration(value, context),
|
|
3232
|
+
}),
|
|
3233
|
+
_: (name, value) => ({ name: value }),
|
|
3234
|
+
});
|
|
3235
|
+
};
|
|
3236
|
+
const serializeAws_restJson1Tags = (input, context) => {
|
|
3237
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
3238
|
+
if (value === null) {
|
|
3239
|
+
return acc;
|
|
3240
|
+
}
|
|
3241
|
+
return {
|
|
3242
|
+
...acc,
|
|
3243
|
+
[key]: value,
|
|
3244
|
+
};
|
|
3245
|
+
}, {});
|
|
3246
|
+
};
|
|
3247
|
+
const deserializeAws_restJson1AppIntegrationsConfiguration = (output, context) => {
|
|
3248
|
+
return {
|
|
3249
|
+
appIntegrationArn: smithy_client_1.expectString(output.appIntegrationArn),
|
|
3250
|
+
objectFields: output.objectFields !== undefined && output.objectFields !== null
|
|
3251
|
+
? deserializeAws_restJson1ObjectFieldsList(output.objectFields, context)
|
|
3252
|
+
: undefined,
|
|
3253
|
+
};
|
|
3254
|
+
};
|
|
3255
|
+
const deserializeAws_restJson1AssistantAssociationData = (output, context) => {
|
|
3256
|
+
return {
|
|
3257
|
+
assistantArn: smithy_client_1.expectString(output.assistantArn),
|
|
3258
|
+
assistantAssociationArn: smithy_client_1.expectString(output.assistantAssociationArn),
|
|
3259
|
+
assistantAssociationId: smithy_client_1.expectString(output.assistantAssociationId),
|
|
3260
|
+
assistantId: smithy_client_1.expectString(output.assistantId),
|
|
3261
|
+
associationData: output.associationData !== undefined && output.associationData !== null
|
|
3262
|
+
? deserializeAws_restJson1AssistantAssociationOutputData(smithy_client_1.expectUnion(output.associationData), context)
|
|
3263
|
+
: undefined,
|
|
3264
|
+
associationType: smithy_client_1.expectString(output.associationType),
|
|
3265
|
+
tags: output.tags !== undefined && output.tags !== null
|
|
3266
|
+
? deserializeAws_restJson1Tags(output.tags, context)
|
|
3267
|
+
: undefined,
|
|
3268
|
+
};
|
|
3269
|
+
};
|
|
3270
|
+
const deserializeAws_restJson1AssistantAssociationOutputData = (output, context) => {
|
|
3271
|
+
if (output.knowledgeBaseAssociation !== undefined && output.knowledgeBaseAssociation !== null) {
|
|
3272
|
+
return {
|
|
3273
|
+
knowledgeBaseAssociation: deserializeAws_restJson1KnowledgeBaseAssociationData(output.knowledgeBaseAssociation, context),
|
|
3274
|
+
};
|
|
3275
|
+
}
|
|
3276
|
+
return { $unknown: Object.entries(output)[0] };
|
|
3277
|
+
};
|
|
3278
|
+
const deserializeAws_restJson1AssistantAssociationSummary = (output, context) => {
|
|
3279
|
+
return {
|
|
3280
|
+
assistantArn: smithy_client_1.expectString(output.assistantArn),
|
|
3281
|
+
assistantAssociationArn: smithy_client_1.expectString(output.assistantAssociationArn),
|
|
3282
|
+
assistantAssociationId: smithy_client_1.expectString(output.assistantAssociationId),
|
|
3283
|
+
assistantId: smithy_client_1.expectString(output.assistantId),
|
|
3284
|
+
associationData: output.associationData !== undefined && output.associationData !== null
|
|
3285
|
+
? deserializeAws_restJson1AssistantAssociationOutputData(smithy_client_1.expectUnion(output.associationData), context)
|
|
3286
|
+
: undefined,
|
|
3287
|
+
associationType: smithy_client_1.expectString(output.associationType),
|
|
3288
|
+
tags: output.tags !== undefined && output.tags !== null
|
|
3289
|
+
? deserializeAws_restJson1Tags(output.tags, context)
|
|
3290
|
+
: undefined,
|
|
3291
|
+
};
|
|
3292
|
+
};
|
|
3293
|
+
const deserializeAws_restJson1AssistantAssociationSummaryList = (output, context) => {
|
|
3294
|
+
return (output || [])
|
|
3295
|
+
.filter((e) => e != null)
|
|
3296
|
+
.map((entry) => {
|
|
3297
|
+
if (entry === null) {
|
|
3298
|
+
return null;
|
|
3299
|
+
}
|
|
3300
|
+
return deserializeAws_restJson1AssistantAssociationSummary(entry, context);
|
|
3301
|
+
});
|
|
3302
|
+
};
|
|
3303
|
+
const deserializeAws_restJson1AssistantData = (output, context) => {
|
|
3304
|
+
return {
|
|
3305
|
+
assistantArn: smithy_client_1.expectString(output.assistantArn),
|
|
3306
|
+
assistantId: smithy_client_1.expectString(output.assistantId),
|
|
3307
|
+
description: smithy_client_1.expectString(output.description),
|
|
3308
|
+
name: smithy_client_1.expectString(output.name),
|
|
3309
|
+
serverSideEncryptionConfiguration: output.serverSideEncryptionConfiguration !== undefined && output.serverSideEncryptionConfiguration !== null
|
|
3310
|
+
? deserializeAws_restJson1ServerSideEncryptionConfiguration(output.serverSideEncryptionConfiguration, context)
|
|
3311
|
+
: undefined,
|
|
3312
|
+
status: smithy_client_1.expectString(output.status),
|
|
3313
|
+
tags: output.tags !== undefined && output.tags !== null
|
|
3314
|
+
? deserializeAws_restJson1Tags(output.tags, context)
|
|
3315
|
+
: undefined,
|
|
3316
|
+
type: smithy_client_1.expectString(output.type),
|
|
3317
|
+
};
|
|
3318
|
+
};
|
|
3319
|
+
const deserializeAws_restJson1AssistantList = (output, context) => {
|
|
3320
|
+
return (output || [])
|
|
3321
|
+
.filter((e) => e != null)
|
|
3322
|
+
.map((entry) => {
|
|
3323
|
+
if (entry === null) {
|
|
3324
|
+
return null;
|
|
3325
|
+
}
|
|
3326
|
+
return deserializeAws_restJson1AssistantSummary(entry, context);
|
|
3327
|
+
});
|
|
3328
|
+
};
|
|
3329
|
+
const deserializeAws_restJson1AssistantSummary = (output, context) => {
|
|
3330
|
+
return {
|
|
3331
|
+
assistantArn: smithy_client_1.expectString(output.assistantArn),
|
|
3332
|
+
assistantId: smithy_client_1.expectString(output.assistantId),
|
|
3333
|
+
description: smithy_client_1.expectString(output.description),
|
|
3334
|
+
name: smithy_client_1.expectString(output.name),
|
|
3335
|
+
serverSideEncryptionConfiguration: output.serverSideEncryptionConfiguration !== undefined && output.serverSideEncryptionConfiguration !== null
|
|
3336
|
+
? deserializeAws_restJson1ServerSideEncryptionConfiguration(output.serverSideEncryptionConfiguration, context)
|
|
3337
|
+
: undefined,
|
|
3338
|
+
status: smithy_client_1.expectString(output.status),
|
|
3339
|
+
tags: output.tags !== undefined && output.tags !== null
|
|
3340
|
+
? deserializeAws_restJson1Tags(output.tags, context)
|
|
3341
|
+
: undefined,
|
|
3342
|
+
type: smithy_client_1.expectString(output.type),
|
|
3343
|
+
};
|
|
3344
|
+
};
|
|
3345
|
+
const deserializeAws_restJson1ContentData = (output, context) => {
|
|
3346
|
+
return {
|
|
3347
|
+
contentArn: smithy_client_1.expectString(output.contentArn),
|
|
3348
|
+
contentId: smithy_client_1.expectString(output.contentId),
|
|
3349
|
+
contentType: smithy_client_1.expectString(output.contentType),
|
|
3350
|
+
knowledgeBaseArn: smithy_client_1.expectString(output.knowledgeBaseArn),
|
|
3351
|
+
knowledgeBaseId: smithy_client_1.expectString(output.knowledgeBaseId),
|
|
3352
|
+
linkOutUri: smithy_client_1.expectString(output.linkOutUri),
|
|
3353
|
+
metadata: output.metadata !== undefined && output.metadata !== null
|
|
3354
|
+
? deserializeAws_restJson1ContentMetadata(output.metadata, context)
|
|
3355
|
+
: undefined,
|
|
3356
|
+
name: smithy_client_1.expectString(output.name),
|
|
3357
|
+
revisionId: smithy_client_1.expectString(output.revisionId),
|
|
3358
|
+
status: smithy_client_1.expectString(output.status),
|
|
3359
|
+
tags: output.tags !== undefined && output.tags !== null
|
|
3360
|
+
? deserializeAws_restJson1Tags(output.tags, context)
|
|
3361
|
+
: undefined,
|
|
3362
|
+
title: smithy_client_1.expectString(output.title),
|
|
3363
|
+
url: smithy_client_1.expectString(output.url),
|
|
3364
|
+
urlExpiry: output.urlExpiry !== undefined && output.urlExpiry !== null
|
|
3365
|
+
? smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(output.urlExpiry)))
|
|
3366
|
+
: undefined,
|
|
3367
|
+
};
|
|
3368
|
+
};
|
|
3369
|
+
const deserializeAws_restJson1ContentMetadata = (output, context) => {
|
|
3370
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
3371
|
+
if (value === null) {
|
|
3372
|
+
return acc;
|
|
3373
|
+
}
|
|
3374
|
+
return {
|
|
3375
|
+
...acc,
|
|
3376
|
+
[key]: smithy_client_1.expectString(value),
|
|
3377
|
+
};
|
|
3378
|
+
}, {});
|
|
3379
|
+
};
|
|
3380
|
+
const deserializeAws_restJson1ContentReference = (output, context) => {
|
|
3381
|
+
return {
|
|
3382
|
+
contentArn: smithy_client_1.expectString(output.contentArn),
|
|
3383
|
+
contentId: smithy_client_1.expectString(output.contentId),
|
|
3384
|
+
knowledgeBaseArn: smithy_client_1.expectString(output.knowledgeBaseArn),
|
|
3385
|
+
knowledgeBaseId: smithy_client_1.expectString(output.knowledgeBaseId),
|
|
3386
|
+
};
|
|
3387
|
+
};
|
|
3388
|
+
const deserializeAws_restJson1ContentSummary = (output, context) => {
|
|
3389
|
+
return {
|
|
3390
|
+
contentArn: smithy_client_1.expectString(output.contentArn),
|
|
3391
|
+
contentId: smithy_client_1.expectString(output.contentId),
|
|
3392
|
+
contentType: smithy_client_1.expectString(output.contentType),
|
|
3393
|
+
knowledgeBaseArn: smithy_client_1.expectString(output.knowledgeBaseArn),
|
|
3394
|
+
knowledgeBaseId: smithy_client_1.expectString(output.knowledgeBaseId),
|
|
3395
|
+
metadata: output.metadata !== undefined && output.metadata !== null
|
|
3396
|
+
? deserializeAws_restJson1ContentMetadata(output.metadata, context)
|
|
3397
|
+
: undefined,
|
|
3398
|
+
name: smithy_client_1.expectString(output.name),
|
|
3399
|
+
revisionId: smithy_client_1.expectString(output.revisionId),
|
|
3400
|
+
status: smithy_client_1.expectString(output.status),
|
|
3401
|
+
tags: output.tags !== undefined && output.tags !== null
|
|
3402
|
+
? deserializeAws_restJson1Tags(output.tags, context)
|
|
3403
|
+
: undefined,
|
|
3404
|
+
title: smithy_client_1.expectString(output.title),
|
|
3405
|
+
};
|
|
3406
|
+
};
|
|
3407
|
+
const deserializeAws_restJson1ContentSummaryList = (output, context) => {
|
|
3408
|
+
return (output || [])
|
|
3409
|
+
.filter((e) => e != null)
|
|
3410
|
+
.map((entry) => {
|
|
3411
|
+
if (entry === null) {
|
|
3412
|
+
return null;
|
|
3413
|
+
}
|
|
3414
|
+
return deserializeAws_restJson1ContentSummary(entry, context);
|
|
3415
|
+
});
|
|
3416
|
+
};
|
|
3417
|
+
const deserializeAws_restJson1Document = (output, context) => {
|
|
3418
|
+
return {
|
|
3419
|
+
contentReference: output.contentReference !== undefined && output.contentReference !== null
|
|
3420
|
+
? deserializeAws_restJson1ContentReference(output.contentReference, context)
|
|
3421
|
+
: undefined,
|
|
3422
|
+
excerpt: output.excerpt !== undefined && output.excerpt !== null
|
|
3423
|
+
? deserializeAws_restJson1DocumentText(output.excerpt, context)
|
|
3424
|
+
: undefined,
|
|
3425
|
+
title: output.title !== undefined && output.title !== null
|
|
3426
|
+
? deserializeAws_restJson1DocumentText(output.title, context)
|
|
3427
|
+
: undefined,
|
|
3428
|
+
};
|
|
3429
|
+
};
|
|
3430
|
+
const deserializeAws_restJson1DocumentText = (output, context) => {
|
|
3431
|
+
return {
|
|
3432
|
+
highlights: output.highlights !== undefined && output.highlights !== null
|
|
3433
|
+
? deserializeAws_restJson1Highlights(output.highlights, context)
|
|
3434
|
+
: undefined,
|
|
3435
|
+
text: smithy_client_1.expectString(output.text),
|
|
3436
|
+
};
|
|
3437
|
+
};
|
|
3438
|
+
const deserializeAws_restJson1Headers = (output, context) => {
|
|
3439
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
3440
|
+
if (value === null) {
|
|
3441
|
+
return acc;
|
|
3442
|
+
}
|
|
3443
|
+
return {
|
|
3444
|
+
...acc,
|
|
3445
|
+
[key]: smithy_client_1.expectString(value),
|
|
3446
|
+
};
|
|
3447
|
+
}, {});
|
|
3448
|
+
};
|
|
3449
|
+
const deserializeAws_restJson1Highlight = (output, context) => {
|
|
3450
|
+
return {
|
|
3451
|
+
beginOffsetInclusive: smithy_client_1.expectInt32(output.beginOffsetInclusive),
|
|
3452
|
+
endOffsetExclusive: smithy_client_1.expectInt32(output.endOffsetExclusive),
|
|
3453
|
+
};
|
|
3454
|
+
};
|
|
3455
|
+
const deserializeAws_restJson1Highlights = (output, context) => {
|
|
3456
|
+
return (output || [])
|
|
3457
|
+
.filter((e) => e != null)
|
|
3458
|
+
.map((entry) => {
|
|
3459
|
+
if (entry === null) {
|
|
3460
|
+
return null;
|
|
3461
|
+
}
|
|
3462
|
+
return deserializeAws_restJson1Highlight(entry, context);
|
|
3463
|
+
});
|
|
3464
|
+
};
|
|
3465
|
+
const deserializeAws_restJson1KnowledgeBaseAssociationData = (output, context) => {
|
|
3466
|
+
return {
|
|
3467
|
+
knowledgeBaseArn: smithy_client_1.expectString(output.knowledgeBaseArn),
|
|
3468
|
+
knowledgeBaseId: smithy_client_1.expectString(output.knowledgeBaseId),
|
|
3469
|
+
};
|
|
3470
|
+
};
|
|
3471
|
+
const deserializeAws_restJson1KnowledgeBaseData = (output, context) => {
|
|
3472
|
+
return {
|
|
3473
|
+
description: smithy_client_1.expectString(output.description),
|
|
3474
|
+
knowledgeBaseArn: smithy_client_1.expectString(output.knowledgeBaseArn),
|
|
3475
|
+
knowledgeBaseId: smithy_client_1.expectString(output.knowledgeBaseId),
|
|
3476
|
+
knowledgeBaseType: smithy_client_1.expectString(output.knowledgeBaseType),
|
|
3477
|
+
lastContentModificationTime: output.lastContentModificationTime !== undefined && output.lastContentModificationTime !== null
|
|
3478
|
+
? smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(output.lastContentModificationTime)))
|
|
3479
|
+
: undefined,
|
|
3480
|
+
name: smithy_client_1.expectString(output.name),
|
|
3481
|
+
renderingConfiguration: output.renderingConfiguration !== undefined && output.renderingConfiguration !== null
|
|
3482
|
+
? deserializeAws_restJson1RenderingConfiguration(output.renderingConfiguration, context)
|
|
3483
|
+
: undefined,
|
|
3484
|
+
serverSideEncryptionConfiguration: output.serverSideEncryptionConfiguration !== undefined && output.serverSideEncryptionConfiguration !== null
|
|
3485
|
+
? deserializeAws_restJson1ServerSideEncryptionConfiguration(output.serverSideEncryptionConfiguration, context)
|
|
3486
|
+
: undefined,
|
|
3487
|
+
sourceConfiguration: output.sourceConfiguration !== undefined && output.sourceConfiguration !== null
|
|
3488
|
+
? deserializeAws_restJson1SourceConfiguration(smithy_client_1.expectUnion(output.sourceConfiguration), context)
|
|
3489
|
+
: undefined,
|
|
3490
|
+
status: smithy_client_1.expectString(output.status),
|
|
3491
|
+
tags: output.tags !== undefined && output.tags !== null
|
|
3492
|
+
? deserializeAws_restJson1Tags(output.tags, context)
|
|
3493
|
+
: undefined,
|
|
3494
|
+
};
|
|
3495
|
+
};
|
|
3496
|
+
const deserializeAws_restJson1KnowledgeBaseList = (output, context) => {
|
|
3497
|
+
return (output || [])
|
|
3498
|
+
.filter((e) => e != null)
|
|
3499
|
+
.map((entry) => {
|
|
3500
|
+
if (entry === null) {
|
|
3501
|
+
return null;
|
|
3502
|
+
}
|
|
3503
|
+
return deserializeAws_restJson1KnowledgeBaseSummary(entry, context);
|
|
3504
|
+
});
|
|
3505
|
+
};
|
|
3506
|
+
const deserializeAws_restJson1KnowledgeBaseSummary = (output, context) => {
|
|
3507
|
+
return {
|
|
3508
|
+
description: smithy_client_1.expectString(output.description),
|
|
3509
|
+
knowledgeBaseArn: smithy_client_1.expectString(output.knowledgeBaseArn),
|
|
3510
|
+
knowledgeBaseId: smithy_client_1.expectString(output.knowledgeBaseId),
|
|
3511
|
+
knowledgeBaseType: smithy_client_1.expectString(output.knowledgeBaseType),
|
|
3512
|
+
name: smithy_client_1.expectString(output.name),
|
|
3513
|
+
renderingConfiguration: output.renderingConfiguration !== undefined && output.renderingConfiguration !== null
|
|
3514
|
+
? deserializeAws_restJson1RenderingConfiguration(output.renderingConfiguration, context)
|
|
3515
|
+
: undefined,
|
|
3516
|
+
serverSideEncryptionConfiguration: output.serverSideEncryptionConfiguration !== undefined && output.serverSideEncryptionConfiguration !== null
|
|
3517
|
+
? deserializeAws_restJson1ServerSideEncryptionConfiguration(output.serverSideEncryptionConfiguration, context)
|
|
3518
|
+
: undefined,
|
|
3519
|
+
sourceConfiguration: output.sourceConfiguration !== undefined && output.sourceConfiguration !== null
|
|
3520
|
+
? deserializeAws_restJson1SourceConfiguration(smithy_client_1.expectUnion(output.sourceConfiguration), context)
|
|
3521
|
+
: undefined,
|
|
3522
|
+
status: smithy_client_1.expectString(output.status),
|
|
3523
|
+
tags: output.tags !== undefined && output.tags !== null
|
|
3524
|
+
? deserializeAws_restJson1Tags(output.tags, context)
|
|
3525
|
+
: undefined,
|
|
3526
|
+
};
|
|
3527
|
+
};
|
|
3528
|
+
const deserializeAws_restJson1NotifyRecommendationsReceivedError = (output, context) => {
|
|
3529
|
+
return {
|
|
3530
|
+
message: smithy_client_1.expectString(output.message),
|
|
3531
|
+
recommendationId: smithy_client_1.expectString(output.recommendationId),
|
|
3532
|
+
};
|
|
3533
|
+
};
|
|
3534
|
+
const deserializeAws_restJson1NotifyRecommendationsReceivedErrorList = (output, context) => {
|
|
3535
|
+
return (output || [])
|
|
3536
|
+
.filter((e) => e != null)
|
|
3537
|
+
.map((entry) => {
|
|
3538
|
+
if (entry === null) {
|
|
3539
|
+
return null;
|
|
3540
|
+
}
|
|
3541
|
+
return deserializeAws_restJson1NotifyRecommendationsReceivedError(entry, context);
|
|
3542
|
+
});
|
|
3543
|
+
};
|
|
3544
|
+
const deserializeAws_restJson1ObjectFieldsList = (output, context) => {
|
|
3545
|
+
return (output || [])
|
|
3546
|
+
.filter((e) => e != null)
|
|
3547
|
+
.map((entry) => {
|
|
3548
|
+
if (entry === null) {
|
|
3549
|
+
return null;
|
|
3550
|
+
}
|
|
3551
|
+
return smithy_client_1.expectString(entry);
|
|
3552
|
+
});
|
|
3553
|
+
};
|
|
3554
|
+
const deserializeAws_restJson1QueryResultsList = (output, context) => {
|
|
3555
|
+
return (output || [])
|
|
3556
|
+
.filter((e) => e != null)
|
|
3557
|
+
.map((entry) => {
|
|
3558
|
+
if (entry === null) {
|
|
3559
|
+
return null;
|
|
3560
|
+
}
|
|
3561
|
+
return deserializeAws_restJson1ResultData(entry, context);
|
|
3562
|
+
});
|
|
3563
|
+
};
|
|
3564
|
+
const deserializeAws_restJson1RecommendationData = (output, context) => {
|
|
3565
|
+
return {
|
|
3566
|
+
document: output.document !== undefined && output.document !== null
|
|
3567
|
+
? deserializeAws_restJson1Document(output.document, context)
|
|
3568
|
+
: undefined,
|
|
3569
|
+
recommendationId: smithy_client_1.expectString(output.recommendationId),
|
|
3570
|
+
relevanceLevel: smithy_client_1.expectString(output.relevanceLevel),
|
|
3571
|
+
relevanceScore: smithy_client_1.limitedParseDouble(output.relevanceScore),
|
|
3572
|
+
};
|
|
3573
|
+
};
|
|
3574
|
+
const deserializeAws_restJson1RecommendationIdList = (output, context) => {
|
|
3575
|
+
return (output || [])
|
|
3576
|
+
.filter((e) => e != null)
|
|
3577
|
+
.map((entry) => {
|
|
3578
|
+
if (entry === null) {
|
|
3579
|
+
return null;
|
|
3580
|
+
}
|
|
3581
|
+
return smithy_client_1.expectString(entry);
|
|
3582
|
+
});
|
|
3583
|
+
};
|
|
3584
|
+
const deserializeAws_restJson1RecommendationList = (output, context) => {
|
|
3585
|
+
return (output || [])
|
|
3586
|
+
.filter((e) => e != null)
|
|
3587
|
+
.map((entry) => {
|
|
3588
|
+
if (entry === null) {
|
|
3589
|
+
return null;
|
|
3590
|
+
}
|
|
3591
|
+
return deserializeAws_restJson1RecommendationData(entry, context);
|
|
3592
|
+
});
|
|
3593
|
+
};
|
|
3594
|
+
const deserializeAws_restJson1RenderingConfiguration = (output, context) => {
|
|
3595
|
+
return {
|
|
3596
|
+
templateUri: smithy_client_1.expectString(output.templateUri),
|
|
3597
|
+
};
|
|
3598
|
+
};
|
|
3599
|
+
const deserializeAws_restJson1ResultData = (output, context) => {
|
|
3600
|
+
return {
|
|
3601
|
+
document: output.document !== undefined && output.document !== null
|
|
3602
|
+
? deserializeAws_restJson1Document(output.document, context)
|
|
3603
|
+
: undefined,
|
|
3604
|
+
relevanceScore: smithy_client_1.limitedParseDouble(output.relevanceScore),
|
|
3605
|
+
resultId: smithy_client_1.expectString(output.resultId),
|
|
3606
|
+
};
|
|
3607
|
+
};
|
|
3608
|
+
const deserializeAws_restJson1ServerSideEncryptionConfiguration = (output, context) => {
|
|
3609
|
+
return {
|
|
3610
|
+
kmsKeyId: smithy_client_1.expectString(output.kmsKeyId),
|
|
3611
|
+
};
|
|
3612
|
+
};
|
|
3613
|
+
const deserializeAws_restJson1SessionData = (output, context) => {
|
|
3614
|
+
return {
|
|
3615
|
+
description: smithy_client_1.expectString(output.description),
|
|
3616
|
+
name: smithy_client_1.expectString(output.name),
|
|
3617
|
+
sessionArn: smithy_client_1.expectString(output.sessionArn),
|
|
3618
|
+
sessionId: smithy_client_1.expectString(output.sessionId),
|
|
3619
|
+
tags: output.tags !== undefined && output.tags !== null
|
|
3620
|
+
? deserializeAws_restJson1Tags(output.tags, context)
|
|
3621
|
+
: undefined,
|
|
3622
|
+
};
|
|
3623
|
+
};
|
|
3624
|
+
const deserializeAws_restJson1SessionSummaries = (output, context) => {
|
|
3625
|
+
return (output || [])
|
|
3626
|
+
.filter((e) => e != null)
|
|
3627
|
+
.map((entry) => {
|
|
3628
|
+
if (entry === null) {
|
|
3629
|
+
return null;
|
|
3630
|
+
}
|
|
3631
|
+
return deserializeAws_restJson1SessionSummary(entry, context);
|
|
3632
|
+
});
|
|
3633
|
+
};
|
|
3634
|
+
const deserializeAws_restJson1SessionSummary = (output, context) => {
|
|
3635
|
+
return {
|
|
3636
|
+
assistantArn: smithy_client_1.expectString(output.assistantArn),
|
|
3637
|
+
assistantId: smithy_client_1.expectString(output.assistantId),
|
|
3638
|
+
sessionArn: smithy_client_1.expectString(output.sessionArn),
|
|
3639
|
+
sessionId: smithy_client_1.expectString(output.sessionId),
|
|
3640
|
+
};
|
|
3641
|
+
};
|
|
3642
|
+
const deserializeAws_restJson1SourceConfiguration = (output, context) => {
|
|
3643
|
+
if (output.appIntegrations !== undefined && output.appIntegrations !== null) {
|
|
3644
|
+
return {
|
|
3645
|
+
appIntegrations: deserializeAws_restJson1AppIntegrationsConfiguration(output.appIntegrations, context),
|
|
3646
|
+
};
|
|
3647
|
+
}
|
|
3648
|
+
return { $unknown: Object.entries(output)[0] };
|
|
3649
|
+
};
|
|
3650
|
+
const deserializeAws_restJson1Tags = (output, context) => {
|
|
3651
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
3652
|
+
if (value === null) {
|
|
3653
|
+
return acc;
|
|
3654
|
+
}
|
|
3655
|
+
return {
|
|
3656
|
+
...acc,
|
|
3657
|
+
[key]: smithy_client_1.expectString(value),
|
|
3658
|
+
};
|
|
3659
|
+
}, {});
|
|
3660
|
+
};
|
|
3661
|
+
const deserializeMetadata = (output) => {
|
|
3662
|
+
var _a;
|
|
3663
|
+
return ({
|
|
3664
|
+
httpStatusCode: output.statusCode,
|
|
3665
|
+
requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
|
|
3666
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
3667
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
3668
|
+
});
|
|
3669
|
+
};
|
|
3670
|
+
// Collect low-level response body stream to Uint8Array.
|
|
3671
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
3672
|
+
if (streamBody instanceof Uint8Array) {
|
|
3673
|
+
return Promise.resolve(streamBody);
|
|
3674
|
+
}
|
|
3675
|
+
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
3676
|
+
};
|
|
3677
|
+
// Encode Uint8Array data into string with utf-8.
|
|
3678
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
3679
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
3680
|
+
value !== null &&
|
|
3681
|
+
value !== "" &&
|
|
3682
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
3683
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
3684
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
3685
|
+
if (encoded.length) {
|
|
3686
|
+
return JSON.parse(encoded);
|
|
3687
|
+
}
|
|
3688
|
+
return {};
|
|
3689
|
+
});
|
|
3690
|
+
/**
|
|
3691
|
+
* Load an error code for the aws.rest-json-1.1 protocol.
|
|
3692
|
+
*/
|
|
3693
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
3694
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
3695
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
3696
|
+
let cleanValue = rawValue;
|
|
3697
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
3698
|
+
cleanValue = cleanValue.split(":")[0];
|
|
3699
|
+
}
|
|
3700
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
3701
|
+
cleanValue = cleanValue.split("#")[1];
|
|
3702
|
+
}
|
|
3703
|
+
return cleanValue;
|
|
3704
|
+
};
|
|
3705
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
3706
|
+
if (headerKey !== undefined) {
|
|
3707
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
3708
|
+
}
|
|
3709
|
+
if (data.code !== undefined) {
|
|
3710
|
+
return sanitizeErrorCode(data.code);
|
|
3711
|
+
}
|
|
3712
|
+
if (data["__type"] !== undefined) {
|
|
3713
|
+
return sanitizeErrorCode(data["__type"]);
|
|
3714
|
+
}
|
|
3715
|
+
return "";
|
|
3716
|
+
};
|
|
3717
|
+
//# sourceMappingURL=Aws_restJson1.js.map
|