@aws-sdk/client-cloudsearch-domain 3.183.0 → 3.185.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,251 +1,339 @@
1
+ import { __assign, __awaiter, __generator, __read } from "tslib";
1
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
3
  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";
3
4
  import { CloudSearchDomainServiceException as __BaseException } from "../models/CloudSearchDomainServiceException";
4
5
  import { DocumentServiceException, SearchException, } from "../models/models_0";
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],
26
- });
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,
6
+ export var serializeAws_restJson1SearchCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
8
+ return __generator(this, function (_c) {
9
+ switch (_c.label) {
10
+ case 0: return [4, context.endpoint()];
11
+ case 1:
12
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
+ headers = {};
14
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/2013-01-01/search";
15
+ query = map({
16
+ format: [, "sdk"],
17
+ pretty: [, "true"],
18
+ cursor: [, input.cursor],
19
+ expr: [, input.expr],
20
+ facet: [, input.facet],
21
+ fq: [, input.filterQuery],
22
+ highlight: [, input.highlight],
23
+ partial: [function () { return input.partial !== void 0; }, function () { return input.partial.toString(); }],
24
+ q: [, input.query],
25
+ "q.options": [, input.queryOptions],
26
+ "q.parser": [, input.queryParser],
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
+ }
37
44
  });
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()],
45
+ }); };
46
+ export var serializeAws_restJson1SuggestCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
47
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
48
+ return __generator(this, function (_c) {
49
+ switch (_c.label) {
50
+ case 0: return [4, context.endpoint()];
51
+ case 1:
52
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
53
+ headers = {};
54
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/2013-01-01/suggest";
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
+ }
49
73
  });
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,
74
+ }); };
75
+ export var serializeAws_restJson1UploadDocumentsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
76
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
77
+ return __generator(this, function (_c) {
78
+ switch (_c.label) {
79
+ case 0: return [4, context.endpoint()];
80
+ case 1:
81
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
82
+ headers = map({}, isSerializableHeaderValue, {
83
+ "content-type": input.contentType || "application/octet-stream",
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
+ }
60
103
  });
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",
104
+ }); };
105
+ export var deserializeAws_restJson1SearchCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
106
+ var contents, data, _a, _b;
107
+ return __generator(this, function (_c) {
108
+ switch (_c.label) {
109
+ case 0:
110
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
111
+ return [2, deserializeAws_restJson1SearchCommandError(output, context)];
112
+ }
113
+ contents = map({
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
+ }
66
135
  });
67
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2013-01-01/documents/batch";
68
- const query = map({
69
- format: [, "sdk"],
136
+ }); };
137
+ var deserializeAws_restJson1SearchCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
138
+ var parsedOutput, _a, errorCode, _b, parsedBody;
139
+ var _c;
140
+ return __generator(this, function (_d) {
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
+ }
70
168
  });
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,
169
+ }); };
170
+ export var deserializeAws_restJson1SuggestCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
171
+ var contents, data, _a, _b;
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
+ }
84
194
  });
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),
195
+ }); };
196
+ var deserializeAws_restJson1SuggestCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
197
+ var parsedOutput, _a, errorCode, _b, parsedBody;
198
+ var _c;
199
+ return __generator(this, function (_d) {
200
+ switch (_d.label) {
201
+ case 0:
202
+ _a = [__assign({}, output)];
203
+ _c = {};
204
+ return [4, parseErrorBody(output.body, context)];
205
+ case 1:
206
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
207
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
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
+ }
92
227
  });
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),
228
+ }); };
229
+ export var deserializeAws_restJson1UploadDocumentsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
230
+ var contents, data, _a, _b;
231
+ return __generator(this, function (_c) {
232
+ switch (_c.label) {
233
+ case 0:
234
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
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
+ }
134
259
  });
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),
260
+ }); };
261
+ var deserializeAws_restJson1UploadDocumentsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
262
+ var parsedOutput, _a, errorCode, _b, parsedBody;
263
+ var _c;
264
+ return __generator(this, function (_d) {
265
+ switch (_d.label) {
266
+ case 0:
267
+ _a = [__assign({}, output)];
268
+ _c = {};
269
+ return [4, parseErrorBody(output.body, context)];
270
+ case 1:
271
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
272
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
273
+ _b = errorCode;
274
+ switch (_b) {
275
+ case "DocumentServiceException": return [3, 2];
276
+ case "com.amazonaws.cloudsearchdomain#DocumentServiceException": return [3, 2];
277
+ }
278
+ return [3, 4];
279
+ case 2: return [4, deserializeAws_restJson1DocumentServiceExceptionResponse(parsedOutput, context)];
280
+ case 3: throw _d.sent();
281
+ case 4:
282
+ parsedBody = parsedOutput.body;
283
+ throwDefaultError({
284
+ output: output,
285
+ parsedBody: parsedBody,
286
+ exceptionCtor: __BaseException,
287
+ errorCode: errorCode,
288
+ });
289
+ _d.label = 5;
290
+ case 5: return [2];
291
+ }
170
292
  });
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,
293
+ }); };
294
+ var map = __map;
295
+ var deserializeAws_restJson1DocumentServiceExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
296
+ var contents, data, exception;
297
+ return __generator(this, function (_a) {
298
+ contents = map({});
299
+ data = parsedOutput.body;
300
+ if (data.message != null) {
301
+ contents.message = __expectString(data.message);
302
+ }
303
+ if (data.status != null) {
304
+ contents.status = __expectString(data.status);
305
+ }
306
+ exception = new DocumentServiceException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
307
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
219
308
  });
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,
309
+ }); };
310
+ var deserializeAws_restJson1SearchExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
311
+ var contents, data, exception;
312
+ return __generator(this, function (_a) {
313
+ contents = map({});
314
+ data = parsedOutput.body;
315
+ if (data.message != null) {
316
+ contents.message = __expectString(data.message);
317
+ }
318
+ exception = new SearchException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
319
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
231
320
  });
