@aws-sdk/client-qconnect 3.461.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/LICENSE +201 -0
- package/README.md +545 -0
- package/dist-cjs/QConnect.js +93 -0
- package/dist-cjs/QConnectClient.js +43 -0
- package/dist-cjs/commands/CreateAssistantAssociationCommand.js +51 -0
- package/dist-cjs/commands/CreateAssistantCommand.js +51 -0
- package/dist-cjs/commands/CreateContentCommand.js +52 -0
- package/dist-cjs/commands/CreateKnowledgeBaseCommand.js +51 -0
- package/dist-cjs/commands/CreateQuickResponseCommand.js +52 -0
- package/dist-cjs/commands/CreateSessionCommand.js +51 -0
- package/dist-cjs/commands/DeleteAssistantAssociationCommand.js +51 -0
- package/dist-cjs/commands/DeleteAssistantCommand.js +51 -0
- package/dist-cjs/commands/DeleteContentCommand.js +51 -0
- package/dist-cjs/commands/DeleteImportJobCommand.js +51 -0
- package/dist-cjs/commands/DeleteKnowledgeBaseCommand.js +51 -0
- package/dist-cjs/commands/DeleteQuickResponseCommand.js +51 -0
- package/dist-cjs/commands/GetAssistantAssociationCommand.js +51 -0
- package/dist-cjs/commands/GetAssistantCommand.js +51 -0
- package/dist-cjs/commands/GetContentCommand.js +52 -0
- package/dist-cjs/commands/GetContentSummaryCommand.js +51 -0
- package/dist-cjs/commands/GetImportJobCommand.js +52 -0
- package/dist-cjs/commands/GetKnowledgeBaseCommand.js +51 -0
- package/dist-cjs/commands/GetQuickResponseCommand.js +52 -0
- package/dist-cjs/commands/GetRecommendationsCommand.js +52 -0
- package/dist-cjs/commands/GetSessionCommand.js +51 -0
- package/dist-cjs/commands/ListAssistantAssociationsCommand.js +51 -0
- package/dist-cjs/commands/ListAssistantsCommand.js +51 -0
- package/dist-cjs/commands/ListContentsCommand.js +51 -0
- package/dist-cjs/commands/ListImportJobsCommand.js +51 -0
- package/dist-cjs/commands/ListKnowledgeBasesCommand.js +51 -0
- package/dist-cjs/commands/ListQuickResponsesCommand.js +52 -0
- package/dist-cjs/commands/ListTagsForResourceCommand.js +51 -0
- package/dist-cjs/commands/NotifyRecommendationsReceivedCommand.js +51 -0
- package/dist-cjs/commands/QueryAssistantCommand.js +52 -0
- package/dist-cjs/commands/RemoveKnowledgeBaseTemplateUriCommand.js +51 -0
- package/dist-cjs/commands/SearchContentCommand.js +51 -0
- package/dist-cjs/commands/SearchQuickResponsesCommand.js +52 -0
- package/dist-cjs/commands/SearchSessionsCommand.js +51 -0
- package/dist-cjs/commands/StartContentUploadCommand.js +52 -0
- package/dist-cjs/commands/StartImportJobCommand.js +52 -0
- package/dist-cjs/commands/TagResourceCommand.js +51 -0
- package/dist-cjs/commands/UntagResourceCommand.js +51 -0
- package/dist-cjs/commands/UpdateContentCommand.js +52 -0
- package/dist-cjs/commands/UpdateKnowledgeBaseTemplateUriCommand.js +51 -0
- package/dist-cjs/commands/UpdateQuickResponseCommand.js +52 -0
- package/dist-cjs/commands/index.js +44 -0
- package/dist-cjs/endpoint/EndpointParameters.js +12 -0
- package/dist-cjs/endpoint/endpointResolver.js +12 -0
- package/dist-cjs/endpoint/ruleset.js +7 -0
- package/dist-cjs/extensionConfiguration.js +2 -0
- package/dist-cjs/index.js +12 -0
- package/dist-cjs/models/QConnectServiceException.js +12 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +559 -0
- package/dist-cjs/pagination/Interfaces.js +2 -0
- package/dist-cjs/pagination/ListAssistantAssociationsPaginator.js +29 -0
- package/dist-cjs/pagination/ListAssistantsPaginator.js +29 -0
- package/dist-cjs/pagination/ListContentsPaginator.js +29 -0
- package/dist-cjs/pagination/ListImportJobsPaginator.js +29 -0
- package/dist-cjs/pagination/ListKnowledgeBasesPaginator.js +29 -0
- package/dist-cjs/pagination/ListQuickResponsesPaginator.js +29 -0
- package/dist-cjs/pagination/QueryAssistantPaginator.js +29 -0
- package/dist-cjs/pagination/SearchContentPaginator.js +29 -0
- package/dist-cjs/pagination/SearchQuickResponsesPaginator.js +29 -0
- package/dist-cjs/pagination/SearchSessionsPaginator.js +29 -0
- package/dist-cjs/pagination/index.js +14 -0
- package/dist-cjs/protocols/Aws_restJson1.js +2993 -0
- package/dist-cjs/runtimeConfig.browser.js +39 -0
- package/dist-cjs/runtimeConfig.js +50 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +24 -0
- package/dist-cjs/runtimeExtensions.js +22 -0
- package/dist-es/QConnect.js +89 -0
- package/dist-es/QConnectClient.js +39 -0
- package/dist-es/commands/CreateAssistantAssociationCommand.js +47 -0
- package/dist-es/commands/CreateAssistantCommand.js +47 -0
- package/dist-es/commands/CreateContentCommand.js +48 -0
- package/dist-es/commands/CreateKnowledgeBaseCommand.js +47 -0
- package/dist-es/commands/CreateQuickResponseCommand.js +48 -0
- package/dist-es/commands/CreateSessionCommand.js +47 -0
- package/dist-es/commands/DeleteAssistantAssociationCommand.js +47 -0
- package/dist-es/commands/DeleteAssistantCommand.js +47 -0
- package/dist-es/commands/DeleteContentCommand.js +47 -0
- package/dist-es/commands/DeleteImportJobCommand.js +47 -0
- package/dist-es/commands/DeleteKnowledgeBaseCommand.js +47 -0
- package/dist-es/commands/DeleteQuickResponseCommand.js +47 -0
- package/dist-es/commands/GetAssistantAssociationCommand.js +47 -0
- package/dist-es/commands/GetAssistantCommand.js +47 -0
- package/dist-es/commands/GetContentCommand.js +48 -0
- package/dist-es/commands/GetContentSummaryCommand.js +47 -0
- package/dist-es/commands/GetImportJobCommand.js +48 -0
- package/dist-es/commands/GetKnowledgeBaseCommand.js +47 -0
- package/dist-es/commands/GetQuickResponseCommand.js +48 -0
- package/dist-es/commands/GetRecommendationsCommand.js +48 -0
- package/dist-es/commands/GetSessionCommand.js +47 -0
- package/dist-es/commands/ListAssistantAssociationsCommand.js +47 -0
- package/dist-es/commands/ListAssistantsCommand.js +47 -0
- package/dist-es/commands/ListContentsCommand.js +47 -0
- package/dist-es/commands/ListImportJobsCommand.js +47 -0
- package/dist-es/commands/ListKnowledgeBasesCommand.js +47 -0
- package/dist-es/commands/ListQuickResponsesCommand.js +48 -0
- package/dist-es/commands/ListTagsForResourceCommand.js +47 -0
- package/dist-es/commands/NotifyRecommendationsReceivedCommand.js +47 -0
- package/dist-es/commands/QueryAssistantCommand.js +48 -0
- package/dist-es/commands/RemoveKnowledgeBaseTemplateUriCommand.js +47 -0
- package/dist-es/commands/SearchContentCommand.js +47 -0
- package/dist-es/commands/SearchQuickResponsesCommand.js +48 -0
- package/dist-es/commands/SearchSessionsCommand.js +47 -0
- package/dist-es/commands/StartContentUploadCommand.js +48 -0
- package/dist-es/commands/StartImportJobCommand.js +48 -0
- package/dist-es/commands/TagResourceCommand.js +47 -0
- package/dist-es/commands/UntagResourceCommand.js +47 -0
- package/dist-es/commands/UpdateContentCommand.js +48 -0
- package/dist-es/commands/UpdateKnowledgeBaseTemplateUriCommand.js +47 -0
- package/dist-es/commands/UpdateQuickResponseCommand.js +48 -0
- package/dist-es/commands/index.js +41 -0
- package/dist-es/endpoint/EndpointParameters.js +8 -0
- package/dist-es/endpoint/endpointResolver.js +8 -0
- package/dist-es/endpoint/ruleset.js +4 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +7 -0
- package/dist-es/models/QConnectServiceException.js +8 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +508 -0
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/ListAssistantAssociationsPaginator.js +25 -0
- package/dist-es/pagination/ListAssistantsPaginator.js +25 -0
- package/dist-es/pagination/ListContentsPaginator.js +25 -0
- package/dist-es/pagination/ListImportJobsPaginator.js +25 -0
- package/dist-es/pagination/ListKnowledgeBasesPaginator.js +25 -0
- package/dist-es/pagination/ListQuickResponsesPaginator.js +25 -0
- package/dist-es/pagination/QueryAssistantPaginator.js +25 -0
- package/dist-es/pagination/SearchContentPaginator.js +25 -0
- package/dist-es/pagination/SearchQuickResponsesPaginator.js +25 -0
- package/dist-es/pagination/SearchSessionsPaginator.js +25 -0
- package/dist-es/pagination/index.js +11 -0
- package/dist-es/protocols/Aws_restJson1.js +2907 -0
- package/dist-es/runtimeConfig.browser.js +34 -0
- package/dist-es/runtimeConfig.js +45 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +20 -0
- package/dist-es/runtimeExtensions.js +18 -0
- package/dist-types/QConnect.d.ts +309 -0
- package/dist-types/QConnectClient.d.ts +222 -0
- package/dist-types/commands/CreateAssistantAssociationCommand.d.ts +117 -0
- package/dist-types/commands/CreateAssistantCommand.d.ts +117 -0
- package/dist-types/commands/CreateContentCommand.d.ts +123 -0
- package/dist-types/commands/CreateKnowledgeBaseCommand.d.ts +157 -0
- package/dist-types/commands/CreateQuickResponseCommand.d.ts +149 -0
- package/dist-types/commands/CreateSessionCommand.d.ts +104 -0
- package/dist-types/commands/DeleteAssistantAssociationCommand.d.ts +81 -0
- package/dist-types/commands/DeleteAssistantCommand.d.ts +80 -0
- package/dist-types/commands/DeleteContentCommand.d.ts +81 -0
- package/dist-types/commands/DeleteImportJobCommand.d.ts +87 -0
- package/dist-types/commands/DeleteKnowledgeBaseCommand.d.ts +94 -0
- package/dist-types/commands/DeleteQuickResponseCommand.d.ts +81 -0
- package/dist-types/commands/GetAssistantAssociationCommand.d.ts +98 -0
- package/dist-types/commands/GetAssistantCommand.d.ts +101 -0
- package/dist-types/commands/GetContentCommand.d.ts +102 -0
- package/dist-types/commands/GetContentSummaryCommand.d.ts +99 -0
- package/dist-types/commands/GetImportJobCommand.d.ts +106 -0
- package/dist-types/commands/GetKnowledgeBaseCommand.d.ts +107 -0
- package/dist-types/commands/GetQuickResponseCommand.d.ts +118 -0
- package/dist-types/commands/GetRecommendationsCommand.d.ts +239 -0
- package/dist-types/commands/GetSessionCommand.d.ts +94 -0
- package/dist-types/commands/ListAssistantAssociationsCommand.d.ts +102 -0
- package/dist-types/commands/ListAssistantsCommand.d.ts +102 -0
- package/dist-types/commands/ListContentsCommand.d.ts +103 -0
- package/dist-types/commands/ListImportJobsCommand.d.ts +104 -0
- package/dist-types/commands/ListKnowledgeBasesCommand.d.ts +107 -0
- package/dist-types/commands/ListQuickResponsesCommand.d.ts +106 -0
- package/dist-types/commands/ListTagsForResourceCommand.d.ts +78 -0
- package/dist-types/commands/NotifyRecommendationsReceivedCommand.d.ts +96 -0
- package/dist-types/commands/QueryAssistantCommand.d.ts +238 -0
- package/dist-types/commands/RemoveKnowledgeBaseTemplateUriCommand.d.ts +80 -0
- package/dist-types/commands/SearchContentCommand.d.ts +113 -0
- package/dist-types/commands/SearchQuickResponsesCommand.d.ts +163 -0
- package/dist-types/commands/SearchSessionsCommand.d.ts +101 -0
- package/dist-types/commands/StartContentUploadCommand.d.ts +92 -0
- package/dist-types/commands/StartImportJobCommand.d.ts +135 -0
- package/dist-types/commands/TagResourceCommand.d.ts +80 -0
- package/dist-types/commands/UntagResourceCommand.d.ts +77 -0
- package/dist-types/commands/UpdateContentCommand.d.ts +114 -0
- package/dist-types/commands/UpdateKnowledgeBaseTemplateUriCommand.d.ts +113 -0
- package/dist-types/commands/UpdateQuickResponseCommand.d.ts +149 -0
- package/dist-types/commands/index.d.ts +41 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +22 -0
- package/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/dist-types/endpoint/ruleset.d.ts +2 -0
- package/dist-types/extensionConfiguration.d.ts +8 -0
- package/dist-types/index.d.ts +27 -0
- package/dist-types/models/QConnectServiceException.d.ts +13 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +4249 -0
- package/dist-types/pagination/Interfaces.d.ts +8 -0
- package/dist-types/pagination/ListAssistantAssociationsPaginator.d.ts +7 -0
- package/dist-types/pagination/ListAssistantsPaginator.d.ts +7 -0
- package/dist-types/pagination/ListContentsPaginator.d.ts +7 -0
- package/dist-types/pagination/ListImportJobsPaginator.d.ts +7 -0
- package/dist-types/pagination/ListKnowledgeBasesPaginator.d.ts +7 -0
- package/dist-types/pagination/ListQuickResponsesPaginator.d.ts +7 -0
- package/dist-types/pagination/QueryAssistantPaginator.d.ts +7 -0
- package/dist-types/pagination/SearchContentPaginator.d.ts +7 -0
- package/dist-types/pagination/SearchQuickResponsesPaginator.d.ts +7 -0
- package/dist-types/pagination/SearchSessionsPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +11 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +371 -0
- package/dist-types/runtimeConfig.browser.d.ts +46 -0
- package/dist-types/runtimeConfig.d.ts +46 -0
- package/dist-types/runtimeConfig.native.d.ts +45 -0
- package/dist-types/runtimeConfig.shared.d.ts +19 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/ts3.4/QConnect.d.ts +702 -0
- package/dist-types/ts3.4/QConnectClient.d.ts +364 -0
- package/dist-types/ts3.4/commands/CreateAssistantAssociationCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/CreateAssistantCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/CreateContentCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/CreateKnowledgeBaseCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/CreateQuickResponseCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/CreateSessionCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/DeleteAssistantAssociationCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/DeleteAssistantCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/DeleteContentCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/DeleteImportJobCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/DeleteKnowledgeBaseCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/DeleteQuickResponseCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/GetAssistantAssociationCommand.d.ts +42 -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 +39 -0
- package/dist-types/ts3.4/commands/GetImportJobCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/GetKnowledgeBaseCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/GetQuickResponseCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/GetRecommendationsCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/GetSessionCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/ListAssistantAssociationsCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/ListAssistantsCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/ListContentsCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/ListImportJobsCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/ListKnowledgeBasesCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/ListQuickResponsesCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/NotifyRecommendationsReceivedCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/QueryAssistantCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/RemoveKnowledgeBaseTemplateUriCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/SearchContentCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/SearchQuickResponsesCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/SearchSessionsCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/StartContentUploadCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/StartImportJobCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/UpdateContentCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/UpdateKnowledgeBaseTemplateUriCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/UpdateQuickResponseCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/index.d.ts +41 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +33 -0
- package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/extensionConfiguration.d.ts +7 -0
- package/dist-types/ts3.4/index.d.ts +10 -0
- package/dist-types/ts3.4/models/QConnectServiceException.d.ts +8 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +1241 -0
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
- package/dist-types/ts3.4/pagination/ListAssistantAssociationsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListAssistantsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListContentsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListImportJobsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListKnowledgeBasesPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListQuickResponsesPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/QueryAssistantPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/SearchContentPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/SearchQuickResponsesPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/SearchSessionsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +11 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +497 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +97 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +97 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +88 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +19 -0
- package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
- package/package.json +104 -0
|
@@ -0,0 +1,2907 @@
|
|
|
1
|
+
import { awsExpectUnion as __expectUnion } from "@aws-sdk/core";
|
|
2
|
+
import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
|
|
3
|
+
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, take, withBaseException, } from "@smithy/smithy-client";
|
|
4
|
+
import { v4 as generateIdempotencyToken } from "uuid";
|
|
5
|
+
import { AccessDeniedException, ConflictException, PreconditionFailedException, RequestTimeoutException, ResourceNotFoundException, ServiceQuotaExceededException, TooManyTagsException, ValidationException, } from "../models/models_0";
|
|
6
|
+
import { QConnectServiceException as __BaseException } from "../models/QConnectServiceException";
|
|
7
|
+
export const se_CreateAssistantCommand = async (input, context) => {
|
|
8
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
9
|
+
const headers = {
|
|
10
|
+
"content-type": "application/json",
|
|
11
|
+
};
|
|
12
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants";
|
|
13
|
+
let body;
|
|
14
|
+
body = JSON.stringify(take(input, {
|
|
15
|
+
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
|
|
16
|
+
description: [],
|
|
17
|
+
name: [],
|
|
18
|
+
serverSideEncryptionConfiguration: (_) => _json(_),
|
|
19
|
+
tags: (_) => _json(_),
|
|
20
|
+
type: [],
|
|
21
|
+
}));
|
|
22
|
+
return new __HttpRequest({
|
|
23
|
+
protocol,
|
|
24
|
+
hostname,
|
|
25
|
+
port,
|
|
26
|
+
method: "POST",
|
|
27
|
+
headers,
|
|
28
|
+
path: resolvedPath,
|
|
29
|
+
body,
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export const se_CreateAssistantAssociationCommand = async (input, context) => {
|
|
33
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
34
|
+
const headers = {
|
|
35
|
+
"content-type": "application/json",
|
|
36
|
+
};
|
|
37
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/associations";
|
|
38
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
|
|
39
|
+
let body;
|
|
40
|
+
body = JSON.stringify(take(input, {
|
|
41
|
+
association: (_) => _json(_),
|
|
42
|
+
associationType: [],
|
|
43
|
+
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
|
|
44
|
+
tags: (_) => _json(_),
|
|
45
|
+
}));
|
|
46
|
+
return new __HttpRequest({
|
|
47
|
+
protocol,
|
|
48
|
+
hostname,
|
|
49
|
+
port,
|
|
50
|
+
method: "POST",
|
|
51
|
+
headers,
|
|
52
|
+
path: resolvedPath,
|
|
53
|
+
body,
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
export const se_CreateContentCommand = async (input, context) => {
|
|
57
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
58
|
+
const headers = {
|
|
59
|
+
"content-type": "application/json",
|
|
60
|
+
};
|
|
61
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
62
|
+
"/knowledgeBases/{knowledgeBaseId}/contents";
|
|
63
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
64
|
+
let body;
|
|
65
|
+
body = JSON.stringify(take(input, {
|
|
66
|
+
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
|
|
67
|
+
metadata: (_) => _json(_),
|
|
68
|
+
name: [],
|
|
69
|
+
overrideLinkOutUri: [],
|
|
70
|
+
tags: (_) => _json(_),
|
|
71
|
+
title: [],
|
|
72
|
+
uploadId: [],
|
|
73
|
+
}));
|
|
74
|
+
return new __HttpRequest({
|
|
75
|
+
protocol,
|
|
76
|
+
hostname,
|
|
77
|
+
port,
|
|
78
|
+
method: "POST",
|
|
79
|
+
headers,
|
|
80
|
+
path: resolvedPath,
|
|
81
|
+
body,
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
export const se_CreateKnowledgeBaseCommand = async (input, context) => {
|
|
85
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
86
|
+
const headers = {
|
|
87
|
+
"content-type": "application/json",
|
|
88
|
+
};
|
|
89
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases";
|
|
90
|
+
let body;
|
|
91
|
+
body = JSON.stringify(take(input, {
|
|
92
|
+
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
|
|
93
|
+
description: [],
|
|
94
|
+
knowledgeBaseType: [],
|
|
95
|
+
name: [],
|
|
96
|
+
renderingConfiguration: (_) => _json(_),
|
|
97
|
+
serverSideEncryptionConfiguration: (_) => _json(_),
|
|
98
|
+
sourceConfiguration: (_) => _json(_),
|
|
99
|
+
tags: (_) => _json(_),
|
|
100
|
+
}));
|
|
101
|
+
return new __HttpRequest({
|
|
102
|
+
protocol,
|
|
103
|
+
hostname,
|
|
104
|
+
port,
|
|
105
|
+
method: "POST",
|
|
106
|
+
headers,
|
|
107
|
+
path: resolvedPath,
|
|
108
|
+
body,
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
export const se_CreateQuickResponseCommand = async (input, context) => {
|
|
112
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
113
|
+
const headers = {
|
|
114
|
+
"content-type": "application/json",
|
|
115
|
+
};
|
|
116
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
117
|
+
"/knowledgeBases/{knowledgeBaseId}/quickResponses";
|
|
118
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
119
|
+
let body;
|
|
120
|
+
body = JSON.stringify(take(input, {
|
|
121
|
+
channels: (_) => _json(_),
|
|
122
|
+
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
|
|
123
|
+
content: (_) => _json(_),
|
|
124
|
+
contentType: [],
|
|
125
|
+
description: [],
|
|
126
|
+
groupingConfiguration: (_) => _json(_),
|
|
127
|
+
isActive: [],
|
|
128
|
+
language: [],
|
|
129
|
+
name: [],
|
|
130
|
+
shortcutKey: [],
|
|
131
|
+
tags: (_) => _json(_),
|
|
132
|
+
}));
|
|
133
|
+
return new __HttpRequest({
|
|
134
|
+
protocol,
|
|
135
|
+
hostname,
|
|
136
|
+
port,
|
|
137
|
+
method: "POST",
|
|
138
|
+
headers,
|
|
139
|
+
path: resolvedPath,
|
|
140
|
+
body,
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
export const se_CreateSessionCommand = async (input, context) => {
|
|
144
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
145
|
+
const headers = {
|
|
146
|
+
"content-type": "application/json",
|
|
147
|
+
};
|
|
148
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/sessions";
|
|
149
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
|
|
150
|
+
let body;
|
|
151
|
+
body = JSON.stringify(take(input, {
|
|
152
|
+
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
|
|
153
|
+
description: [],
|
|
154
|
+
name: [],
|
|
155
|
+
tags: (_) => _json(_),
|
|
156
|
+
}));
|
|
157
|
+
return new __HttpRequest({
|
|
158
|
+
protocol,
|
|
159
|
+
hostname,
|
|
160
|
+
port,
|
|
161
|
+
method: "POST",
|
|
162
|
+
headers,
|
|
163
|
+
path: resolvedPath,
|
|
164
|
+
body,
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
export const se_DeleteAssistantCommand = async (input, context) => {
|
|
168
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
169
|
+
const headers = {};
|
|
170
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}";
|
|
171
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
|
|
172
|
+
let body;
|
|
173
|
+
return new __HttpRequest({
|
|
174
|
+
protocol,
|
|
175
|
+
hostname,
|
|
176
|
+
port,
|
|
177
|
+
method: "DELETE",
|
|
178
|
+
headers,
|
|
179
|
+
path: resolvedPath,
|
|
180
|
+
body,
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
export const se_DeleteAssistantAssociationCommand = async (input, context) => {
|
|
184
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
185
|
+
const headers = {};
|
|
186
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
187
|
+
"/assistants/{assistantId}/associations/{assistantAssociationId}";
|
|
188
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "assistantAssociationId", () => input.assistantAssociationId, "{assistantAssociationId}", false);
|
|
189
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
|
|
190
|
+
let body;
|
|
191
|
+
return new __HttpRequest({
|
|
192
|
+
protocol,
|
|
193
|
+
hostname,
|
|
194
|
+
port,
|
|
195
|
+
method: "DELETE",
|
|
196
|
+
headers,
|
|
197
|
+
path: resolvedPath,
|
|
198
|
+
body,
|
|
199
|
+
});
|
|
200
|
+
};
|
|
201
|
+
export const se_DeleteContentCommand = async (input, context) => {
|
|
202
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
203
|
+
const headers = {};
|
|
204
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
205
|
+
"/knowledgeBases/{knowledgeBaseId}/contents/{contentId}";
|
|
206
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
207
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "contentId", () => input.contentId, "{contentId}", false);
|
|
208
|
+
let body;
|
|
209
|
+
return new __HttpRequest({
|
|
210
|
+
protocol,
|
|
211
|
+
hostname,
|
|
212
|
+
port,
|
|
213
|
+
method: "DELETE",
|
|
214
|
+
headers,
|
|
215
|
+
path: resolvedPath,
|
|
216
|
+
body,
|
|
217
|
+
});
|
|
218
|
+
};
|
|
219
|
+
export const se_DeleteImportJobCommand = async (input, context) => {
|
|
220
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
221
|
+
const headers = {};
|
|
222
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
223
|
+
"/knowledgeBases/{knowledgeBaseId}/importJobs/{importJobId}";
|
|
224
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
225
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "importJobId", () => input.importJobId, "{importJobId}", false);
|
|
226
|
+
let body;
|
|
227
|
+
return new __HttpRequest({
|
|
228
|
+
protocol,
|
|
229
|
+
hostname,
|
|
230
|
+
port,
|
|
231
|
+
method: "DELETE",
|
|
232
|
+
headers,
|
|
233
|
+
path: resolvedPath,
|
|
234
|
+
body,
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
export const se_DeleteKnowledgeBaseCommand = async (input, context) => {
|
|
238
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
239
|
+
const headers = {};
|
|
240
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases/{knowledgeBaseId}";
|
|
241
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
242
|
+
let body;
|
|
243
|
+
return new __HttpRequest({
|
|
244
|
+
protocol,
|
|
245
|
+
hostname,
|
|
246
|
+
port,
|
|
247
|
+
method: "DELETE",
|
|
248
|
+
headers,
|
|
249
|
+
path: resolvedPath,
|
|
250
|
+
body,
|
|
251
|
+
});
|
|
252
|
+
};
|
|
253
|
+
export const se_DeleteQuickResponseCommand = async (input, context) => {
|
|
254
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
255
|
+
const headers = {};
|
|
256
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
257
|
+
"/knowledgeBases/{knowledgeBaseId}/quickResponses/{quickResponseId}";
|
|
258
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
259
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "quickResponseId", () => input.quickResponseId, "{quickResponseId}", false);
|
|
260
|
+
let body;
|
|
261
|
+
return new __HttpRequest({
|
|
262
|
+
protocol,
|
|
263
|
+
hostname,
|
|
264
|
+
port,
|
|
265
|
+
method: "DELETE",
|
|
266
|
+
headers,
|
|
267
|
+
path: resolvedPath,
|
|
268
|
+
body,
|
|
269
|
+
});
|
|
270
|
+
};
|
|
271
|
+
export const se_GetAssistantCommand = async (input, context) => {
|
|
272
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
273
|
+
const headers = {};
|
|
274
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}";
|
|
275
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
|
|
276
|
+
let body;
|
|
277
|
+
return new __HttpRequest({
|
|
278
|
+
protocol,
|
|
279
|
+
hostname,
|
|
280
|
+
port,
|
|
281
|
+
method: "GET",
|
|
282
|
+
headers,
|
|
283
|
+
path: resolvedPath,
|
|
284
|
+
body,
|
|
285
|
+
});
|
|
286
|
+
};
|
|
287
|
+
export const se_GetAssistantAssociationCommand = async (input, context) => {
|
|
288
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
289
|
+
const headers = {};
|
|
290
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
291
|
+
"/assistants/{assistantId}/associations/{assistantAssociationId}";
|
|
292
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "assistantAssociationId", () => input.assistantAssociationId, "{assistantAssociationId}", false);
|
|
293
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
|
|
294
|
+
let body;
|
|
295
|
+
return new __HttpRequest({
|
|
296
|
+
protocol,
|
|
297
|
+
hostname,
|
|
298
|
+
port,
|
|
299
|
+
method: "GET",
|
|
300
|
+
headers,
|
|
301
|
+
path: resolvedPath,
|
|
302
|
+
body,
|
|
303
|
+
});
|
|
304
|
+
};
|
|
305
|
+
export const se_GetContentCommand = async (input, context) => {
|
|
306
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
307
|
+
const headers = {};
|
|
308
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
309
|
+
"/knowledgeBases/{knowledgeBaseId}/contents/{contentId}";
|
|
310
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "contentId", () => input.contentId, "{contentId}", false);
|
|
311
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
312
|
+
let body;
|
|
313
|
+
return new __HttpRequest({
|
|
314
|
+
protocol,
|
|
315
|
+
hostname,
|
|
316
|
+
port,
|
|
317
|
+
method: "GET",
|
|
318
|
+
headers,
|
|
319
|
+
path: resolvedPath,
|
|
320
|
+
body,
|
|
321
|
+
});
|
|
322
|
+
};
|
|
323
|
+
export const se_GetContentSummaryCommand = async (input, context) => {
|
|
324
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
325
|
+
const headers = {};
|
|
326
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
327
|
+
"/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/summary";
|
|
328
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "contentId", () => input.contentId, "{contentId}", false);
|
|
329
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
330
|
+
let body;
|
|
331
|
+
return new __HttpRequest({
|
|
332
|
+
protocol,
|
|
333
|
+
hostname,
|
|
334
|
+
port,
|
|
335
|
+
method: "GET",
|
|
336
|
+
headers,
|
|
337
|
+
path: resolvedPath,
|
|
338
|
+
body,
|
|
339
|
+
});
|
|
340
|
+
};
|
|
341
|
+
export const se_GetImportJobCommand = async (input, context) => {
|
|
342
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
343
|
+
const headers = {};
|
|
344
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
345
|
+
"/knowledgeBases/{knowledgeBaseId}/importJobs/{importJobId}";
|
|
346
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "importJobId", () => input.importJobId, "{importJobId}", false);
|
|
347
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
348
|
+
let body;
|
|
349
|
+
return new __HttpRequest({
|
|
350
|
+
protocol,
|
|
351
|
+
hostname,
|
|
352
|
+
port,
|
|
353
|
+
method: "GET",
|
|
354
|
+
headers,
|
|
355
|
+
path: resolvedPath,
|
|
356
|
+
body,
|
|
357
|
+
});
|
|
358
|
+
};
|
|
359
|
+
export const se_GetKnowledgeBaseCommand = async (input, context) => {
|
|
360
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
361
|
+
const headers = {};
|
|
362
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases/{knowledgeBaseId}";
|
|
363
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
364
|
+
let body;
|
|
365
|
+
return new __HttpRequest({
|
|
366
|
+
protocol,
|
|
367
|
+
hostname,
|
|
368
|
+
port,
|
|
369
|
+
method: "GET",
|
|
370
|
+
headers,
|
|
371
|
+
path: resolvedPath,
|
|
372
|
+
body,
|
|
373
|
+
});
|
|
374
|
+
};
|
|
375
|
+
export const se_GetQuickResponseCommand = async (input, context) => {
|
|
376
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
377
|
+
const headers = {};
|
|
378
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
379
|
+
"/knowledgeBases/{knowledgeBaseId}/quickResponses/{quickResponseId}";
|
|
380
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "quickResponseId", () => input.quickResponseId, "{quickResponseId}", false);
|
|
381
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
382
|
+
let body;
|
|
383
|
+
return new __HttpRequest({
|
|
384
|
+
protocol,
|
|
385
|
+
hostname,
|
|
386
|
+
port,
|
|
387
|
+
method: "GET",
|
|
388
|
+
headers,
|
|
389
|
+
path: resolvedPath,
|
|
390
|
+
body,
|
|
391
|
+
});
|
|
392
|
+
};
|
|
393
|
+
export const se_GetRecommendationsCommand = async (input, context) => {
|
|
394
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
395
|
+
const headers = {};
|
|
396
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
397
|
+
"/assistants/{assistantId}/sessions/{sessionId}/recommendations";
|
|
398
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
|
|
399
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
|
|
400
|
+
const query = map({
|
|
401
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
402
|
+
waitTimeSeconds: [() => input.waitTimeSeconds !== void 0, () => input.waitTimeSeconds.toString()],
|
|
403
|
+
});
|
|
404
|
+
let body;
|
|
405
|
+
return new __HttpRequest({
|
|
406
|
+
protocol,
|
|
407
|
+
hostname,
|
|
408
|
+
port,
|
|
409
|
+
method: "GET",
|
|
410
|
+
headers,
|
|
411
|
+
path: resolvedPath,
|
|
412
|
+
query,
|
|
413
|
+
body,
|
|
414
|
+
});
|
|
415
|
+
};
|
|
416
|
+
export const se_GetSessionCommand = async (input, context) => {
|
|
417
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
418
|
+
const headers = {};
|
|
419
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
420
|
+
"/assistants/{assistantId}/sessions/{sessionId}";
|
|
421
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
|
|
422
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
|
|
423
|
+
let body;
|
|
424
|
+
return new __HttpRequest({
|
|
425
|
+
protocol,
|
|
426
|
+
hostname,
|
|
427
|
+
port,
|
|
428
|
+
method: "GET",
|
|
429
|
+
headers,
|
|
430
|
+
path: resolvedPath,
|
|
431
|
+
body,
|
|
432
|
+
});
|
|
433
|
+
};
|
|
434
|
+
export const se_ListAssistantAssociationsCommand = async (input, context) => {
|
|
435
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
436
|
+
const headers = {};
|
|
437
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/associations";
|
|
438
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
|
|
439
|
+
const query = map({
|
|
440
|
+
nextToken: [, input.nextToken],
|
|
441
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
442
|
+
});
|
|
443
|
+
let body;
|
|
444
|
+
return new __HttpRequest({
|
|
445
|
+
protocol,
|
|
446
|
+
hostname,
|
|
447
|
+
port,
|
|
448
|
+
method: "GET",
|
|
449
|
+
headers,
|
|
450
|
+
path: resolvedPath,
|
|
451
|
+
query,
|
|
452
|
+
body,
|
|
453
|
+
});
|
|
454
|
+
};
|
|
455
|
+
export const se_ListAssistantsCommand = async (input, context) => {
|
|
456
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
457
|
+
const headers = {};
|
|
458
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants";
|
|
459
|
+
const query = map({
|
|
460
|
+
nextToken: [, input.nextToken],
|
|
461
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
462
|
+
});
|
|
463
|
+
let body;
|
|
464
|
+
return new __HttpRequest({
|
|
465
|
+
protocol,
|
|
466
|
+
hostname,
|
|
467
|
+
port,
|
|
468
|
+
method: "GET",
|
|
469
|
+
headers,
|
|
470
|
+
path: resolvedPath,
|
|
471
|
+
query,
|
|
472
|
+
body,
|
|
473
|
+
});
|
|
474
|
+
};
|
|
475
|
+
export const se_ListContentsCommand = async (input, context) => {
|
|
476
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
477
|
+
const headers = {};
|
|
478
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
479
|
+
"/knowledgeBases/{knowledgeBaseId}/contents";
|
|
480
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
481
|
+
const query = map({
|
|
482
|
+
nextToken: [, input.nextToken],
|
|
483
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
484
|
+
});
|
|
485
|
+
let body;
|
|
486
|
+
return new __HttpRequest({
|
|
487
|
+
protocol,
|
|
488
|
+
hostname,
|
|
489
|
+
port,
|
|
490
|
+
method: "GET",
|
|
491
|
+
headers,
|
|
492
|
+
path: resolvedPath,
|
|
493
|
+
query,
|
|
494
|
+
body,
|
|
495
|
+
});
|
|
496
|
+
};
|
|
497
|
+
export const se_ListImportJobsCommand = async (input, context) => {
|
|
498
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
499
|
+
const headers = {};
|
|
500
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
501
|
+
"/knowledgeBases/{knowledgeBaseId}/importJobs";
|
|
502
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
503
|
+
const query = map({
|
|
504
|
+
nextToken: [, input.nextToken],
|
|
505
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
506
|
+
});
|
|
507
|
+
let body;
|
|
508
|
+
return new __HttpRequest({
|
|
509
|
+
protocol,
|
|
510
|
+
hostname,
|
|
511
|
+
port,
|
|
512
|
+
method: "GET",
|
|
513
|
+
headers,
|
|
514
|
+
path: resolvedPath,
|
|
515
|
+
query,
|
|
516
|
+
body,
|
|
517
|
+
});
|
|
518
|
+
};
|
|
519
|
+
export const se_ListKnowledgeBasesCommand = async (input, context) => {
|
|
520
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
521
|
+
const headers = {};
|
|
522
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases";
|
|
523
|
+
const query = map({
|
|
524
|
+
nextToken: [, input.nextToken],
|
|
525
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
526
|
+
});
|
|
527
|
+
let body;
|
|
528
|
+
return new __HttpRequest({
|
|
529
|
+
protocol,
|
|
530
|
+
hostname,
|
|
531
|
+
port,
|
|
532
|
+
method: "GET",
|
|
533
|
+
headers,
|
|
534
|
+
path: resolvedPath,
|
|
535
|
+
query,
|
|
536
|
+
body,
|
|
537
|
+
});
|
|
538
|
+
};
|
|
539
|
+
export const se_ListQuickResponsesCommand = async (input, context) => {
|
|
540
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
541
|
+
const headers = {};
|
|
542
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
543
|
+
"/knowledgeBases/{knowledgeBaseId}/quickResponses";
|
|
544
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
545
|
+
const query = map({
|
|
546
|
+
nextToken: [, input.nextToken],
|
|
547
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
548
|
+
});
|
|
549
|
+
let body;
|
|
550
|
+
return new __HttpRequest({
|
|
551
|
+
protocol,
|
|
552
|
+
hostname,
|
|
553
|
+
port,
|
|
554
|
+
method: "GET",
|
|
555
|
+
headers,
|
|
556
|
+
path: resolvedPath,
|
|
557
|
+
query,
|
|
558
|
+
body,
|
|
559
|
+
});
|
|
560
|
+
};
|
|
561
|
+
export const se_ListTagsForResourceCommand = async (input, context) => {
|
|
562
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
563
|
+
const headers = {};
|
|
564
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
|
|
565
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
|
|
566
|
+
let body;
|
|
567
|
+
return new __HttpRequest({
|
|
568
|
+
protocol,
|
|
569
|
+
hostname,
|
|
570
|
+
port,
|
|
571
|
+
method: "GET",
|
|
572
|
+
headers,
|
|
573
|
+
path: resolvedPath,
|
|
574
|
+
body,
|
|
575
|
+
});
|
|
576
|
+
};
|
|
577
|
+
export const se_NotifyRecommendationsReceivedCommand = async (input, context) => {
|
|
578
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
579
|
+
const headers = {
|
|
580
|
+
"content-type": "application/json",
|
|
581
|
+
};
|
|
582
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
583
|
+
"/assistants/{assistantId}/sessions/{sessionId}/recommendations/notify";
|
|
584
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
|
|
585
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
|
|
586
|
+
let body;
|
|
587
|
+
body = JSON.stringify(take(input, {
|
|
588
|
+
recommendationIds: (_) => _json(_),
|
|
589
|
+
}));
|
|
590
|
+
return new __HttpRequest({
|
|
591
|
+
protocol,
|
|
592
|
+
hostname,
|
|
593
|
+
port,
|
|
594
|
+
method: "POST",
|
|
595
|
+
headers,
|
|
596
|
+
path: resolvedPath,
|
|
597
|
+
body,
|
|
598
|
+
});
|
|
599
|
+
};
|
|
600
|
+
export const se_QueryAssistantCommand = async (input, context) => {
|
|
601
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
602
|
+
const headers = {
|
|
603
|
+
"content-type": "application/json",
|
|
604
|
+
};
|
|
605
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/query";
|
|
606
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
|
|
607
|
+
let body;
|
|
608
|
+
body = JSON.stringify(take(input, {
|
|
609
|
+
maxResults: [],
|
|
610
|
+
nextToken: [],
|
|
611
|
+
queryCondition: (_) => _json(_),
|
|
612
|
+
queryText: [],
|
|
613
|
+
sessionId: [],
|
|
614
|
+
}));
|
|
615
|
+
return new __HttpRequest({
|
|
616
|
+
protocol,
|
|
617
|
+
hostname,
|
|
618
|
+
port,
|
|
619
|
+
method: "POST",
|
|
620
|
+
headers,
|
|
621
|
+
path: resolvedPath,
|
|
622
|
+
body,
|
|
623
|
+
});
|
|
624
|
+
};
|
|
625
|
+
export const se_RemoveKnowledgeBaseTemplateUriCommand = async (input, context) => {
|
|
626
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
627
|
+
const headers = {};
|
|
628
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
629
|
+
"/knowledgeBases/{knowledgeBaseId}/templateUri";
|
|
630
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
631
|
+
let body;
|
|
632
|
+
return new __HttpRequest({
|
|
633
|
+
protocol,
|
|
634
|
+
hostname,
|
|
635
|
+
port,
|
|
636
|
+
method: "DELETE",
|
|
637
|
+
headers,
|
|
638
|
+
path: resolvedPath,
|
|
639
|
+
body,
|
|
640
|
+
});
|
|
641
|
+
};
|
|
642
|
+
export const se_SearchContentCommand = async (input, context) => {
|
|
643
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
644
|
+
const headers = {
|
|
645
|
+
"content-type": "application/json",
|
|
646
|
+
};
|
|
647
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases/{knowledgeBaseId}/search";
|
|
648
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
649
|
+
const query = map({
|
|
650
|
+
nextToken: [, input.nextToken],
|
|
651
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
652
|
+
});
|
|
653
|
+
let body;
|
|
654
|
+
body = JSON.stringify(take(input, {
|
|
655
|
+
searchExpression: (_) => _json(_),
|
|
656
|
+
}));
|
|
657
|
+
return new __HttpRequest({
|
|
658
|
+
protocol,
|
|
659
|
+
hostname,
|
|
660
|
+
port,
|
|
661
|
+
method: "POST",
|
|
662
|
+
headers,
|
|
663
|
+
path: resolvedPath,
|
|
664
|
+
query,
|
|
665
|
+
body,
|
|
666
|
+
});
|
|
667
|
+
};
|
|
668
|
+
export const se_SearchQuickResponsesCommand = async (input, context) => {
|
|
669
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
670
|
+
const headers = {
|
|
671
|
+
"content-type": "application/json",
|
|
672
|
+
};
|
|
673
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
674
|
+
"/knowledgeBases/{knowledgeBaseId}/search/quickResponses";
|
|
675
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
676
|
+
const query = map({
|
|
677
|
+
nextToken: [, input.nextToken],
|
|
678
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
679
|
+
});
|
|
680
|
+
let body;
|
|
681
|
+
body = JSON.stringify(take(input, {
|
|
682
|
+
attributes: (_) => _json(_),
|
|
683
|
+
searchExpression: (_) => _json(_),
|
|
684
|
+
}));
|
|
685
|
+
return new __HttpRequest({
|
|
686
|
+
protocol,
|
|
687
|
+
hostname,
|
|
688
|
+
port,
|
|
689
|
+
method: "POST",
|
|
690
|
+
headers,
|
|
691
|
+
path: resolvedPath,
|
|
692
|
+
query,
|
|
693
|
+
body,
|
|
694
|
+
});
|
|
695
|
+
};
|
|
696
|
+
export const se_SearchSessionsCommand = async (input, context) => {
|
|
697
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
698
|
+
const headers = {
|
|
699
|
+
"content-type": "application/json",
|
|
700
|
+
};
|
|
701
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/searchSessions";
|
|
702
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
|
|
703
|
+
const query = map({
|
|
704
|
+
nextToken: [, input.nextToken],
|
|
705
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
706
|
+
});
|
|
707
|
+
let body;
|
|
708
|
+
body = JSON.stringify(take(input, {
|
|
709
|
+
searchExpression: (_) => _json(_),
|
|
710
|
+
}));
|
|
711
|
+
return new __HttpRequest({
|
|
712
|
+
protocol,
|
|
713
|
+
hostname,
|
|
714
|
+
port,
|
|
715
|
+
method: "POST",
|
|
716
|
+
headers,
|
|
717
|
+
path: resolvedPath,
|
|
718
|
+
query,
|
|
719
|
+
body,
|
|
720
|
+
});
|
|
721
|
+
};
|
|
722
|
+
export const se_StartContentUploadCommand = async (input, context) => {
|
|
723
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
724
|
+
const headers = {
|
|
725
|
+
"content-type": "application/json",
|
|
726
|
+
};
|
|
727
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases/{knowledgeBaseId}/upload";
|
|
728
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
729
|
+
let body;
|
|
730
|
+
body = JSON.stringify(take(input, {
|
|
731
|
+
contentType: [],
|
|
732
|
+
presignedUrlTimeToLive: [],
|
|
733
|
+
}));
|
|
734
|
+
return new __HttpRequest({
|
|
735
|
+
protocol,
|
|
736
|
+
hostname,
|
|
737
|
+
port,
|
|
738
|
+
method: "POST",
|
|
739
|
+
headers,
|
|
740
|
+
path: resolvedPath,
|
|
741
|
+
body,
|
|
742
|
+
});
|
|
743
|
+
};
|
|
744
|
+
export const se_StartImportJobCommand = async (input, context) => {
|
|
745
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
746
|
+
const headers = {
|
|
747
|
+
"content-type": "application/json",
|
|
748
|
+
};
|
|
749
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
750
|
+
"/knowledgeBases/{knowledgeBaseId}/importJobs";
|
|
751
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
752
|
+
let body;
|
|
753
|
+
body = JSON.stringify(take(input, {
|
|
754
|
+
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
|
|
755
|
+
externalSourceConfiguration: (_) => _json(_),
|
|
756
|
+
importJobType: [],
|
|
757
|
+
metadata: (_) => _json(_),
|
|
758
|
+
uploadId: [],
|
|
759
|
+
}));
|
|
760
|
+
return new __HttpRequest({
|
|
761
|
+
protocol,
|
|
762
|
+
hostname,
|
|
763
|
+
port,
|
|
764
|
+
method: "POST",
|
|
765
|
+
headers,
|
|
766
|
+
path: resolvedPath,
|
|
767
|
+
body,
|
|
768
|
+
});
|
|
769
|
+
};
|
|
770
|
+
export const se_TagResourceCommand = async (input, context) => {
|
|
771
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
772
|
+
const headers = {
|
|
773
|
+
"content-type": "application/json",
|
|
774
|
+
};
|
|
775
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
|
|
776
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
|
|
777
|
+
let body;
|
|
778
|
+
body = JSON.stringify(take(input, {
|
|
779
|
+
tags: (_) => _json(_),
|
|
780
|
+
}));
|
|
781
|
+
return new __HttpRequest({
|
|
782
|
+
protocol,
|
|
783
|
+
hostname,
|
|
784
|
+
port,
|
|
785
|
+
method: "POST",
|
|
786
|
+
headers,
|
|
787
|
+
path: resolvedPath,
|
|
788
|
+
body,
|
|
789
|
+
});
|
|
790
|
+
};
|
|
791
|
+
export const se_UntagResourceCommand = async (input, context) => {
|
|
792
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
793
|
+
const headers = {};
|
|
794
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
|
|
795
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
|
|
796
|
+
const query = map({
|
|
797
|
+
tagKeys: [
|
|
798
|
+
__expectNonNull(input.tagKeys, `tagKeys`) != null,
|
|
799
|
+
() => (input.tagKeys || []).map((_entry) => _entry),
|
|
800
|
+
],
|
|
801
|
+
});
|
|
802
|
+
let body;
|
|
803
|
+
return new __HttpRequest({
|
|
804
|
+
protocol,
|
|
805
|
+
hostname,
|
|
806
|
+
port,
|
|
807
|
+
method: "DELETE",
|
|
808
|
+
headers,
|
|
809
|
+
path: resolvedPath,
|
|
810
|
+
query,
|
|
811
|
+
body,
|
|
812
|
+
});
|
|
813
|
+
};
|
|
814
|
+
export const se_UpdateContentCommand = async (input, context) => {
|
|
815
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
816
|
+
const headers = {
|
|
817
|
+
"content-type": "application/json",
|
|
818
|
+
};
|
|
819
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
820
|
+
"/knowledgeBases/{knowledgeBaseId}/contents/{contentId}";
|
|
821
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
822
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "contentId", () => input.contentId, "{contentId}", false);
|
|
823
|
+
let body;
|
|
824
|
+
body = JSON.stringify(take(input, {
|
|
825
|
+
metadata: (_) => _json(_),
|
|
826
|
+
overrideLinkOutUri: [],
|
|
827
|
+
removeOverrideLinkOutUri: [],
|
|
828
|
+
revisionId: [],
|
|
829
|
+
title: [],
|
|
830
|
+
uploadId: [],
|
|
831
|
+
}));
|
|
832
|
+
return new __HttpRequest({
|
|
833
|
+
protocol,
|
|
834
|
+
hostname,
|
|
835
|
+
port,
|
|
836
|
+
method: "POST",
|
|
837
|
+
headers,
|
|
838
|
+
path: resolvedPath,
|
|
839
|
+
body,
|
|
840
|
+
});
|
|
841
|
+
};
|
|
842
|
+
export const se_UpdateKnowledgeBaseTemplateUriCommand = async (input, context) => {
|
|
843
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
844
|
+
const headers = {
|
|
845
|
+
"content-type": "application/json",
|
|
846
|
+
};
|
|
847
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
848
|
+
"/knowledgeBases/{knowledgeBaseId}/templateUri";
|
|
849
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
850
|
+
let body;
|
|
851
|
+
body = JSON.stringify(take(input, {
|
|
852
|
+
templateUri: [],
|
|
853
|
+
}));
|
|
854
|
+
return new __HttpRequest({
|
|
855
|
+
protocol,
|
|
856
|
+
hostname,
|
|
857
|
+
port,
|
|
858
|
+
method: "POST",
|
|
859
|
+
headers,
|
|
860
|
+
path: resolvedPath,
|
|
861
|
+
body,
|
|
862
|
+
});
|
|
863
|
+
};
|
|
864
|
+
export const se_UpdateQuickResponseCommand = async (input, context) => {
|
|
865
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
866
|
+
const headers = {
|
|
867
|
+
"content-type": "application/json",
|
|
868
|
+
};
|
|
869
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
870
|
+
"/knowledgeBases/{knowledgeBaseId}/quickResponses/{quickResponseId}";
|
|
871
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
|
|
872
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "quickResponseId", () => input.quickResponseId, "{quickResponseId}", false);
|
|
873
|
+
let body;
|
|
874
|
+
body = JSON.stringify(take(input, {
|
|
875
|
+
channels: (_) => _json(_),
|
|
876
|
+
content: (_) => _json(_),
|
|
877
|
+
contentType: [],
|
|
878
|
+
description: [],
|
|
879
|
+
groupingConfiguration: (_) => _json(_),
|
|
880
|
+
isActive: [],
|
|
881
|
+
language: [],
|
|
882
|
+
name: [],
|
|
883
|
+
removeDescription: [],
|
|
884
|
+
removeGroupingConfiguration: [],
|
|
885
|
+
removeShortcutKey: [],
|
|
886
|
+
shortcutKey: [],
|
|
887
|
+
}));
|
|
888
|
+
return new __HttpRequest({
|
|
889
|
+
protocol,
|
|
890
|
+
hostname,
|
|
891
|
+
port,
|
|
892
|
+
method: "POST",
|
|
893
|
+
headers,
|
|
894
|
+
path: resolvedPath,
|
|
895
|
+
body,
|
|
896
|
+
});
|
|
897
|
+
};
|
|
898
|
+
export const de_CreateAssistantCommand = async (output, context) => {
|
|
899
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
900
|
+
return de_CreateAssistantCommandError(output, context);
|
|
901
|
+
}
|
|
902
|
+
const contents = map({
|
|
903
|
+
$metadata: deserializeMetadata(output),
|
|
904
|
+
});
|
|
905
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
906
|
+
const doc = take(data, {
|
|
907
|
+
assistant: _json,
|
|
908
|
+
});
|
|
909
|
+
Object.assign(contents, doc);
|
|
910
|
+
return contents;
|
|
911
|
+
};
|
|
912
|
+
const de_CreateAssistantCommandError = async (output, context) => {
|
|
913
|
+
const parsedOutput = {
|
|
914
|
+
...output,
|
|
915
|
+
body: await parseErrorBody(output.body, context),
|
|
916
|
+
};
|
|
917
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
918
|
+
switch (errorCode) {
|
|
919
|
+
case "AccessDeniedException":
|
|
920
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
921
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
922
|
+
case "ConflictException":
|
|
923
|
+
case "com.amazonaws.qconnect#ConflictException":
|
|
924
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
925
|
+
case "ServiceQuotaExceededException":
|
|
926
|
+
case "com.amazonaws.qconnect#ServiceQuotaExceededException":
|
|
927
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
928
|
+
case "ValidationException":
|
|
929
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
930
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
931
|
+
default:
|
|
932
|
+
const parsedBody = parsedOutput.body;
|
|
933
|
+
return throwDefaultError({
|
|
934
|
+
output,
|
|
935
|
+
parsedBody,
|
|
936
|
+
errorCode,
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
};
|
|
940
|
+
export const de_CreateAssistantAssociationCommand = async (output, context) => {
|
|
941
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
942
|
+
return de_CreateAssistantAssociationCommandError(output, context);
|
|
943
|
+
}
|
|
944
|
+
const contents = map({
|
|
945
|
+
$metadata: deserializeMetadata(output),
|
|
946
|
+
});
|
|
947
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
948
|
+
const doc = take(data, {
|
|
949
|
+
assistantAssociation: _json,
|
|
950
|
+
});
|
|
951
|
+
Object.assign(contents, doc);
|
|
952
|
+
return contents;
|
|
953
|
+
};
|
|
954
|
+
const de_CreateAssistantAssociationCommandError = async (output, context) => {
|
|
955
|
+
const parsedOutput = {
|
|
956
|
+
...output,
|
|
957
|
+
body: await parseErrorBody(output.body, context),
|
|
958
|
+
};
|
|
959
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
960
|
+
switch (errorCode) {
|
|
961
|
+
case "AccessDeniedException":
|
|
962
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
963
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
964
|
+
case "ConflictException":
|
|
965
|
+
case "com.amazonaws.qconnect#ConflictException":
|
|
966
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
967
|
+
case "ResourceNotFoundException":
|
|
968
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
969
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
970
|
+
case "ServiceQuotaExceededException":
|
|
971
|
+
case "com.amazonaws.qconnect#ServiceQuotaExceededException":
|
|
972
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
973
|
+
case "ValidationException":
|
|
974
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
975
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
976
|
+
default:
|
|
977
|
+
const parsedBody = parsedOutput.body;
|
|
978
|
+
return throwDefaultError({
|
|
979
|
+
output,
|
|
980
|
+
parsedBody,
|
|
981
|
+
errorCode,
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
};
|
|
985
|
+
export const de_CreateContentCommand = async (output, context) => {
|
|
986
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
987
|
+
return de_CreateContentCommandError(output, context);
|
|
988
|
+
}
|
|
989
|
+
const contents = map({
|
|
990
|
+
$metadata: deserializeMetadata(output),
|
|
991
|
+
});
|
|
992
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
993
|
+
const doc = take(data, {
|
|
994
|
+
content: (_) => de_ContentData(_, context),
|
|
995
|
+
});
|
|
996
|
+
Object.assign(contents, doc);
|
|
997
|
+
return contents;
|
|
998
|
+
};
|
|
999
|
+
const de_CreateContentCommandError = async (output, context) => {
|
|
1000
|
+
const parsedOutput = {
|
|
1001
|
+
...output,
|
|
1002
|
+
body: await parseErrorBody(output.body, context),
|
|
1003
|
+
};
|
|
1004
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1005
|
+
switch (errorCode) {
|
|
1006
|
+
case "AccessDeniedException":
|
|
1007
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1008
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1009
|
+
case "ConflictException":
|
|
1010
|
+
case "com.amazonaws.qconnect#ConflictException":
|
|
1011
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
1012
|
+
case "ResourceNotFoundException":
|
|
1013
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1014
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1015
|
+
case "ServiceQuotaExceededException":
|
|
1016
|
+
case "com.amazonaws.qconnect#ServiceQuotaExceededException":
|
|
1017
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
1018
|
+
case "ValidationException":
|
|
1019
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1020
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1021
|
+
default:
|
|
1022
|
+
const parsedBody = parsedOutput.body;
|
|
1023
|
+
return throwDefaultError({
|
|
1024
|
+
output,
|
|
1025
|
+
parsedBody,
|
|
1026
|
+
errorCode,
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
};
|
|
1030
|
+
export const de_CreateKnowledgeBaseCommand = async (output, context) => {
|
|
1031
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1032
|
+
return de_CreateKnowledgeBaseCommandError(output, context);
|
|
1033
|
+
}
|
|
1034
|
+
const contents = map({
|
|
1035
|
+
$metadata: deserializeMetadata(output),
|
|
1036
|
+
});
|
|
1037
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1038
|
+
const doc = take(data, {
|
|
1039
|
+
knowledgeBase: (_) => de_KnowledgeBaseData(_, context),
|
|
1040
|
+
});
|
|
1041
|
+
Object.assign(contents, doc);
|
|
1042
|
+
return contents;
|
|
1043
|
+
};
|
|
1044
|
+
const de_CreateKnowledgeBaseCommandError = async (output, context) => {
|
|
1045
|
+
const parsedOutput = {
|
|
1046
|
+
...output,
|
|
1047
|
+
body: await parseErrorBody(output.body, context),
|
|
1048
|
+
};
|
|
1049
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1050
|
+
switch (errorCode) {
|
|
1051
|
+
case "AccessDeniedException":
|
|
1052
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1053
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1054
|
+
case "ConflictException":
|
|
1055
|
+
case "com.amazonaws.qconnect#ConflictException":
|
|
1056
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
1057
|
+
case "ServiceQuotaExceededException":
|
|
1058
|
+
case "com.amazonaws.qconnect#ServiceQuotaExceededException":
|
|
1059
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
1060
|
+
case "ValidationException":
|
|
1061
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1062
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1063
|
+
default:
|
|
1064
|
+
const parsedBody = parsedOutput.body;
|
|
1065
|
+
return throwDefaultError({
|
|
1066
|
+
output,
|
|
1067
|
+
parsedBody,
|
|
1068
|
+
errorCode,
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1071
|
+
};
|
|
1072
|
+
export const de_CreateQuickResponseCommand = async (output, context) => {
|
|
1073
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1074
|
+
return de_CreateQuickResponseCommandError(output, context);
|
|
1075
|
+
}
|
|
1076
|
+
const contents = map({
|
|
1077
|
+
$metadata: deserializeMetadata(output),
|
|
1078
|
+
});
|
|
1079
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1080
|
+
const doc = take(data, {
|
|
1081
|
+
quickResponse: (_) => de_QuickResponseData(_, context),
|
|
1082
|
+
});
|
|
1083
|
+
Object.assign(contents, doc);
|
|
1084
|
+
return contents;
|
|
1085
|
+
};
|
|
1086
|
+
const de_CreateQuickResponseCommandError = async (output, context) => {
|
|
1087
|
+
const parsedOutput = {
|
|
1088
|
+
...output,
|
|
1089
|
+
body: await parseErrorBody(output.body, context),
|
|
1090
|
+
};
|
|
1091
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1092
|
+
switch (errorCode) {
|
|
1093
|
+
case "AccessDeniedException":
|
|
1094
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1095
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1096
|
+
case "ConflictException":
|
|
1097
|
+
case "com.amazonaws.qconnect#ConflictException":
|
|
1098
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
1099
|
+
case "ResourceNotFoundException":
|
|
1100
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1101
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1102
|
+
case "ServiceQuotaExceededException":
|
|
1103
|
+
case "com.amazonaws.qconnect#ServiceQuotaExceededException":
|
|
1104
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
1105
|
+
case "ValidationException":
|
|
1106
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1107
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1108
|
+
default:
|
|
1109
|
+
const parsedBody = parsedOutput.body;
|
|
1110
|
+
return throwDefaultError({
|
|
1111
|
+
output,
|
|
1112
|
+
parsedBody,
|
|
1113
|
+
errorCode,
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
};
|
|
1117
|
+
export const de_CreateSessionCommand = async (output, context) => {
|
|
1118
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1119
|
+
return de_CreateSessionCommandError(output, context);
|
|
1120
|
+
}
|
|
1121
|
+
const contents = map({
|
|
1122
|
+
$metadata: deserializeMetadata(output),
|
|
1123
|
+
});
|
|
1124
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1125
|
+
const doc = take(data, {
|
|
1126
|
+
session: _json,
|
|
1127
|
+
});
|
|
1128
|
+
Object.assign(contents, doc);
|
|
1129
|
+
return contents;
|
|
1130
|
+
};
|
|
1131
|
+
const de_CreateSessionCommandError = async (output, context) => {
|
|
1132
|
+
const parsedOutput = {
|
|
1133
|
+
...output,
|
|
1134
|
+
body: await parseErrorBody(output.body, context),
|
|
1135
|
+
};
|
|
1136
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1137
|
+
switch (errorCode) {
|
|
1138
|
+
case "ConflictException":
|
|
1139
|
+
case "com.amazonaws.qconnect#ConflictException":
|
|
1140
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
1141
|
+
case "ResourceNotFoundException":
|
|
1142
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1143
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1144
|
+
case "ValidationException":
|
|
1145
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1146
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1147
|
+
default:
|
|
1148
|
+
const parsedBody = parsedOutput.body;
|
|
1149
|
+
return throwDefaultError({
|
|
1150
|
+
output,
|
|
1151
|
+
parsedBody,
|
|
1152
|
+
errorCode,
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
};
|
|
1156
|
+
export const de_DeleteAssistantCommand = async (output, context) => {
|
|
1157
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
1158
|
+
return de_DeleteAssistantCommandError(output, context);
|
|
1159
|
+
}
|
|
1160
|
+
const contents = map({
|
|
1161
|
+
$metadata: deserializeMetadata(output),
|
|
1162
|
+
});
|
|
1163
|
+
await collectBody(output.body, context);
|
|
1164
|
+
return contents;
|
|
1165
|
+
};
|
|
1166
|
+
const de_DeleteAssistantCommandError = async (output, context) => {
|
|
1167
|
+
const parsedOutput = {
|
|
1168
|
+
...output,
|
|
1169
|
+
body: await parseErrorBody(output.body, context),
|
|
1170
|
+
};
|
|
1171
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1172
|
+
switch (errorCode) {
|
|
1173
|
+
case "AccessDeniedException":
|
|
1174
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1175
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1176
|
+
case "ResourceNotFoundException":
|
|
1177
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1178
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1179
|
+
case "ValidationException":
|
|
1180
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1181
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1182
|
+
default:
|
|
1183
|
+
const parsedBody = parsedOutput.body;
|
|
1184
|
+
return throwDefaultError({
|
|
1185
|
+
output,
|
|
1186
|
+
parsedBody,
|
|
1187
|
+
errorCode,
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
};
|
|
1191
|
+
export const de_DeleteAssistantAssociationCommand = async (output, context) => {
|
|
1192
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
1193
|
+
return de_DeleteAssistantAssociationCommandError(output, context);
|
|
1194
|
+
}
|
|
1195
|
+
const contents = map({
|
|
1196
|
+
$metadata: deserializeMetadata(output),
|
|
1197
|
+
});
|
|
1198
|
+
await collectBody(output.body, context);
|
|
1199
|
+
return contents;
|
|
1200
|
+
};
|
|
1201
|
+
const de_DeleteAssistantAssociationCommandError = async (output, context) => {
|
|
1202
|
+
const parsedOutput = {
|
|
1203
|
+
...output,
|
|
1204
|
+
body: await parseErrorBody(output.body, context),
|
|
1205
|
+
};
|
|
1206
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1207
|
+
switch (errorCode) {
|
|
1208
|
+
case "AccessDeniedException":
|
|
1209
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1210
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1211
|
+
case "ResourceNotFoundException":
|
|
1212
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1213
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1214
|
+
case "ValidationException":
|
|
1215
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1216
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1217
|
+
default:
|
|
1218
|
+
const parsedBody = parsedOutput.body;
|
|
1219
|
+
return throwDefaultError({
|
|
1220
|
+
output,
|
|
1221
|
+
parsedBody,
|
|
1222
|
+
errorCode,
|
|
1223
|
+
});
|
|
1224
|
+
}
|
|
1225
|
+
};
|
|
1226
|
+
export const de_DeleteContentCommand = async (output, context) => {
|
|
1227
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
1228
|
+
return de_DeleteContentCommandError(output, context);
|
|
1229
|
+
}
|
|
1230
|
+
const contents = map({
|
|
1231
|
+
$metadata: deserializeMetadata(output),
|
|
1232
|
+
});
|
|
1233
|
+
await collectBody(output.body, context);
|
|
1234
|
+
return contents;
|
|
1235
|
+
};
|
|
1236
|
+
const de_DeleteContentCommandError = async (output, context) => {
|
|
1237
|
+
const parsedOutput = {
|
|
1238
|
+
...output,
|
|
1239
|
+
body: await parseErrorBody(output.body, context),
|
|
1240
|
+
};
|
|
1241
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1242
|
+
switch (errorCode) {
|
|
1243
|
+
case "AccessDeniedException":
|
|
1244
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1245
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1246
|
+
case "ResourceNotFoundException":
|
|
1247
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1248
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1249
|
+
case "ValidationException":
|
|
1250
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1251
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1252
|
+
default:
|
|
1253
|
+
const parsedBody = parsedOutput.body;
|
|
1254
|
+
return throwDefaultError({
|
|
1255
|
+
output,
|
|
1256
|
+
parsedBody,
|
|
1257
|
+
errorCode,
|
|
1258
|
+
});
|
|
1259
|
+
}
|
|
1260
|
+
};
|
|
1261
|
+
export const de_DeleteImportJobCommand = async (output, context) => {
|
|
1262
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
1263
|
+
return de_DeleteImportJobCommandError(output, context);
|
|
1264
|
+
}
|
|
1265
|
+
const contents = map({
|
|
1266
|
+
$metadata: deserializeMetadata(output),
|
|
1267
|
+
});
|
|
1268
|
+
await collectBody(output.body, context);
|
|
1269
|
+
return contents;
|
|
1270
|
+
};
|
|
1271
|
+
const de_DeleteImportJobCommandError = async (output, context) => {
|
|
1272
|
+
const parsedOutput = {
|
|
1273
|
+
...output,
|
|
1274
|
+
body: await parseErrorBody(output.body, context),
|
|
1275
|
+
};
|
|
1276
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1277
|
+
switch (errorCode) {
|
|
1278
|
+
case "AccessDeniedException":
|
|
1279
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1280
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1281
|
+
case "ConflictException":
|
|
1282
|
+
case "com.amazonaws.qconnect#ConflictException":
|
|
1283
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
1284
|
+
case "ResourceNotFoundException":
|
|
1285
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1286
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1287
|
+
case "ValidationException":
|
|
1288
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1289
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1290
|
+
default:
|
|
1291
|
+
const parsedBody = parsedOutput.body;
|
|
1292
|
+
return throwDefaultError({
|
|
1293
|
+
output,
|
|
1294
|
+
parsedBody,
|
|
1295
|
+
errorCode,
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
export const de_DeleteKnowledgeBaseCommand = async (output, context) => {
|
|
1300
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
1301
|
+
return de_DeleteKnowledgeBaseCommandError(output, context);
|
|
1302
|
+
}
|
|
1303
|
+
const contents = map({
|
|
1304
|
+
$metadata: deserializeMetadata(output),
|
|
1305
|
+
});
|
|
1306
|
+
await collectBody(output.body, context);
|
|
1307
|
+
return contents;
|
|
1308
|
+
};
|
|
1309
|
+
const de_DeleteKnowledgeBaseCommandError = async (output, context) => {
|
|
1310
|
+
const parsedOutput = {
|
|
1311
|
+
...output,
|
|
1312
|
+
body: await parseErrorBody(output.body, context),
|
|
1313
|
+
};
|
|
1314
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1315
|
+
switch (errorCode) {
|
|
1316
|
+
case "AccessDeniedException":
|
|
1317
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1318
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1319
|
+
case "ConflictException":
|
|
1320
|
+
case "com.amazonaws.qconnect#ConflictException":
|
|
1321
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
1322
|
+
case "ResourceNotFoundException":
|
|
1323
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1324
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1325
|
+
case "ValidationException":
|
|
1326
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1327
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1328
|
+
default:
|
|
1329
|
+
const parsedBody = parsedOutput.body;
|
|
1330
|
+
return throwDefaultError({
|
|
1331
|
+
output,
|
|
1332
|
+
parsedBody,
|
|
1333
|
+
errorCode,
|
|
1334
|
+
});
|
|
1335
|
+
}
|
|
1336
|
+
};
|
|
1337
|
+
export const de_DeleteQuickResponseCommand = async (output, context) => {
|
|
1338
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
1339
|
+
return de_DeleteQuickResponseCommandError(output, context);
|
|
1340
|
+
}
|
|
1341
|
+
const contents = map({
|
|
1342
|
+
$metadata: deserializeMetadata(output),
|
|
1343
|
+
});
|
|
1344
|
+
await collectBody(output.body, context);
|
|
1345
|
+
return contents;
|
|
1346
|
+
};
|
|
1347
|
+
const de_DeleteQuickResponseCommandError = async (output, context) => {
|
|
1348
|
+
const parsedOutput = {
|
|
1349
|
+
...output,
|
|
1350
|
+
body: await parseErrorBody(output.body, context),
|
|
1351
|
+
};
|
|
1352
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1353
|
+
switch (errorCode) {
|
|
1354
|
+
case "AccessDeniedException":
|
|
1355
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1356
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1357
|
+
case "ResourceNotFoundException":
|
|
1358
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1359
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1360
|
+
case "ValidationException":
|
|
1361
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1362
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1363
|
+
default:
|
|
1364
|
+
const parsedBody = parsedOutput.body;
|
|
1365
|
+
return throwDefaultError({
|
|
1366
|
+
output,
|
|
1367
|
+
parsedBody,
|
|
1368
|
+
errorCode,
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1371
|
+
};
|
|
1372
|
+
export const de_GetAssistantCommand = async (output, context) => {
|
|
1373
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1374
|
+
return de_GetAssistantCommandError(output, context);
|
|
1375
|
+
}
|
|
1376
|
+
const contents = map({
|
|
1377
|
+
$metadata: deserializeMetadata(output),
|
|
1378
|
+
});
|
|
1379
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1380
|
+
const doc = take(data, {
|
|
1381
|
+
assistant: _json,
|
|
1382
|
+
});
|
|
1383
|
+
Object.assign(contents, doc);
|
|
1384
|
+
return contents;
|
|
1385
|
+
};
|
|
1386
|
+
const de_GetAssistantCommandError = async (output, context) => {
|
|
1387
|
+
const parsedOutput = {
|
|
1388
|
+
...output,
|
|
1389
|
+
body: await parseErrorBody(output.body, context),
|
|
1390
|
+
};
|
|
1391
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1392
|
+
switch (errorCode) {
|
|
1393
|
+
case "AccessDeniedException":
|
|
1394
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1395
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1396
|
+
case "ResourceNotFoundException":
|
|
1397
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1398
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1399
|
+
case "ValidationException":
|
|
1400
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1401
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1402
|
+
default:
|
|
1403
|
+
const parsedBody = parsedOutput.body;
|
|
1404
|
+
return throwDefaultError({
|
|
1405
|
+
output,
|
|
1406
|
+
parsedBody,
|
|
1407
|
+
errorCode,
|
|
1408
|
+
});
|
|
1409
|
+
}
|
|
1410
|
+
};
|
|
1411
|
+
export const de_GetAssistantAssociationCommand = async (output, context) => {
|
|
1412
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1413
|
+
return de_GetAssistantAssociationCommandError(output, context);
|
|
1414
|
+
}
|
|
1415
|
+
const contents = map({
|
|
1416
|
+
$metadata: deserializeMetadata(output),
|
|
1417
|
+
});
|
|
1418
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1419
|
+
const doc = take(data, {
|
|
1420
|
+
assistantAssociation: _json,
|
|
1421
|
+
});
|
|
1422
|
+
Object.assign(contents, doc);
|
|
1423
|
+
return contents;
|
|
1424
|
+
};
|
|
1425
|
+
const de_GetAssistantAssociationCommandError = async (output, context) => {
|
|
1426
|
+
const parsedOutput = {
|
|
1427
|
+
...output,
|
|
1428
|
+
body: await parseErrorBody(output.body, context),
|
|
1429
|
+
};
|
|
1430
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1431
|
+
switch (errorCode) {
|
|
1432
|
+
case "AccessDeniedException":
|
|
1433
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1434
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1435
|
+
case "ResourceNotFoundException":
|
|
1436
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1437
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1438
|
+
case "ValidationException":
|
|
1439
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1440
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1441
|
+
default:
|
|
1442
|
+
const parsedBody = parsedOutput.body;
|
|
1443
|
+
return throwDefaultError({
|
|
1444
|
+
output,
|
|
1445
|
+
parsedBody,
|
|
1446
|
+
errorCode,
|
|
1447
|
+
});
|
|
1448
|
+
}
|
|
1449
|
+
};
|
|
1450
|
+
export const de_GetContentCommand = async (output, context) => {
|
|
1451
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1452
|
+
return de_GetContentCommandError(output, context);
|
|
1453
|
+
}
|
|
1454
|
+
const contents = map({
|
|
1455
|
+
$metadata: deserializeMetadata(output),
|
|
1456
|
+
});
|
|
1457
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1458
|
+
const doc = take(data, {
|
|
1459
|
+
content: (_) => de_ContentData(_, context),
|
|
1460
|
+
});
|
|
1461
|
+
Object.assign(contents, doc);
|
|
1462
|
+
return contents;
|
|
1463
|
+
};
|
|
1464
|
+
const de_GetContentCommandError = async (output, context) => {
|
|
1465
|
+
const parsedOutput = {
|
|
1466
|
+
...output,
|
|
1467
|
+
body: await parseErrorBody(output.body, context),
|
|
1468
|
+
};
|
|
1469
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1470
|
+
switch (errorCode) {
|
|
1471
|
+
case "AccessDeniedException":
|
|
1472
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1473
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1474
|
+
case "ResourceNotFoundException":
|
|
1475
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1476
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1477
|
+
case "ValidationException":
|
|
1478
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1479
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1480
|
+
default:
|
|
1481
|
+
const parsedBody = parsedOutput.body;
|
|
1482
|
+
return throwDefaultError({
|
|
1483
|
+
output,
|
|
1484
|
+
parsedBody,
|
|
1485
|
+
errorCode,
|
|
1486
|
+
});
|
|
1487
|
+
}
|
|
1488
|
+
};
|
|
1489
|
+
export const de_GetContentSummaryCommand = async (output, context) => {
|
|
1490
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1491
|
+
return de_GetContentSummaryCommandError(output, context);
|
|
1492
|
+
}
|
|
1493
|
+
const contents = map({
|
|
1494
|
+
$metadata: deserializeMetadata(output),
|
|
1495
|
+
});
|
|
1496
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1497
|
+
const doc = take(data, {
|
|
1498
|
+
contentSummary: _json,
|
|
1499
|
+
});
|
|
1500
|
+
Object.assign(contents, doc);
|
|
1501
|
+
return contents;
|
|
1502
|
+
};
|
|
1503
|
+
const de_GetContentSummaryCommandError = async (output, context) => {
|
|
1504
|
+
const parsedOutput = {
|
|
1505
|
+
...output,
|
|
1506
|
+
body: await parseErrorBody(output.body, context),
|
|
1507
|
+
};
|
|
1508
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1509
|
+
switch (errorCode) {
|
|
1510
|
+
case "AccessDeniedException":
|
|
1511
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1512
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1513
|
+
case "ResourceNotFoundException":
|
|
1514
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1515
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1516
|
+
case "ValidationException":
|
|
1517
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1518
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1519
|
+
default:
|
|
1520
|
+
const parsedBody = parsedOutput.body;
|
|
1521
|
+
return throwDefaultError({
|
|
1522
|
+
output,
|
|
1523
|
+
parsedBody,
|
|
1524
|
+
errorCode,
|
|
1525
|
+
});
|
|
1526
|
+
}
|
|
1527
|
+
};
|
|
1528
|
+
export const de_GetImportJobCommand = async (output, context) => {
|
|
1529
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1530
|
+
return de_GetImportJobCommandError(output, context);
|
|
1531
|
+
}
|
|
1532
|
+
const contents = map({
|
|
1533
|
+
$metadata: deserializeMetadata(output),
|
|
1534
|
+
});
|
|
1535
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1536
|
+
const doc = take(data, {
|
|
1537
|
+
importJob: (_) => de_ImportJobData(_, context),
|
|
1538
|
+
});
|
|
1539
|
+
Object.assign(contents, doc);
|
|
1540
|
+
return contents;
|
|
1541
|
+
};
|
|
1542
|
+
const de_GetImportJobCommandError = async (output, context) => {
|
|
1543
|
+
const parsedOutput = {
|
|
1544
|
+
...output,
|
|
1545
|
+
body: await parseErrorBody(output.body, context),
|
|
1546
|
+
};
|
|
1547
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1548
|
+
switch (errorCode) {
|
|
1549
|
+
case "AccessDeniedException":
|
|
1550
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1551
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1552
|
+
case "ResourceNotFoundException":
|
|
1553
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1554
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1555
|
+
case "ValidationException":
|
|
1556
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1557
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1558
|
+
default:
|
|
1559
|
+
const parsedBody = parsedOutput.body;
|
|
1560
|
+
return throwDefaultError({
|
|
1561
|
+
output,
|
|
1562
|
+
parsedBody,
|
|
1563
|
+
errorCode,
|
|
1564
|
+
});
|
|
1565
|
+
}
|
|
1566
|
+
};
|
|
1567
|
+
export const de_GetKnowledgeBaseCommand = async (output, context) => {
|
|
1568
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1569
|
+
return de_GetKnowledgeBaseCommandError(output, context);
|
|
1570
|
+
}
|
|
1571
|
+
const contents = map({
|
|
1572
|
+
$metadata: deserializeMetadata(output),
|
|
1573
|
+
});
|
|
1574
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1575
|
+
const doc = take(data, {
|
|
1576
|
+
knowledgeBase: (_) => de_KnowledgeBaseData(_, context),
|
|
1577
|
+
});
|
|
1578
|
+
Object.assign(contents, doc);
|
|
1579
|
+
return contents;
|
|
1580
|
+
};
|
|
1581
|
+
const de_GetKnowledgeBaseCommandError = async (output, context) => {
|
|
1582
|
+
const parsedOutput = {
|
|
1583
|
+
...output,
|
|
1584
|
+
body: await parseErrorBody(output.body, context),
|
|
1585
|
+
};
|
|
1586
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1587
|
+
switch (errorCode) {
|
|
1588
|
+
case "AccessDeniedException":
|
|
1589
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1590
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1591
|
+
case "ResourceNotFoundException":
|
|
1592
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1593
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1594
|
+
case "ValidationException":
|
|
1595
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1596
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1597
|
+
default:
|
|
1598
|
+
const parsedBody = parsedOutput.body;
|
|
1599
|
+
return throwDefaultError({
|
|
1600
|
+
output,
|
|
1601
|
+
parsedBody,
|
|
1602
|
+
errorCode,
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1605
|
+
};
|
|
1606
|
+
export const de_GetQuickResponseCommand = async (output, context) => {
|
|
1607
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1608
|
+
return de_GetQuickResponseCommandError(output, context);
|
|
1609
|
+
}
|
|
1610
|
+
const contents = map({
|
|
1611
|
+
$metadata: deserializeMetadata(output),
|
|
1612
|
+
});
|
|
1613
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1614
|
+
const doc = take(data, {
|
|
1615
|
+
quickResponse: (_) => de_QuickResponseData(_, context),
|
|
1616
|
+
});
|
|
1617
|
+
Object.assign(contents, doc);
|
|
1618
|
+
return contents;
|
|
1619
|
+
};
|
|
1620
|
+
const de_GetQuickResponseCommandError = async (output, context) => {
|
|
1621
|
+
const parsedOutput = {
|
|
1622
|
+
...output,
|
|
1623
|
+
body: await parseErrorBody(output.body, context),
|
|
1624
|
+
};
|
|
1625
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1626
|
+
switch (errorCode) {
|
|
1627
|
+
case "AccessDeniedException":
|
|
1628
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1629
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1630
|
+
case "ResourceNotFoundException":
|
|
1631
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1632
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1633
|
+
case "ValidationException":
|
|
1634
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1635
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1636
|
+
default:
|
|
1637
|
+
const parsedBody = parsedOutput.body;
|
|
1638
|
+
return throwDefaultError({
|
|
1639
|
+
output,
|
|
1640
|
+
parsedBody,
|
|
1641
|
+
errorCode,
|
|
1642
|
+
});
|
|
1643
|
+
}
|
|
1644
|
+
};
|
|
1645
|
+
export const de_GetRecommendationsCommand = async (output, context) => {
|
|
1646
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1647
|
+
return de_GetRecommendationsCommandError(output, context);
|
|
1648
|
+
}
|
|
1649
|
+
const contents = map({
|
|
1650
|
+
$metadata: deserializeMetadata(output),
|
|
1651
|
+
});
|
|
1652
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1653
|
+
const doc = take(data, {
|
|
1654
|
+
recommendations: (_) => de_RecommendationList(_, context),
|
|
1655
|
+
triggers: _json,
|
|
1656
|
+
});
|
|
1657
|
+
Object.assign(contents, doc);
|
|
1658
|
+
return contents;
|
|
1659
|
+
};
|
|
1660
|
+
const de_GetRecommendationsCommandError = async (output, context) => {
|
|
1661
|
+
const parsedOutput = {
|
|
1662
|
+
...output,
|
|
1663
|
+
body: await parseErrorBody(output.body, context),
|
|
1664
|
+
};
|
|
1665
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1666
|
+
switch (errorCode) {
|
|
1667
|
+
case "AccessDeniedException":
|
|
1668
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1669
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1670
|
+
case "ResourceNotFoundException":
|
|
1671
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1672
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1673
|
+
case "ValidationException":
|
|
1674
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1675
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1676
|
+
default:
|
|
1677
|
+
const parsedBody = parsedOutput.body;
|
|
1678
|
+
return throwDefaultError({
|
|
1679
|
+
output,
|
|
1680
|
+
parsedBody,
|
|
1681
|
+
errorCode,
|
|
1682
|
+
});
|
|
1683
|
+
}
|
|
1684
|
+
};
|
|
1685
|
+
export const de_GetSessionCommand = async (output, context) => {
|
|
1686
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1687
|
+
return de_GetSessionCommandError(output, context);
|
|
1688
|
+
}
|
|
1689
|
+
const contents = map({
|
|
1690
|
+
$metadata: deserializeMetadata(output),
|
|
1691
|
+
});
|
|
1692
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1693
|
+
const doc = take(data, {
|
|
1694
|
+
session: _json,
|
|
1695
|
+
});
|
|
1696
|
+
Object.assign(contents, doc);
|
|
1697
|
+
return contents;
|
|
1698
|
+
};
|
|
1699
|
+
const de_GetSessionCommandError = async (output, context) => {
|
|
1700
|
+
const parsedOutput = {
|
|
1701
|
+
...output,
|
|
1702
|
+
body: await parseErrorBody(output.body, context),
|
|
1703
|
+
};
|
|
1704
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1705
|
+
switch (errorCode) {
|
|
1706
|
+
case "AccessDeniedException":
|
|
1707
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1708
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1709
|
+
case "ResourceNotFoundException":
|
|
1710
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1711
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1712
|
+
case "ValidationException":
|
|
1713
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1714
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1715
|
+
default:
|
|
1716
|
+
const parsedBody = parsedOutput.body;
|
|
1717
|
+
return throwDefaultError({
|
|
1718
|
+
output,
|
|
1719
|
+
parsedBody,
|
|
1720
|
+
errorCode,
|
|
1721
|
+
});
|
|
1722
|
+
}
|
|
1723
|
+
};
|
|
1724
|
+
export const de_ListAssistantAssociationsCommand = async (output, context) => {
|
|
1725
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1726
|
+
return de_ListAssistantAssociationsCommandError(output, context);
|
|
1727
|
+
}
|
|
1728
|
+
const contents = map({
|
|
1729
|
+
$metadata: deserializeMetadata(output),
|
|
1730
|
+
});
|
|
1731
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1732
|
+
const doc = take(data, {
|
|
1733
|
+
assistantAssociationSummaries: _json,
|
|
1734
|
+
nextToken: __expectString,
|
|
1735
|
+
});
|
|
1736
|
+
Object.assign(contents, doc);
|
|
1737
|
+
return contents;
|
|
1738
|
+
};
|
|
1739
|
+
const de_ListAssistantAssociationsCommandError = async (output, context) => {
|
|
1740
|
+
const parsedOutput = {
|
|
1741
|
+
...output,
|
|
1742
|
+
body: await parseErrorBody(output.body, context),
|
|
1743
|
+
};
|
|
1744
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1745
|
+
switch (errorCode) {
|
|
1746
|
+
case "AccessDeniedException":
|
|
1747
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1748
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1749
|
+
case "ResourceNotFoundException":
|
|
1750
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1751
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1752
|
+
case "ValidationException":
|
|
1753
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1754
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1755
|
+
default:
|
|
1756
|
+
const parsedBody = parsedOutput.body;
|
|
1757
|
+
return throwDefaultError({
|
|
1758
|
+
output,
|
|
1759
|
+
parsedBody,
|
|
1760
|
+
errorCode,
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1763
|
+
};
|
|
1764
|
+
export const de_ListAssistantsCommand = async (output, context) => {
|
|
1765
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1766
|
+
return de_ListAssistantsCommandError(output, context);
|
|
1767
|
+
}
|
|
1768
|
+
const contents = map({
|
|
1769
|
+
$metadata: deserializeMetadata(output),
|
|
1770
|
+
});
|
|
1771
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1772
|
+
const doc = take(data, {
|
|
1773
|
+
assistantSummaries: _json,
|
|
1774
|
+
nextToken: __expectString,
|
|
1775
|
+
});
|
|
1776
|
+
Object.assign(contents, doc);
|
|
1777
|
+
return contents;
|
|
1778
|
+
};
|
|
1779
|
+
const de_ListAssistantsCommandError = async (output, context) => {
|
|
1780
|
+
const parsedOutput = {
|
|
1781
|
+
...output,
|
|
1782
|
+
body: await parseErrorBody(output.body, context),
|
|
1783
|
+
};
|
|
1784
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1785
|
+
switch (errorCode) {
|
|
1786
|
+
case "AccessDeniedException":
|
|
1787
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1788
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1789
|
+
case "ValidationException":
|
|
1790
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1791
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1792
|
+
default:
|
|
1793
|
+
const parsedBody = parsedOutput.body;
|
|
1794
|
+
return throwDefaultError({
|
|
1795
|
+
output,
|
|
1796
|
+
parsedBody,
|
|
1797
|
+
errorCode,
|
|
1798
|
+
});
|
|
1799
|
+
}
|
|
1800
|
+
};
|
|
1801
|
+
export const de_ListContentsCommand = async (output, context) => {
|
|
1802
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1803
|
+
return de_ListContentsCommandError(output, context);
|
|
1804
|
+
}
|
|
1805
|
+
const contents = map({
|
|
1806
|
+
$metadata: deserializeMetadata(output),
|
|
1807
|
+
});
|
|
1808
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1809
|
+
const doc = take(data, {
|
|
1810
|
+
contentSummaries: _json,
|
|
1811
|
+
nextToken: __expectString,
|
|
1812
|
+
});
|
|
1813
|
+
Object.assign(contents, doc);
|
|
1814
|
+
return contents;
|
|
1815
|
+
};
|
|
1816
|
+
const de_ListContentsCommandError = async (output, context) => {
|
|
1817
|
+
const parsedOutput = {
|
|
1818
|
+
...output,
|
|
1819
|
+
body: await parseErrorBody(output.body, context),
|
|
1820
|
+
};
|
|
1821
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1822
|
+
switch (errorCode) {
|
|
1823
|
+
case "AccessDeniedException":
|
|
1824
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1825
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1826
|
+
case "ResourceNotFoundException":
|
|
1827
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1828
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1829
|
+
case "ValidationException":
|
|
1830
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1831
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1832
|
+
default:
|
|
1833
|
+
const parsedBody = parsedOutput.body;
|
|
1834
|
+
return throwDefaultError({
|
|
1835
|
+
output,
|
|
1836
|
+
parsedBody,
|
|
1837
|
+
errorCode,
|
|
1838
|
+
});
|
|
1839
|
+
}
|
|
1840
|
+
};
|
|
1841
|
+
export const de_ListImportJobsCommand = async (output, context) => {
|
|
1842
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1843
|
+
return de_ListImportJobsCommandError(output, context);
|
|
1844
|
+
}
|
|
1845
|
+
const contents = map({
|
|
1846
|
+
$metadata: deserializeMetadata(output),
|
|
1847
|
+
});
|
|
1848
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1849
|
+
const doc = take(data, {
|
|
1850
|
+
importJobSummaries: (_) => de_ImportJobList(_, context),
|
|
1851
|
+
nextToken: __expectString,
|
|
1852
|
+
});
|
|
1853
|
+
Object.assign(contents, doc);
|
|
1854
|
+
return contents;
|
|
1855
|
+
};
|
|
1856
|
+
const de_ListImportJobsCommandError = async (output, context) => {
|
|
1857
|
+
const parsedOutput = {
|
|
1858
|
+
...output,
|
|
1859
|
+
body: await parseErrorBody(output.body, context),
|
|
1860
|
+
};
|
|
1861
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1862
|
+
switch (errorCode) {
|
|
1863
|
+
case "AccessDeniedException":
|
|
1864
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1865
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1866
|
+
case "ValidationException":
|
|
1867
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1868
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1869
|
+
default:
|
|
1870
|
+
const parsedBody = parsedOutput.body;
|
|
1871
|
+
return throwDefaultError({
|
|
1872
|
+
output,
|
|
1873
|
+
parsedBody,
|
|
1874
|
+
errorCode,
|
|
1875
|
+
});
|
|
1876
|
+
}
|
|
1877
|
+
};
|
|
1878
|
+
export const de_ListKnowledgeBasesCommand = async (output, context) => {
|
|
1879
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1880
|
+
return de_ListKnowledgeBasesCommandError(output, context);
|
|
1881
|
+
}
|
|
1882
|
+
const contents = map({
|
|
1883
|
+
$metadata: deserializeMetadata(output),
|
|
1884
|
+
});
|
|
1885
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1886
|
+
const doc = take(data, {
|
|
1887
|
+
knowledgeBaseSummaries: _json,
|
|
1888
|
+
nextToken: __expectString,
|
|
1889
|
+
});
|
|
1890
|
+
Object.assign(contents, doc);
|
|
1891
|
+
return contents;
|
|
1892
|
+
};
|
|
1893
|
+
const de_ListKnowledgeBasesCommandError = async (output, context) => {
|
|
1894
|
+
const parsedOutput = {
|
|
1895
|
+
...output,
|
|
1896
|
+
body: await parseErrorBody(output.body, context),
|
|
1897
|
+
};
|
|
1898
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1899
|
+
switch (errorCode) {
|
|
1900
|
+
case "AccessDeniedException":
|
|
1901
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1902
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1903
|
+
case "ValidationException":
|
|
1904
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1905
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1906
|
+
default:
|
|
1907
|
+
const parsedBody = parsedOutput.body;
|
|
1908
|
+
return throwDefaultError({
|
|
1909
|
+
output,
|
|
1910
|
+
parsedBody,
|
|
1911
|
+
errorCode,
|
|
1912
|
+
});
|
|
1913
|
+
}
|
|
1914
|
+
};
|
|
1915
|
+
export const de_ListQuickResponsesCommand = async (output, context) => {
|
|
1916
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1917
|
+
return de_ListQuickResponsesCommandError(output, context);
|
|
1918
|
+
}
|
|
1919
|
+
const contents = map({
|
|
1920
|
+
$metadata: deserializeMetadata(output),
|
|
1921
|
+
});
|
|
1922
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1923
|
+
const doc = take(data, {
|
|
1924
|
+
nextToken: __expectString,
|
|
1925
|
+
quickResponseSummaries: (_) => de_QuickResponseSummaryList(_, context),
|
|
1926
|
+
});
|
|
1927
|
+
Object.assign(contents, doc);
|
|
1928
|
+
return contents;
|
|
1929
|
+
};
|
|
1930
|
+
const de_ListQuickResponsesCommandError = async (output, context) => {
|
|
1931
|
+
const parsedOutput = {
|
|
1932
|
+
...output,
|
|
1933
|
+
body: await parseErrorBody(output.body, context),
|
|
1934
|
+
};
|
|
1935
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1936
|
+
switch (errorCode) {
|
|
1937
|
+
case "AccessDeniedException":
|
|
1938
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
1939
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1940
|
+
case "ResourceNotFoundException":
|
|
1941
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1942
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1943
|
+
case "ValidationException":
|
|
1944
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
1945
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1946
|
+
default:
|
|
1947
|
+
const parsedBody = parsedOutput.body;
|
|
1948
|
+
return throwDefaultError({
|
|
1949
|
+
output,
|
|
1950
|
+
parsedBody,
|
|
1951
|
+
errorCode,
|
|
1952
|
+
});
|
|
1953
|
+
}
|
|
1954
|
+
};
|
|
1955
|
+
export const de_ListTagsForResourceCommand = async (output, context) => {
|
|
1956
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1957
|
+
return de_ListTagsForResourceCommandError(output, context);
|
|
1958
|
+
}
|
|
1959
|
+
const contents = map({
|
|
1960
|
+
$metadata: deserializeMetadata(output),
|
|
1961
|
+
});
|
|
1962
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1963
|
+
const doc = take(data, {
|
|
1964
|
+
tags: _json,
|
|
1965
|
+
});
|
|
1966
|
+
Object.assign(contents, doc);
|
|
1967
|
+
return contents;
|
|
1968
|
+
};
|
|
1969
|
+
const de_ListTagsForResourceCommandError = async (output, context) => {
|
|
1970
|
+
const parsedOutput = {
|
|
1971
|
+
...output,
|
|
1972
|
+
body: await parseErrorBody(output.body, context),
|
|
1973
|
+
};
|
|
1974
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1975
|
+
switch (errorCode) {
|
|
1976
|
+
case "ResourceNotFoundException":
|
|
1977
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
1978
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1979
|
+
default:
|
|
1980
|
+
const parsedBody = parsedOutput.body;
|
|
1981
|
+
return throwDefaultError({
|
|
1982
|
+
output,
|
|
1983
|
+
parsedBody,
|
|
1984
|
+
errorCode,
|
|
1985
|
+
});
|
|
1986
|
+
}
|
|
1987
|
+
};
|
|
1988
|
+
export const de_NotifyRecommendationsReceivedCommand = async (output, context) => {
|
|
1989
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1990
|
+
return de_NotifyRecommendationsReceivedCommandError(output, context);
|
|
1991
|
+
}
|
|
1992
|
+
const contents = map({
|
|
1993
|
+
$metadata: deserializeMetadata(output),
|
|
1994
|
+
});
|
|
1995
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1996
|
+
const doc = take(data, {
|
|
1997
|
+
errors: _json,
|
|
1998
|
+
recommendationIds: _json,
|
|
1999
|
+
});
|
|
2000
|
+
Object.assign(contents, doc);
|
|
2001
|
+
return contents;
|
|
2002
|
+
};
|
|
2003
|
+
const de_NotifyRecommendationsReceivedCommandError = async (output, context) => {
|
|
2004
|
+
const parsedOutput = {
|
|
2005
|
+
...output,
|
|
2006
|
+
body: await parseErrorBody(output.body, context),
|
|
2007
|
+
};
|
|
2008
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2009
|
+
switch (errorCode) {
|
|
2010
|
+
case "AccessDeniedException":
|
|
2011
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
2012
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
2013
|
+
case "ResourceNotFoundException":
|
|
2014
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
2015
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2016
|
+
case "ValidationException":
|
|
2017
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
2018
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
2019
|
+
default:
|
|
2020
|
+
const parsedBody = parsedOutput.body;
|
|
2021
|
+
return throwDefaultError({
|
|
2022
|
+
output,
|
|
2023
|
+
parsedBody,
|
|
2024
|
+
errorCode,
|
|
2025
|
+
});
|
|
2026
|
+
}
|
|
2027
|
+
};
|
|
2028
|
+
export const de_QueryAssistantCommand = async (output, context) => {
|
|
2029
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2030
|
+
return de_QueryAssistantCommandError(output, context);
|
|
2031
|
+
}
|
|
2032
|
+
const contents = map({
|
|
2033
|
+
$metadata: deserializeMetadata(output),
|
|
2034
|
+
});
|
|
2035
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
2036
|
+
const doc = take(data, {
|
|
2037
|
+
nextToken: __expectString,
|
|
2038
|
+
results: (_) => de_QueryResultsList(_, context),
|
|
2039
|
+
});
|
|
2040
|
+
Object.assign(contents, doc);
|
|
2041
|
+
return contents;
|
|
2042
|
+
};
|
|
2043
|
+
const de_QueryAssistantCommandError = async (output, context) => {
|
|
2044
|
+
const parsedOutput = {
|
|
2045
|
+
...output,
|
|
2046
|
+
body: await parseErrorBody(output.body, context),
|
|
2047
|
+
};
|
|
2048
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2049
|
+
switch (errorCode) {
|
|
2050
|
+
case "AccessDeniedException":
|
|
2051
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
2052
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
2053
|
+
case "RequestTimeoutException":
|
|
2054
|
+
case "com.amazonaws.qconnect#RequestTimeoutException":
|
|
2055
|
+
throw await de_RequestTimeoutExceptionRes(parsedOutput, context);
|
|
2056
|
+
case "ResourceNotFoundException":
|
|
2057
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
2058
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2059
|
+
case "ValidationException":
|
|
2060
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
2061
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
2062
|
+
default:
|
|
2063
|
+
const parsedBody = parsedOutput.body;
|
|
2064
|
+
return throwDefaultError({
|
|
2065
|
+
output,
|
|
2066
|
+
parsedBody,
|
|
2067
|
+
errorCode,
|
|
2068
|
+
});
|
|
2069
|
+
}
|
|
2070
|
+
};
|
|
2071
|
+
export const de_RemoveKnowledgeBaseTemplateUriCommand = async (output, context) => {
|
|
2072
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
2073
|
+
return de_RemoveKnowledgeBaseTemplateUriCommandError(output, context);
|
|
2074
|
+
}
|
|
2075
|
+
const contents = map({
|
|
2076
|
+
$metadata: deserializeMetadata(output),
|
|
2077
|
+
});
|
|
2078
|
+
await collectBody(output.body, context);
|
|
2079
|
+
return contents;
|
|
2080
|
+
};
|
|
2081
|
+
const de_RemoveKnowledgeBaseTemplateUriCommandError = async (output, context) => {
|
|
2082
|
+
const parsedOutput = {
|
|
2083
|
+
...output,
|
|
2084
|
+
body: await parseErrorBody(output.body, context),
|
|
2085
|
+
};
|
|
2086
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2087
|
+
switch (errorCode) {
|
|
2088
|
+
case "AccessDeniedException":
|
|
2089
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
2090
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
2091
|
+
case "ResourceNotFoundException":
|
|
2092
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
2093
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2094
|
+
case "ValidationException":
|
|
2095
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
2096
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
2097
|
+
default:
|
|
2098
|
+
const parsedBody = parsedOutput.body;
|
|
2099
|
+
return throwDefaultError({
|
|
2100
|
+
output,
|
|
2101
|
+
parsedBody,
|
|
2102
|
+
errorCode,
|
|
2103
|
+
});
|
|
2104
|
+
}
|
|
2105
|
+
};
|
|
2106
|
+
export const de_SearchContentCommand = async (output, context) => {
|
|
2107
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2108
|
+
return de_SearchContentCommandError(output, context);
|
|
2109
|
+
}
|
|
2110
|
+
const contents = map({
|
|
2111
|
+
$metadata: deserializeMetadata(output),
|
|
2112
|
+
});
|
|
2113
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
2114
|
+
const doc = take(data, {
|
|
2115
|
+
contentSummaries: _json,
|
|
2116
|
+
nextToken: __expectString,
|
|
2117
|
+
});
|
|
2118
|
+
Object.assign(contents, doc);
|
|
2119
|
+
return contents;
|
|
2120
|
+
};
|
|
2121
|
+
const de_SearchContentCommandError = async (output, context) => {
|
|
2122
|
+
const parsedOutput = {
|
|
2123
|
+
...output,
|
|
2124
|
+
body: await parseErrorBody(output.body, context),
|
|
2125
|
+
};
|
|
2126
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2127
|
+
switch (errorCode) {
|
|
2128
|
+
case "AccessDeniedException":
|
|
2129
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
2130
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
2131
|
+
case "ResourceNotFoundException":
|
|
2132
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
2133
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2134
|
+
case "ValidationException":
|
|
2135
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
2136
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
2137
|
+
default:
|
|
2138
|
+
const parsedBody = parsedOutput.body;
|
|
2139
|
+
return throwDefaultError({
|
|
2140
|
+
output,
|
|
2141
|
+
parsedBody,
|
|
2142
|
+
errorCode,
|
|
2143
|
+
});
|
|
2144
|
+
}
|
|
2145
|
+
};
|
|
2146
|
+
export const de_SearchQuickResponsesCommand = async (output, context) => {
|
|
2147
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2148
|
+
return de_SearchQuickResponsesCommandError(output, context);
|
|
2149
|
+
}
|
|
2150
|
+
const contents = map({
|
|
2151
|
+
$metadata: deserializeMetadata(output),
|
|
2152
|
+
});
|
|
2153
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
2154
|
+
const doc = take(data, {
|
|
2155
|
+
nextToken: __expectString,
|
|
2156
|
+
results: (_) => de_QuickResponseSearchResultsList(_, context),
|
|
2157
|
+
});
|
|
2158
|
+
Object.assign(contents, doc);
|
|
2159
|
+
return contents;
|
|
2160
|
+
};
|
|
2161
|
+
const de_SearchQuickResponsesCommandError = async (output, context) => {
|
|
2162
|
+
const parsedOutput = {
|
|
2163
|
+
...output,
|
|
2164
|
+
body: await parseErrorBody(output.body, context),
|
|
2165
|
+
};
|
|
2166
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2167
|
+
switch (errorCode) {
|
|
2168
|
+
case "AccessDeniedException":
|
|
2169
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
2170
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
2171
|
+
case "RequestTimeoutException":
|
|
2172
|
+
case "com.amazonaws.qconnect#RequestTimeoutException":
|
|
2173
|
+
throw await de_RequestTimeoutExceptionRes(parsedOutput, context);
|
|
2174
|
+
case "ResourceNotFoundException":
|
|
2175
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
2176
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2177
|
+
case "ValidationException":
|
|
2178
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
2179
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
2180
|
+
default:
|
|
2181
|
+
const parsedBody = parsedOutput.body;
|
|
2182
|
+
return throwDefaultError({
|
|
2183
|
+
output,
|
|
2184
|
+
parsedBody,
|
|
2185
|
+
errorCode,
|
|
2186
|
+
});
|
|
2187
|
+
}
|
|
2188
|
+
};
|
|
2189
|
+
export const de_SearchSessionsCommand = async (output, context) => {
|
|
2190
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2191
|
+
return de_SearchSessionsCommandError(output, context);
|
|
2192
|
+
}
|
|
2193
|
+
const contents = map({
|
|
2194
|
+
$metadata: deserializeMetadata(output),
|
|
2195
|
+
});
|
|
2196
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
2197
|
+
const doc = take(data, {
|
|
2198
|
+
nextToken: __expectString,
|
|
2199
|
+
sessionSummaries: _json,
|
|
2200
|
+
});
|
|
2201
|
+
Object.assign(contents, doc);
|
|
2202
|
+
return contents;
|
|
2203
|
+
};
|
|
2204
|
+
const de_SearchSessionsCommandError = async (output, context) => {
|
|
2205
|
+
const parsedOutput = {
|
|
2206
|
+
...output,
|
|
2207
|
+
body: await parseErrorBody(output.body, context),
|
|
2208
|
+
};
|
|
2209
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2210
|
+
switch (errorCode) {
|
|
2211
|
+
case "AccessDeniedException":
|
|
2212
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
2213
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
2214
|
+
case "ResourceNotFoundException":
|
|
2215
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
2216
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2217
|
+
case "ValidationException":
|
|
2218
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
2219
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
2220
|
+
default:
|
|
2221
|
+
const parsedBody = parsedOutput.body;
|
|
2222
|
+
return throwDefaultError({
|
|
2223
|
+
output,
|
|
2224
|
+
parsedBody,
|
|
2225
|
+
errorCode,
|
|
2226
|
+
});
|
|
2227
|
+
}
|
|
2228
|
+
};
|
|
2229
|
+
export const de_StartContentUploadCommand = async (output, context) => {
|
|
2230
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2231
|
+
return de_StartContentUploadCommandError(output, context);
|
|
2232
|
+
}
|
|
2233
|
+
const contents = map({
|
|
2234
|
+
$metadata: deserializeMetadata(output),
|
|
2235
|
+
});
|
|
2236
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
2237
|
+
const doc = take(data, {
|
|
2238
|
+
headersToInclude: _json,
|
|
2239
|
+
uploadId: __expectString,
|
|
2240
|
+
url: __expectString,
|
|
2241
|
+
urlExpiry: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
2242
|
+
});
|
|
2243
|
+
Object.assign(contents, doc);
|
|
2244
|
+
return contents;
|
|
2245
|
+
};
|
|
2246
|
+
const de_StartContentUploadCommandError = async (output, context) => {
|
|
2247
|
+
const parsedOutput = {
|
|
2248
|
+
...output,
|
|
2249
|
+
body: await parseErrorBody(output.body, context),
|
|
2250
|
+
};
|
|
2251
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2252
|
+
switch (errorCode) {
|
|
2253
|
+
case "AccessDeniedException":
|
|
2254
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
2255
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
2256
|
+
case "ResourceNotFoundException":
|
|
2257
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
2258
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2259
|
+
case "ValidationException":
|
|
2260
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
2261
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
2262
|
+
default:
|
|
2263
|
+
const parsedBody = parsedOutput.body;
|
|
2264
|
+
return throwDefaultError({
|
|
2265
|
+
output,
|
|
2266
|
+
parsedBody,
|
|
2267
|
+
errorCode,
|
|
2268
|
+
});
|
|
2269
|
+
}
|
|
2270
|
+
};
|
|
2271
|
+
export const de_StartImportJobCommand = async (output, context) => {
|
|
2272
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2273
|
+
return de_StartImportJobCommandError(output, context);
|
|
2274
|
+
}
|
|
2275
|
+
const contents = map({
|
|
2276
|
+
$metadata: deserializeMetadata(output),
|
|
2277
|
+
});
|
|
2278
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
2279
|
+
const doc = take(data, {
|
|
2280
|
+
importJob: (_) => de_ImportJobData(_, context),
|
|
2281
|
+
});
|
|
2282
|
+
Object.assign(contents, doc);
|
|
2283
|
+
return contents;
|
|
2284
|
+
};
|
|
2285
|
+
const de_StartImportJobCommandError = async (output, context) => {
|
|
2286
|
+
const parsedOutput = {
|
|
2287
|
+
...output,
|
|
2288
|
+
body: await parseErrorBody(output.body, context),
|
|
2289
|
+
};
|
|
2290
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2291
|
+
switch (errorCode) {
|
|
2292
|
+
case "AccessDeniedException":
|
|
2293
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
2294
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
2295
|
+
case "ConflictException":
|
|
2296
|
+
case "com.amazonaws.qconnect#ConflictException":
|
|
2297
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
2298
|
+
case "ResourceNotFoundException":
|
|
2299
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
2300
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2301
|
+
case "ServiceQuotaExceededException":
|
|
2302
|
+
case "com.amazonaws.qconnect#ServiceQuotaExceededException":
|
|
2303
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
2304
|
+
case "ValidationException":
|
|
2305
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
2306
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
2307
|
+
default:
|
|
2308
|
+
const parsedBody = parsedOutput.body;
|
|
2309
|
+
return throwDefaultError({
|
|
2310
|
+
output,
|
|
2311
|
+
parsedBody,
|
|
2312
|
+
errorCode,
|
|
2313
|
+
});
|
|
2314
|
+
}
|
|
2315
|
+
};
|
|
2316
|
+
export const de_TagResourceCommand = async (output, context) => {
|
|
2317
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2318
|
+
return de_TagResourceCommandError(output, context);
|
|
2319
|
+
}
|
|
2320
|
+
const contents = map({
|
|
2321
|
+
$metadata: deserializeMetadata(output),
|
|
2322
|
+
});
|
|
2323
|
+
await collectBody(output.body, context);
|
|
2324
|
+
return contents;
|
|
2325
|
+
};
|
|
2326
|
+
const de_TagResourceCommandError = async (output, context) => {
|
|
2327
|
+
const parsedOutput = {
|
|
2328
|
+
...output,
|
|
2329
|
+
body: await parseErrorBody(output.body, context),
|
|
2330
|
+
};
|
|
2331
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2332
|
+
switch (errorCode) {
|
|
2333
|
+
case "ResourceNotFoundException":
|
|
2334
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
2335
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2336
|
+
case "TooManyTagsException":
|
|
2337
|
+
case "com.amazonaws.qconnect#TooManyTagsException":
|
|
2338
|
+
throw await de_TooManyTagsExceptionRes(parsedOutput, context);
|
|
2339
|
+
default:
|
|
2340
|
+
const parsedBody = parsedOutput.body;
|
|
2341
|
+
return throwDefaultError({
|
|
2342
|
+
output,
|
|
2343
|
+
parsedBody,
|
|
2344
|
+
errorCode,
|
|
2345
|
+
});
|
|
2346
|
+
}
|
|
2347
|
+
};
|
|
2348
|
+
export const de_UntagResourceCommand = async (output, context) => {
|
|
2349
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2350
|
+
return de_UntagResourceCommandError(output, context);
|
|
2351
|
+
}
|
|
2352
|
+
const contents = map({
|
|
2353
|
+
$metadata: deserializeMetadata(output),
|
|
2354
|
+
});
|
|
2355
|
+
await collectBody(output.body, context);
|
|
2356
|
+
return contents;
|
|
2357
|
+
};
|
|
2358
|
+
const de_UntagResourceCommandError = async (output, context) => {
|
|
2359
|
+
const parsedOutput = {
|
|
2360
|
+
...output,
|
|
2361
|
+
body: await parseErrorBody(output.body, context),
|
|
2362
|
+
};
|
|
2363
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2364
|
+
switch (errorCode) {
|
|
2365
|
+
case "ResourceNotFoundException":
|
|
2366
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
2367
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2368
|
+
default:
|
|
2369
|
+
const parsedBody = parsedOutput.body;
|
|
2370
|
+
return throwDefaultError({
|
|
2371
|
+
output,
|
|
2372
|
+
parsedBody,
|
|
2373
|
+
errorCode,
|
|
2374
|
+
});
|
|
2375
|
+
}
|
|
2376
|
+
};
|
|
2377
|
+
export const de_UpdateContentCommand = async (output, context) => {
|
|
2378
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2379
|
+
return de_UpdateContentCommandError(output, context);
|
|
2380
|
+
}
|
|
2381
|
+
const contents = map({
|
|
2382
|
+
$metadata: deserializeMetadata(output),
|
|
2383
|
+
});
|
|
2384
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
2385
|
+
const doc = take(data, {
|
|
2386
|
+
content: (_) => de_ContentData(_, context),
|
|
2387
|
+
});
|
|
2388
|
+
Object.assign(contents, doc);
|
|
2389
|
+
return contents;
|
|
2390
|
+
};
|
|
2391
|
+
const de_UpdateContentCommandError = async (output, context) => {
|
|
2392
|
+
const parsedOutput = {
|
|
2393
|
+
...output,
|
|
2394
|
+
body: await parseErrorBody(output.body, context),
|
|
2395
|
+
};
|
|
2396
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2397
|
+
switch (errorCode) {
|
|
2398
|
+
case "AccessDeniedException":
|
|
2399
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
2400
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
2401
|
+
case "PreconditionFailedException":
|
|
2402
|
+
case "com.amazonaws.qconnect#PreconditionFailedException":
|
|
2403
|
+
throw await de_PreconditionFailedExceptionRes(parsedOutput, context);
|
|
2404
|
+
case "ResourceNotFoundException":
|
|
2405
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
2406
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2407
|
+
case "ValidationException":
|
|
2408
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
2409
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
2410
|
+
default:
|
|
2411
|
+
const parsedBody = parsedOutput.body;
|
|
2412
|
+
return throwDefaultError({
|
|
2413
|
+
output,
|
|
2414
|
+
parsedBody,
|
|
2415
|
+
errorCode,
|
|
2416
|
+
});
|
|
2417
|
+
}
|
|
2418
|
+
};
|
|
2419
|
+
export const de_UpdateKnowledgeBaseTemplateUriCommand = async (output, context) => {
|
|
2420
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2421
|
+
return de_UpdateKnowledgeBaseTemplateUriCommandError(output, context);
|
|
2422
|
+
}
|
|
2423
|
+
const contents = map({
|
|
2424
|
+
$metadata: deserializeMetadata(output),
|
|
2425
|
+
});
|
|
2426
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
2427
|
+
const doc = take(data, {
|
|
2428
|
+
knowledgeBase: (_) => de_KnowledgeBaseData(_, context),
|
|
2429
|
+
});
|
|
2430
|
+
Object.assign(contents, doc);
|
|
2431
|
+
return contents;
|
|
2432
|
+
};
|
|
2433
|
+
const de_UpdateKnowledgeBaseTemplateUriCommandError = async (output, context) => {
|
|
2434
|
+
const parsedOutput = {
|
|
2435
|
+
...output,
|
|
2436
|
+
body: await parseErrorBody(output.body, context),
|
|
2437
|
+
};
|
|
2438
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2439
|
+
switch (errorCode) {
|
|
2440
|
+
case "AccessDeniedException":
|
|
2441
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
2442
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
2443
|
+
case "ResourceNotFoundException":
|
|
2444
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
2445
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2446
|
+
case "ValidationException":
|
|
2447
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
2448
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
2449
|
+
default:
|
|
2450
|
+
const parsedBody = parsedOutput.body;
|
|
2451
|
+
return throwDefaultError({
|
|
2452
|
+
output,
|
|
2453
|
+
parsedBody,
|
|
2454
|
+
errorCode,
|
|
2455
|
+
});
|
|
2456
|
+
}
|
|
2457
|
+
};
|
|
2458
|
+
export const de_UpdateQuickResponseCommand = async (output, context) => {
|
|
2459
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2460
|
+
return de_UpdateQuickResponseCommandError(output, context);
|
|
2461
|
+
}
|
|
2462
|
+
const contents = map({
|
|
2463
|
+
$metadata: deserializeMetadata(output),
|
|
2464
|
+
});
|
|
2465
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
2466
|
+
const doc = take(data, {
|
|
2467
|
+
quickResponse: (_) => de_QuickResponseData(_, context),
|
|
2468
|
+
});
|
|
2469
|
+
Object.assign(contents, doc);
|
|
2470
|
+
return contents;
|
|
2471
|
+
};
|
|
2472
|
+
const de_UpdateQuickResponseCommandError = async (output, context) => {
|
|
2473
|
+
const parsedOutput = {
|
|
2474
|
+
...output,
|
|
2475
|
+
body: await parseErrorBody(output.body, context),
|
|
2476
|
+
};
|
|
2477
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2478
|
+
switch (errorCode) {
|
|
2479
|
+
case "AccessDeniedException":
|
|
2480
|
+
case "com.amazonaws.qconnect#AccessDeniedException":
|
|
2481
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
2482
|
+
case "ConflictException":
|
|
2483
|
+
case "com.amazonaws.qconnect#ConflictException":
|
|
2484
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
2485
|
+
case "PreconditionFailedException":
|
|
2486
|
+
case "com.amazonaws.qconnect#PreconditionFailedException":
|
|
2487
|
+
throw await de_PreconditionFailedExceptionRes(parsedOutput, context);
|
|
2488
|
+
case "ResourceNotFoundException":
|
|
2489
|
+
case "com.amazonaws.qconnect#ResourceNotFoundException":
|
|
2490
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
2491
|
+
case "ValidationException":
|
|
2492
|
+
case "com.amazonaws.qconnect#ValidationException":
|
|
2493
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
2494
|
+
default:
|
|
2495
|
+
const parsedBody = parsedOutput.body;
|
|
2496
|
+
return throwDefaultError({
|
|
2497
|
+
output,
|
|
2498
|
+
parsedBody,
|
|
2499
|
+
errorCode,
|
|
2500
|
+
});
|
|
2501
|
+
}
|
|
2502
|
+
};
|
|
2503
|
+
const throwDefaultError = withBaseException(__BaseException);
|
|
2504
|
+
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
2505
|
+
const contents = map({});
|
|
2506
|
+
const data = parsedOutput.body;
|
|
2507
|
+
const doc = take(data, {
|
|
2508
|
+
message: __expectString,
|
|
2509
|
+
});
|
|
2510
|
+
Object.assign(contents, doc);
|
|
2511
|
+
const exception = new AccessDeniedException({
|
|
2512
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2513
|
+
...contents,
|
|
2514
|
+
});
|
|
2515
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
2516
|
+
};
|
|
2517
|
+
const de_ConflictExceptionRes = async (parsedOutput, context) => {
|
|
2518
|
+
const contents = map({});
|
|
2519
|
+
const data = parsedOutput.body;
|
|
2520
|
+
const doc = take(data, {
|
|
2521
|
+
message: __expectString,
|
|
2522
|
+
});
|
|
2523
|
+
Object.assign(contents, doc);
|
|
2524
|
+
const exception = new ConflictException({
|
|
2525
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2526
|
+
...contents,
|
|
2527
|
+
});
|
|
2528
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
2529
|
+
};
|
|
2530
|
+
const de_PreconditionFailedExceptionRes = async (parsedOutput, context) => {
|
|
2531
|
+
const contents = map({});
|
|
2532
|
+
const data = parsedOutput.body;
|
|
2533
|
+
const doc = take(data, {
|
|
2534
|
+
message: __expectString,
|
|
2535
|
+
});
|
|
2536
|
+
Object.assign(contents, doc);
|
|
2537
|
+
const exception = new PreconditionFailedException({
|
|
2538
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2539
|
+
...contents,
|
|
2540
|
+
});
|
|
2541
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
2542
|
+
};
|
|
2543
|
+
const de_RequestTimeoutExceptionRes = async (parsedOutput, context) => {
|
|
2544
|
+
const contents = map({});
|
|
2545
|
+
const data = parsedOutput.body;
|
|
2546
|
+
const doc = take(data, {
|
|
2547
|
+
message: __expectString,
|
|
2548
|
+
});
|
|
2549
|
+
Object.assign(contents, doc);
|
|
2550
|
+
const exception = new RequestTimeoutException({
|
|
2551
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2552
|
+
...contents,
|
|
2553
|
+
});
|
|
2554
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
2555
|
+
};
|
|
2556
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
2557
|
+
const contents = map({});
|
|
2558
|
+
const data = parsedOutput.body;
|
|
2559
|
+
const doc = take(data, {
|
|
2560
|
+
message: __expectString,
|
|
2561
|
+
resourceName: __expectString,
|
|
2562
|
+
});
|
|
2563
|
+
Object.assign(contents, doc);
|
|
2564
|
+
const exception = new ResourceNotFoundException({
|
|
2565
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2566
|
+
...contents,
|
|
2567
|
+
});
|
|
2568
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
2569
|
+
};
|
|
2570
|
+
const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
|
|
2571
|
+
const contents = map({});
|
|
2572
|
+
const data = parsedOutput.body;
|
|
2573
|
+
const doc = take(data, {
|
|
2574
|
+
message: __expectString,
|
|
2575
|
+
});
|
|
2576
|
+
Object.assign(contents, doc);
|
|
2577
|
+
const exception = new ServiceQuotaExceededException({
|
|
2578
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2579
|
+
...contents,
|
|
2580
|
+
});
|
|
2581
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
2582
|
+
};
|
|
2583
|
+
const de_TooManyTagsExceptionRes = async (parsedOutput, context) => {
|
|
2584
|
+
const contents = map({});
|
|
2585
|
+
const data = parsedOutput.body;
|
|
2586
|
+
const doc = take(data, {
|
|
2587
|
+
message: __expectString,
|
|
2588
|
+
resourceName: __expectString,
|
|
2589
|
+
});
|
|
2590
|
+
Object.assign(contents, doc);
|
|
2591
|
+
const exception = new TooManyTagsException({
|
|
2592
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2593
|
+
...contents,
|
|
2594
|
+
});
|
|
2595
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
2596
|
+
};
|
|
2597
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
2598
|
+
const contents = map({});
|
|
2599
|
+
const data = parsedOutput.body;
|
|
2600
|
+
const doc = take(data, {
|
|
2601
|
+
message: __expectString,
|
|
2602
|
+
});
|
|
2603
|
+
Object.assign(contents, doc);
|
|
2604
|
+
const exception = new ValidationException({
|
|
2605
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
2606
|
+
...contents,
|
|
2607
|
+
});
|
|
2608
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
2609
|
+
};
|
|
2610
|
+
const de_ContentData = (output, context) => {
|
|
2611
|
+
return take(output, {
|
|
2612
|
+
contentArn: __expectString,
|
|
2613
|
+
contentId: __expectString,
|
|
2614
|
+
contentType: __expectString,
|
|
2615
|
+
knowledgeBaseArn: __expectString,
|
|
2616
|
+
knowledgeBaseId: __expectString,
|
|
2617
|
+
linkOutUri: __expectString,
|
|
2618
|
+
metadata: _json,
|
|
2619
|
+
name: __expectString,
|
|
2620
|
+
revisionId: __expectString,
|
|
2621
|
+
status: __expectString,
|
|
2622
|
+
tags: _json,
|
|
2623
|
+
title: __expectString,
|
|
2624
|
+
url: __expectString,
|
|
2625
|
+
urlExpiry: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
2626
|
+
});
|
|
2627
|
+
};
|
|
2628
|
+
const de_ContentDataDetails = (output, context) => {
|
|
2629
|
+
return take(output, {
|
|
2630
|
+
rankingData: (_) => de_RankingData(_, context),
|
|
2631
|
+
textData: _json,
|
|
2632
|
+
});
|
|
2633
|
+
};
|
|
2634
|
+
const de_DataDetails = (output, context) => {
|
|
2635
|
+
if (output.contentData != null) {
|
|
2636
|
+
return {
|
|
2637
|
+
contentData: de_ContentDataDetails(output.contentData, context),
|
|
2638
|
+
};
|
|
2639
|
+
}
|
|
2640
|
+
if (output.generativeData != null) {
|
|
2641
|
+
return {
|
|
2642
|
+
generativeData: de_GenerativeDataDetails(output.generativeData, context),
|
|
2643
|
+
};
|
|
2644
|
+
}
|
|
2645
|
+
if (output.sourceContentData != null) {
|
|
2646
|
+
return {
|
|
2647
|
+
sourceContentData: de_SourceContentDataDetails(output.sourceContentData, context),
|
|
2648
|
+
};
|
|
2649
|
+
}
|
|
2650
|
+
return { $unknown: Object.entries(output)[0] };
|
|
2651
|
+
};
|
|
2652
|
+
const de_DataSummary = (output, context) => {
|
|
2653
|
+
return take(output, {
|
|
2654
|
+
details: (_) => de_DataDetails(__expectUnion(_), context),
|
|
2655
|
+
reference: (_) => _json(__expectUnion(_)),
|
|
2656
|
+
});
|
|
2657
|
+
};
|
|
2658
|
+
const de_DataSummaryList = (output, context) => {
|
|
2659
|
+
const retVal = (output || [])
|
|
2660
|
+
.filter((e) => e != null)
|
|
2661
|
+
.map((entry) => {
|
|
2662
|
+
return de_DataSummary(entry, context);
|
|
2663
|
+
});
|
|
2664
|
+
return retVal;
|
|
2665
|
+
};
|
|
2666
|
+
const de_GenerativeDataDetails = (output, context) => {
|
|
2667
|
+
return take(output, {
|
|
2668
|
+
completion: __expectString,
|
|
2669
|
+
rankingData: (_) => de_RankingData(_, context),
|
|
2670
|
+
references: (_) => de_DataSummaryList(_, context),
|
|
2671
|
+
});
|
|
2672
|
+
};
|
|
2673
|
+
const de_ImportJobData = (output, context) => {
|
|
2674
|
+
return take(output, {
|
|
2675
|
+
createdTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
2676
|
+
externalSourceConfiguration: _json,
|
|
2677
|
+
failedRecordReport: __expectString,
|
|
2678
|
+
importJobId: __expectString,
|
|
2679
|
+
importJobType: __expectString,
|
|
2680
|
+
knowledgeBaseArn: __expectString,
|
|
2681
|
+
knowledgeBaseId: __expectString,
|
|
2682
|
+
lastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
2683
|
+
metadata: _json,
|
|
2684
|
+
status: __expectString,
|
|
2685
|
+
uploadId: __expectString,
|
|
2686
|
+
url: __expectString,
|
|
2687
|
+
urlExpiry: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
2688
|
+
});
|
|
2689
|
+
};
|
|
2690
|
+
const de_ImportJobList = (output, context) => {
|
|
2691
|
+
const retVal = (output || [])
|
|
2692
|
+
.filter((e) => e != null)
|
|
2693
|
+
.map((entry) => {
|
|
2694
|
+
return de_ImportJobSummary(entry, context);
|
|
2695
|
+
});
|
|
2696
|
+
return retVal;
|
|
2697
|
+
};
|
|
2698
|
+
const de_ImportJobSummary = (output, context) => {
|
|
2699
|
+
return take(output, {
|
|
2700
|
+
createdTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
2701
|
+
externalSourceConfiguration: _json,
|
|
2702
|
+
importJobId: __expectString,
|
|
2703
|
+
importJobType: __expectString,
|
|
2704
|
+
knowledgeBaseArn: __expectString,
|
|
2705
|
+
knowledgeBaseId: __expectString,
|
|
2706
|
+
lastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
2707
|
+
metadata: _json,
|
|
2708
|
+
status: __expectString,
|
|
2709
|
+
uploadId: __expectString,
|
|
2710
|
+
});
|
|
2711
|
+
};
|
|
2712
|
+
const de_KnowledgeBaseData = (output, context) => {
|
|
2713
|
+
return take(output, {
|
|
2714
|
+
description: __expectString,
|
|
2715
|
+
knowledgeBaseArn: __expectString,
|
|
2716
|
+
knowledgeBaseId: __expectString,
|
|
2717
|
+
knowledgeBaseType: __expectString,
|
|
2718
|
+
lastContentModificationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
2719
|
+
name: __expectString,
|
|
2720
|
+
renderingConfiguration: _json,
|
|
2721
|
+
serverSideEncryptionConfiguration: _json,
|
|
2722
|
+
sourceConfiguration: (_) => _json(__expectUnion(_)),
|
|
2723
|
+
status: __expectString,
|
|
2724
|
+
tags: _json,
|
|
2725
|
+
});
|
|
2726
|
+
};
|
|
2727
|
+
const de_QueryResultsList = (output, context) => {
|
|
2728
|
+
const retVal = (output || [])
|
|
2729
|
+
.filter((e) => e != null)
|
|
2730
|
+
.map((entry) => {
|
|
2731
|
+
return de_ResultData(entry, context);
|
|
2732
|
+
});
|
|
2733
|
+
return retVal;
|
|
2734
|
+
};
|
|
2735
|
+
const de_QuickResponseData = (output, context) => {
|
|
2736
|
+
return take(output, {
|
|
2737
|
+
channels: _json,
|
|
2738
|
+
contentType: __expectString,
|
|
2739
|
+
contents: _json,
|
|
2740
|
+
createdTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
2741
|
+
description: __expectString,
|
|
2742
|
+
groupingConfiguration: _json,
|
|
2743
|
+
isActive: __expectBoolean,
|
|
2744
|
+
knowledgeBaseArn: __expectString,
|
|
2745
|
+
knowledgeBaseId: __expectString,
|
|
2746
|
+
language: __expectString,
|
|
2747
|
+
lastModifiedBy: __expectString,
|
|
2748
|
+
lastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
2749
|
+
name: __expectString,
|
|
2750
|
+
quickResponseArn: __expectString,
|
|
2751
|
+
quickResponseId: __expectString,
|
|
2752
|
+
shortcutKey: __expectString,
|
|
2753
|
+
status: __expectString,
|
|
2754
|
+
tags: _json,
|
|
2755
|
+
});
|
|
2756
|
+
};
|
|
2757
|
+
const de_QuickResponseSearchResultData = (output, context) => {
|
|
2758
|
+
return take(output, {
|
|
2759
|
+
attributesInterpolated: _json,
|
|
2760
|
+
attributesNotInterpolated: _json,
|
|
2761
|
+
channels: _json,
|
|
2762
|
+
contentType: __expectString,
|
|
2763
|
+
contents: _json,
|
|
2764
|
+
createdTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
2765
|
+
description: __expectString,
|
|
2766
|
+
groupingConfiguration: _json,
|
|
2767
|
+
isActive: __expectBoolean,
|
|
2768
|
+
knowledgeBaseArn: __expectString,
|
|
2769
|
+
knowledgeBaseId: __expectString,
|
|
2770
|
+
language: __expectString,
|
|
2771
|
+
lastModifiedBy: __expectString,
|
|
2772
|
+
lastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
2773
|
+
name: __expectString,
|
|
2774
|
+
quickResponseArn: __expectString,
|
|
2775
|
+
quickResponseId: __expectString,
|
|
2776
|
+
shortcutKey: __expectString,
|
|
2777
|
+
status: __expectString,
|
|
2778
|
+
tags: _json,
|
|
2779
|
+
});
|
|
2780
|
+
};
|
|
2781
|
+
const de_QuickResponseSearchResultsList = (output, context) => {
|
|
2782
|
+
const retVal = (output || [])
|
|
2783
|
+
.filter((e) => e != null)
|
|
2784
|
+
.map((entry) => {
|
|
2785
|
+
return de_QuickResponseSearchResultData(entry, context);
|
|
2786
|
+
});
|
|
2787
|
+
return retVal;
|
|
2788
|
+
};
|
|
2789
|
+
const de_QuickResponseSummary = (output, context) => {
|
|
2790
|
+
return take(output, {
|
|
2791
|
+
channels: _json,
|
|
2792
|
+
contentType: __expectString,
|
|
2793
|
+
createdTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
2794
|
+
description: __expectString,
|
|
2795
|
+
isActive: __expectBoolean,
|
|
2796
|
+
knowledgeBaseArn: __expectString,
|
|
2797
|
+
knowledgeBaseId: __expectString,
|
|
2798
|
+
lastModifiedBy: __expectString,
|
|
2799
|
+
lastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
2800
|
+
name: __expectString,
|
|
2801
|
+
quickResponseArn: __expectString,
|
|
2802
|
+
quickResponseId: __expectString,
|
|
2803
|
+
status: __expectString,
|
|
2804
|
+
tags: _json,
|
|
2805
|
+
});
|
|
2806
|
+
};
|
|
2807
|
+
const de_QuickResponseSummaryList = (output, context) => {
|
|
2808
|
+
const retVal = (output || [])
|
|
2809
|
+
.filter((e) => e != null)
|
|
2810
|
+
.map((entry) => {
|
|
2811
|
+
return de_QuickResponseSummary(entry, context);
|
|
2812
|
+
});
|
|
2813
|
+
return retVal;
|
|
2814
|
+
};
|
|
2815
|
+
const de_RankingData = (output, context) => {
|
|
2816
|
+
return take(output, {
|
|
2817
|
+
relevanceLevel: __expectString,
|
|
2818
|
+
relevanceScore: __limitedParseDouble,
|
|
2819
|
+
});
|
|
2820
|
+
};
|
|
2821
|
+
const de_RecommendationData = (output, context) => {
|
|
2822
|
+
return take(output, {
|
|
2823
|
+
data: (_) => de_DataSummary(_, context),
|
|
2824
|
+
document: _json,
|
|
2825
|
+
recommendationId: __expectString,
|
|
2826
|
+
relevanceLevel: __expectString,
|
|
2827
|
+
relevanceScore: __limitedParseDouble,
|
|
2828
|
+
type: __expectString,
|
|
2829
|
+
});
|
|
2830
|
+
};
|
|
2831
|
+
const de_RecommendationList = (output, context) => {
|
|
2832
|
+
const retVal = (output || [])
|
|
2833
|
+
.filter((e) => e != null)
|
|
2834
|
+
.map((entry) => {
|
|
2835
|
+
return de_RecommendationData(entry, context);
|
|
2836
|
+
});
|
|
2837
|
+
return retVal;
|
|
2838
|
+
};
|
|
2839
|
+
const de_ResultData = (output, context) => {
|
|
2840
|
+
return take(output, {
|
|
2841
|
+
data: (_) => de_DataSummary(_, context),
|
|
2842
|
+
document: _json,
|
|
2843
|
+
relevanceScore: __limitedParseDouble,
|
|
2844
|
+
resultId: __expectString,
|
|
2845
|
+
type: __expectString,
|
|
2846
|
+
});
|
|
2847
|
+
};
|
|
2848
|
+
const de_SourceContentDataDetails = (output, context) => {
|
|
2849
|
+
return take(output, {
|
|
2850
|
+
id: __expectString,
|
|
2851
|
+
rankingData: (_) => de_RankingData(_, context),
|
|
2852
|
+
textData: _json,
|
|
2853
|
+
type: __expectString,
|
|
2854
|
+
});
|
|
2855
|
+
};
|
|
2856
|
+
const deserializeMetadata = (output) => ({
|
|
2857
|
+
httpStatusCode: output.statusCode,
|
|
2858
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
2859
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
2860
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
2861
|
+
});
|
|
2862
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
2863
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
2864
|
+
value !== null &&
|
|
2865
|
+
value !== "" &&
|
|
2866
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
2867
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
2868
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
2869
|
+
if (encoded.length) {
|
|
2870
|
+
return JSON.parse(encoded);
|
|
2871
|
+
}
|
|
2872
|
+
return {};
|
|
2873
|
+
});
|
|
2874
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
2875
|
+
const value = await parseBody(errorBody, context);
|
|
2876
|
+
value.message = value.message ?? value.Message;
|
|
2877
|
+
return value;
|
|
2878
|
+
};
|
|
2879
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
2880
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
2881
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
2882
|
+
let cleanValue = rawValue;
|
|
2883
|
+
if (typeof cleanValue === "number") {
|
|
2884
|
+
cleanValue = cleanValue.toString();
|
|
2885
|
+
}
|
|
2886
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
2887
|
+
cleanValue = cleanValue.split(",")[0];
|
|
2888
|
+
}
|
|
2889
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
2890
|
+
cleanValue = cleanValue.split(":")[0];
|
|
2891
|
+
}
|
|
2892
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
2893
|
+
cleanValue = cleanValue.split("#")[1];
|
|
2894
|
+
}
|
|
2895
|
+
return cleanValue;
|
|
2896
|
+
};
|
|
2897
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
2898
|
+
if (headerKey !== undefined) {
|
|
2899
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
2900
|
+
}
|
|
2901
|
+
if (data.code !== undefined) {
|
|
2902
|
+
return sanitizeErrorCode(data.code);
|
|
2903
|
+
}
|
|
2904
|
+
if (data["__type"] !== undefined) {
|
|
2905
|
+
return sanitizeErrorCode(data["__type"]);
|
|
2906
|
+
}
|
|
2907
|
+
};
|