@aws-sdk/client-kendra-ranking 3.247.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 +207 -0
- package/dist-cjs/KendraRanking.js +142 -0
- package/dist-cjs/KendraRankingClient.js +40 -0
- package/dist-cjs/commands/CreateRescoreExecutionPlanCommand.js +45 -0
- package/dist-cjs/commands/DeleteRescoreExecutionPlanCommand.js +45 -0
- package/dist-cjs/commands/DescribeRescoreExecutionPlanCommand.js +45 -0
- package/dist-cjs/commands/ListRescoreExecutionPlansCommand.js +45 -0
- package/dist-cjs/commands/ListTagsForResourceCommand.js +45 -0
- package/dist-cjs/commands/RescoreCommand.js +45 -0
- package/dist-cjs/commands/TagResourceCommand.js +45 -0
- package/dist-cjs/commands/UntagResourceCommand.js +45 -0
- package/dist-cjs/commands/UpdateRescoreExecutionPlanCommand.js +45 -0
- package/dist-cjs/commands/index.js +12 -0
- package/dist-cjs/endpoint/EndpointParameters.js +11 -0
- package/dist-cjs/endpoint/endpointResolver.js +12 -0
- package/dist-cjs/endpoint/ruleset.js +7 -0
- package/dist-cjs/index.js +11 -0
- package/dist-cjs/models/KendraRankingServiceException.js +11 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +208 -0
- package/dist-cjs/pagination/Interfaces.js +2 -0
- package/dist-cjs/pagination/ListRescoreExecutionPlansPaginator.js +36 -0
- package/dist-cjs/pagination/index.js +5 -0
- package/dist-cjs/protocols/Aws_json1_0.js +928 -0
- package/dist-cjs/runtimeConfig.browser.js +42 -0
- package/dist-cjs/runtimeConfig.js +51 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +18 -0
- package/dist-es/KendraRanking.js +138 -0
- package/dist-es/KendraRankingClient.js +36 -0
- package/dist-es/commands/CreateRescoreExecutionPlanCommand.js +41 -0
- package/dist-es/commands/DeleteRescoreExecutionPlanCommand.js +41 -0
- package/dist-es/commands/DescribeRescoreExecutionPlanCommand.js +41 -0
- package/dist-es/commands/ListRescoreExecutionPlansCommand.js +41 -0
- package/dist-es/commands/ListTagsForResourceCommand.js +41 -0
- package/dist-es/commands/RescoreCommand.js +41 -0
- package/dist-es/commands/TagResourceCommand.js +41 -0
- package/dist-es/commands/UntagResourceCommand.js +41 -0
- package/dist-es/commands/UpdateRescoreExecutionPlanCommand.js +41 -0
- package/dist-es/commands/index.js +9 -0
- package/dist-es/endpoint/EndpointParameters.js +7 -0
- package/dist-es/endpoint/endpointResolver.js +8 -0
- package/dist-es/endpoint/ruleset.js +4 -0
- package/dist-es/index.js +6 -0
- package/dist-es/models/KendraRankingServiceException.js +7 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +176 -0
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/ListRescoreExecutionPlansPaginator.js +32 -0
- package/dist-es/pagination/index.js +2 -0
- package/dist-es/protocols/Aws_json1_0.js +907 -0
- package/dist-es/runtimeConfig.browser.js +37 -0
- package/dist-es/runtimeConfig.js +46 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +14 -0
- package/dist-types/KendraRanking.d.ts +104 -0
- package/dist-types/KendraRankingClient.d.ts +152 -0
- package/dist-types/commands/CreateRescoreExecutionPlanCommand.d.ts +46 -0
- package/dist-types/commands/DeleteRescoreExecutionPlanCommand.d.ts +39 -0
- package/dist-types/commands/DescribeRescoreExecutionPlanCommand.d.ts +39 -0
- package/dist-types/commands/ListRescoreExecutionPlansCommand.d.ts +39 -0
- package/dist-types/commands/ListTagsForResourceCommand.d.ts +39 -0
- package/dist-types/commands/RescoreCommand.d.ts +40 -0
- package/dist-types/commands/TagResourceCommand.d.ts +41 -0
- package/dist-types/commands/UntagResourceCommand.d.ts +40 -0
- package/dist-types/commands/UpdateRescoreExecutionPlanCommand.d.ts +42 -0
- package/dist-types/commands/index.d.ts +9 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +17 -0
- package/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/dist-types/endpoint/ruleset.d.ts +2 -0
- package/dist-types/index.d.ts +6 -0
- package/dist-types/models/KendraRankingServiceException.d.ts +10 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +600 -0
- package/dist-types/pagination/Interfaces.d.ts +6 -0
- package/dist-types/pagination/ListRescoreExecutionPlansPaginator.d.ts +4 -0
- package/dist-types/pagination/index.d.ts +2 -0
- package/dist-types/protocols/Aws_json1_0.d.ts +29 -0
- package/dist-types/runtimeConfig.browser.d.ts +42 -0
- package/dist-types/runtimeConfig.d.ts +42 -0
- package/dist-types/runtimeConfig.native.d.ts +41 -0
- package/dist-types/runtimeConfig.shared.d.ts +16 -0
- package/dist-types/ts3.4/KendraRanking.d.ts +157 -0
- package/dist-types/ts3.4/KendraRankingClient.d.ts +166 -0
- package/dist-types/ts3.4/commands/CreateRescoreExecutionPlanCommand.d.ts +41 -0
- package/dist-types/ts3.4/commands/DeleteRescoreExecutionPlanCommand.d.ts +37 -0
- package/dist-types/ts3.4/commands/DescribeRescoreExecutionPlanCommand.d.ts +41 -0
- package/dist-types/ts3.4/commands/ListRescoreExecutionPlansCommand.d.ts +41 -0
- package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/RescoreCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +34 -0
- package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +37 -0
- package/dist-types/ts3.4/commands/UpdateRescoreExecutionPlanCommand.d.ts +37 -0
- package/dist-types/ts3.4/commands/index.d.ts +9 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +32 -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/index.d.ts +6 -0
- package/dist-types/ts3.4/models/KendraRankingServiceException.d.ts +7 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +224 -0
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +7 -0
- package/dist-types/ts3.4/pagination/ListRescoreExecutionPlansPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +2 -0
- package/dist-types/ts3.4/protocols/Aws_json1_0.d.ts +113 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +91 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +91 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +80 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +16 -0
- package/package.json +105 -0
|
@@ -0,0 +1,907 @@
|
|
|
1
|
+
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
|
+
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseFloat32 as __limitedParseFloat32, parseEpochTimestamp as __parseEpochTimestamp, serializeFloat as __serializeFloat, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
3
|
+
import { v4 as generateIdempotencyToken } from "uuid";
|
|
4
|
+
import { KendraRankingServiceException as __BaseException } from "../models/KendraRankingServiceException";
|
|
5
|
+
import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ResourceUnavailableException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
6
|
+
export const serializeAws_json1_0CreateRescoreExecutionPlanCommand = async (input, context) => {
|
|
7
|
+
const headers = {
|
|
8
|
+
"content-type": "application/x-amz-json-1.0",
|
|
9
|
+
"x-amz-target": "AWSKendraRerankingFrontendService.CreateRescoreExecutionPlan",
|
|
10
|
+
};
|
|
11
|
+
let body;
|
|
12
|
+
body = JSON.stringify(serializeAws_json1_0CreateRescoreExecutionPlanRequest(input, context));
|
|
13
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
14
|
+
};
|
|
15
|
+
export const serializeAws_json1_0DeleteRescoreExecutionPlanCommand = async (input, context) => {
|
|
16
|
+
const headers = {
|
|
17
|
+
"content-type": "application/x-amz-json-1.0",
|
|
18
|
+
"x-amz-target": "AWSKendraRerankingFrontendService.DeleteRescoreExecutionPlan",
|
|
19
|
+
};
|
|
20
|
+
let body;
|
|
21
|
+
body = JSON.stringify(serializeAws_json1_0DeleteRescoreExecutionPlanRequest(input, context));
|
|
22
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
23
|
+
};
|
|
24
|
+
export const serializeAws_json1_0DescribeRescoreExecutionPlanCommand = async (input, context) => {
|
|
25
|
+
const headers = {
|
|
26
|
+
"content-type": "application/x-amz-json-1.0",
|
|
27
|
+
"x-amz-target": "AWSKendraRerankingFrontendService.DescribeRescoreExecutionPlan",
|
|
28
|
+
};
|
|
29
|
+
let body;
|
|
30
|
+
body = JSON.stringify(serializeAws_json1_0DescribeRescoreExecutionPlanRequest(input, context));
|
|
31
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
32
|
+
};
|
|
33
|
+
export const serializeAws_json1_0ListRescoreExecutionPlansCommand = async (input, context) => {
|
|
34
|
+
const headers = {
|
|
35
|
+
"content-type": "application/x-amz-json-1.0",
|
|
36
|
+
"x-amz-target": "AWSKendraRerankingFrontendService.ListRescoreExecutionPlans",
|
|
37
|
+
};
|
|
38
|
+
let body;
|
|
39
|
+
body = JSON.stringify(serializeAws_json1_0ListRescoreExecutionPlansRequest(input, context));
|
|
40
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
41
|
+
};
|
|
42
|
+
export const serializeAws_json1_0ListTagsForResourceCommand = async (input, context) => {
|
|
43
|
+
const headers = {
|
|
44
|
+
"content-type": "application/x-amz-json-1.0",
|
|
45
|
+
"x-amz-target": "AWSKendraRerankingFrontendService.ListTagsForResource",
|
|
46
|
+
};
|
|
47
|
+
let body;
|
|
48
|
+
body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context));
|
|
49
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
50
|
+
};
|
|
51
|
+
export const serializeAws_json1_0RescoreCommand = async (input, context) => {
|
|
52
|
+
const headers = {
|
|
53
|
+
"content-type": "application/x-amz-json-1.0",
|
|
54
|
+
"x-amz-target": "AWSKendraRerankingFrontendService.Rescore",
|
|
55
|
+
};
|
|
56
|
+
let body;
|
|
57
|
+
body = JSON.stringify(serializeAws_json1_0RescoreRequest(input, context));
|
|
58
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
59
|
+
};
|
|
60
|
+
export const serializeAws_json1_0TagResourceCommand = async (input, context) => {
|
|
61
|
+
const headers = {
|
|
62
|
+
"content-type": "application/x-amz-json-1.0",
|
|
63
|
+
"x-amz-target": "AWSKendraRerankingFrontendService.TagResource",
|
|
64
|
+
};
|
|
65
|
+
let body;
|
|
66
|
+
body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context));
|
|
67
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
68
|
+
};
|
|
69
|
+
export const serializeAws_json1_0UntagResourceCommand = async (input, context) => {
|
|
70
|
+
const headers = {
|
|
71
|
+
"content-type": "application/x-amz-json-1.0",
|
|
72
|
+
"x-amz-target": "AWSKendraRerankingFrontendService.UntagResource",
|
|
73
|
+
};
|
|
74
|
+
let body;
|
|
75
|
+
body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context));
|
|
76
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
77
|
+
};
|
|
78
|
+
export const serializeAws_json1_0UpdateRescoreExecutionPlanCommand = async (input, context) => {
|
|
79
|
+
const headers = {
|
|
80
|
+
"content-type": "application/x-amz-json-1.0",
|
|
81
|
+
"x-amz-target": "AWSKendraRerankingFrontendService.UpdateRescoreExecutionPlan",
|
|
82
|
+
};
|
|
83
|
+
let body;
|
|
84
|
+
body = JSON.stringify(serializeAws_json1_0UpdateRescoreExecutionPlanRequest(input, context));
|
|
85
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
86
|
+
};
|
|
87
|
+
export const deserializeAws_json1_0CreateRescoreExecutionPlanCommand = async (output, context) => {
|
|
88
|
+
if (output.statusCode >= 300) {
|
|
89
|
+
return deserializeAws_json1_0CreateRescoreExecutionPlanCommandError(output, context);
|
|
90
|
+
}
|
|
91
|
+
const data = await parseBody(output.body, context);
|
|
92
|
+
let contents = {};
|
|
93
|
+
contents = deserializeAws_json1_0CreateRescoreExecutionPlanResponse(data, context);
|
|
94
|
+
const response = {
|
|
95
|
+
$metadata: deserializeMetadata(output),
|
|
96
|
+
...contents,
|
|
97
|
+
};
|
|
98
|
+
return Promise.resolve(response);
|
|
99
|
+
};
|
|
100
|
+
const deserializeAws_json1_0CreateRescoreExecutionPlanCommandError = async (output, context) => {
|
|
101
|
+
const parsedOutput = {
|
|
102
|
+
...output,
|
|
103
|
+
body: await parseErrorBody(output.body, context),
|
|
104
|
+
};
|
|
105
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
106
|
+
switch (errorCode) {
|
|
107
|
+
case "AccessDeniedException":
|
|
108
|
+
case "com.amazonaws.kendraranking#AccessDeniedException":
|
|
109
|
+
throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
|
|
110
|
+
case "ConflictException":
|
|
111
|
+
case "com.amazonaws.kendraranking#ConflictException":
|
|
112
|
+
throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
|
|
113
|
+
case "InternalServerException":
|
|
114
|
+
case "com.amazonaws.kendraranking#InternalServerException":
|
|
115
|
+
throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
|
|
116
|
+
case "ServiceQuotaExceededException":
|
|
117
|
+
case "com.amazonaws.kendraranking#ServiceQuotaExceededException":
|
|
118
|
+
throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
119
|
+
case "ThrottlingException":
|
|
120
|
+
case "com.amazonaws.kendraranking#ThrottlingException":
|
|
121
|
+
throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
|
|
122
|
+
case "ValidationException":
|
|
123
|
+
case "com.amazonaws.kendraranking#ValidationException":
|
|
124
|
+
throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
|
|
125
|
+
default:
|
|
126
|
+
const parsedBody = parsedOutput.body;
|
|
127
|
+
throwDefaultError({
|
|
128
|
+
output,
|
|
129
|
+
parsedBody,
|
|
130
|
+
exceptionCtor: __BaseException,
|
|
131
|
+
errorCode,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
export const deserializeAws_json1_0DeleteRescoreExecutionPlanCommand = async (output, context) => {
|
|
136
|
+
if (output.statusCode >= 300) {
|
|
137
|
+
return deserializeAws_json1_0DeleteRescoreExecutionPlanCommandError(output, context);
|
|
138
|
+
}
|
|
139
|
+
await collectBody(output.body, context);
|
|
140
|
+
const response = {
|
|
141
|
+
$metadata: deserializeMetadata(output),
|
|
142
|
+
};
|
|
143
|
+
return Promise.resolve(response);
|
|
144
|
+
};
|
|
145
|
+
const deserializeAws_json1_0DeleteRescoreExecutionPlanCommandError = async (output, context) => {
|
|
146
|
+
const parsedOutput = {
|
|
147
|
+
...output,
|
|
148
|
+
body: await parseErrorBody(output.body, context),
|
|
149
|
+
};
|
|
150
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
151
|
+
switch (errorCode) {
|
|
152
|
+
case "AccessDeniedException":
|
|
153
|
+
case "com.amazonaws.kendraranking#AccessDeniedException":
|
|
154
|
+
throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
|
|
155
|
+
case "ConflictException":
|
|
156
|
+
case "com.amazonaws.kendraranking#ConflictException":
|
|
157
|
+
throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
|
|
158
|
+
case "InternalServerException":
|
|
159
|
+
case "com.amazonaws.kendraranking#InternalServerException":
|
|
160
|
+
throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
|
|
161
|
+
case "ResourceNotFoundException":
|
|
162
|
+
case "com.amazonaws.kendraranking#ResourceNotFoundException":
|
|
163
|
+
throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
164
|
+
case "ThrottlingException":
|
|
165
|
+
case "com.amazonaws.kendraranking#ThrottlingException":
|
|
166
|
+
throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
|
|
167
|
+
case "ValidationException":
|
|
168
|
+
case "com.amazonaws.kendraranking#ValidationException":
|
|
169
|
+
throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
|
|
170
|
+
default:
|
|
171
|
+
const parsedBody = parsedOutput.body;
|
|
172
|
+
throwDefaultError({
|
|
173
|
+
output,
|
|
174
|
+
parsedBody,
|
|
175
|
+
exceptionCtor: __BaseException,
|
|
176
|
+
errorCode,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
export const deserializeAws_json1_0DescribeRescoreExecutionPlanCommand = async (output, context) => {
|
|
181
|
+
if (output.statusCode >= 300) {
|
|
182
|
+
return deserializeAws_json1_0DescribeRescoreExecutionPlanCommandError(output, context);
|
|
183
|
+
}
|
|
184
|
+
const data = await parseBody(output.body, context);
|
|
185
|
+
let contents = {};
|
|
186
|
+
contents = deserializeAws_json1_0DescribeRescoreExecutionPlanResponse(data, context);
|
|
187
|
+
const response = {
|
|
188
|
+
$metadata: deserializeMetadata(output),
|
|
189
|
+
...contents,
|
|
190
|
+
};
|
|
191
|
+
return Promise.resolve(response);
|
|
192
|
+
};
|
|
193
|
+
const deserializeAws_json1_0DescribeRescoreExecutionPlanCommandError = async (output, context) => {
|
|
194
|
+
const parsedOutput = {
|
|
195
|
+
...output,
|
|
196
|
+
body: await parseErrorBody(output.body, context),
|
|
197
|
+
};
|
|
198
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
199
|
+
switch (errorCode) {
|
|
200
|
+
case "AccessDeniedException":
|
|
201
|
+
case "com.amazonaws.kendraranking#AccessDeniedException":
|
|
202
|
+
throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
|
|
203
|
+
case "InternalServerException":
|
|
204
|
+
case "com.amazonaws.kendraranking#InternalServerException":
|
|
205
|
+
throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
|
|
206
|
+
case "ResourceNotFoundException":
|
|
207
|
+
case "com.amazonaws.kendraranking#ResourceNotFoundException":
|
|
208
|
+
throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
209
|
+
case "ThrottlingException":
|
|
210
|
+
case "com.amazonaws.kendraranking#ThrottlingException":
|
|
211
|
+
throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
|
|
212
|
+
case "ValidationException":
|
|
213
|
+
case "com.amazonaws.kendraranking#ValidationException":
|
|
214
|
+
throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
|
|
215
|
+
default:
|
|
216
|
+
const parsedBody = parsedOutput.body;
|
|
217
|
+
throwDefaultError({
|
|
218
|
+
output,
|
|
219
|
+
parsedBody,
|
|
220
|
+
exceptionCtor: __BaseException,
|
|
221
|
+
errorCode,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
export const deserializeAws_json1_0ListRescoreExecutionPlansCommand = async (output, context) => {
|
|
226
|
+
if (output.statusCode >= 300) {
|
|
227
|
+
return deserializeAws_json1_0ListRescoreExecutionPlansCommandError(output, context);
|
|
228
|
+
}
|
|
229
|
+
const data = await parseBody(output.body, context);
|
|
230
|
+
let contents = {};
|
|
231
|
+
contents = deserializeAws_json1_0ListRescoreExecutionPlansResponse(data, context);
|
|
232
|
+
const response = {
|
|
233
|
+
$metadata: deserializeMetadata(output),
|
|
234
|
+
...contents,
|
|
235
|
+
};
|
|
236
|
+
return Promise.resolve(response);
|
|
237
|
+
};
|
|
238
|
+
const deserializeAws_json1_0ListRescoreExecutionPlansCommandError = async (output, context) => {
|
|
239
|
+
const parsedOutput = {
|
|
240
|
+
...output,
|
|
241
|
+
body: await parseErrorBody(output.body, context),
|
|
242
|
+
};
|
|
243
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
244
|
+
switch (errorCode) {
|
|
245
|
+
case "AccessDeniedException":
|
|
246
|
+
case "com.amazonaws.kendraranking#AccessDeniedException":
|
|
247
|
+
throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
|
|
248
|
+
case "InternalServerException":
|
|
249
|
+
case "com.amazonaws.kendraranking#InternalServerException":
|
|
250
|
+
throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
|
|
251
|
+
case "ThrottlingException":
|
|
252
|
+
case "com.amazonaws.kendraranking#ThrottlingException":
|
|
253
|
+
throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
|
|
254
|
+
case "ValidationException":
|
|
255
|
+
case "com.amazonaws.kendraranking#ValidationException":
|
|
256
|
+
throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
|
|
257
|
+
default:
|
|
258
|
+
const parsedBody = parsedOutput.body;
|
|
259
|
+
throwDefaultError({
|
|
260
|
+
output,
|
|
261
|
+
parsedBody,
|
|
262
|
+
exceptionCtor: __BaseException,
|
|
263
|
+
errorCode,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
export const deserializeAws_json1_0ListTagsForResourceCommand = async (output, context) => {
|
|
268
|
+
if (output.statusCode >= 300) {
|
|
269
|
+
return deserializeAws_json1_0ListTagsForResourceCommandError(output, context);
|
|
270
|
+
}
|
|
271
|
+
const data = await parseBody(output.body, context);
|
|
272
|
+
let contents = {};
|
|
273
|
+
contents = deserializeAws_json1_0ListTagsForResourceResponse(data, context);
|
|
274
|
+
const response = {
|
|
275
|
+
$metadata: deserializeMetadata(output),
|
|
276
|
+
...contents,
|
|
277
|
+
};
|
|
278
|
+
return Promise.resolve(response);
|
|
279
|
+
};
|
|
280
|
+
const deserializeAws_json1_0ListTagsForResourceCommandError = async (output, context) => {
|
|
281
|
+
const parsedOutput = {
|
|
282
|
+
...output,
|
|
283
|
+
body: await parseErrorBody(output.body, context),
|
|
284
|
+
};
|
|
285
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
286
|
+
switch (errorCode) {
|
|
287
|
+
case "AccessDeniedException":
|
|
288
|
+
case "com.amazonaws.kendraranking#AccessDeniedException":
|
|
289
|
+
throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
|
|
290
|
+
case "InternalServerException":
|
|
291
|
+
case "com.amazonaws.kendraranking#InternalServerException":
|
|
292
|
+
throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
|
|
293
|
+
case "ResourceUnavailableException":
|
|
294
|
+
case "com.amazonaws.kendraranking#ResourceUnavailableException":
|
|
295
|
+
throw await deserializeAws_json1_0ResourceUnavailableExceptionResponse(parsedOutput, context);
|
|
296
|
+
case "ThrottlingException":
|
|
297
|
+
case "com.amazonaws.kendraranking#ThrottlingException":
|
|
298
|
+
throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
|
|
299
|
+
case "ValidationException":
|
|
300
|
+
case "com.amazonaws.kendraranking#ValidationException":
|
|
301
|
+
throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
|
|
302
|
+
default:
|
|
303
|
+
const parsedBody = parsedOutput.body;
|
|
304
|
+
throwDefaultError({
|
|
305
|
+
output,
|
|
306
|
+
parsedBody,
|
|
307
|
+
exceptionCtor: __BaseException,
|
|
308
|
+
errorCode,
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
export const deserializeAws_json1_0RescoreCommand = async (output, context) => {
|
|
313
|
+
if (output.statusCode >= 300) {
|
|
314
|
+
return deserializeAws_json1_0RescoreCommandError(output, context);
|
|
315
|
+
}
|
|
316
|
+
const data = await parseBody(output.body, context);
|
|
317
|
+
let contents = {};
|
|
318
|
+
contents = deserializeAws_json1_0RescoreResult(data, context);
|
|
319
|
+
const response = {
|
|
320
|
+
$metadata: deserializeMetadata(output),
|
|
321
|
+
...contents,
|
|
322
|
+
};
|
|
323
|
+
return Promise.resolve(response);
|
|
324
|
+
};
|
|
325
|
+
const deserializeAws_json1_0RescoreCommandError = async (output, context) => {
|
|
326
|
+
const parsedOutput = {
|
|
327
|
+
...output,
|
|
328
|
+
body: await parseErrorBody(output.body, context),
|
|
329
|
+
};
|
|
330
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
331
|
+
switch (errorCode) {
|
|
332
|
+
case "AccessDeniedException":
|
|
333
|
+
case "com.amazonaws.kendraranking#AccessDeniedException":
|
|
334
|
+
throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
|
|
335
|
+
case "ConflictException":
|
|
336
|
+
case "com.amazonaws.kendraranking#ConflictException":
|
|
337
|
+
throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
|
|
338
|
+
case "InternalServerException":
|
|
339
|
+
case "com.amazonaws.kendraranking#InternalServerException":
|
|
340
|
+
throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
|
|
341
|
+
case "ResourceNotFoundException":
|
|
342
|
+
case "com.amazonaws.kendraranking#ResourceNotFoundException":
|
|
343
|
+
throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
344
|
+
case "ThrottlingException":
|
|
345
|
+
case "com.amazonaws.kendraranking#ThrottlingException":
|
|
346
|
+
throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
|
|
347
|
+
case "ValidationException":
|
|
348
|
+
case "com.amazonaws.kendraranking#ValidationException":
|
|
349
|
+
throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
|
|
350
|
+
default:
|
|
351
|
+
const parsedBody = parsedOutput.body;
|
|
352
|
+
throwDefaultError({
|
|
353
|
+
output,
|
|
354
|
+
parsedBody,
|
|
355
|
+
exceptionCtor: __BaseException,
|
|
356
|
+
errorCode,
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
export const deserializeAws_json1_0TagResourceCommand = async (output, context) => {
|
|
361
|
+
if (output.statusCode >= 300) {
|
|
362
|
+
return deserializeAws_json1_0TagResourceCommandError(output, context);
|
|
363
|
+
}
|
|
364
|
+
const data = await parseBody(output.body, context);
|
|
365
|
+
let contents = {};
|
|
366
|
+
contents = deserializeAws_json1_0TagResourceResponse(data, context);
|
|
367
|
+
const response = {
|
|
368
|
+
$metadata: deserializeMetadata(output),
|
|
369
|
+
...contents,
|
|
370
|
+
};
|
|
371
|
+
return Promise.resolve(response);
|
|
372
|
+
};
|
|
373
|
+
const deserializeAws_json1_0TagResourceCommandError = async (output, context) => {
|
|
374
|
+
const parsedOutput = {
|
|
375
|
+
...output,
|
|
376
|
+
body: await parseErrorBody(output.body, context),
|
|
377
|
+
};
|
|
378
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
379
|
+
switch (errorCode) {
|
|
380
|
+
case "AccessDeniedException":
|
|
381
|
+
case "com.amazonaws.kendraranking#AccessDeniedException":
|
|
382
|
+
throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
|
|
383
|
+
case "InternalServerException":
|
|
384
|
+
case "com.amazonaws.kendraranking#InternalServerException":
|
|
385
|
+
throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
|
|
386
|
+
case "ResourceUnavailableException":
|
|
387
|
+
case "com.amazonaws.kendraranking#ResourceUnavailableException":
|
|
388
|
+
throw await deserializeAws_json1_0ResourceUnavailableExceptionResponse(parsedOutput, context);
|
|
389
|
+
case "ThrottlingException":
|
|
390
|
+
case "com.amazonaws.kendraranking#ThrottlingException":
|
|
391
|
+
throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
|
|
392
|
+
case "ValidationException":
|
|
393
|
+
case "com.amazonaws.kendraranking#ValidationException":
|
|
394
|
+
throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
|
|
395
|
+
default:
|
|
396
|
+
const parsedBody = parsedOutput.body;
|
|
397
|
+
throwDefaultError({
|
|
398
|
+
output,
|
|
399
|
+
parsedBody,
|
|
400
|
+
exceptionCtor: __BaseException,
|
|
401
|
+
errorCode,
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
export const deserializeAws_json1_0UntagResourceCommand = async (output, context) => {
|
|
406
|
+
if (output.statusCode >= 300) {
|
|
407
|
+
return deserializeAws_json1_0UntagResourceCommandError(output, context);
|
|
408
|
+
}
|
|
409
|
+
const data = await parseBody(output.body, context);
|
|
410
|
+
let contents = {};
|
|
411
|
+
contents = deserializeAws_json1_0UntagResourceResponse(data, context);
|
|
412
|
+
const response = {
|
|
413
|
+
$metadata: deserializeMetadata(output),
|
|
414
|
+
...contents,
|
|
415
|
+
};
|
|
416
|
+
return Promise.resolve(response);
|
|
417
|
+
};
|
|
418
|
+
const deserializeAws_json1_0UntagResourceCommandError = async (output, context) => {
|
|
419
|
+
const parsedOutput = {
|
|
420
|
+
...output,
|
|
421
|
+
body: await parseErrorBody(output.body, context),
|
|
422
|
+
};
|
|
423
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
424
|
+
switch (errorCode) {
|
|
425
|
+
case "AccessDeniedException":
|
|
426
|
+
case "com.amazonaws.kendraranking#AccessDeniedException":
|
|
427
|
+
throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
|
|
428
|
+
case "InternalServerException":
|
|
429
|
+
case "com.amazonaws.kendraranking#InternalServerException":
|
|
430
|
+
throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
|
|
431
|
+
case "ResourceUnavailableException":
|
|
432
|
+
case "com.amazonaws.kendraranking#ResourceUnavailableException":
|
|
433
|
+
throw await deserializeAws_json1_0ResourceUnavailableExceptionResponse(parsedOutput, context);
|
|
434
|
+
case "ThrottlingException":
|
|
435
|
+
case "com.amazonaws.kendraranking#ThrottlingException":
|
|
436
|
+
throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
|
|
437
|
+
case "ValidationException":
|
|
438
|
+
case "com.amazonaws.kendraranking#ValidationException":
|
|
439
|
+
throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
|
|
440
|
+
default:
|
|
441
|
+
const parsedBody = parsedOutput.body;
|
|
442
|
+
throwDefaultError({
|
|
443
|
+
output,
|
|
444
|
+
parsedBody,
|
|
445
|
+
exceptionCtor: __BaseException,
|
|
446
|
+
errorCode,
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
export const deserializeAws_json1_0UpdateRescoreExecutionPlanCommand = async (output, context) => {
|
|
451
|
+
if (output.statusCode >= 300) {
|
|
452
|
+
return deserializeAws_json1_0UpdateRescoreExecutionPlanCommandError(output, context);
|
|
453
|
+
}
|
|
454
|
+
await collectBody(output.body, context);
|
|
455
|
+
const response = {
|
|
456
|
+
$metadata: deserializeMetadata(output),
|
|
457
|
+
};
|
|
458
|
+
return Promise.resolve(response);
|
|
459
|
+
};
|
|
460
|
+
const deserializeAws_json1_0UpdateRescoreExecutionPlanCommandError = async (output, context) => {
|
|
461
|
+
const parsedOutput = {
|
|
462
|
+
...output,
|
|
463
|
+
body: await parseErrorBody(output.body, context),
|
|
464
|
+
};
|
|
465
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
466
|
+
switch (errorCode) {
|
|
467
|
+
case "AccessDeniedException":
|
|
468
|
+
case "com.amazonaws.kendraranking#AccessDeniedException":
|
|
469
|
+
throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
|
|
470
|
+
case "ConflictException":
|
|
471
|
+
case "com.amazonaws.kendraranking#ConflictException":
|
|
472
|
+
throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
|
|
473
|
+
case "InternalServerException":
|
|
474
|
+
case "com.amazonaws.kendraranking#InternalServerException":
|
|
475
|
+
throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
|
|
476
|
+
case "ResourceNotFoundException":
|
|
477
|
+
case "com.amazonaws.kendraranking#ResourceNotFoundException":
|
|
478
|
+
throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
479
|
+
case "ServiceQuotaExceededException":
|
|
480
|
+
case "com.amazonaws.kendraranking#ServiceQuotaExceededException":
|
|
481
|
+
throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
482
|
+
case "ThrottlingException":
|
|
483
|
+
case "com.amazonaws.kendraranking#ThrottlingException":
|
|
484
|
+
throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
|
|
485
|
+
case "ValidationException":
|
|
486
|
+
case "com.amazonaws.kendraranking#ValidationException":
|
|
487
|
+
throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
|
|
488
|
+
default:
|
|
489
|
+
const parsedBody = parsedOutput.body;
|
|
490
|
+
throwDefaultError({
|
|
491
|
+
output,
|
|
492
|
+
parsedBody,
|
|
493
|
+
exceptionCtor: __BaseException,
|
|
494
|
+
errorCode,
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
const deserializeAws_json1_0AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
499
|
+
const body = parsedOutput.body;
|
|
500
|
+
const deserialized = deserializeAws_json1_0AccessDeniedException(body, context);
|
|
501
|
+
const exception = new AccessDeniedException({
|
|
502
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
503
|
+
...deserialized,
|
|
504
|
+
});
|
|
505
|
+
return __decorateServiceException(exception, body);
|
|
506
|
+
};
|
|
507
|
+
const deserializeAws_json1_0ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
508
|
+
const body = parsedOutput.body;
|
|
509
|
+
const deserialized = deserializeAws_json1_0ConflictException(body, context);
|
|
510
|
+
const exception = new ConflictException({
|
|
511
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
512
|
+
...deserialized,
|
|
513
|
+
});
|
|
514
|
+
return __decorateServiceException(exception, body);
|
|
515
|
+
};
|
|
516
|
+
const deserializeAws_json1_0InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
517
|
+
const body = parsedOutput.body;
|
|
518
|
+
const deserialized = deserializeAws_json1_0InternalServerException(body, context);
|
|
519
|
+
const exception = new InternalServerException({
|
|
520
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
521
|
+
...deserialized,
|
|
522
|
+
});
|
|
523
|
+
return __decorateServiceException(exception, body);
|
|
524
|
+
};
|
|
525
|
+
const deserializeAws_json1_0ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
526
|
+
const body = parsedOutput.body;
|
|
527
|
+
const deserialized = deserializeAws_json1_0ResourceNotFoundException(body, context);
|
|
528
|
+
const exception = new ResourceNotFoundException({
|
|
529
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
530
|
+
...deserialized,
|
|
531
|
+
});
|
|
532
|
+
return __decorateServiceException(exception, body);
|
|
533
|
+
};
|
|
534
|
+
const deserializeAws_json1_0ResourceUnavailableExceptionResponse = async (parsedOutput, context) => {
|
|
535
|
+
const body = parsedOutput.body;
|
|
536
|
+
const deserialized = deserializeAws_json1_0ResourceUnavailableException(body, context);
|
|
537
|
+
const exception = new ResourceUnavailableException({
|
|
538
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
539
|
+
...deserialized,
|
|
540
|
+
});
|
|
541
|
+
return __decorateServiceException(exception, body);
|
|
542
|
+
};
|
|
543
|
+
const deserializeAws_json1_0ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
|
|
544
|
+
const body = parsedOutput.body;
|
|
545
|
+
const deserialized = deserializeAws_json1_0ServiceQuotaExceededException(body, context);
|
|
546
|
+
const exception = new ServiceQuotaExceededException({
|
|
547
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
548
|
+
...deserialized,
|
|
549
|
+
});
|
|
550
|
+
return __decorateServiceException(exception, body);
|
|
551
|
+
};
|
|
552
|
+
const deserializeAws_json1_0ThrottlingExceptionResponse = async (parsedOutput, context) => {
|
|
553
|
+
const body = parsedOutput.body;
|
|
554
|
+
const deserialized = deserializeAws_json1_0ThrottlingException(body, context);
|
|
555
|
+
const exception = new ThrottlingException({
|
|
556
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
557
|
+
...deserialized,
|
|
558
|
+
});
|
|
559
|
+
return __decorateServiceException(exception, body);
|
|
560
|
+
};
|
|
561
|
+
const deserializeAws_json1_0ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
562
|
+
const body = parsedOutput.body;
|
|
563
|
+
const deserialized = deserializeAws_json1_0ValidationException(body, context);
|
|
564
|
+
const exception = new ValidationException({
|
|
565
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
566
|
+
...deserialized,
|
|
567
|
+
});
|
|
568
|
+
return __decorateServiceException(exception, body);
|
|
569
|
+
};
|
|
570
|
+
const serializeAws_json1_0BodyTokensList = (input, context) => {
|
|
571
|
+
return input
|
|
572
|
+
.filter((e) => e != null)
|
|
573
|
+
.map((entry) => {
|
|
574
|
+
return entry;
|
|
575
|
+
});
|
|
576
|
+
};
|
|
577
|
+
const serializeAws_json1_0CapacityUnitsConfiguration = (input, context) => {
|
|
578
|
+
return {
|
|
579
|
+
...(input.RescoreCapacityUnits != null && { RescoreCapacityUnits: input.RescoreCapacityUnits }),
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
const serializeAws_json1_0CreateRescoreExecutionPlanRequest = (input, context) => {
|
|
583
|
+
return {
|
|
584
|
+
...(input.CapacityUnits != null && {
|
|
585
|
+
CapacityUnits: serializeAws_json1_0CapacityUnitsConfiguration(input.CapacityUnits, context),
|
|
586
|
+
}),
|
|
587
|
+
ClientToken: input.ClientToken ?? generateIdempotencyToken(),
|
|
588
|
+
...(input.Description != null && { Description: input.Description }),
|
|
589
|
+
...(input.Name != null && { Name: input.Name }),
|
|
590
|
+
...(input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }),
|
|
591
|
+
};
|
|
592
|
+
};
|
|
593
|
+
const serializeAws_json1_0DeleteRescoreExecutionPlanRequest = (input, context) => {
|
|
594
|
+
return {
|
|
595
|
+
...(input.Id != null && { Id: input.Id }),
|
|
596
|
+
};
|
|
597
|
+
};
|
|
598
|
+
const serializeAws_json1_0DescribeRescoreExecutionPlanRequest = (input, context) => {
|
|
599
|
+
return {
|
|
600
|
+
...(input.Id != null && { Id: input.Id }),
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
const serializeAws_json1_0Document = (input, context) => {
|
|
604
|
+
return {
|
|
605
|
+
...(input.Body != null && { Body: input.Body }),
|
|
606
|
+
...(input.GroupId != null && { GroupId: input.GroupId }),
|
|
607
|
+
...(input.Id != null && { Id: input.Id }),
|
|
608
|
+
...(input.OriginalScore != null && { OriginalScore: __serializeFloat(input.OriginalScore) }),
|
|
609
|
+
...(input.Title != null && { Title: input.Title }),
|
|
610
|
+
...(input.TokenizedBody != null && {
|
|
611
|
+
TokenizedBody: serializeAws_json1_0BodyTokensList(input.TokenizedBody, context),
|
|
612
|
+
}),
|
|
613
|
+
...(input.TokenizedTitle != null && {
|
|
614
|
+
TokenizedTitle: serializeAws_json1_0TitleTokensList(input.TokenizedTitle, context),
|
|
615
|
+
}),
|
|
616
|
+
};
|
|
617
|
+
};
|
|
618
|
+
const serializeAws_json1_0DocumentList = (input, context) => {
|
|
619
|
+
return input
|
|
620
|
+
.filter((e) => e != null)
|
|
621
|
+
.map((entry) => {
|
|
622
|
+
return serializeAws_json1_0Document(entry, context);
|
|
623
|
+
});
|
|
624
|
+
};
|
|
625
|
+
const serializeAws_json1_0ListRescoreExecutionPlansRequest = (input, context) => {
|
|
626
|
+
return {
|
|
627
|
+
...(input.MaxResults != null && { MaxResults: input.MaxResults }),
|
|
628
|
+
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
629
|
+
};
|
|
630
|
+
};
|
|
631
|
+
const serializeAws_json1_0ListTagsForResourceRequest = (input, context) => {
|
|
632
|
+
return {
|
|
633
|
+
...(input.ResourceARN != null && { ResourceARN: input.ResourceARN }),
|
|
634
|
+
};
|
|
635
|
+
};
|
|
636
|
+
const serializeAws_json1_0RescoreRequest = (input, context) => {
|
|
637
|
+
return {
|
|
638
|
+
...(input.Documents != null && { Documents: serializeAws_json1_0DocumentList(input.Documents, context) }),
|
|
639
|
+
...(input.RescoreExecutionPlanId != null && { RescoreExecutionPlanId: input.RescoreExecutionPlanId }),
|
|
640
|
+
...(input.SearchQuery != null && { SearchQuery: input.SearchQuery }),
|
|
641
|
+
};
|
|
642
|
+
};
|
|
643
|
+
const serializeAws_json1_0Tag = (input, context) => {
|
|
644
|
+
return {
|
|
645
|
+
...(input.Key != null && { Key: input.Key }),
|
|
646
|
+
...(input.Value != null && { Value: input.Value }),
|
|
647
|
+
};
|
|
648
|
+
};
|
|
649
|
+
const serializeAws_json1_0TagKeyList = (input, context) => {
|
|
650
|
+
return input
|
|
651
|
+
.filter((e) => e != null)
|
|
652
|
+
.map((entry) => {
|
|
653
|
+
return entry;
|
|
654
|
+
});
|
|
655
|
+
};
|
|
656
|
+
const serializeAws_json1_0TagList = (input, context) => {
|
|
657
|
+
return input
|
|
658
|
+
.filter((e) => e != null)
|
|
659
|
+
.map((entry) => {
|
|
660
|
+
return serializeAws_json1_0Tag(entry, context);
|
|
661
|
+
});
|
|
662
|
+
};
|
|
663
|
+
const serializeAws_json1_0TagResourceRequest = (input, context) => {
|
|
664
|
+
return {
|
|
665
|
+
...(input.ResourceARN != null && { ResourceARN: input.ResourceARN }),
|
|
666
|
+
...(input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }),
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
const serializeAws_json1_0TitleTokensList = (input, context) => {
|
|
670
|
+
return input
|
|
671
|
+
.filter((e) => e != null)
|
|
672
|
+
.map((entry) => {
|
|
673
|
+
return entry;
|
|
674
|
+
});
|
|
675
|
+
};
|
|
676
|
+
const serializeAws_json1_0UntagResourceRequest = (input, context) => {
|
|
677
|
+
return {
|
|
678
|
+
...(input.ResourceARN != null && { ResourceARN: input.ResourceARN }),
|
|
679
|
+
...(input.TagKeys != null && { TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) }),
|
|
680
|
+
};
|
|
681
|
+
};
|
|
682
|
+
const serializeAws_json1_0UpdateRescoreExecutionPlanRequest = (input, context) => {
|
|
683
|
+
return {
|
|
684
|
+
...(input.CapacityUnits != null && {
|
|
685
|
+
CapacityUnits: serializeAws_json1_0CapacityUnitsConfiguration(input.CapacityUnits, context),
|
|
686
|
+
}),
|
|
687
|
+
...(input.Description != null && { Description: input.Description }),
|
|
688
|
+
...(input.Id != null && { Id: input.Id }),
|
|
689
|
+
...(input.Name != null && { Name: input.Name }),
|
|
690
|
+
};
|
|
691
|
+
};
|
|
692
|
+
const deserializeAws_json1_0AccessDeniedException = (output, context) => {
|
|
693
|
+
return {
|
|
694
|
+
Message: __expectString(output.Message),
|
|
695
|
+
};
|
|
696
|
+
};
|
|
697
|
+
const deserializeAws_json1_0CapacityUnitsConfiguration = (output, context) => {
|
|
698
|
+
return {
|
|
699
|
+
RescoreCapacityUnits: __expectInt32(output.RescoreCapacityUnits),
|
|
700
|
+
};
|
|
701
|
+
};
|
|
702
|
+
const deserializeAws_json1_0ConflictException = (output, context) => {
|
|
703
|
+
return {
|
|
704
|
+
Message: __expectString(output.Message),
|
|
705
|
+
};
|
|
706
|
+
};
|
|
707
|
+
const deserializeAws_json1_0CreateRescoreExecutionPlanResponse = (output, context) => {
|
|
708
|
+
return {
|
|
709
|
+
Arn: __expectString(output.Arn),
|
|
710
|
+
Id: __expectString(output.Id),
|
|
711
|
+
};
|
|
712
|
+
};
|
|
713
|
+
const deserializeAws_json1_0DescribeRescoreExecutionPlanResponse = (output, context) => {
|
|
714
|
+
return {
|
|
715
|
+
Arn: __expectString(output.Arn),
|
|
716
|
+
CapacityUnits: output.CapacityUnits != null
|
|
717
|
+
? deserializeAws_json1_0CapacityUnitsConfiguration(output.CapacityUnits, context)
|
|
718
|
+
: undefined,
|
|
719
|
+
CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
|
|
720
|
+
Description: __expectString(output.Description),
|
|
721
|
+
ErrorMessage: __expectString(output.ErrorMessage),
|
|
722
|
+
Id: __expectString(output.Id),
|
|
723
|
+
Name: __expectString(output.Name),
|
|
724
|
+
Status: __expectString(output.Status),
|
|
725
|
+
UpdatedAt: output.UpdatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.UpdatedAt))) : undefined,
|
|
726
|
+
};
|
|
727
|
+
};
|
|
728
|
+
const deserializeAws_json1_0InternalServerException = (output, context) => {
|
|
729
|
+
return {
|
|
730
|
+
Message: __expectString(output.Message),
|
|
731
|
+
};
|
|
732
|
+
};
|
|
733
|
+
const deserializeAws_json1_0ListRescoreExecutionPlansResponse = (output, context) => {
|
|
734
|
+
return {
|
|
735
|
+
NextToken: __expectString(output.NextToken),
|
|
736
|
+
SummaryItems: output.SummaryItems != null
|
|
737
|
+
? deserializeAws_json1_0RescoreExecutionPlanSummaryList(output.SummaryItems, context)
|
|
738
|
+
: undefined,
|
|
739
|
+
};
|
|
740
|
+
};
|
|
741
|
+
const deserializeAws_json1_0ListTagsForResourceResponse = (output, context) => {
|
|
742
|
+
return {
|
|
743
|
+
Tags: output.Tags != null ? deserializeAws_json1_0TagList(output.Tags, context) : undefined,
|
|
744
|
+
};
|
|
745
|
+
};
|
|
746
|
+
const deserializeAws_json1_0RescoreExecutionPlanSummary = (output, context) => {
|
|
747
|
+
return {
|
|
748
|
+
CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
|
|
749
|
+
Id: __expectString(output.Id),
|
|
750
|
+
Name: __expectString(output.Name),
|
|
751
|
+
Status: __expectString(output.Status),
|
|
752
|
+
UpdatedAt: output.UpdatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.UpdatedAt))) : undefined,
|
|
753
|
+
};
|
|
754
|
+
};
|
|
755
|
+
const deserializeAws_json1_0RescoreExecutionPlanSummaryList = (output, context) => {
|
|
756
|
+
const retVal = (output || [])
|
|
757
|
+
.filter((e) => e != null)
|
|
758
|
+
.map((entry) => {
|
|
759
|
+
if (entry === null) {
|
|
760
|
+
return null;
|
|
761
|
+
}
|
|
762
|
+
return deserializeAws_json1_0RescoreExecutionPlanSummary(entry, context);
|
|
763
|
+
});
|
|
764
|
+
return retVal;
|
|
765
|
+
};
|
|
766
|
+
const deserializeAws_json1_0RescoreResult = (output, context) => {
|
|
767
|
+
return {
|
|
768
|
+
RescoreId: __expectString(output.RescoreId),
|
|
769
|
+
ResultItems: output.ResultItems != null ? deserializeAws_json1_0RescoreResultItemList(output.ResultItems, context) : undefined,
|
|
770
|
+
};
|
|
771
|
+
};
|
|
772
|
+
const deserializeAws_json1_0RescoreResultItem = (output, context) => {
|
|
773
|
+
return {
|
|
774
|
+
DocumentId: __expectString(output.DocumentId),
|
|
775
|
+
Score: __limitedParseFloat32(output.Score),
|
|
776
|
+
};
|
|
777
|
+
};
|
|
778
|
+
const deserializeAws_json1_0RescoreResultItemList = (output, context) => {
|
|
779
|
+
const retVal = (output || [])
|
|
780
|
+
.filter((e) => e != null)
|
|
781
|
+
.map((entry) => {
|
|
782
|
+
if (entry === null) {
|
|
783
|
+
return null;
|
|
784
|
+
}
|
|
785
|
+
return deserializeAws_json1_0RescoreResultItem(entry, context);
|
|
786
|
+
});
|
|
787
|
+
return retVal;
|
|
788
|
+
};
|
|
789
|
+
const deserializeAws_json1_0ResourceNotFoundException = (output, context) => {
|
|
790
|
+
return {
|
|
791
|
+
Message: __expectString(output.Message),
|
|
792
|
+
};
|
|
793
|
+
};
|
|
794
|
+
const deserializeAws_json1_0ResourceUnavailableException = (output, context) => {
|
|
795
|
+
return {
|
|
796
|
+
Message: __expectString(output.Message),
|
|
797
|
+
};
|
|
798
|
+
};
|
|
799
|
+
const deserializeAws_json1_0ServiceQuotaExceededException = (output, context) => {
|
|
800
|
+
return {
|
|
801
|
+
Message: __expectString(output.Message),
|
|
802
|
+
};
|
|
803
|
+
};
|
|
804
|
+
const deserializeAws_json1_0Tag = (output, context) => {
|
|
805
|
+
return {
|
|
806
|
+
Key: __expectString(output.Key),
|
|
807
|
+
Value: __expectString(output.Value),
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
const deserializeAws_json1_0TagList = (output, context) => {
|
|
811
|
+
const retVal = (output || [])
|
|
812
|
+
.filter((e) => e != null)
|
|
813
|
+
.map((entry) => {
|
|
814
|
+
if (entry === null) {
|
|
815
|
+
return null;
|
|
816
|
+
}
|
|
817
|
+
return deserializeAws_json1_0Tag(entry, context);
|
|
818
|
+
});
|
|
819
|
+
return retVal;
|
|
820
|
+
};
|
|
821
|
+
const deserializeAws_json1_0TagResourceResponse = (output, context) => {
|
|
822
|
+
return {};
|
|
823
|
+
};
|
|
824
|
+
const deserializeAws_json1_0ThrottlingException = (output, context) => {
|
|
825
|
+
return {
|
|
826
|
+
Message: __expectString(output.Message),
|
|
827
|
+
};
|
|
828
|
+
};
|
|
829
|
+
const deserializeAws_json1_0UntagResourceResponse = (output, context) => {
|
|
830
|
+
return {};
|
|
831
|
+
};
|
|
832
|
+
const deserializeAws_json1_0ValidationException = (output, context) => {
|
|
833
|
+
return {
|
|
834
|
+
Message: __expectString(output.Message),
|
|
835
|
+
};
|
|
836
|
+
};
|
|
837
|
+
const deserializeMetadata = (output) => ({
|
|
838
|
+
httpStatusCode: output.statusCode,
|
|
839
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
840
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
841
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
842
|
+
});
|
|
843
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
844
|
+
if (streamBody instanceof Uint8Array) {
|
|
845
|
+
return Promise.resolve(streamBody);
|
|
846
|
+
}
|
|
847
|
+
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
848
|
+
};
|
|
849
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
850
|
+
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
851
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
852
|
+
const contents = {
|
|
853
|
+
protocol,
|
|
854
|
+
hostname,
|
|
855
|
+
port,
|
|
856
|
+
method: "POST",
|
|
857
|
+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
858
|
+
headers,
|
|
859
|
+
};
|
|
860
|
+
if (resolvedHostname !== undefined) {
|
|
861
|
+
contents.hostname = resolvedHostname;
|
|
862
|
+
}
|
|
863
|
+
if (body !== undefined) {
|
|
864
|
+
contents.body = body;
|
|
865
|
+
}
|
|
866
|
+
return new __HttpRequest(contents);
|
|
867
|
+
};
|
|
868
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
869
|
+
if (encoded.length) {
|
|
870
|
+
return JSON.parse(encoded);
|
|
871
|
+
}
|
|
872
|
+
return {};
|
|
873
|
+
});
|
|
874
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
875
|
+
const value = await parseBody(errorBody, context);
|
|
876
|
+
value.message = value.message ?? value.Message;
|
|
877
|
+
return value;
|
|
878
|
+
};
|
|
879
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
880
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
881
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
882
|
+
let cleanValue = rawValue;
|
|
883
|
+
if (typeof cleanValue === "number") {
|
|
884
|
+
cleanValue = cleanValue.toString();
|
|
885
|
+
}
|
|
886
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
887
|
+
cleanValue = cleanValue.split(",")[0];
|
|
888
|
+
}
|
|
889
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
890
|
+
cleanValue = cleanValue.split(":")[0];
|
|
891
|
+
}
|
|
892
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
893
|
+
cleanValue = cleanValue.split("#")[1];
|
|
894
|
+
}
|
|
895
|
+
return cleanValue;
|
|
896
|
+
};
|
|
897
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
898
|
+
if (headerKey !== undefined) {
|
|
899
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
900
|
+
}
|
|
901
|
+
if (data.code !== undefined) {
|
|
902
|
+
return sanitizeErrorCode(data.code);
|
|
903
|
+
}
|
|
904
|
+
if (data["__type"] !== undefined) {
|
|
905
|
+
return sanitizeErrorCode(data["__type"]);
|
|
906
|
+
}
|
|
907
|
+
};
|