232
- return __decorateServiceException(exception, parsedOutput.body);
233
- };
234
- const deserializeAws_restJson1Bucket = (output, context) => {
321
+ }); };
322
+ var deserializeAws_restJson1Bucket = function (output, context) {
235
323
  return {
236
324
  count: __expectLong(output.count),
237
325
  value: __expectString(output.value),
238
326
  };
239
327
  };
240
- const deserializeAws_restJson1BucketInfo = (output, context) => {
328
+ var deserializeAws_restJson1BucketInfo = function (output, context) {
241
329
  return {
242
330
  buckets: output.buckets != null ? deserializeAws_restJson1BucketList(output.buckets, context) : undefined,
243
331
  };
244
332
  };
245
- const deserializeAws_restJson1BucketList = (output, context) => {
246
- const retVal = (output || [])
247
- .filter((e) => e != null)
248
- .map((entry) => {
333
+ var deserializeAws_restJson1BucketList = function (output, context) {
334
+ var retVal = (output || [])
335
+ .filter(function (e) { return e != null; })
336
+ .map(function (entry) {
249
337
  if (entry === null) {
250
338
  return null;
251
339
  }
@@ -253,15 +341,15 @@ const deserializeAws_restJson1BucketList = (output, context) => {
253
341
  });
254
342
  return retVal;
255
343
  };
256
- const deserializeAws_restJson1DocumentServiceWarning = (output, context) => {
344
+ var deserializeAws_restJson1DocumentServiceWarning = function (output, context) {
257
345
  return {
258
346
  message: __expectString(output.message),
259
347
  };
260
348
  };
261
- const deserializeAws_restJson1DocumentServiceWarnings = (output, context) => {
262
- const retVal = (output || [])
263
- .filter((e) => e != null)
264
- .map((entry) => {
349
+ var deserializeAws_restJson1DocumentServiceWarnings = function (output, context) {
350
+ var retVal = (output || [])
351
+ .filter(function (e) { return e != null; })
352
+ .map(function (entry) {
265
353
  if (entry === null) {
266
354
  return null;
267
355
  }
@@ -269,40 +357,37 @@ const deserializeAws_restJson1DocumentServiceWarnings = (output, context) => {
269
357
  });
270
358
  return retVal;
271
359
  };
272
- const deserializeAws_restJson1Exprs = (output, context) => {
273
- return Object.entries(output).reduce((acc, [key, value]) => {
360
+ var deserializeAws_restJson1Exprs = function (output, context) {
361
+ return Object.entries(output).reduce(function (acc, _a) {
362
+ var _b;
363
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
274
364
  if (value === null) {
275
365
  return acc;
276
366
  }
277
- return {
278
- ...acc,
279
- [key]: __expectString(value),
280
- };
367
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
281
368
  }, {});
282
369
  };
283
- const deserializeAws_restJson1Facets = (output, context) => {
284
- return Object.entries(output).reduce((acc, [key, value]) => {
370
+ var deserializeAws_restJson1Facets = function (output, context) {
371
+ return Object.entries(output).reduce(function (acc, _a) {
372
+ var _b;
373
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
285
374
  if (value === null) {
286
375
  return acc;
287
376
  }
288
- return {
289
- ...acc,
290
- [key]: deserializeAws_restJson1BucketInfo(value, context),
291
- };
377
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1BucketInfo(value, context), _b));
292
378
  }, {});
293
379
  };
294
- const deserializeAws_restJson1Fields = (output, context) => {
295
- return Object.entries(output).reduce((acc, [key, value]) => {
380
+ var deserializeAws_restJson1Fields = function (output, context) {
381
+ return Object.entries(output).reduce(function (acc, _a) {
382
+ var _b;
383
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
296
384
  if (value === null) {
297
385
  return acc;
298
386
  }
299
- return {
300
- ...acc,
301
- [key]: deserializeAws_restJson1FieldValue(value, context),
302
- };
387
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1FieldValue(value, context), _b));
303
388
  }, {});
304
389
  };
305
- const deserializeAws_restJson1FieldStats = (output, context) => {
390
+ var deserializeAws_restJson1FieldStats = function (output, context) {
306
391
  return {
307
392
  count: __expectLong(output.count),
308
393
  max: __expectString(output.max),
@@ -314,10 +399,10 @@ const deserializeAws_restJson1FieldStats = (output, context) => {
314
399
  sumOfSquares: __limitedParseDouble(output.sumOfSquares),
315
400
  };
316
401
  };
317
- const deserializeAws_restJson1FieldValue = (output, context) => {
318
- const retVal = (output || [])
319
- .filter((e) => e != null)
320
- .map((entry) => {
402
+ var deserializeAws_restJson1FieldValue = function (output, context) {
403
+ var retVal = (output || [])
404
+ .filter(function (e) { return e != null; })
405
+ .map(function (entry) {
321
406
  if (entry === null) {
322
407
  return null;
323
408
  }
@@ -325,18 +410,17 @@ const deserializeAws_restJson1FieldValue = (output, context) => {
325
410
  });
326
411
  return retVal;
327
412
  };
328
- const deserializeAws_restJson1Highlights = (output, context) => {
329
- return Object.entries(output).reduce((acc, [key, value]) => {
413
+ var deserializeAws_restJson1Highlights = function (output, context) {
414
+ return Object.entries(output).reduce(function (acc, _a) {
415
+ var _b;
416
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
330
417
  if (value === null) {
331
418
  return acc;
332
419
  }
333
- return {
334
- ...acc,
335
- [key]: __expectString(value),
336
- };
420
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
337
421
  }, {});
338
422
  };
339
- const deserializeAws_restJson1Hit = (output, context) => {
423
+ var deserializeAws_restJson1Hit = function (output, context) {
340
424
  return {
341
425
  exprs: output.exprs != null ? deserializeAws_restJson1Exprs(output.exprs, context) : undefined,
342
426
  fields: output.fields != null ? deserializeAws_restJson1Fields(output.fields, context) : undefined,
@@ -344,10 +428,10 @@ const deserializeAws_restJson1Hit = (output, context) => {
344
428
  id: __expectString(output.id),
345
429
  };
346
430
  };
347
- const deserializeAws_restJson1HitList = (output, context) => {
348
- const retVal = (output || [])
349
- .filter((e) => e != null)
350
- .map((entry) => {
431
+ var deserializeAws_restJson1HitList = function (output, context) {
432
+ var retVal = (output || [])
433
+ .filter(function (e) { return e != null; })
434
+ .map(function (entry) {
351
435
  if (entry === null) {
352
436
  return null;
353
437
  }
@@ -355,7 +439,7 @@ const deserializeAws_restJson1HitList = (output, context) => {
355
439
  });
356
440
  return retVal;
357
441
  };
358
- const deserializeAws_restJson1Hits = (output, context) => {
442
+ var deserializeAws_restJson1Hits = function (output, context) {
359
443
  return {
360
444
  cursor: __expectString(output.cursor),
361
445
  found: __expectLong(output.found),
@@ -363,34 +447,33 @@ const deserializeAws_restJson1Hits = (output, context) => {
363
447
  start: __expectLong(output.start),
364
448
  };
365
449
  };
366
- const deserializeAws_restJson1SearchStatus = (output, context) => {
450
+ var deserializeAws_restJson1SearchStatus = function (output, context) {
367
451
  return {
368
452
  rid: __expectString(output.rid),
369
453
  timems: __expectLong(output.timems),
370
454
  };
371
455
  };
372
- const deserializeAws_restJson1Stats = (output, context) => {
373
- return Object.entries(output).reduce((acc, [key, value]) => {
456
+ var deserializeAws_restJson1Stats = function (output, context) {
457
+ return Object.entries(output).reduce(function (acc, _a) {
458
+ var _b;
459
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
374
460
  if (value === null) {
375
461
  return acc;
376
462
  }
377
- return {
378
- ...acc,
379
- [key]: deserializeAws_restJson1FieldStats(value, context),
380
- };
463
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1FieldStats(value, context), _b));
381
464
  }, {});
382
465
  };
383
- const deserializeAws_restJson1SuggestionMatch = (output, context) => {
466
+ var deserializeAws_restJson1SuggestionMatch = function (output, context) {
384
467
  return {
385
468
  id: __expectString(output.id),
386
469
  score: __expectLong(output.score),
387
470
  suggestion: __expectString(output.suggestion),
388
471
  };
389
472
  };
390
- const deserializeAws_restJson1Suggestions = (output, context) => {
391
- const retVal = (output || [])
392
- .filter((e) => e != null)
393
- .map((entry) => {
473
+ var deserializeAws_restJson1Suggestions = function (output, context) {
474
+ var retVal = (output || [])
475
+ .filter(function (e) { return e != null; })
476
+ .map(function (entry) {
394
477
  if (entry === null) {
395
478
  return null;
396
479
  }
@@ -398,52 +481,70 @@ const deserializeAws_restJson1Suggestions = (output, context) => {
398
481
  });
399
482
  return retVal;
400
483
  };
401
- const deserializeAws_restJson1SuggestModel = (output, context) => {
484
+ var deserializeAws_restJson1SuggestModel = function (output, context) {
402
485
  return {
403
486
  found: __expectLong(output.found),
404
487
  query: __expectString(output.query),
405
488
  suggestions: output.suggestions != null ? deserializeAws_restJson1Suggestions(output.suggestions, context) : undefined,
406
489
  };
407
490
  };
408
- const deserializeAws_restJson1SuggestStatus = (output, context) => {
491
+ var deserializeAws_restJson1SuggestStatus = function (output, context) {
409
492
  return {
410
493
  rid: __expectString(output.rid),
411
494
  timems: __expectLong(output.timems),
412
495
  };
413
496
  };
414
- const deserializeMetadata = (output) => ({
415
- httpStatusCode: output.statusCode,
416
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-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) => {
497
+ var deserializeMetadata = function (output) {
498
+ var _a, _b;
499
+ return ({
500
+ httpStatusCode: output.statusCode,
501
+ requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
502
+ extendedRequestId: output.headers["x-amz-id-2"],
503
+ cfId: output.headers["x-amz-cf-id"],
504
+ });
505
+ };
506
+ var collectBody = function (streamBody, context) {
507
+ if (streamBody === void 0) { streamBody = new Uint8Array(); }
421
508
  if (streamBody instanceof Uint8Array) {
422
509
  return Promise.resolve(streamBody);
423
510
  }
424
511
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
425
512
  };
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;
513
+ var collectBodyString = function (streamBody, context) {
514
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
515
+ };
516
+ var isSerializableHeaderValue = function (value) {
517
+ return value !== undefined &&
518
+ value !== null &&
519
+ value !== "" &&
520
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
521
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
442
522
  };
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;
523
+ var parseBody = function (streamBody, context) {
524
+ return collectBodyString(streamBody, context).then(function (encoded) {
525
+ if (encoded.length) {
526
+ return JSON.parse(encoded);
527
+ }
528
+ return {};
529
+ });
530
+ };
531
+ var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
532
+ var value;
533
+ var _a;
534
+ return __generator(this, function (_b) {
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;
447
548
  if (typeof cleanValue === "number") {
448
549
  cleanValue = cleanValue.toString();
449
550
  }
@@ -458,7 +559,7 @@ const loadRestJsonErrorCode = (output, data) => {
458
559
  }
459
560
  return cleanValue;
460
561
  };
461
- const headerKey = findKey(output.headers, "x-amzn-errortype");
562
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
462
563
  if (headerKey !== undefined) {
463
564
  return sanitizeErrorCode(output.headers[headerKey]);
464
565
  }