@aws-sdk/client-cloudsearch-domain 3.186.0 → 3.190.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist-es/CloudSearchDomain.js +14 -21
- package/dist-es/CloudSearchDomainClient.js +22 -28
- package/dist-es/commands/SearchCommand.js +21 -28
- package/dist-es/commands/SuggestCommand.js +21 -28
- package/dist-es/commands/UploadDocumentsCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/CloudSearchDomainServiceException.js +5 -10
- package/dist-es/models/models_0.js +71 -40
- package/dist-es/protocols/Aws_restJson1.js +306 -407
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/package.json +33 -33
|
@@ -1,339 +1,251 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator, __read } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { CloudSearchDomainServiceException as __BaseException } from "../models/CloudSearchDomainServiceException";
|
|
5
4
|
import { DocumentServiceException, SearchException, } from "../models/models_0";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return: [, input.return],
|
|
28
|
-
size: [function () { return input.size !== void 0; }, function () { return input.size.toString(); }],
|
|
29
|
-
sort: [, input.sort],
|
|
30
|
-
start: [function () { return input.start !== void 0; }, function () { return input.start.toString(); }],
|
|
31
|
-
stats: [, input.stats],
|
|
32
|
-
});
|
|
33
|
-
return [2, new __HttpRequest({
|
|
34
|
-
protocol: protocol,
|
|
35
|
-
hostname: hostname,
|
|
36
|
-
port: port,
|
|
37
|
-
method: "GET",
|
|
38
|
-
headers: headers,
|
|
39
|
-
path: resolvedPath,
|
|
40
|
-
query: query,
|
|
41
|
-
body: body,
|
|
42
|
-
})];
|
|
43
|
-
}
|
|
5
|
+
export const serializeAws_restJson1SearchCommand = async (input, context) => {
|
|
6
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
7
|
+
const headers = {};
|
|
8
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2013-01-01/search";
|
|
9
|
+
const query = map({
|
|
10
|
+
format: [, "sdk"],
|
|
11
|
+
pretty: [, "true"],
|
|
12
|
+
cursor: [, input.cursor],
|
|
13
|
+
expr: [, input.expr],
|
|
14
|
+
facet: [, input.facet],
|
|
15
|
+
fq: [, input.filterQuery],
|
|
16
|
+
highlight: [, input.highlight],
|
|
17
|
+
partial: [() => input.partial !== void 0, () => input.partial.toString()],
|
|
18
|
+
q: [, input.query],
|
|
19
|
+
"q.options": [, input.queryOptions],
|
|
20
|
+
"q.parser": [, input.queryParser],
|
|
21
|
+
return: [, input.return],
|
|
22
|
+
size: [() => input.size !== void 0, () => input.size.toString()],
|
|
23
|
+
sort: [, input.sort],
|
|
24
|
+
start: [() => input.start !== void 0, () => input.start.toString()],
|
|
25
|
+
stats: [, input.stats],
|
|
44
26
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
query = map({
|
|
56
|
-
format: [, "sdk"],
|
|
57
|
-
pretty: [, "true"],
|
|
58
|
-
q: [, input.query],
|
|
59
|
-
suggester: [, input.suggester],
|
|
60
|
-
size: [function () { return input.size !== void 0; }, function () { return input.size.toString(); }],
|
|
61
|
-
});
|
|
62
|
-
return [2, new __HttpRequest({
|
|
63
|
-
protocol: protocol,
|
|
64
|
-
hostname: hostname,
|
|
65
|
-
port: port,
|
|
66
|
-
method: "GET",
|
|
67
|
-
headers: headers,
|
|
68
|
-
path: resolvedPath,
|
|
69
|
-
query: query,
|
|
70
|
-
body: body,
|
|
71
|
-
})];
|
|
72
|
-
}
|
|
27
|
+
let body;
|
|
28
|
+
return new __HttpRequest({
|
|
29
|
+
protocol,
|
|
30
|
+
hostname,
|
|
31
|
+
port,
|
|
32
|
+
method: "GET",
|
|
33
|
+
headers,
|
|
34
|
+
path: resolvedPath,
|
|
35
|
+
query,
|
|
36
|
+
body,
|
|
73
37
|
});
|
|
74
|
-
}
|
|
75
|
-
export
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/2013-01-01/documents/batch";
|
|
86
|
-
query = map({
|
|
87
|
-
format: [, "sdk"],
|
|
88
|
-
});
|
|
89
|
-
if (input.documents !== undefined) {
|
|
90
|
-
body = input.documents;
|
|
91
|
-
}
|
|
92
|
-
return [2, new __HttpRequest({
|
|
93
|
-
protocol: protocol,
|
|
94
|
-
hostname: hostname,
|
|
95
|
-
port: port,
|
|
96
|
-
method: "POST",
|
|
97
|
-
headers: headers,
|
|
98
|
-
path: resolvedPath,
|
|
99
|
-
query: query,
|
|
100
|
-
body: body,
|
|
101
|
-
})];
|
|
102
|
-
}
|
|
38
|
+
};
|
|
39
|
+
export const serializeAws_restJson1SuggestCommand = async (input, context) => {
|
|
40
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
41
|
+
const headers = {};
|
|
42
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2013-01-01/suggest";
|
|
43
|
+
const query = map({
|
|
44
|
+
format: [, "sdk"],
|
|
45
|
+
pretty: [, "true"],
|
|
46
|
+
q: [, input.query],
|
|
47
|
+
suggester: [, input.suggester],
|
|
48
|
+
size: [() => input.size !== void 0, () => input.size.toString()],
|
|
103
49
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
$metadata: deserializeMetadata(output),
|
|
115
|
-
});
|
|
116
|
-
_a = __expectNonNull;
|
|
117
|
-
_b = __expectObject;
|
|
118
|
-
return [4, parseBody(output.body, context)];
|
|
119
|
-
case 1:
|
|
120
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
121
|
-
if (data.facets != null) {
|
|
122
|
-
contents.facets = deserializeAws_restJson1Facets(data.facets, context);
|
|
123
|
-
}
|
|
124
|
-
if (data.hits != null) {
|
|
125
|
-
contents.hits = deserializeAws_restJson1Hits(data.hits, context);
|
|
126
|
-
}
|
|
127
|
-
if (data.stats != null) {
|
|
128
|
-
contents.stats = deserializeAws_restJson1Stats(data.stats, context);
|
|
129
|
-
}
|
|
130
|
-
if (data.status != null) {
|
|
131
|
-
contents.status = deserializeAws_restJson1SearchStatus(data.status, context);
|
|
132
|
-
}
|
|
133
|
-
return [2, contents];
|
|
134
|
-
}
|
|
50
|
+
let body;
|
|
51
|
+
return new __HttpRequest({
|
|
52
|
+
protocol,
|
|
53
|
+
hostname,
|
|
54
|
+
port,
|
|
55
|
+
method: "GET",
|
|
56
|
+
headers,
|
|
57
|
+
path: resolvedPath,
|
|
58
|
+
query,
|
|
59
|
+
body,
|
|
135
60
|
});
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
switch (_d.label) {
|
|
142
|
-
case 0:
|
|
143
|
-
_a = [__assign({}, output)];
|
|
144
|
-
_c = {};
|
|
145
|
-
return [4, parseErrorBody(output.body, context)];
|
|
146
|
-
case 1:
|
|
147
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
148
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
149
|
-
_b = errorCode;
|
|
150
|
-
switch (_b) {
|
|
151
|
-
case "SearchException": return [3, 2];
|
|
152
|
-
case "com.amazonaws.cloudsearchdomain#SearchException": return [3, 2];
|
|
153
|
-
}
|
|
154
|
-
return [3, 4];
|
|
155
|
-
case 2: return [4, deserializeAws_restJson1SearchExceptionResponse(parsedOutput, context)];
|
|
156
|
-
case 3: throw _d.sent();
|
|
157
|
-
case 4:
|
|
158
|
-
parsedBody = parsedOutput.body;
|
|
159
|
-
throwDefaultError({
|
|
160
|
-
output: output,
|
|
161
|
-
parsedBody: parsedBody,
|
|
162
|
-
exceptionCtor: __BaseException,
|
|
163
|
-
errorCode: errorCode,
|
|
164
|
-
});
|
|
165
|
-
_d.label = 5;
|
|
166
|
-
case 5: return [2];
|
|
167
|
-
}
|
|
61
|
+
};
|
|
62
|
+
export const serializeAws_restJson1UploadDocumentsCommand = async (input, context) => {
|
|
63
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
64
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
65
|
+
"content-type": input.contentType || "application/octet-stream",
|
|
168
66
|
});
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
return __generator(this, function (_c) {
|
|
173
|
-
switch (_c.label) {
|
|
174
|
-
case 0:
|
|
175
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
176
|
-
return [2, deserializeAws_restJson1SuggestCommandError(output, context)];
|
|
177
|
-
}
|
|
178
|
-
contents = map({
|
|
179
|
-
$metadata: deserializeMetadata(output),
|
|
180
|
-
});
|
|
181
|
-
_a = __expectNonNull;
|
|
182
|
-
_b = __expectObject;
|
|
183
|
-
return [4, parseBody(output.body, context)];
|
|
184
|
-
case 1:
|
|
185
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
186
|
-
if (data.status != null) {
|
|
187
|
-
contents.status = deserializeAws_restJson1SuggestStatus(data.status, context);
|
|
188
|
-
}
|
|
189
|
-
if (data.suggest != null) {
|
|
190
|
-
contents.suggest = deserializeAws_restJson1SuggestModel(data.suggest, context);
|
|
191
|
-
}
|
|
192
|
-
return [2, contents];
|
|
193
|
-
}
|
|
67
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2013-01-01/documents/batch";
|
|
68
|
+
const query = map({
|
|
69
|
+
format: [, "sdk"],
|
|
194
70
|
});
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
return
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
_b = errorCode;
|
|
209
|
-
switch (_b) {
|
|
210
|
-
case "SearchException": return [3, 2];
|
|
211
|
-
case "com.amazonaws.cloudsearchdomain#SearchException": return [3, 2];
|
|
212
|
-
}
|
|
213
|
-
return [3, 4];
|
|
214
|
-
case 2: return [4, deserializeAws_restJson1SearchExceptionResponse(parsedOutput, context)];
|
|
215
|
-
case 3: throw _d.sent();
|
|
216
|
-
case 4:
|
|
217
|
-
parsedBody = parsedOutput.body;
|
|
218
|
-
throwDefaultError({
|
|
219
|
-
output: output,
|
|
220
|
-
parsedBody: parsedBody,
|
|
221
|
-
exceptionCtor: __BaseException,
|
|
222
|
-
errorCode: errorCode,
|
|
223
|
-
});
|
|
224
|
-
_d.label = 5;
|
|
225
|
-
case 5: return [2];
|
|
226
|
-
}
|
|
71
|
+
let body;
|
|
72
|
+
if (input.documents !== undefined) {
|
|
73
|
+
body = input.documents;
|
|
74
|
+
}
|
|
75
|
+
return new __HttpRequest({
|
|
76
|
+
protocol,
|
|
77
|
+
hostname,
|
|
78
|
+
port,
|
|
79
|
+
method: "POST",
|
|
80
|
+
headers,
|
|
81
|
+
path: resolvedPath,
|
|
82
|
+
query,
|
|
83
|
+
body,
|
|
227
84
|
});
|
|
228
|
-
}
|
|
229
|
-
export
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
return [2, deserializeAws_restJson1UploadDocumentsCommandError(output, context)];
|
|
236
|
-
}
|
|
237
|
-
contents = map({
|
|
238
|
-
$metadata: deserializeMetadata(output),
|
|
239
|
-
});
|
|
240
|
-
_a = __expectNonNull;
|
|
241
|
-
_b = __expectObject;
|
|
242
|
-
return [4, parseBody(output.body, context)];
|
|
243
|
-
case 1:
|
|
244
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
245
|
-
if (data.adds != null) {
|
|
246
|
-
contents.adds = __expectLong(data.adds);
|
|
247
|
-
}
|
|
248
|
-
if (data.deletes != null) {
|
|
249
|
-
contents.deletes = __expectLong(data.deletes);
|
|
250
|
-
}
|
|
251
|
-
if (data.status != null) {
|
|
252
|
-
contents.status = __expectString(data.status);
|
|
253
|
-
}
|
|
254
|
-
if (data.warnings != null) {
|
|
255
|
-
contents.warnings = deserializeAws_restJson1DocumentServiceWarnings(data.warnings, context);
|
|
256
|
-
}
|
|
257
|
-
return [2, contents];
|
|
258
|
-
}
|
|
85
|
+
};
|
|
86
|
+
export const deserializeAws_restJson1SearchCommand = async (output, context) => {
|
|
87
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
88
|
+
return deserializeAws_restJson1SearchCommandError(output, context);
|
|
89
|
+
}
|
|
90
|
+
const contents = map({
|
|
91
|
+
$metadata: deserializeMetadata(output),
|
|
259
92
|
});
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
93
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
94
|
+
if (data.facets != null) {
|
|
95
|
+
contents.facets = deserializeAws_restJson1Facets(data.facets, context);
|
|
96
|
+
}
|
|
97
|
+
if (data.hits != null) {
|
|
98
|
+
contents.hits = deserializeAws_restJson1Hits(data.hits, context);
|
|
99
|
+
}
|
|
100
|
+
if (data.stats != null) {
|
|
101
|
+
contents.stats = deserializeAws_restJson1Stats(data.stats, context);
|
|
102
|
+
}
|
|
103
|
+
if (data.status != null) {
|
|
104
|
+
contents.status = deserializeAws_restJson1SearchStatus(data.status, context);
|
|
105
|
+
}
|
|
106
|
+
return contents;
|
|
107
|
+
};
|
|
108
|
+
const deserializeAws_restJson1SearchCommandError = async (output, context) => {
|
|
109
|
+
const parsedOutput = {
|
|
110
|
+
...output,
|
|
111
|
+
body: await parseErrorBody(output.body, context),
|
|
112
|
+
};
|
|
113
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
114
|
+
switch (errorCode) {
|
|
115
|
+
case "SearchException":
|
|
116
|
+
case "com.amazonaws.cloudsearchdomain#SearchException":
|
|
117
|
+
throw await deserializeAws_restJson1SearchExceptionResponse(parsedOutput, context);
|
|
118
|
+
default:
|
|
119
|
+
const parsedBody = parsedOutput.body;
|
|
120
|
+
throwDefaultError({
|
|
121
|
+
output,
|
|
122
|
+
parsedBody,
|
|
123
|
+
exceptionCtor: __BaseException,
|
|
124
|
+
errorCode,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
export const deserializeAws_restJson1SuggestCommand = async (output, context) => {
|
|
129
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
130
|
+
return deserializeAws_restJson1SuggestCommandError(output, context);
|
|
131
|
+
}
|
|
132
|
+
const contents = map({
|
|
133
|
+
$metadata: deserializeMetadata(output),
|
|
292
134
|
});
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
contents =
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
135
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
136
|
+
if (data.status != null) {
|
|
137
|
+
contents.status = deserializeAws_restJson1SuggestStatus(data.status, context);
|
|
138
|
+
}
|
|
139
|
+
if (data.suggest != null) {
|
|
140
|
+
contents.suggest = deserializeAws_restJson1SuggestModel(data.suggest, context);
|
|
141
|
+
}
|
|
142
|
+
return contents;
|
|
143
|
+
};
|
|
144
|
+
const deserializeAws_restJson1SuggestCommandError = async (output, context) => {
|
|
145
|
+
const parsedOutput = {
|
|
146
|
+
...output,
|
|
147
|
+
body: await parseErrorBody(output.body, context),
|
|
148
|
+
};
|
|
149
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
150
|
+
switch (errorCode) {
|
|
151
|
+
case "SearchException":
|
|
152
|
+
case "com.amazonaws.cloudsearchdomain#SearchException":
|
|
153
|
+
throw await deserializeAws_restJson1SearchExceptionResponse(parsedOutput, context);
|
|
154
|
+
default:
|
|
155
|
+
const parsedBody = parsedOutput.body;
|
|
156
|
+
throwDefaultError({
|
|
157
|
+
output,
|
|
158
|
+
parsedBody,
|
|
159
|
+
exceptionCtor: __BaseException,
|
|
160
|
+
errorCode,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
export const deserializeAws_restJson1UploadDocumentsCommand = async (output, context) => {
|
|
165
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
166
|
+
return deserializeAws_restJson1UploadDocumentsCommandError(output, context);
|
|
167
|
+
}
|
|
168
|
+
const contents = map({
|
|
169
|
+
$metadata: deserializeMetadata(output),
|
|
308
170
|
});
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
171
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
172
|
+
if (data.adds != null) {
|
|
173
|
+
contents.adds = __expectLong(data.adds);
|
|
174
|
+
}
|
|
175
|
+
if (data.deletes != null) {
|
|
176
|
+
contents.deletes = __expectLong(data.deletes);
|
|
177
|
+
}
|
|
178
|
+
if (data.status != null) {
|
|
179
|
+
contents.status = __expectString(data.status);
|
|
180
|
+
}
|
|
181
|
+
if (data.warnings != null) {
|
|
182
|
+
contents.warnings = deserializeAws_restJson1DocumentServiceWarnings(data.warnings, context);
|
|
183
|
+
}
|
|
184
|
+
return contents;
|
|
185
|
+
};
|
|
186
|
+
const deserializeAws_restJson1UploadDocumentsCommandError = async (output, context) => {
|
|
187
|
+
const parsedOutput = {
|
|
188
|
+
...output,
|
|
189
|
+
body: await parseErrorBody(output.body, context),
|
|
190
|
+
};
|
|
191
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
192
|
+
switch (errorCode) {
|
|
193
|
+
case "DocumentServiceException":
|
|
194
|
+
case "com.amazonaws.cloudsearchdomain#DocumentServiceException":
|
|
195
|
+
throw await deserializeAws_restJson1DocumentServiceExceptionResponse(parsedOutput, context);
|
|
196
|
+
default:
|
|
197
|
+
const parsedBody = parsedOutput.body;
|
|
198
|
+
throwDefaultError({
|
|
199
|
+
output,
|
|
200
|
+
parsedBody,
|
|
201
|
+
exceptionCtor: __BaseException,
|
|
202
|
+
errorCode,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
const map = __map;
|
|
207
|
+
const deserializeAws_restJson1DocumentServiceExceptionResponse = async (parsedOutput, context) => {
|
|
208
|
+
const contents = map({});
|
|
209
|
+
const data = parsedOutput.body;
|
|
210
|
+
if (data.message != null) {
|
|
211
|
+
contents.message = __expectString(data.message);
|
|
212
|
+
}
|
|
213
|
+
if (data.status != null) {
|
|
214
|
+
contents.status = __expectString(data.status);
|
|
215
|
+
}
|
|
216
|
+
const exception = new DocumentServiceException({
|
|
217
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
218
|
+
...contents,
|
|
219
|
+
});
|
|
220
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
221
|
+
};
|
|
222
|
+
const deserializeAws_restJson1SearchExceptionResponse = async (parsedOutput, context) => {
|
|
223
|
+
const contents = map({});
|
|
224
|
+
const data = parsedOutput.body;
|
|
225
|
+
if (data.message != null) {
|
|
226
|
+
contents.message = __expectString(data.message);
|
|
227
|
+
}
|
|
228
|
+
const exception = new SearchException({
|
|
229
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
230
|
+
...contents,
|
|
320
231
|
});
|
|
321
|
-
|
|
322
|
-
|
|
232
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
233
|
+
};
|
|
234
|
+
const deserializeAws_restJson1Bucket = (output, context) => {
|
|
323
235
|
return {
|
|
324
236
|
count: __expectLong(output.count),
|
|
325
237
|
value: __expectString(output.value),
|
|
326
238
|
};
|
|
327
239
|
};
|
|
328
|
-
|
|
240
|
+
const deserializeAws_restJson1BucketInfo = (output, context) => {
|
|
329
241
|
return {
|
|
330
242
|
buckets: output.buckets != null ? deserializeAws_restJson1BucketList(output.buckets, context) : undefined,
|
|
331
243
|
};
|
|
332
244
|
};
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
.filter(
|
|
336
|
-
.map(
|
|
245
|
+
const deserializeAws_restJson1BucketList = (output, context) => {
|
|
246
|
+
const retVal = (output || [])
|
|
247
|
+
.filter((e) => e != null)
|
|
248
|
+
.map((entry) => {
|
|
337
249
|
if (entry === null) {
|
|
338
250
|
return null;
|
|
339
251
|
}
|
|
@@ -341,15 +253,15 @@ var deserializeAws_restJson1BucketList = function (output, context) {
|
|
|
341
253
|
});
|
|
342
254
|
return retVal;
|
|
343
255
|
};
|
|
344
|
-
|
|
256
|
+
const deserializeAws_restJson1DocumentServiceWarning = (output, context) => {
|
|
345
257
|
return {
|
|
346
258
|
message: __expectString(output.message),
|
|
347
259
|
};
|
|
348
260
|
};
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
.filter(
|
|
352
|
-
.map(
|
|
261
|
+
const deserializeAws_restJson1DocumentServiceWarnings = (output, context) => {
|
|
262
|
+
const retVal = (output || [])
|
|
263
|
+
.filter((e) => e != null)
|
|
264
|
+
.map((entry) => {
|
|
353
265
|
if (entry === null) {
|
|
354
266
|
return null;
|
|
355
267
|
}
|
|
@@ -357,37 +269,40 @@ var deserializeAws_restJson1DocumentServiceWarnings = function (output, context)
|
|
|
357
269
|
});
|
|
358
270
|
return retVal;
|
|
359
271
|
};
|
|
360
|
-
|
|
361
|
-
return Object.entries(output).reduce(
|
|
362
|
-
var _b;
|
|
363
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
272
|
+
const deserializeAws_restJson1Exprs = (output, context) => {
|
|
273
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
364
274
|
if (value === null) {
|
|
365
275
|
return acc;
|
|
366
276
|
}
|
|
367
|
-
return
|
|
277
|
+
return {
|
|
278
|
+
...acc,
|
|
279
|
+
[key]: __expectString(value),
|
|
280
|
+
};
|
|
368
281
|
}, {});
|
|
369
282
|
};
|
|
370
|
-
|
|
371
|
-
return Object.entries(output).reduce(
|
|
372
|
-
var _b;
|
|
373
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
283
|
+
const deserializeAws_restJson1Facets = (output, context) => {
|
|
284
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
374
285
|
if (value === null) {
|
|
375
286
|
return acc;
|
|
376
287
|
}
|
|
377
|
-
return
|
|
288
|
+
return {
|
|
289
|
+
...acc,
|
|
290
|
+
[key]: deserializeAws_restJson1BucketInfo(value, context),
|
|
291
|
+
};
|
|
378
292
|
}, {});
|
|
379
293
|
};
|
|
380
|
-
|
|
381
|
-
return Object.entries(output).reduce(
|
|
382
|
-
var _b;
|
|
383
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
294
|
+
const deserializeAws_restJson1Fields = (output, context) => {
|
|
295
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
384
296
|
if (value === null) {
|
|
385
297
|
return acc;
|
|
386
298
|
}
|
|
387
|
-
return
|
|
299
|
+
return {
|
|
300
|
+
...acc,
|
|
301
|
+
[key]: deserializeAws_restJson1FieldValue(value, context),
|
|
302
|
+
};
|
|
388
303
|
}, {});
|
|
389
304
|
};
|
|
390
|
-
|
|
305
|
+
const deserializeAws_restJson1FieldStats = (output, context) => {
|
|
391
306
|
return {
|
|
392
307
|
count: __expectLong(output.count),
|
|
393
308
|
max: __expectString(output.max),
|
|
@@ -399,10 +314,10 @@ var deserializeAws_restJson1FieldStats = function (output, context) {
|
|
|
399
314
|
sumOfSquares: __limitedParseDouble(output.sumOfSquares),
|
|
400
315
|
};
|
|
401
316
|
};
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
.filter(
|
|
405
|
-
.map(
|
|
317
|
+
const deserializeAws_restJson1FieldValue = (output, context) => {
|
|
318
|
+
const retVal = (output || [])
|
|
319
|
+
.filter((e) => e != null)
|
|
320
|
+
.map((entry) => {
|
|
406
321
|
if (entry === null) {
|
|
407
322
|
return null;
|
|
408
323
|
}
|
|
@@ -410,17 +325,18 @@ var deserializeAws_restJson1FieldValue = function (output, context) {
|
|
|
410
325
|
});
|
|
411
326
|
return retVal;
|
|
412
327
|
};
|
|
413
|
-
|
|
414
|
-
return Object.entries(output).reduce(
|
|
415
|
-
var _b;
|
|
416
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
328
|
+
const deserializeAws_restJson1Highlights = (output, context) => {
|
|
329
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
417
330
|
if (value === null) {
|
|
418
331
|
return acc;
|
|
419
332
|
}
|
|
420
|
-
return
|
|
333
|
+
return {
|
|
334
|
+
...acc,
|
|
335
|
+
[key]: __expectString(value),
|
|
336
|
+
};
|
|
421
337
|
}, {});
|
|
422
338
|
};
|
|
423
|
-
|
|
339
|
+
const deserializeAws_restJson1Hit = (output, context) => {
|
|
424
340
|
return {
|
|
425
341
|
exprs: output.exprs != null ? deserializeAws_restJson1Exprs(output.exprs, context) : undefined,
|
|
426
342
|
fields: output.fields != null ? deserializeAws_restJson1Fields(output.fields, context) : undefined,
|
|
@@ -428,10 +344,10 @@ var deserializeAws_restJson1Hit = function (output, context) {
|
|
|
428
344
|
id: __expectString(output.id),
|
|
429
345
|
};
|
|
430
346
|
};
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
.filter(
|
|
434
|
-
.map(
|
|
347
|
+
const deserializeAws_restJson1HitList = (output, context) => {
|
|
348
|
+
const retVal = (output || [])
|
|
349
|
+
.filter((e) => e != null)
|
|
350
|
+
.map((entry) => {
|
|
435
351
|
if (entry === null) {
|
|
436
352
|
return null;
|
|
437
353
|
}
|
|
@@ -439,7 +355,7 @@ var deserializeAws_restJson1HitList = function (output, context) {
|
|
|
439
355
|
});
|
|
440
356
|
return retVal;
|
|
441
357
|
};
|
|
442
|
-
|
|
358
|
+
const deserializeAws_restJson1Hits = (output, context) => {
|
|
443
359
|
return {
|
|
444
360
|
cursor: __expectString(output.cursor),
|
|
445
361
|
found: __expectLong(output.found),
|
|
@@ -447,33 +363,34 @@ var deserializeAws_restJson1Hits = function (output, context) {
|
|
|
447
363
|
start: __expectLong(output.start),
|
|
448
364
|
};
|
|
449
365
|
};
|
|
450
|
-
|
|
366
|
+
const deserializeAws_restJson1SearchStatus = (output, context) => {
|
|
451
367
|
return {
|
|
452
368
|
rid: __expectString(output.rid),
|
|
453
369
|
timems: __expectLong(output.timems),
|
|
454
370
|
};
|
|
455
371
|
};
|
|
456
|
-
|
|
457
|
-
return Object.entries(output).reduce(
|
|
458
|
-
var _b;
|
|
459
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
372
|
+
const deserializeAws_restJson1Stats = (output, context) => {
|
|
373
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
460
374
|
if (value === null) {
|
|
461
375
|
return acc;
|
|
462
376
|
}
|
|
463
|
-
return
|
|
377
|
+
return {
|
|
378
|
+
...acc,
|
|
379
|
+
[key]: deserializeAws_restJson1FieldStats(value, context),
|
|
380
|
+
};
|
|
464
381
|
}, {});
|
|
465
382
|
};
|
|
466
|
-
|
|
383
|
+
const deserializeAws_restJson1SuggestionMatch = (output, context) => {
|
|
467
384
|
return {
|
|
468
385
|
id: __expectString(output.id),
|
|
469
386
|
score: __expectLong(output.score),
|
|
470
387
|
suggestion: __expectString(output.suggestion),
|
|
471
388
|
};
|
|
472
389
|
};
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
.filter(
|
|
476
|
-
.map(
|
|
390
|
+
const deserializeAws_restJson1Suggestions = (output, context) => {
|
|
391
|
+
const retVal = (output || [])
|
|
392
|
+
.filter((e) => e != null)
|
|
393
|
+
.map((entry) => {
|
|
477
394
|
if (entry === null) {
|
|
478
395
|
return null;
|
|
479
396
|
}
|
|
@@ -481,70 +398,52 @@ var deserializeAws_restJson1Suggestions = function (output, context) {
|
|
|
481
398
|
});
|
|
482
399
|
return retVal;
|
|
483
400
|
};
|
|
484
|
-
|
|
401
|
+
const deserializeAws_restJson1SuggestModel = (output, context) => {
|
|
485
402
|
return {
|
|
486
403
|
found: __expectLong(output.found),
|
|
487
404
|
query: __expectString(output.query),
|
|
488
405
|
suggestions: output.suggestions != null ? deserializeAws_restJson1Suggestions(output.suggestions, context) : undefined,
|
|
489
406
|
};
|
|
490
407
|
};
|
|
491
|
-
|
|
408
|
+
const deserializeAws_restJson1SuggestStatus = (output, context) => {
|
|
492
409
|
return {
|
|
493
410
|
rid: __expectString(output.rid),
|
|
494
411
|
timems: __expectLong(output.timems),
|
|
495
412
|
};
|
|
496
413
|
};
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
});
|
|
505
|
-
};
|
|
506
|
-
var collectBody = function (streamBody, context) {
|
|
507
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
414
|
+
const deserializeMetadata = (output) => ({
|
|
415
|
+
httpStatusCode: output.statusCode,
|
|
416
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
417
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
418
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
419
|
+
});
|
|
420
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
508
421
|
if (streamBody instanceof Uint8Array) {
|
|
509
422
|
return Promise.resolve(streamBody);
|
|
510
423
|
}
|
|
511
424
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
512
425
|
};
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
});
|
|
426
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
427
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
428
|
+
value !== null &&
|
|
429
|
+
value !== "" &&
|
|
430
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
431
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
432
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
433
|
+
if (encoded.length) {
|
|
434
|
+
return JSON.parse(encoded);
|
|
435
|
+
}
|
|
436
|
+
return {};
|
|
437
|
+
});
|
|
438
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
439
|
+
const value = await parseBody(errorBody, context);
|
|
440
|
+
value.message = value.message ?? value.Message;
|
|
441
|
+
return value;
|
|
530
442
|
};
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
switch (_b.label) {
|
|
536
|
-
case 0: return [4, parseBody(errorBody, context)];
|
|
537
|
-
case 1:
|
|
538
|
-
value = _b.sent();
|
|
539
|
-
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
540
|
-
return [2, value];
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
|
-
}); };
|
|
544
|
-
var loadRestJsonErrorCode = function (output, data) {
|
|
545
|
-
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
546
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
547
|
-
var cleanValue = rawValue;
|
|
443
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
444
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
445
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
446
|
+
let cleanValue = rawValue;
|
|
548
447
|
if (typeof cleanValue === "number") {
|
|
549
448
|
cleanValue = cleanValue.toString();
|
|
550
449
|
}
|
|
@@ -559,7 +458,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
559
458
|
}
|
|
560
459
|
return cleanValue;
|
|
561
460
|
};
|
|
562
|
-
|
|
461
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
563
462
|
if (headerKey !== undefined) {
|
|
564
463
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
565
464
|
}
|