@aws-sdk/client-textract 3.183.0 → 3.186.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,1010 +1,1225 @@
1
+ import { __assign, __awaiter, __generator } from "tslib";
1
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
3
  import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectString as __expectString, LazyJsonString as __LazyJsonString, limitedParseFloat32 as __limitedParseFloat32, throwDefaultError, } from "@aws-sdk/smithy-client";
3
4
  import { AccessDeniedException, BadDocumentException, DocumentTooLargeException, HumanLoopQuotaExceededException, IdempotentParameterMismatchException, InternalServerError, InvalidJobIdException, InvalidKMSKeyException, InvalidParameterException, InvalidS3ObjectException, LimitExceededException, ProvisionedThroughputExceededException, ThrottlingException, UnsupportedDocumentException, } from "../models/models_0";
4
5
  import { TextractServiceException as __BaseException } from "../models/TextractServiceException";
5
- export const serializeAws_json1_1AnalyzeDocumentCommand = async (input, context) => {
6
- const headers = {
7
- "content-type": "application/x-amz-json-1.1",
8
- "x-amz-target": "Textract.AnalyzeDocument",
9
- };
10
- let body;
11
- body = JSON.stringify(serializeAws_json1_1AnalyzeDocumentRequest(input, context));
12
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
- };
14
- export const serializeAws_json1_1AnalyzeExpenseCommand = async (input, context) => {
15
- const headers = {
16
- "content-type": "application/x-amz-json-1.1",
17
- "x-amz-target": "Textract.AnalyzeExpense",
18
- };
19
- let body;
20
- body = JSON.stringify(serializeAws_json1_1AnalyzeExpenseRequest(input, context));
21
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
- };
23
- export const serializeAws_json1_1AnalyzeIDCommand = async (input, context) => {
24
- const headers = {
25
- "content-type": "application/x-amz-json-1.1",
26
- "x-amz-target": "Textract.AnalyzeID",
27
- };
28
- let body;
29
- body = JSON.stringify(serializeAws_json1_1AnalyzeIDRequest(input, context));
30
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
- };
32
- export const serializeAws_json1_1DetectDocumentTextCommand = async (input, context) => {
33
- const headers = {
34
- "content-type": "application/x-amz-json-1.1",
35
- "x-amz-target": "Textract.DetectDocumentText",
36
- };
37
- let body;
38
- body = JSON.stringify(serializeAws_json1_1DetectDocumentTextRequest(input, context));
39
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
- };
41
- export const serializeAws_json1_1GetDocumentAnalysisCommand = async (input, context) => {
42
- const headers = {
43
- "content-type": "application/x-amz-json-1.1",
44
- "x-amz-target": "Textract.GetDocumentAnalysis",
45
- };
46
- let body;
47
- body = JSON.stringify(serializeAws_json1_1GetDocumentAnalysisRequest(input, context));
48
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
- };
50
- export const serializeAws_json1_1GetDocumentTextDetectionCommand = async (input, context) => {
51
- const headers = {
52
- "content-type": "application/x-amz-json-1.1",
53
- "x-amz-target": "Textract.GetDocumentTextDetection",
54
- };
55
- let body;
56
- body = JSON.stringify(serializeAws_json1_1GetDocumentTextDetectionRequest(input, context));
57
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
- };
59
- export const serializeAws_json1_1GetExpenseAnalysisCommand = async (input, context) => {
60
- const headers = {
61
- "content-type": "application/x-amz-json-1.1",
62
- "x-amz-target": "Textract.GetExpenseAnalysis",
63
- };
64
- let body;
65
- body = JSON.stringify(serializeAws_json1_1GetExpenseAnalysisRequest(input, context));
66
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
67
- };
68
- export const serializeAws_json1_1StartDocumentAnalysisCommand = async (input, context) => {
69
- const headers = {
70
- "content-type": "application/x-amz-json-1.1",
71
- "x-amz-target": "Textract.StartDocumentAnalysis",
72
- };
73
- let body;
74
- body = JSON.stringify(serializeAws_json1_1StartDocumentAnalysisRequest(input, context));
75
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
- };
77
- export const serializeAws_json1_1StartDocumentTextDetectionCommand = async (input, context) => {
78
- const headers = {
79
- "content-type": "application/x-amz-json-1.1",
80
- "x-amz-target": "Textract.StartDocumentTextDetection",
81
- };
82
- let body;
83
- body = JSON.stringify(serializeAws_json1_1StartDocumentTextDetectionRequest(input, context));
84
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
85
- };
86
- export const serializeAws_json1_1StartExpenseAnalysisCommand = async (input, context) => {
87
- const headers = {
88
- "content-type": "application/x-amz-json-1.1",
89
- "x-amz-target": "Textract.StartExpenseAnalysis",
90
- };
91
- let body;
92
- body = JSON.stringify(serializeAws_json1_1StartExpenseAnalysisRequest(input, context));
93
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
94
- };
95
- export const deserializeAws_json1_1AnalyzeDocumentCommand = async (output, context) => {
96
- if (output.statusCode >= 300) {
97
- return deserializeAws_json1_1AnalyzeDocumentCommandError(output, context);
98
- }
99
- const data = await parseBody(output.body, context);
100
- let contents = {};
101
- contents = deserializeAws_json1_1AnalyzeDocumentResponse(data, context);
102
- const response = {
103
- $metadata: deserializeMetadata(output),
104
- ...contents,
105
- };
106
- return Promise.resolve(response);
107
- };
108
- const deserializeAws_json1_1AnalyzeDocumentCommandError = 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 "AccessDeniedException":
116
- case "com.amazonaws.textract#AccessDeniedException":
117
- throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
118
- case "BadDocumentException":
119
- case "com.amazonaws.textract#BadDocumentException":
120
- throw await deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context);
121
- case "DocumentTooLargeException":
122
- case "com.amazonaws.textract#DocumentTooLargeException":
123
- throw await deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context);
124
- case "HumanLoopQuotaExceededException":
125
- case "com.amazonaws.textract#HumanLoopQuotaExceededException":
126
- throw await deserializeAws_json1_1HumanLoopQuotaExceededExceptionResponse(parsedOutput, context);
127
- case "InternalServerError":
128
- case "com.amazonaws.textract#InternalServerError":
129
- throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
130
- case "InvalidParameterException":
131
- case "com.amazonaws.textract#InvalidParameterException":
132
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
133
- case "InvalidS3ObjectException":
134
- case "com.amazonaws.textract#InvalidS3ObjectException":
135
- throw await deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context);
136
- case "ProvisionedThroughputExceededException":
137
- case "com.amazonaws.textract#ProvisionedThroughputExceededException":
138
- throw await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context);
139
- case "ThrottlingException":
140
- case "com.amazonaws.textract#ThrottlingException":
141
- throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
142
- case "UnsupportedDocumentException":
143
- case "com.amazonaws.textract#UnsupportedDocumentException":
144
- throw await deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context);
145
- default:
146
- const parsedBody = parsedOutput.body;
147
- throwDefaultError({
148
- output,
149
- parsedBody,
150
- exceptionCtor: __BaseException,
151
- errorCode,
152
- });
153
- }
154
- };
155
- export const deserializeAws_json1_1AnalyzeExpenseCommand = async (output, context) => {
156
- if (output.statusCode >= 300) {
157
- return deserializeAws_json1_1AnalyzeExpenseCommandError(output, context);
158
- }
159
- const data = await parseBody(output.body, context);
160
- let contents = {};
161
- contents = deserializeAws_json1_1AnalyzeExpenseResponse(data, context);
162
- const response = {
163
- $metadata: deserializeMetadata(output),
164
- ...contents,
165
- };
166
- return Promise.resolve(response);
167
- };
168
- const deserializeAws_json1_1AnalyzeExpenseCommandError = async (output, context) => {
169
- const parsedOutput = {
170
- ...output,
171
- body: await parseErrorBody(output.body, context),
172
- };
173
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
174
- switch (errorCode) {
175
- case "AccessDeniedException":
176
- case "com.amazonaws.textract#AccessDeniedException":
177
- throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
178
- case "BadDocumentException":
179
- case "com.amazonaws.textract#BadDocumentException":
180
- throw await deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context);
181
- case "DocumentTooLargeException":
182
- case "com.amazonaws.textract#DocumentTooLargeException":
183
- throw await deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context);
184
- case "InternalServerError":
185
- case "com.amazonaws.textract#InternalServerError":
186
- throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
187
- case "InvalidParameterException":
188
- case "com.amazonaws.textract#InvalidParameterException":
189
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
190
- case "InvalidS3ObjectException":
191
- case "com.amazonaws.textract#InvalidS3ObjectException":
192
- throw await deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context);
193
- case "ProvisionedThroughputExceededException":
194
- case "com.amazonaws.textract#ProvisionedThroughputExceededException":
195
- throw await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context);
196
- case "ThrottlingException":
197
- case "com.amazonaws.textract#ThrottlingException":
198
- throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
199
- case "UnsupportedDocumentException":
200
- case "com.amazonaws.textract#UnsupportedDocumentException":
201
- throw await deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context);
202
- default:
203
- const parsedBody = parsedOutput.body;
204
- throwDefaultError({
205
- output,
206
- parsedBody,
207
- exceptionCtor: __BaseException,
208
- errorCode,
209
- });
210
- }
211
- };
212
- export const deserializeAws_json1_1AnalyzeIDCommand = async (output, context) => {
213
- if (output.statusCode >= 300) {
214
- return deserializeAws_json1_1AnalyzeIDCommandError(output, context);
215
- }
216
- const data = await parseBody(output.body, context);
217
- let contents = {};
218
- contents = deserializeAws_json1_1AnalyzeIDResponse(data, context);
219
- const response = {
220
- $metadata: deserializeMetadata(output),
221
- ...contents,
222
- };
223
- return Promise.resolve(response);
224
- };
225
- const deserializeAws_json1_1AnalyzeIDCommandError = async (output, context) => {
226
- const parsedOutput = {
227
- ...output,
228
- body: await parseErrorBody(output.body, context),
229
- };
230
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
231
- switch (errorCode) {
232
- case "AccessDeniedException":
233
- case "com.amazonaws.textract#AccessDeniedException":
234
- throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
235
- case "BadDocumentException":
236
- case "com.amazonaws.textract#BadDocumentException":
237
- throw await deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context);
238
- case "DocumentTooLargeException":
239
- case "com.amazonaws.textract#DocumentTooLargeException":
240
- throw await deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context);
241
- case "InternalServerError":
242
- case "com.amazonaws.textract#InternalServerError":
243
- throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
244
- case "InvalidParameterException":
245
- case "com.amazonaws.textract#InvalidParameterException":
246
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
247
- case "InvalidS3ObjectException":
248
- case "com.amazonaws.textract#InvalidS3ObjectException":
249
- throw await deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context);
250
- case "ProvisionedThroughputExceededException":
251
- case "com.amazonaws.textract#ProvisionedThroughputExceededException":
252
- throw await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context);
253
- case "ThrottlingException":
254
- case "com.amazonaws.textract#ThrottlingException":
255
- throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
256
- case "UnsupportedDocumentException":
257
- case "com.amazonaws.textract#UnsupportedDocumentException":
258
- throw await deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context);
259
- default:
260
- const parsedBody = parsedOutput.body;
261
- throwDefaultError({
262
- output,
263
- parsedBody,
264
- exceptionCtor: __BaseException,
265
- errorCode,
266
- });
267
- }
268
- };
269
- export const deserializeAws_json1_1DetectDocumentTextCommand = async (output, context) => {
270
- if (output.statusCode >= 300) {
271
- return deserializeAws_json1_1DetectDocumentTextCommandError(output, context);
272
- }
273
- const data = await parseBody(output.body, context);
274
- let contents = {};
275
- contents = deserializeAws_json1_1DetectDocumentTextResponse(data, context);
276
- const response = {
277
- $metadata: deserializeMetadata(output),
278
- ...contents,
279
- };
280
- return Promise.resolve(response);
281
- };
282
- const deserializeAws_json1_1DetectDocumentTextCommandError = async (output, context) => {
283
- const parsedOutput = {
284
- ...output,
285
- body: await parseErrorBody(output.body, context),
286
- };
287
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
288
- switch (errorCode) {
289
- case "AccessDeniedException":
290
- case "com.amazonaws.textract#AccessDeniedException":
291
- throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
292
- case "BadDocumentException":
293
- case "com.amazonaws.textract#BadDocumentException":
294
- throw await deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context);
295
- case "DocumentTooLargeException":
296
- case "com.amazonaws.textract#DocumentTooLargeException":
297
- throw await deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context);
298
- case "InternalServerError":
299
- case "com.amazonaws.textract#InternalServerError":
300
- throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
301
- case "InvalidParameterException":
302
- case "com.amazonaws.textract#InvalidParameterException":
303
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
304
- case "InvalidS3ObjectException":
305
- case "com.amazonaws.textract#InvalidS3ObjectException":
306
- throw await deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context);
307
- case "ProvisionedThroughputExceededException":
308
- case "com.amazonaws.textract#ProvisionedThroughputExceededException":
309
- throw await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context);
310
- case "ThrottlingException":
311
- case "com.amazonaws.textract#ThrottlingException":
312
- throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
313
- case "UnsupportedDocumentException":
314
- case "com.amazonaws.textract#UnsupportedDocumentException":
315
- throw await deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context);
316
- default:
317
- const parsedBody = parsedOutput.body;
318
- throwDefaultError({
319
- output,
320
- parsedBody,
321
- exceptionCtor: __BaseException,
322
- errorCode,
323
- });
324
- }
325
- };
326
- export const deserializeAws_json1_1GetDocumentAnalysisCommand = async (output, context) => {
327
- if (output.statusCode >= 300) {
328
- return deserializeAws_json1_1GetDocumentAnalysisCommandError(output, context);
329
- }
330
- const data = await parseBody(output.body, context);
331
- let contents = {};
332
- contents = deserializeAws_json1_1GetDocumentAnalysisResponse(data, context);
333
- const response = {
334
- $metadata: deserializeMetadata(output),
335
- ...contents,
336
- };
337
- return Promise.resolve(response);
338
- };
339
- const deserializeAws_json1_1GetDocumentAnalysisCommandError = async (output, context) => {
340
- const parsedOutput = {
341
- ...output,
342
- body: await parseErrorBody(output.body, context),
343
- };
344
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
345
- switch (errorCode) {
346
- case "AccessDeniedException":
347
- case "com.amazonaws.textract#AccessDeniedException":
348
- throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
349
- case "InternalServerError":
350
- case "com.amazonaws.textract#InternalServerError":
351
- throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
352
- case "InvalidJobIdException":
353
- case "com.amazonaws.textract#InvalidJobIdException":
354
- throw await deserializeAws_json1_1InvalidJobIdExceptionResponse(parsedOutput, context);
355
- case "InvalidKMSKeyException":
356
- case "com.amazonaws.textract#InvalidKMSKeyException":
357
- throw await deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context);
358
- case "InvalidParameterException":
359
- case "com.amazonaws.textract#InvalidParameterException":
360
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
361
- case "InvalidS3ObjectException":
362
- case "com.amazonaws.textract#InvalidS3ObjectException":
363
- throw await deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context);
364
- case "ProvisionedThroughputExceededException":
365
- case "com.amazonaws.textract#ProvisionedThroughputExceededException":
366
- throw await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context);
367
- case "ThrottlingException":
368
- case "com.amazonaws.textract#ThrottlingException":
369
- throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
370
- default:
371
- const parsedBody = parsedOutput.body;
372
- throwDefaultError({
373
- output,
374
- parsedBody,
375
- exceptionCtor: __BaseException,
376
- errorCode,
377
- });
378
- }
379
- };
380
- export const deserializeAws_json1_1GetDocumentTextDetectionCommand = async (output, context) => {
381
- if (output.statusCode >= 300) {
382
- return deserializeAws_json1_1GetDocumentTextDetectionCommandError(output, context);
383
- }
384
- const data = await parseBody(output.body, context);
385
- let contents = {};
386
- contents = deserializeAws_json1_1GetDocumentTextDetectionResponse(data, context);
387
- const response = {
388
- $metadata: deserializeMetadata(output),
389
- ...contents,
390
- };
391
- return Promise.resolve(response);
392
- };
393
- const deserializeAws_json1_1GetDocumentTextDetectionCommandError = async (output, context) => {
394
- const parsedOutput = {
395
- ...output,
396
- body: await parseErrorBody(output.body, context),
397
- };
398
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
399
- switch (errorCode) {
400
- case "AccessDeniedException":
401
- case "com.amazonaws.textract#AccessDeniedException":
402
- throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
403
- case "InternalServerError":
404
- case "com.amazonaws.textract#InternalServerError":
405
- throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
406
- case "InvalidJobIdException":
407
- case "com.amazonaws.textract#InvalidJobIdException":
408
- throw await deserializeAws_json1_1InvalidJobIdExceptionResponse(parsedOutput, context);
409
- case "InvalidKMSKeyException":
410
- case "com.amazonaws.textract#InvalidKMSKeyException":
411
- throw await deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context);
412
- case "InvalidParameterException":
413
- case "com.amazonaws.textract#InvalidParameterException":
414
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
415
- case "InvalidS3ObjectException":
416
- case "com.amazonaws.textract#InvalidS3ObjectException":
417
- throw await deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context);
418
- case "ProvisionedThroughputExceededException":
419
- case "com.amazonaws.textract#ProvisionedThroughputExceededException":
420
- throw await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context);
421
- case "ThrottlingException":
422
- case "com.amazonaws.textract#ThrottlingException":
423
- throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
424
- default:
425
- const parsedBody = parsedOutput.body;
426
- throwDefaultError({
427
- output,
428
- parsedBody,
429
- exceptionCtor: __BaseException,
430
- errorCode,
431
- });
432
- }
433
- };
434
- export const deserializeAws_json1_1GetExpenseAnalysisCommand = async (output, context) => {
435
- if (output.statusCode >= 300) {
436
- return deserializeAws_json1_1GetExpenseAnalysisCommandError(output, context);
437
- }
438
- const data = await parseBody(output.body, context);
439
- let contents = {};
440
- contents = deserializeAws_json1_1GetExpenseAnalysisResponse(data, context);
441
- const response = {
442
- $metadata: deserializeMetadata(output),
443
- ...contents,
444
- };
445
- return Promise.resolve(response);
446
- };
447
- const deserializeAws_json1_1GetExpenseAnalysisCommandError = async (output, context) => {
448
- const parsedOutput = {
449
- ...output,
450
- body: await parseErrorBody(output.body, context),
451
- };
452
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
453
- switch (errorCode) {
454
- case "AccessDeniedException":
455
- case "com.amazonaws.textract#AccessDeniedException":
456
- throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
457
- case "InternalServerError":
458
- case "com.amazonaws.textract#InternalServerError":
459
- throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
460
- case "InvalidJobIdException":
461
- case "com.amazonaws.textract#InvalidJobIdException":
462
- throw await deserializeAws_json1_1InvalidJobIdExceptionResponse(parsedOutput, context);
463
- case "InvalidKMSKeyException":
464
- case "com.amazonaws.textract#InvalidKMSKeyException":
465
- throw await deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context);
466
- case "InvalidParameterException":
467
- case "com.amazonaws.textract#InvalidParameterException":
468
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
469
- case "InvalidS3ObjectException":
470
- case "com.amazonaws.textract#InvalidS3ObjectException":
471
- throw await deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context);
472
- case "ProvisionedThroughputExceededException":
473
- case "com.amazonaws.textract#ProvisionedThroughputExceededException":
474
- throw await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context);
475
- case "ThrottlingException":
476
- case "com.amazonaws.textract#ThrottlingException":
477
- throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
478
- default:
479
- const parsedBody = parsedOutput.body;
480
- throwDefaultError({
481
- output,
482
- parsedBody,
483
- exceptionCtor: __BaseException,
484
- errorCode,
485
- });
486
- }
487
- };
488
- export const deserializeAws_json1_1StartDocumentAnalysisCommand = async (output, context) => {
489
- if (output.statusCode >= 300) {
490
- return deserializeAws_json1_1StartDocumentAnalysisCommandError(output, context);
491
- }
492
- const data = await parseBody(output.body, context);
493
- let contents = {};
494
- contents = deserializeAws_json1_1StartDocumentAnalysisResponse(data, context);
495
- const response = {
496
- $metadata: deserializeMetadata(output),
497
- ...contents,
498
- };
499
- return Promise.resolve(response);
500
- };
501
- const deserializeAws_json1_1StartDocumentAnalysisCommandError = async (output, context) => {
502
- const parsedOutput = {
503
- ...output,
504
- body: await parseErrorBody(output.body, context),
505
- };
506
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
507
- switch (errorCode) {
508
- case "AccessDeniedException":
509
- case "com.amazonaws.textract#AccessDeniedException":
510
- throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
511
- case "BadDocumentException":
512
- case "com.amazonaws.textract#BadDocumentException":
513
- throw await deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context);
514
- case "DocumentTooLargeException":
515
- case "com.amazonaws.textract#DocumentTooLargeException":
516
- throw await deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context);
517
- case "IdempotentParameterMismatchException":
518
- case "com.amazonaws.textract#IdempotentParameterMismatchException":
519
- throw await deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse(parsedOutput, context);
520
- case "InternalServerError":
521
- case "com.amazonaws.textract#InternalServerError":
522
- throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
523
- case "InvalidKMSKeyException":
524
- case "com.amazonaws.textract#InvalidKMSKeyException":
525
- throw await deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context);
526
- case "InvalidParameterException":
527
- case "com.amazonaws.textract#InvalidParameterException":
528
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
529
- case "InvalidS3ObjectException":
530
- case "com.amazonaws.textract#InvalidS3ObjectException":
531
- throw await deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context);
532
- case "LimitExceededException":
533
- case "com.amazonaws.textract#LimitExceededException":
534
- throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
535
- case "ProvisionedThroughputExceededException":
536
- case "com.amazonaws.textract#ProvisionedThroughputExceededException":
537
- throw await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context);
538
- case "ThrottlingException":
539
- case "com.amazonaws.textract#ThrottlingException":
540
- throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
541
- case "UnsupportedDocumentException":
542
- case "com.amazonaws.textract#UnsupportedDocumentException":
543
- throw await deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context);
544
- default:
545
- const parsedBody = parsedOutput.body;
546
- throwDefaultError({
547
- output,
548
- parsedBody,
549
- exceptionCtor: __BaseException,
550
- errorCode,
551
- });
552
- }
553
- };
554
- export const deserializeAws_json1_1StartDocumentTextDetectionCommand = async (output, context) => {
555
- if (output.statusCode >= 300) {
556
- return deserializeAws_json1_1StartDocumentTextDetectionCommandError(output, context);
557
- }
558
- const data = await parseBody(output.body, context);
559
- let contents = {};
560
- contents = deserializeAws_json1_1StartDocumentTextDetectionResponse(data, context);
561
- const response = {
562
- $metadata: deserializeMetadata(output),
563
- ...contents,
564
- };
565
- return Promise.resolve(response);
566
- };
567
- const deserializeAws_json1_1StartDocumentTextDetectionCommandError = async (output, context) => {
568
- const parsedOutput = {
569
- ...output,
570
- body: await parseErrorBody(output.body, context),
571
- };
572
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
573
- switch (errorCode) {
574
- case "AccessDeniedException":
575
- case "com.amazonaws.textract#AccessDeniedException":
576
- throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
577
- case "BadDocumentException":
578
- case "com.amazonaws.textract#BadDocumentException":
579
- throw await deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context);
580
- case "DocumentTooLargeException":
581
- case "com.amazonaws.textract#DocumentTooLargeException":
582
- throw await deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context);
583
- case "IdempotentParameterMismatchException":
584
- case "com.amazonaws.textract#IdempotentParameterMismatchException":
585
- throw await deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse(parsedOutput, context);
586
- case "InternalServerError":
587
- case "com.amazonaws.textract#InternalServerError":
588
- throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
589
- case "InvalidKMSKeyException":
590
- case "com.amazonaws.textract#InvalidKMSKeyException":
591
- throw await deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context);
592
- case "InvalidParameterException":
593
- case "com.amazonaws.textract#InvalidParameterException":
594
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
595
- case "InvalidS3ObjectException":
596
- case "com.amazonaws.textract#InvalidS3ObjectException":
597
- throw await deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context);
598
- case "LimitExceededException":
599
- case "com.amazonaws.textract#LimitExceededException":
600
- throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
601
- case "ProvisionedThroughputExceededException":
602
- case "com.amazonaws.textract#ProvisionedThroughputExceededException":
603
- throw await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context);
604
- case "ThrottlingException":
605
- case "com.amazonaws.textract#ThrottlingException":
606
- throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
607
- case "UnsupportedDocumentException":
608
- case "com.amazonaws.textract#UnsupportedDocumentException":
609
- throw await deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context);
610
- default:
611
- const parsedBody = parsedOutput.body;
612
- throwDefaultError({
613
- output,
614
- parsedBody,
615
- exceptionCtor: __BaseException,
616
- errorCode,
617
- });
618
- }
619
- };
620
- export const deserializeAws_json1_1StartExpenseAnalysisCommand = async (output, context) => {
621
- if (output.statusCode >= 300) {
622
- return deserializeAws_json1_1StartExpenseAnalysisCommandError(output, context);
623
- }
624
- const data = await parseBody(output.body, context);
625
- let contents = {};
626
- contents = deserializeAws_json1_1StartExpenseAnalysisResponse(data, context);
627
- const response = {
628
- $metadata: deserializeMetadata(output),
629
- ...contents,
630
- };
631
- return Promise.resolve(response);
632
- };
633
- const deserializeAws_json1_1StartExpenseAnalysisCommandError = async (output, context) => {
634
- const parsedOutput = {
635
- ...output,
636
- body: await parseErrorBody(output.body, context),
637
- };
638
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
639
- switch (errorCode) {
640
- case "AccessDeniedException":
641
- case "com.amazonaws.textract#AccessDeniedException":
642
- throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
643
- case "BadDocumentException":
644
- case "com.amazonaws.textract#BadDocumentException":
645
- throw await deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context);
646
- case "DocumentTooLargeException":
647
- case "com.amazonaws.textract#DocumentTooLargeException":
648
- throw await deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context);
649
- case "IdempotentParameterMismatchException":
650
- case "com.amazonaws.textract#IdempotentParameterMismatchException":
651
- throw await deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse(parsedOutput, context);
652
- case "InternalServerError":
653
- case "com.amazonaws.textract#InternalServerError":
654
- throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
655
- case "InvalidKMSKeyException":
656
- case "com.amazonaws.textract#InvalidKMSKeyException":
657
- throw await deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context);
658
- case "InvalidParameterException":
659
- case "com.amazonaws.textract#InvalidParameterException":
660
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
661
- case "InvalidS3ObjectException":
662
- case "com.amazonaws.textract#InvalidS3ObjectException":
663
- throw await deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context);
664
- case "LimitExceededException":
665
- case "com.amazonaws.textract#LimitExceededException":
666
- throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
667
- case "ProvisionedThroughputExceededException":
668
- case "com.amazonaws.textract#ProvisionedThroughputExceededException":
669
- throw await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context);
670
- case "ThrottlingException":
671
- case "com.amazonaws.textract#ThrottlingException":
672
- throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
673
- case "UnsupportedDocumentException":
674
- case "com.amazonaws.textract#UnsupportedDocumentException":
675
- throw await deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context);
676
- default:
677
- const parsedBody = parsedOutput.body;
678
- throwDefaultError({
679
- output,
680
- parsedBody,
681
- exceptionCtor: __BaseException,
682
- errorCode,
683
- });
684
- }
685
- };
686
- const deserializeAws_json1_1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
687
- const body = parsedOutput.body;
688
- const deserialized = deserializeAws_json1_1AccessDeniedException(body, context);
689
- const exception = new AccessDeniedException({
690
- $metadata: deserializeMetadata(parsedOutput),
691
- ...deserialized,
692
- });
693
- return __decorateServiceException(exception, body);
694
- };
695
- const deserializeAws_json1_1BadDocumentExceptionResponse = async (parsedOutput, context) => {
696
- const body = parsedOutput.body;
697
- const deserialized = deserializeAws_json1_1BadDocumentException(body, context);
698
- const exception = new BadDocumentException({
699
- $metadata: deserializeMetadata(parsedOutput),
700
- ...deserialized,
701
- });
702
- return __decorateServiceException(exception, body);
703
- };
704
- const deserializeAws_json1_1DocumentTooLargeExceptionResponse = async (parsedOutput, context) => {
705
- const body = parsedOutput.body;
706
- const deserialized = deserializeAws_json1_1DocumentTooLargeException(body, context);
707
- const exception = new DocumentTooLargeException({
708
- $metadata: deserializeMetadata(parsedOutput),
709
- ...deserialized,
710
- });
711
- return __decorateServiceException(exception, body);
712
- };
713
- const deserializeAws_json1_1HumanLoopQuotaExceededExceptionResponse = async (parsedOutput, context) => {
714
- const body = parsedOutput.body;
715
- const deserialized = deserializeAws_json1_1HumanLoopQuotaExceededException(body, context);
716
- const exception = new HumanLoopQuotaExceededException({
717
- $metadata: deserializeMetadata(parsedOutput),
718
- ...deserialized,
719
- });
720
- return __decorateServiceException(exception, body);
721
- };
722
- const deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse = async (parsedOutput, context) => {
723
- const body = parsedOutput.body;
724
- const deserialized = deserializeAws_json1_1IdempotentParameterMismatchException(body, context);
725
- const exception = new IdempotentParameterMismatchException({
726
- $metadata: deserializeMetadata(parsedOutput),
727
- ...deserialized,
728
- });
729
- return __decorateServiceException(exception, body);
730
- };
731
- const deserializeAws_json1_1InternalServerErrorResponse = async (parsedOutput, context) => {
732
- const body = parsedOutput.body;
733
- const deserialized = deserializeAws_json1_1InternalServerError(body, context);
734
- const exception = new InternalServerError({
735
- $metadata: deserializeMetadata(parsedOutput),
736
- ...deserialized,
737
- });
738
- return __decorateServiceException(exception, body);
739
- };
740
- const deserializeAws_json1_1InvalidJobIdExceptionResponse = async (parsedOutput, context) => {
741
- const body = parsedOutput.body;
742
- const deserialized = deserializeAws_json1_1InvalidJobIdException(body, context);
743
- const exception = new InvalidJobIdException({
744
- $metadata: deserializeMetadata(parsedOutput),
745
- ...deserialized,
746
- });
747
- return __decorateServiceException(exception, body);
748
- };
749
- const deserializeAws_json1_1InvalidKMSKeyExceptionResponse = async (parsedOutput, context) => {
750
- const body = parsedOutput.body;
751
- const deserialized = deserializeAws_json1_1InvalidKMSKeyException(body, context);
752
- const exception = new InvalidKMSKeyException({
753
- $metadata: deserializeMetadata(parsedOutput),
754
- ...deserialized,
755
- });
756
- return __decorateServiceException(exception, body);
757
- };
758
- const deserializeAws_json1_1InvalidParameterExceptionResponse = async (parsedOutput, context) => {
759
- const body = parsedOutput.body;
760
- const deserialized = deserializeAws_json1_1InvalidParameterException(body, context);
761
- const exception = new InvalidParameterException({
762
- $metadata: deserializeMetadata(parsedOutput),
763
- ...deserialized,
764
- });
765
- return __decorateServiceException(exception, body);
766
- };
767
- const deserializeAws_json1_1InvalidS3ObjectExceptionResponse = async (parsedOutput, context) => {
768
- const body = parsedOutput.body;
769
- const deserialized = deserializeAws_json1_1InvalidS3ObjectException(body, context);
770
- const exception = new InvalidS3ObjectException({
771
- $metadata: deserializeMetadata(parsedOutput),
772
- ...deserialized,
773
- });
774
- return __decorateServiceException(exception, body);
775
- };
776
- const deserializeAws_json1_1LimitExceededExceptionResponse = async (parsedOutput, context) => {
777
- const body = parsedOutput.body;
778
- const deserialized = deserializeAws_json1_1LimitExceededException(body, context);
779
- const exception = new LimitExceededException({
780
- $metadata: deserializeMetadata(parsedOutput),
781
- ...deserialized,
782
- });
783
- return __decorateServiceException(exception, body);
784
- };
785
- const deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse = async (parsedOutput, context) => {
786
- const body = parsedOutput.body;
787
- const deserialized = deserializeAws_json1_1ProvisionedThroughputExceededException(body, context);
788
- const exception = new ProvisionedThroughputExceededException({
789
- $metadata: deserializeMetadata(parsedOutput),
790
- ...deserialized,
791
- });
792
- return __decorateServiceException(exception, body);
793
- };
794
- const deserializeAws_json1_1ThrottlingExceptionResponse = async (parsedOutput, context) => {
795
- const body = parsedOutput.body;
796
- const deserialized = deserializeAws_json1_1ThrottlingException(body, context);
797
- const exception = new ThrottlingException({
798
- $metadata: deserializeMetadata(parsedOutput),
799
- ...deserialized,
800
- });
801
- return __decorateServiceException(exception, body);
802
- };
803
- const deserializeAws_json1_1UnsupportedDocumentExceptionResponse = async (parsedOutput, context) => {
804
- const body = parsedOutput.body;
805
- const deserialized = deserializeAws_json1_1UnsupportedDocumentException(body, context);
806
- const exception = new UnsupportedDocumentException({
807
- $metadata: deserializeMetadata(parsedOutput),
808
- ...deserialized,
809
- });
810
- return __decorateServiceException(exception, body);
811
- };
812
- const serializeAws_json1_1AnalyzeDocumentRequest = (input, context) => {
813
- return {
814
- ...(input.Document != null && { Document: serializeAws_json1_1Document(input.Document, context) }),
815
- ...(input.FeatureTypes != null && { FeatureTypes: serializeAws_json1_1FeatureTypes(input.FeatureTypes, context) }),
816
- ...(input.HumanLoopConfig != null && {
817
- HumanLoopConfig: serializeAws_json1_1HumanLoopConfig(input.HumanLoopConfig, context),
818
- }),
819
- ...(input.QueriesConfig != null && {
820
- QueriesConfig: serializeAws_json1_1QueriesConfig(input.QueriesConfig, context),
821
- }),
822
- };
823
- };
824
- const serializeAws_json1_1AnalyzeExpenseRequest = (input, context) => {
825
- return {
826
- ...(input.Document != null && { Document: serializeAws_json1_1Document(input.Document, context) }),
827
- };
828
- };
829
- const serializeAws_json1_1AnalyzeIDRequest = (input, context) => {
830
- return {
831
- ...(input.DocumentPages != null && {
832
- DocumentPages: serializeAws_json1_1DocumentPages(input.DocumentPages, context),
833
- }),
834
- };
835
- };
836
- const serializeAws_json1_1ContentClassifiers = (input, context) => {
6
+ export var serializeAws_json1_1AnalyzeDocumentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
+ var headers, body;
8
+ return __generator(this, function (_a) {
9
+ headers = {
10
+ "content-type": "application/x-amz-json-1.1",
11
+ "x-amz-target": "Textract.AnalyzeDocument",
12
+ };
13
+ body = JSON.stringify(serializeAws_json1_1AnalyzeDocumentRequest(input, context));
14
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
15
+ });
16
+ }); };
17
+ export var serializeAws_json1_1AnalyzeExpenseCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
18
+ var headers, body;
19
+ return __generator(this, function (_a) {
20
+ headers = {
21
+ "content-type": "application/x-amz-json-1.1",
22
+ "x-amz-target": "Textract.AnalyzeExpense",
23
+ };
24
+ body = JSON.stringify(serializeAws_json1_1AnalyzeExpenseRequest(input, context));
25
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
26
+ });
27
+ }); };
28
+ export var serializeAws_json1_1AnalyzeIDCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
29
+ var headers, body;
30
+ return __generator(this, function (_a) {
31
+ headers = {
32
+ "content-type": "application/x-amz-json-1.1",
33
+ "x-amz-target": "Textract.AnalyzeID",
34
+ };
35
+ body = JSON.stringify(serializeAws_json1_1AnalyzeIDRequest(input, context));
36
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
37
+ });
38
+ }); };
39
+ export var serializeAws_json1_1DetectDocumentTextCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
40
+ var headers, body;
41
+ return __generator(this, function (_a) {
42
+ headers = {
43
+ "content-type": "application/x-amz-json-1.1",
44
+ "x-amz-target": "Textract.DetectDocumentText",
45
+ };
46
+ body = JSON.stringify(serializeAws_json1_1DetectDocumentTextRequest(input, context));
47
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
48
+ });
49
+ }); };
50
+ export var serializeAws_json1_1GetDocumentAnalysisCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
51
+ var headers, body;
52
+ return __generator(this, function (_a) {
53
+ headers = {
54
+ "content-type": "application/x-amz-json-1.1",
55
+ "x-amz-target": "Textract.GetDocumentAnalysis",
56
+ };
57
+ body = JSON.stringify(serializeAws_json1_1GetDocumentAnalysisRequest(input, context));
58
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
59
+ });
60
+ }); };
61
+ export var serializeAws_json1_1GetDocumentTextDetectionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
62
+ var headers, body;
63
+ return __generator(this, function (_a) {
64
+ headers = {
65
+ "content-type": "application/x-amz-json-1.1",
66
+ "x-amz-target": "Textract.GetDocumentTextDetection",
67
+ };
68
+ body = JSON.stringify(serializeAws_json1_1GetDocumentTextDetectionRequest(input, context));
69
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
70
+ });
71
+ }); };
72
+ export var serializeAws_json1_1GetExpenseAnalysisCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
73
+ var headers, body;
74
+ return __generator(this, function (_a) {
75
+ headers = {
76
+ "content-type": "application/x-amz-json-1.1",
77
+ "x-amz-target": "Textract.GetExpenseAnalysis",
78
+ };
79
+ body = JSON.stringify(serializeAws_json1_1GetExpenseAnalysisRequest(input, context));
80
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
81
+ });
82
+ }); };
83
+ export var serializeAws_json1_1StartDocumentAnalysisCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
84
+ var headers, body;
85
+ return __generator(this, function (_a) {
86
+ headers = {
87
+ "content-type": "application/x-amz-json-1.1",
88
+ "x-amz-target": "Textract.StartDocumentAnalysis",
89
+ };
90
+ body = JSON.stringify(serializeAws_json1_1StartDocumentAnalysisRequest(input, context));
91
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
92
+ });
93
+ }); };
94
+ export var serializeAws_json1_1StartDocumentTextDetectionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
95
+ var headers, body;
96
+ return __generator(this, function (_a) {
97
+ headers = {
98
+ "content-type": "application/x-amz-json-1.1",
99
+ "x-amz-target": "Textract.StartDocumentTextDetection",
100
+ };
101
+ body = JSON.stringify(serializeAws_json1_1StartDocumentTextDetectionRequest(input, context));
102
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
103
+ });
104
+ }); };
105
+ export var serializeAws_json1_1StartExpenseAnalysisCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
106
+ var headers, body;
107
+ return __generator(this, function (_a) {
108
+ headers = {
109
+ "content-type": "application/x-amz-json-1.1",
110
+ "x-amz-target": "Textract.StartExpenseAnalysis",
111
+ };
112
+ body = JSON.stringify(serializeAws_json1_1StartExpenseAnalysisRequest(input, context));
113
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
114
+ });
115
+ }); };
116
+ export var deserializeAws_json1_1AnalyzeDocumentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
117
+ var data, contents, response;
118
+ return __generator(this, function (_a) {
119
+ switch (_a.label) {
120
+ case 0:
121
+ if (output.statusCode >= 300) {
122
+ return [2, deserializeAws_json1_1AnalyzeDocumentCommandError(output, context)];
123
+ }
124
+ return [4, parseBody(output.body, context)];
125
+ case 1:
126
+ data = _a.sent();
127
+ contents = {};
128
+ contents = deserializeAws_json1_1AnalyzeDocumentResponse(data, context);
129
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
130
+ return [2, Promise.resolve(response)];
131
+ }
132
+ });
133
+ }); };
134
+ var deserializeAws_json1_1AnalyzeDocumentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
135
+ var parsedOutput, _a, errorCode, _b, parsedBody;
136
+ var _c;
137
+ return __generator(this, function (_d) {
138
+ switch (_d.label) {
139
+ case 0:
140
+ _a = [__assign({}, output)];
141
+ _c = {};
142
+ return [4, parseErrorBody(output.body, context)];
143
+ case 1:
144
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
145
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
146
+ _b = errorCode;
147
+ switch (_b) {
148
+ case "AccessDeniedException": return [3, 2];
149
+ case "com.amazonaws.textract#AccessDeniedException": return [3, 2];
150
+ case "BadDocumentException": return [3, 4];
151
+ case "com.amazonaws.textract#BadDocumentException": return [3, 4];
152
+ case "DocumentTooLargeException": return [3, 6];
153
+ case "com.amazonaws.textract#DocumentTooLargeException": return [3, 6];
154
+ case "HumanLoopQuotaExceededException": return [3, 8];
155
+ case "com.amazonaws.textract#HumanLoopQuotaExceededException": return [3, 8];
156
+ case "InternalServerError": return [3, 10];
157
+ case "com.amazonaws.textract#InternalServerError": return [3, 10];
158
+ case "InvalidParameterException": return [3, 12];
159
+ case "com.amazonaws.textract#InvalidParameterException": return [3, 12];
160
+ case "InvalidS3ObjectException": return [3, 14];
161
+ case "com.amazonaws.textract#InvalidS3ObjectException": return [3, 14];
162
+ case "ProvisionedThroughputExceededException": return [3, 16];
163
+ case "com.amazonaws.textract#ProvisionedThroughputExceededException": return [3, 16];
164
+ case "ThrottlingException": return [3, 18];
165
+ case "com.amazonaws.textract#ThrottlingException": return [3, 18];
166
+ case "UnsupportedDocumentException": return [3, 20];
167
+ case "com.amazonaws.textract#UnsupportedDocumentException": return [3, 20];
168
+ }
169
+ return [3, 22];
170
+ case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
171
+ case 3: throw _d.sent();
172
+ case 4: return [4, deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context)];
173
+ case 5: throw _d.sent();
174
+ case 6: return [4, deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context)];
175
+ case 7: throw _d.sent();
176
+ case 8: return [4, deserializeAws_json1_1HumanLoopQuotaExceededExceptionResponse(parsedOutput, context)];
177
+ case 9: throw _d.sent();
178
+ case 10: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
179
+ case 11: throw _d.sent();
180
+ case 12: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
181
+ case 13: throw _d.sent();
182
+ case 14: return [4, deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)];
183
+ case 15: throw _d.sent();
184
+ case 16: return [4, deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)];
185
+ case 17: throw _d.sent();
186
+ case 18: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
187
+ case 19: throw _d.sent();
188
+ case 20: return [4, deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context)];
189
+ case 21: throw _d.sent();
190
+ case 22:
191
+ parsedBody = parsedOutput.body;
192
+ throwDefaultError({
193
+ output: output,
194
+ parsedBody: parsedBody,
195
+ exceptionCtor: __BaseException,
196
+ errorCode: errorCode,
197
+ });
198
+ _d.label = 23;
199
+ case 23: return [2];
200
+ }
201
+ });
202
+ }); };
203
+ export var deserializeAws_json1_1AnalyzeExpenseCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
204
+ var data, contents, response;
205
+ return __generator(this, function (_a) {
206
+ switch (_a.label) {
207
+ case 0:
208
+ if (output.statusCode >= 300) {
209
+ return [2, deserializeAws_json1_1AnalyzeExpenseCommandError(output, context)];
210
+ }
211
+ return [4, parseBody(output.body, context)];
212
+ case 1:
213
+ data = _a.sent();
214
+ contents = {};
215
+ contents = deserializeAws_json1_1AnalyzeExpenseResponse(data, context);
216
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
217
+ return [2, Promise.resolve(response)];
218
+ }
219
+ });
220
+ }); };
221
+ var deserializeAws_json1_1AnalyzeExpenseCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
222
+ var parsedOutput, _a, errorCode, _b, parsedBody;
223
+ var _c;
224
+ return __generator(this, function (_d) {
225
+ switch (_d.label) {
226
+ case 0:
227
+ _a = [__assign({}, output)];
228
+ _c = {};
229
+ return [4, parseErrorBody(output.body, context)];
230
+ case 1:
231
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
232
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
233
+ _b = errorCode;
234
+ switch (_b) {
235
+ case "AccessDeniedException": return [3, 2];
236
+ case "com.amazonaws.textract#AccessDeniedException": return [3, 2];
237
+ case "BadDocumentException": return [3, 4];
238
+ case "com.amazonaws.textract#BadDocumentException": return [3, 4];
239
+ case "DocumentTooLargeException": return [3, 6];
240
+ case "com.amazonaws.textract#DocumentTooLargeException": return [3, 6];
241
+ case "InternalServerError": return [3, 8];
242
+ case "com.amazonaws.textract#InternalServerError": return [3, 8];
243
+ case "InvalidParameterException": return [3, 10];
244
+ case "com.amazonaws.textract#InvalidParameterException": return [3, 10];
245
+ case "InvalidS3ObjectException": return [3, 12];
246
+ case "com.amazonaws.textract#InvalidS3ObjectException": return [3, 12];
247
+ case "ProvisionedThroughputExceededException": return [3, 14];
248
+ case "com.amazonaws.textract#ProvisionedThroughputExceededException": return [3, 14];
249
+ case "ThrottlingException": return [3, 16];
250
+ case "com.amazonaws.textract#ThrottlingException": return [3, 16];
251
+ case "UnsupportedDocumentException": return [3, 18];
252
+ case "com.amazonaws.textract#UnsupportedDocumentException": return [3, 18];
253
+ }
254
+ return [3, 20];
255
+ case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
256
+ case 3: throw _d.sent();
257
+ case 4: return [4, deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context)];
258
+ case 5: throw _d.sent();
259
+ case 6: return [4, deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context)];
260
+ case 7: throw _d.sent();
261
+ case 8: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
262
+ case 9: throw _d.sent();
263
+ case 10: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
264
+ case 11: throw _d.sent();
265
+ case 12: return [4, deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)];
266
+ case 13: throw _d.sent();
267
+ case 14: return [4, deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)];
268
+ case 15: throw _d.sent();
269
+ case 16: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
270
+ case 17: throw _d.sent();
271
+ case 18: return [4, deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context)];
272
+ case 19: throw _d.sent();
273
+ case 20:
274
+ parsedBody = parsedOutput.body;
275
+ throwDefaultError({
276
+ output: output,
277
+ parsedBody: parsedBody,
278
+ exceptionCtor: __BaseException,
279
+ errorCode: errorCode,
280
+ });
281
+ _d.label = 21;
282
+ case 21: return [2];
283
+ }
284
+ });
285
+ }); };
286
+ export var deserializeAws_json1_1AnalyzeIDCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
287
+ var data, contents, response;
288
+ return __generator(this, function (_a) {
289
+ switch (_a.label) {
290
+ case 0:
291
+ if (output.statusCode >= 300) {
292
+ return [2, deserializeAws_json1_1AnalyzeIDCommandError(output, context)];
293
+ }
294
+ return [4, parseBody(output.body, context)];
295
+ case 1:
296
+ data = _a.sent();
297
+ contents = {};
298
+ contents = deserializeAws_json1_1AnalyzeIDResponse(data, context);
299
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
300
+ return [2, Promise.resolve(response)];
301
+ }
302
+ });
303
+ }); };
304
+ var deserializeAws_json1_1AnalyzeIDCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
305
+ var parsedOutput, _a, errorCode, _b, parsedBody;
306
+ var _c;
307
+ return __generator(this, function (_d) {
308
+ switch (_d.label) {
309
+ case 0:
310
+ _a = [__assign({}, output)];
311
+ _c = {};
312
+ return [4, parseErrorBody(output.body, context)];
313
+ case 1:
314
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
315
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
316
+ _b = errorCode;
317
+ switch (_b) {
318
+ case "AccessDeniedException": return [3, 2];
319
+ case "com.amazonaws.textract#AccessDeniedException": return [3, 2];
320
+ case "BadDocumentException": return [3, 4];
321
+ case "com.amazonaws.textract#BadDocumentException": return [3, 4];
322
+ case "DocumentTooLargeException": return [3, 6];
323
+ case "com.amazonaws.textract#DocumentTooLargeException": return [3, 6];
324
+ case "InternalServerError": return [3, 8];
325
+ case "com.amazonaws.textract#InternalServerError": return [3, 8];
326
+ case "InvalidParameterException": return [3, 10];
327
+ case "com.amazonaws.textract#InvalidParameterException": return [3, 10];
328
+ case "InvalidS3ObjectException": return [3, 12];
329
+ case "com.amazonaws.textract#InvalidS3ObjectException": return [3, 12];
330
+ case "ProvisionedThroughputExceededException": return [3, 14];
331
+ case "com.amazonaws.textract#ProvisionedThroughputExceededException": return [3, 14];
332
+ case "ThrottlingException": return [3, 16];
333
+ case "com.amazonaws.textract#ThrottlingException": return [3, 16];
334
+ case "UnsupportedDocumentException": return [3, 18];
335
+ case "com.amazonaws.textract#UnsupportedDocumentException": return [3, 18];
336
+ }
337
+ return [3, 20];
338
+ case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
339
+ case 3: throw _d.sent();
340
+ case 4: return [4, deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context)];
341
+ case 5: throw _d.sent();
342
+ case 6: return [4, deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context)];
343
+ case 7: throw _d.sent();
344
+ case 8: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
345
+ case 9: throw _d.sent();
346
+ case 10: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
347
+ case 11: throw _d.sent();
348
+ case 12: return [4, deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)];
349
+ case 13: throw _d.sent();
350
+ case 14: return [4, deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)];
351
+ case 15: throw _d.sent();
352
+ case 16: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
353
+ case 17: throw _d.sent();
354
+ case 18: return [4, deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context)];
355
+ case 19: throw _d.sent();
356
+ case 20:
357
+ parsedBody = parsedOutput.body;
358
+ throwDefaultError({
359
+ output: output,
360
+ parsedBody: parsedBody,
361
+ exceptionCtor: __BaseException,
362
+ errorCode: errorCode,
363
+ });
364
+ _d.label = 21;
365
+ case 21: return [2];
366
+ }
367
+ });
368
+ }); };
369
+ export var deserializeAws_json1_1DetectDocumentTextCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
370
+ var data, contents, response;
371
+ return __generator(this, function (_a) {
372
+ switch (_a.label) {
373
+ case 0:
374
+ if (output.statusCode >= 300) {
375
+ return [2, deserializeAws_json1_1DetectDocumentTextCommandError(output, context)];
376
+ }
377
+ return [4, parseBody(output.body, context)];
378
+ case 1:
379
+ data = _a.sent();
380
+ contents = {};
381
+ contents = deserializeAws_json1_1DetectDocumentTextResponse(data, context);
382
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
383
+ return [2, Promise.resolve(response)];
384
+ }
385
+ });
386
+ }); };
387
+ var deserializeAws_json1_1DetectDocumentTextCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
388
+ var parsedOutput, _a, errorCode, _b, parsedBody;
389
+ var _c;
390
+ return __generator(this, function (_d) {
391
+ switch (_d.label) {
392
+ case 0:
393
+ _a = [__assign({}, output)];
394
+ _c = {};
395
+ return [4, parseErrorBody(output.body, context)];
396
+ case 1:
397
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
398
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
399
+ _b = errorCode;
400
+ switch (_b) {
401
+ case "AccessDeniedException": return [3, 2];
402
+ case "com.amazonaws.textract#AccessDeniedException": return [3, 2];
403
+ case "BadDocumentException": return [3, 4];
404
+ case "com.amazonaws.textract#BadDocumentException": return [3, 4];
405
+ case "DocumentTooLargeException": return [3, 6];
406
+ case "com.amazonaws.textract#DocumentTooLargeException": return [3, 6];
407
+ case "InternalServerError": return [3, 8];
408
+ case "com.amazonaws.textract#InternalServerError": return [3, 8];
409
+ case "InvalidParameterException": return [3, 10];
410
+ case "com.amazonaws.textract#InvalidParameterException": return [3, 10];
411
+ case "InvalidS3ObjectException": return [3, 12];
412
+ case "com.amazonaws.textract#InvalidS3ObjectException": return [3, 12];
413
+ case "ProvisionedThroughputExceededException": return [3, 14];
414
+ case "com.amazonaws.textract#ProvisionedThroughputExceededException": return [3, 14];
415
+ case "ThrottlingException": return [3, 16];
416
+ case "com.amazonaws.textract#ThrottlingException": return [3, 16];
417
+ case "UnsupportedDocumentException": return [3, 18];
418
+ case "com.amazonaws.textract#UnsupportedDocumentException": return [3, 18];
419
+ }
420
+ return [3, 20];
421
+ case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
422
+ case 3: throw _d.sent();
423
+ case 4: return [4, deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context)];
424
+ case 5: throw _d.sent();
425
+ case 6: return [4, deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context)];
426
+ case 7: throw _d.sent();
427
+ case 8: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
428
+ case 9: throw _d.sent();
429
+ case 10: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
430
+ case 11: throw _d.sent();
431
+ case 12: return [4, deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)];
432
+ case 13: throw _d.sent();
433
+ case 14: return [4, deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)];
434
+ case 15: throw _d.sent();
435
+ case 16: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
436
+ case 17: throw _d.sent();
437
+ case 18: return [4, deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context)];
438
+ case 19: throw _d.sent();
439
+ case 20:
440
+ parsedBody = parsedOutput.body;
441
+ throwDefaultError({
442
+ output: output,
443
+ parsedBody: parsedBody,
444
+ exceptionCtor: __BaseException,
445
+ errorCode: errorCode,
446
+ });
447
+ _d.label = 21;
448
+ case 21: return [2];
449
+ }
450
+ });
451
+ }); };
452
+ export var deserializeAws_json1_1GetDocumentAnalysisCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
453
+ var data, contents, response;
454
+ return __generator(this, function (_a) {
455
+ switch (_a.label) {
456
+ case 0:
457
+ if (output.statusCode >= 300) {
458
+ return [2, deserializeAws_json1_1GetDocumentAnalysisCommandError(output, context)];
459
+ }
460
+ return [4, parseBody(output.body, context)];
461
+ case 1:
462
+ data = _a.sent();
463
+ contents = {};
464
+ contents = deserializeAws_json1_1GetDocumentAnalysisResponse(data, context);
465
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
466
+ return [2, Promise.resolve(response)];
467
+ }
468
+ });
469
+ }); };
470
+ var deserializeAws_json1_1GetDocumentAnalysisCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
471
+ var parsedOutput, _a, errorCode, _b, parsedBody;
472
+ var _c;
473
+ return __generator(this, function (_d) {
474
+ switch (_d.label) {
475
+ case 0:
476
+ _a = [__assign({}, output)];
477
+ _c = {};
478
+ return [4, parseErrorBody(output.body, context)];
479
+ case 1:
480
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
481
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
482
+ _b = errorCode;
483
+ switch (_b) {
484
+ case "AccessDeniedException": return [3, 2];
485
+ case "com.amazonaws.textract#AccessDeniedException": return [3, 2];
486
+ case "InternalServerError": return [3, 4];
487
+ case "com.amazonaws.textract#InternalServerError": return [3, 4];
488
+ case "InvalidJobIdException": return [3, 6];
489
+ case "com.amazonaws.textract#InvalidJobIdException": return [3, 6];
490
+ case "InvalidKMSKeyException": return [3, 8];
491
+ case "com.amazonaws.textract#InvalidKMSKeyException": return [3, 8];
492
+ case "InvalidParameterException": return [3, 10];
493
+ case "com.amazonaws.textract#InvalidParameterException": return [3, 10];
494
+ case "InvalidS3ObjectException": return [3, 12];
495
+ case "com.amazonaws.textract#InvalidS3ObjectException": return [3, 12];
496
+ case "ProvisionedThroughputExceededException": return [3, 14];
497
+ case "com.amazonaws.textract#ProvisionedThroughputExceededException": return [3, 14];
498
+ case "ThrottlingException": return [3, 16];
499
+ case "com.amazonaws.textract#ThrottlingException": return [3, 16];
500
+ }
501
+ return [3, 18];
502
+ case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
503
+ case 3: throw _d.sent();
504
+ case 4: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
505
+ case 5: throw _d.sent();
506
+ case 6: return [4, deserializeAws_json1_1InvalidJobIdExceptionResponse(parsedOutput, context)];
507
+ case 7: throw _d.sent();
508
+ case 8: return [4, deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context)];
509
+ case 9: throw _d.sent();
510
+ case 10: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
511
+ case 11: throw _d.sent();
512
+ case 12: return [4, deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)];
513
+ case 13: throw _d.sent();
514
+ case 14: return [4, deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)];
515
+ case 15: throw _d.sent();
516
+ case 16: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
517
+ case 17: throw _d.sent();
518
+ case 18:
519
+ parsedBody = parsedOutput.body;
520
+ throwDefaultError({
521
+ output: output,
522
+ parsedBody: parsedBody,
523
+ exceptionCtor: __BaseException,
524
+ errorCode: errorCode,
525
+ });
526
+ _d.label = 19;
527
+ case 19: return [2];
528
+ }
529
+ });
530
+ }); };
531
+ export var deserializeAws_json1_1GetDocumentTextDetectionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
532
+ var data, contents, response;
533
+ return __generator(this, function (_a) {
534
+ switch (_a.label) {
535
+ case 0:
536
+ if (output.statusCode >= 300) {
537
+ return [2, deserializeAws_json1_1GetDocumentTextDetectionCommandError(output, context)];
538
+ }
539
+ return [4, parseBody(output.body, context)];
540
+ case 1:
541
+ data = _a.sent();
542
+ contents = {};
543
+ contents = deserializeAws_json1_1GetDocumentTextDetectionResponse(data, context);
544
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
545
+ return [2, Promise.resolve(response)];
546
+ }
547
+ });
548
+ }); };
549
+ var deserializeAws_json1_1GetDocumentTextDetectionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
550
+ var parsedOutput, _a, errorCode, _b, parsedBody;
551
+ var _c;
552
+ return __generator(this, function (_d) {
553
+ switch (_d.label) {
554
+ case 0:
555
+ _a = [__assign({}, output)];
556
+ _c = {};
557
+ return [4, parseErrorBody(output.body, context)];
558
+ case 1:
559
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
560
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
561
+ _b = errorCode;
562
+ switch (_b) {
563
+ case "AccessDeniedException": return [3, 2];
564
+ case "com.amazonaws.textract#AccessDeniedException": return [3, 2];
565
+ case "InternalServerError": return [3, 4];
566
+ case "com.amazonaws.textract#InternalServerError": return [3, 4];
567
+ case "InvalidJobIdException": return [3, 6];
568
+ case "com.amazonaws.textract#InvalidJobIdException": return [3, 6];
569
+ case "InvalidKMSKeyException": return [3, 8];
570
+ case "com.amazonaws.textract#InvalidKMSKeyException": return [3, 8];
571
+ case "InvalidParameterException": return [3, 10];
572
+ case "com.amazonaws.textract#InvalidParameterException": return [3, 10];
573
+ case "InvalidS3ObjectException": return [3, 12];
574
+ case "com.amazonaws.textract#InvalidS3ObjectException": return [3, 12];
575
+ case "ProvisionedThroughputExceededException": return [3, 14];
576
+ case "com.amazonaws.textract#ProvisionedThroughputExceededException": return [3, 14];
577
+ case "ThrottlingException": return [3, 16];
578
+ case "com.amazonaws.textract#ThrottlingException": return [3, 16];
579
+ }
580
+ return [3, 18];
581
+ case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
582
+ case 3: throw _d.sent();
583
+ case 4: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
584
+ case 5: throw _d.sent();
585
+ case 6: return [4, deserializeAws_json1_1InvalidJobIdExceptionResponse(parsedOutput, context)];
586
+ case 7: throw _d.sent();
587
+ case 8: return [4, deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context)];
588
+ case 9: throw _d.sent();
589
+ case 10: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
590
+ case 11: throw _d.sent();
591
+ case 12: return [4, deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)];
592
+ case 13: throw _d.sent();
593
+ case 14: return [4, deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)];
594
+ case 15: throw _d.sent();
595
+ case 16: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
596
+ case 17: throw _d.sent();
597
+ case 18:
598
+ parsedBody = parsedOutput.body;
599
+ throwDefaultError({
600
+ output: output,
601
+ parsedBody: parsedBody,
602
+ exceptionCtor: __BaseException,
603
+ errorCode: errorCode,
604
+ });
605
+ _d.label = 19;
606
+ case 19: return [2];
607
+ }
608
+ });
609
+ }); };
610
+ export var deserializeAws_json1_1GetExpenseAnalysisCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
611
+ var data, contents, response;
612
+ return __generator(this, function (_a) {
613
+ switch (_a.label) {
614
+ case 0:
615
+ if (output.statusCode >= 300) {
616
+ return [2, deserializeAws_json1_1GetExpenseAnalysisCommandError(output, context)];
617
+ }
618
+ return [4, parseBody(output.body, context)];
619
+ case 1:
620
+ data = _a.sent();
621
+ contents = {};
622
+ contents = deserializeAws_json1_1GetExpenseAnalysisResponse(data, context);
623
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
624
+ return [2, Promise.resolve(response)];
625
+ }
626
+ });
627
+ }); };
628
+ var deserializeAws_json1_1GetExpenseAnalysisCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
629
+ var parsedOutput, _a, errorCode, _b, parsedBody;
630
+ var _c;
631
+ return __generator(this, function (_d) {
632
+ switch (_d.label) {
633
+ case 0:
634
+ _a = [__assign({}, output)];
635
+ _c = {};
636
+ return [4, parseErrorBody(output.body, context)];
637
+ case 1:
638
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
639
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
640
+ _b = errorCode;
641
+ switch (_b) {
642
+ case "AccessDeniedException": return [3, 2];
643
+ case "com.amazonaws.textract#AccessDeniedException": return [3, 2];
644
+ case "InternalServerError": return [3, 4];
645
+ case "com.amazonaws.textract#InternalServerError": return [3, 4];
646
+ case "InvalidJobIdException": return [3, 6];
647
+ case "com.amazonaws.textract#InvalidJobIdException": return [3, 6];
648
+ case "InvalidKMSKeyException": return [3, 8];
649
+ case "com.amazonaws.textract#InvalidKMSKeyException": return [3, 8];
650
+ case "InvalidParameterException": return [3, 10];
651
+ case "com.amazonaws.textract#InvalidParameterException": return [3, 10];
652
+ case "InvalidS3ObjectException": return [3, 12];
653
+ case "com.amazonaws.textract#InvalidS3ObjectException": return [3, 12];
654
+ case "ProvisionedThroughputExceededException": return [3, 14];
655
+ case "com.amazonaws.textract#ProvisionedThroughputExceededException": return [3, 14];
656
+ case "ThrottlingException": return [3, 16];
657
+ case "com.amazonaws.textract#ThrottlingException": return [3, 16];
658
+ }
659
+ return [3, 18];
660
+ case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
661
+ case 3: throw _d.sent();
662
+ case 4: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
663
+ case 5: throw _d.sent();
664
+ case 6: return [4, deserializeAws_json1_1InvalidJobIdExceptionResponse(parsedOutput, context)];
665
+ case 7: throw _d.sent();
666
+ case 8: return [4, deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context)];
667
+ case 9: throw _d.sent();
668
+ case 10: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
669
+ case 11: throw _d.sent();
670
+ case 12: return [4, deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)];
671
+ case 13: throw _d.sent();
672
+ case 14: return [4, deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)];
673
+ case 15: throw _d.sent();
674
+ case 16: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
675
+ case 17: throw _d.sent();
676
+ case 18:
677
+ parsedBody = parsedOutput.body;
678
+ throwDefaultError({
679
+ output: output,
680
+ parsedBody: parsedBody,
681
+ exceptionCtor: __BaseException,
682
+ errorCode: errorCode,
683
+ });
684
+ _d.label = 19;
685
+ case 19: return [2];
686
+ }
687
+ });
688
+ }); };
689
+ export var deserializeAws_json1_1StartDocumentAnalysisCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
690
+ var data, contents, response;
691
+ return __generator(this, function (_a) {
692
+ switch (_a.label) {
693
+ case 0:
694
+ if (output.statusCode >= 300) {
695
+ return [2, deserializeAws_json1_1StartDocumentAnalysisCommandError(output, context)];
696
+ }
697
+ return [4, parseBody(output.body, context)];
698
+ case 1:
699
+ data = _a.sent();
700
+ contents = {};
701
+ contents = deserializeAws_json1_1StartDocumentAnalysisResponse(data, context);
702
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
703
+ return [2, Promise.resolve(response)];
704
+ }
705
+ });
706
+ }); };
707
+ var deserializeAws_json1_1StartDocumentAnalysisCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
708
+ var parsedOutput, _a, errorCode, _b, parsedBody;
709
+ var _c;
710
+ return __generator(this, function (_d) {
711
+ switch (_d.label) {
712
+ case 0:
713
+ _a = [__assign({}, output)];
714
+ _c = {};
715
+ return [4, parseErrorBody(output.body, context)];
716
+ case 1:
717
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
718
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
719
+ _b = errorCode;
720
+ switch (_b) {
721
+ case "AccessDeniedException": return [3, 2];
722
+ case "com.amazonaws.textract#AccessDeniedException": return [3, 2];
723
+ case "BadDocumentException": return [3, 4];
724
+ case "com.amazonaws.textract#BadDocumentException": return [3, 4];
725
+ case "DocumentTooLargeException": return [3, 6];
726
+ case "com.amazonaws.textract#DocumentTooLargeException": return [3, 6];
727
+ case "IdempotentParameterMismatchException": return [3, 8];
728
+ case "com.amazonaws.textract#IdempotentParameterMismatchException": return [3, 8];
729
+ case "InternalServerError": return [3, 10];
730
+ case "com.amazonaws.textract#InternalServerError": return [3, 10];
731
+ case "InvalidKMSKeyException": return [3, 12];
732
+ case "com.amazonaws.textract#InvalidKMSKeyException": return [3, 12];
733
+ case "InvalidParameterException": return [3, 14];
734
+ case "com.amazonaws.textract#InvalidParameterException": return [3, 14];
735
+ case "InvalidS3ObjectException": return [3, 16];
736
+ case "com.amazonaws.textract#InvalidS3ObjectException": return [3, 16];
737
+ case "LimitExceededException": return [3, 18];
738
+ case "com.amazonaws.textract#LimitExceededException": return [3, 18];
739
+ case "ProvisionedThroughputExceededException": return [3, 20];
740
+ case "com.amazonaws.textract#ProvisionedThroughputExceededException": return [3, 20];
741
+ case "ThrottlingException": return [3, 22];
742
+ case "com.amazonaws.textract#ThrottlingException": return [3, 22];
743
+ case "UnsupportedDocumentException": return [3, 24];
744
+ case "com.amazonaws.textract#UnsupportedDocumentException": return [3, 24];
745
+ }
746
+ return [3, 26];
747
+ case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
748
+ case 3: throw _d.sent();
749
+ case 4: return [4, deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context)];
750
+ case 5: throw _d.sent();
751
+ case 6: return [4, deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context)];
752
+ case 7: throw _d.sent();
753
+ case 8: return [4, deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)];
754
+ case 9: throw _d.sent();
755
+ case 10: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
756
+ case 11: throw _d.sent();
757
+ case 12: return [4, deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context)];
758
+ case 13: throw _d.sent();
759
+ case 14: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
760
+ case 15: throw _d.sent();
761
+ case 16: return [4, deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)];
762
+ case 17: throw _d.sent();
763
+ case 18: return [4, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];
764
+ case 19: throw _d.sent();
765
+ case 20: return [4, deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)];
766
+ case 21: throw _d.sent();
767
+ case 22: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
768
+ case 23: throw _d.sent();
769
+ case 24: return [4, deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context)];
770
+ case 25: throw _d.sent();
771
+ case 26:
772
+ parsedBody = parsedOutput.body;
773
+ throwDefaultError({
774
+ output: output,
775
+ parsedBody: parsedBody,
776
+ exceptionCtor: __BaseException,
777
+ errorCode: errorCode,
778
+ });
779
+ _d.label = 27;
780
+ case 27: return [2];
781
+ }
782
+ });
783
+ }); };
784
+ export var deserializeAws_json1_1StartDocumentTextDetectionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
785
+ var data, contents, response;
786
+ return __generator(this, function (_a) {
787
+ switch (_a.label) {
788
+ case 0:
789
+ if (output.statusCode >= 300) {
790
+ return [2, deserializeAws_json1_1StartDocumentTextDetectionCommandError(output, context)];
791
+ }
792
+ return [4, parseBody(output.body, context)];
793
+ case 1:
794
+ data = _a.sent();
795
+ contents = {};
796
+ contents = deserializeAws_json1_1StartDocumentTextDetectionResponse(data, context);
797
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
798
+ return [2, Promise.resolve(response)];
799
+ }
800
+ });
801
+ }); };
802
+ var deserializeAws_json1_1StartDocumentTextDetectionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
803
+ var parsedOutput, _a, errorCode, _b, parsedBody;
804
+ var _c;
805
+ return __generator(this, function (_d) {
806
+ switch (_d.label) {
807
+ case 0:
808
+ _a = [__assign({}, output)];
809
+ _c = {};
810
+ return [4, parseErrorBody(output.body, context)];
811
+ case 1:
812
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
813
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
814
+ _b = errorCode;
815
+ switch (_b) {
816
+ case "AccessDeniedException": return [3, 2];
817
+ case "com.amazonaws.textract#AccessDeniedException": return [3, 2];
818
+ case "BadDocumentException": return [3, 4];
819
+ case "com.amazonaws.textract#BadDocumentException": return [3, 4];
820
+ case "DocumentTooLargeException": return [3, 6];
821
+ case "com.amazonaws.textract#DocumentTooLargeException": return [3, 6];
822
+ case "IdempotentParameterMismatchException": return [3, 8];
823
+ case "com.amazonaws.textract#IdempotentParameterMismatchException": return [3, 8];
824
+ case "InternalServerError": return [3, 10];
825
+ case "com.amazonaws.textract#InternalServerError": return [3, 10];
826
+ case "InvalidKMSKeyException": return [3, 12];
827
+ case "com.amazonaws.textract#InvalidKMSKeyException": return [3, 12];
828
+ case "InvalidParameterException": return [3, 14];
829
+ case "com.amazonaws.textract#InvalidParameterException": return [3, 14];
830
+ case "InvalidS3ObjectException": return [3, 16];
831
+ case "com.amazonaws.textract#InvalidS3ObjectException": return [3, 16];
832
+ case "LimitExceededException": return [3, 18];
833
+ case "com.amazonaws.textract#LimitExceededException": return [3, 18];
834
+ case "ProvisionedThroughputExceededException": return [3, 20];
835
+ case "com.amazonaws.textract#ProvisionedThroughputExceededException": return [3, 20];
836
+ case "ThrottlingException": return [3, 22];
837
+ case "com.amazonaws.textract#ThrottlingException": return [3, 22];
838
+ case "UnsupportedDocumentException": return [3, 24];
839
+ case "com.amazonaws.textract#UnsupportedDocumentException": return [3, 24];
840
+ }
841
+ return [3, 26];
842
+ case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
843
+ case 3: throw _d.sent();
844
+ case 4: return [4, deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context)];
845
+ case 5: throw _d.sent();
846
+ case 6: return [4, deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context)];
847
+ case 7: throw _d.sent();
848
+ case 8: return [4, deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)];
849
+ case 9: throw _d.sent();
850
+ case 10: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
851
+ case 11: throw _d.sent();
852
+ case 12: return [4, deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context)];
853
+ case 13: throw _d.sent();
854
+ case 14: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
855
+ case 15: throw _d.sent();
856
+ case 16: return [4, deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)];
857
+ case 17: throw _d.sent();
858
+ case 18: return [4, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];
859
+ case 19: throw _d.sent();
860
+ case 20: return [4, deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)];
861
+ case 21: throw _d.sent();
862
+ case 22: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
863
+ case 23: throw _d.sent();
864
+ case 24: return [4, deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context)];
865
+ case 25: throw _d.sent();
866
+ case 26:
867
+ parsedBody = parsedOutput.body;
868
+ throwDefaultError({
869
+ output: output,
870
+ parsedBody: parsedBody,
871
+ exceptionCtor: __BaseException,
872
+ errorCode: errorCode,
873
+ });
874
+ _d.label = 27;
875
+ case 27: return [2];
876
+ }
877
+ });
878
+ }); };
879
+ export var deserializeAws_json1_1StartExpenseAnalysisCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
880
+ var data, contents, response;
881
+ return __generator(this, function (_a) {
882
+ switch (_a.label) {
883
+ case 0:
884
+ if (output.statusCode >= 300) {
885
+ return [2, deserializeAws_json1_1StartExpenseAnalysisCommandError(output, context)];
886
+ }
887
+ return [4, parseBody(output.body, context)];
888
+ case 1:
889
+ data = _a.sent();
890
+ contents = {};
891
+ contents = deserializeAws_json1_1StartExpenseAnalysisResponse(data, context);
892
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
893
+ return [2, Promise.resolve(response)];
894
+ }
895
+ });
896
+ }); };
897
+ var deserializeAws_json1_1StartExpenseAnalysisCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
898
+ var parsedOutput, _a, errorCode, _b, parsedBody;
899
+ var _c;
900
+ return __generator(this, function (_d) {
901
+ switch (_d.label) {
902
+ case 0:
903
+ _a = [__assign({}, output)];
904
+ _c = {};
905
+ return [4, parseErrorBody(output.body, context)];
906
+ case 1:
907
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
908
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
909
+ _b = errorCode;
910
+ switch (_b) {
911
+ case "AccessDeniedException": return [3, 2];
912
+ case "com.amazonaws.textract#AccessDeniedException": return [3, 2];
913
+ case "BadDocumentException": return [3, 4];
914
+ case "com.amazonaws.textract#BadDocumentException": return [3, 4];
915
+ case "DocumentTooLargeException": return [3, 6];
916
+ case "com.amazonaws.textract#DocumentTooLargeException": return [3, 6];
917
+ case "IdempotentParameterMismatchException": return [3, 8];
918
+ case "com.amazonaws.textract#IdempotentParameterMismatchException": return [3, 8];
919
+ case "InternalServerError": return [3, 10];
920
+ case "com.amazonaws.textract#InternalServerError": return [3, 10];
921
+ case "InvalidKMSKeyException": return [3, 12];
922
+ case "com.amazonaws.textract#InvalidKMSKeyException": return [3, 12];
923
+ case "InvalidParameterException": return [3, 14];
924
+ case "com.amazonaws.textract#InvalidParameterException": return [3, 14];
925
+ case "InvalidS3ObjectException": return [3, 16];
926
+ case "com.amazonaws.textract#InvalidS3ObjectException": return [3, 16];
927
+ case "LimitExceededException": return [3, 18];
928
+ case "com.amazonaws.textract#LimitExceededException": return [3, 18];
929
+ case "ProvisionedThroughputExceededException": return [3, 20];
930
+ case "com.amazonaws.textract#ProvisionedThroughputExceededException": return [3, 20];
931
+ case "ThrottlingException": return [3, 22];
932
+ case "com.amazonaws.textract#ThrottlingException": return [3, 22];
933
+ case "UnsupportedDocumentException": return [3, 24];
934
+ case "com.amazonaws.textract#UnsupportedDocumentException": return [3, 24];
935
+ }
936
+ return [3, 26];
937
+ case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
938
+ case 3: throw _d.sent();
939
+ case 4: return [4, deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context)];
940
+ case 5: throw _d.sent();
941
+ case 6: return [4, deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context)];
942
+ case 7: throw _d.sent();
943
+ case 8: return [4, deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)];
944
+ case 9: throw _d.sent();
945
+ case 10: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
946
+ case 11: throw _d.sent();
947
+ case 12: return [4, deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context)];
948
+ case 13: throw _d.sent();
949
+ case 14: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
950
+ case 15: throw _d.sent();
951
+ case 16: return [4, deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)];
952
+ case 17: throw _d.sent();
953
+ case 18: return [4, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];
954
+ case 19: throw _d.sent();
955
+ case 20: return [4, deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)];
956
+ case 21: throw _d.sent();
957
+ case 22: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
958
+ case 23: throw _d.sent();
959
+ case 24: return [4, deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context)];
960
+ case 25: throw _d.sent();
961
+ case 26:
962
+ parsedBody = parsedOutput.body;
963
+ throwDefaultError({
964
+ output: output,
965
+ parsedBody: parsedBody,
966
+ exceptionCtor: __BaseException,
967
+ errorCode: errorCode,
968
+ });
969
+ _d.label = 27;
970
+ case 27: return [2];
971
+ }
972
+ });
973
+ }); };
974
+ var deserializeAws_json1_1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
975
+ var body, deserialized, exception;
976
+ return __generator(this, function (_a) {
977
+ body = parsedOutput.body;
978
+ deserialized = deserializeAws_json1_1AccessDeniedException(body, context);
979
+ exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
980
+ return [2, __decorateServiceException(exception, body)];
981
+ });
982
+ }); };
983
+ var deserializeAws_json1_1BadDocumentExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
984
+ var body, deserialized, exception;
985
+ return __generator(this, function (_a) {
986
+ body = parsedOutput.body;
987
+ deserialized = deserializeAws_json1_1BadDocumentException(body, context);
988
+ exception = new BadDocumentException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
989
+ return [2, __decorateServiceException(exception, body)];
990
+ });
991
+ }); };
992
+ var deserializeAws_json1_1DocumentTooLargeExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
993
+ var body, deserialized, exception;
994
+ return __generator(this, function (_a) {
995
+ body = parsedOutput.body;
996
+ deserialized = deserializeAws_json1_1DocumentTooLargeException(body, context);
997
+ exception = new DocumentTooLargeException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
998
+ return [2, __decorateServiceException(exception, body)];
999
+ });
1000
+ }); };
1001
+ var deserializeAws_json1_1HumanLoopQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1002
+ var body, deserialized, exception;
1003
+ return __generator(this, function (_a) {
1004
+ body = parsedOutput.body;
1005
+ deserialized = deserializeAws_json1_1HumanLoopQuotaExceededException(body, context);
1006
+ exception = new HumanLoopQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1007
+ return [2, __decorateServiceException(exception, body)];
1008
+ });
1009
+ }); };
1010
+ var deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1011
+ var body, deserialized, exception;
1012
+ return __generator(this, function (_a) {
1013
+ body = parsedOutput.body;
1014
+ deserialized = deserializeAws_json1_1IdempotentParameterMismatchException(body, context);
1015
+ exception = new IdempotentParameterMismatchException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1016
+ return [2, __decorateServiceException(exception, body)];
1017
+ });
1018
+ }); };
1019
+ var deserializeAws_json1_1InternalServerErrorResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1020
+ var body, deserialized, exception;
1021
+ return __generator(this, function (_a) {
1022
+ body = parsedOutput.body;
1023
+ deserialized = deserializeAws_json1_1InternalServerError(body, context);
1024
+ exception = new InternalServerError(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1025
+ return [2, __decorateServiceException(exception, body)];
1026
+ });
1027
+ }); };
1028
+ var deserializeAws_json1_1InvalidJobIdExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1029
+ var body, deserialized, exception;
1030
+ return __generator(this, function (_a) {
1031
+ body = parsedOutput.body;
1032
+ deserialized = deserializeAws_json1_1InvalidJobIdException(body, context);
1033
+ exception = new InvalidJobIdException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1034
+ return [2, __decorateServiceException(exception, body)];
1035
+ });
1036
+ }); };
1037
+ var deserializeAws_json1_1InvalidKMSKeyExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1038
+ var body, deserialized, exception;
1039
+ return __generator(this, function (_a) {
1040
+ body = parsedOutput.body;
1041
+ deserialized = deserializeAws_json1_1InvalidKMSKeyException(body, context);
1042
+ exception = new InvalidKMSKeyException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1043
+ return [2, __decorateServiceException(exception, body)];
1044
+ });
1045
+ }); };
1046
+ var deserializeAws_json1_1InvalidParameterExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1047
+ var body, deserialized, exception;
1048
+ return __generator(this, function (_a) {
1049
+ body = parsedOutput.body;
1050
+ deserialized = deserializeAws_json1_1InvalidParameterException(body, context);
1051
+ exception = new InvalidParameterException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1052
+ return [2, __decorateServiceException(exception, body)];
1053
+ });
1054
+ }); };
1055
+ var deserializeAws_json1_1InvalidS3ObjectExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1056
+ var body, deserialized, exception;
1057
+ return __generator(this, function (_a) {
1058
+ body = parsedOutput.body;
1059
+ deserialized = deserializeAws_json1_1InvalidS3ObjectException(body, context);
1060
+ exception = new InvalidS3ObjectException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1061
+ return [2, __decorateServiceException(exception, body)];
1062
+ });
1063
+ }); };
1064
+ var deserializeAws_json1_1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1065
+ var body, deserialized, exception;
1066
+ return __generator(this, function (_a) {
1067
+ body = parsedOutput.body;
1068
+ deserialized = deserializeAws_json1_1LimitExceededException(body, context);
1069
+ exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1070
+ return [2, __decorateServiceException(exception, body)];
1071
+ });
1072
+ }); };
1073
+ var deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1074
+ var body, deserialized, exception;
1075
+ return __generator(this, function (_a) {
1076
+ body = parsedOutput.body;
1077
+ deserialized = deserializeAws_json1_1ProvisionedThroughputExceededException(body, context);
1078
+ exception = new ProvisionedThroughputExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1079
+ return [2, __decorateServiceException(exception, body)];
1080
+ });
1081
+ }); };
1082
+ var deserializeAws_json1_1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1083
+ var body, deserialized, exception;
1084
+ return __generator(this, function (_a) {
1085
+ body = parsedOutput.body;
1086
+ deserialized = deserializeAws_json1_1ThrottlingException(body, context);
1087
+ exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1088
+ return [2, __decorateServiceException(exception, body)];
1089
+ });
1090
+ }); };
1091
+ var deserializeAws_json1_1UnsupportedDocumentExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1092
+ var body, deserialized, exception;
1093
+ return __generator(this, function (_a) {
1094
+ body = parsedOutput.body;
1095
+ deserialized = deserializeAws_json1_1UnsupportedDocumentException(body, context);
1096
+ exception = new UnsupportedDocumentException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1097
+ return [2, __decorateServiceException(exception, body)];
1098
+ });
1099
+ }); };
1100
+ var serializeAws_json1_1AnalyzeDocumentRequest = function (input, context) {
1101
+ return __assign(__assign(__assign(__assign({}, (input.Document != null && { Document: serializeAws_json1_1Document(input.Document, context) })), (input.FeatureTypes != null && { FeatureTypes: serializeAws_json1_1FeatureTypes(input.FeatureTypes, context) })), (input.HumanLoopConfig != null && {
1102
+ HumanLoopConfig: serializeAws_json1_1HumanLoopConfig(input.HumanLoopConfig, context),
1103
+ })), (input.QueriesConfig != null && {
1104
+ QueriesConfig: serializeAws_json1_1QueriesConfig(input.QueriesConfig, context),
1105
+ }));
1106
+ };
1107
+ var serializeAws_json1_1AnalyzeExpenseRequest = function (input, context) {
1108
+ return __assign({}, (input.Document != null && { Document: serializeAws_json1_1Document(input.Document, context) }));
1109
+ };
1110
+ var serializeAws_json1_1AnalyzeIDRequest = function (input, context) {
1111
+ return __assign({}, (input.DocumentPages != null && {
1112
+ DocumentPages: serializeAws_json1_1DocumentPages(input.DocumentPages, context),
1113
+ }));
1114
+ };
1115
+ var serializeAws_json1_1ContentClassifiers = function (input, context) {
837
1116
  return input
838
- .filter((e) => e != null)
839
- .map((entry) => {
1117
+ .filter(function (e) { return e != null; })
1118
+ .map(function (entry) {
840
1119
  return entry;
841
1120
  });
842
1121
  };
843
- const serializeAws_json1_1DetectDocumentTextRequest = (input, context) => {
844
- return {
845
- ...(input.Document != null && { Document: serializeAws_json1_1Document(input.Document, context) }),
846
- };
1122
+ var serializeAws_json1_1DetectDocumentTextRequest = function (input, context) {
1123
+ return __assign({}, (input.Document != null && { Document: serializeAws_json1_1Document(input.Document, context) }));
847
1124
  };
848
- const serializeAws_json1_1Document = (input, context) => {
849
- return {
850
- ...(input.Bytes != null && { Bytes: context.base64Encoder(input.Bytes) }),
851
- ...(input.S3Object != null && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }),
852
- };
1125
+ var serializeAws_json1_1Document = function (input, context) {
1126
+ return __assign(__assign({}, (input.Bytes != null && { Bytes: context.base64Encoder(input.Bytes) })), (input.S3Object != null && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }));
853
1127
  };
854
- const serializeAws_json1_1DocumentLocation = (input, context) => {
855
- return {
856
- ...(input.S3Object != null && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }),
857
- };
1128
+ var serializeAws_json1_1DocumentLocation = function (input, context) {
1129
+ return __assign({}, (input.S3Object != null && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }));
858
1130
  };
859
- const serializeAws_json1_1DocumentPages = (input, context) => {
1131
+ var serializeAws_json1_1DocumentPages = function (input, context) {
860
1132
  return input
861
- .filter((e) => e != null)
862
- .map((entry) => {
1133
+ .filter(function (e) { return e != null; })
1134
+ .map(function (entry) {
863
1135
  return serializeAws_json1_1Document(entry, context);
864
1136
  });
865
1137
  };
866
- const serializeAws_json1_1FeatureTypes = (input, context) => {
1138
+ var serializeAws_json1_1FeatureTypes = function (input, context) {
867
1139
  return input
868
- .filter((e) => e != null)
869
- .map((entry) => {
1140
+ .filter(function (e) { return e != null; })
1141
+ .map(function (entry) {
870
1142
  return entry;
871
1143
  });
872
1144
  };
873
- const serializeAws_json1_1GetDocumentAnalysisRequest = (input, context) => {
874
- return {
875
- ...(input.JobId != null && { JobId: input.JobId }),
876
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
877
- ...(input.NextToken != null && { NextToken: input.NextToken }),
878
- };
1145
+ var serializeAws_json1_1GetDocumentAnalysisRequest = function (input, context) {
1146
+ return __assign(__assign(__assign({}, (input.JobId != null && { JobId: input.JobId })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken }));
879
1147
  };
880
- const serializeAws_json1_1GetDocumentTextDetectionRequest = (input, context) => {
881
- return {
882
- ...(input.JobId != null && { JobId: input.JobId }),
883
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
884
- ...(input.NextToken != null && { NextToken: input.NextToken }),
885
- };
1148
+ var serializeAws_json1_1GetDocumentTextDetectionRequest = function (input, context) {
1149
+ return __assign(__assign(__assign({}, (input.JobId != null && { JobId: input.JobId })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken }));
886
1150
  };
887
- const serializeAws_json1_1GetExpenseAnalysisRequest = (input, context) => {
888
- return {
889
- ...(input.JobId != null && { JobId: input.JobId }),
890
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
891
- ...(input.NextToken != null && { NextToken: input.NextToken }),
892
- };
1151
+ var serializeAws_json1_1GetExpenseAnalysisRequest = function (input, context) {
1152
+ return __assign(__assign(__assign({}, (input.JobId != null && { JobId: input.JobId })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken }));
893
1153
  };
894
- const serializeAws_json1_1HumanLoopConfig = (input, context) => {
895
- return {
896
- ...(input.DataAttributes != null && {
897
- DataAttributes: serializeAws_json1_1HumanLoopDataAttributes(input.DataAttributes, context),
898
- }),
899
- ...(input.FlowDefinitionArn != null && { FlowDefinitionArn: input.FlowDefinitionArn }),
900
- ...(input.HumanLoopName != null && { HumanLoopName: input.HumanLoopName }),
901
- };
1154
+ var serializeAws_json1_1HumanLoopConfig = function (input, context) {
1155
+ return __assign(__assign(__assign({}, (input.DataAttributes != null && {
1156
+ DataAttributes: serializeAws_json1_1HumanLoopDataAttributes(input.DataAttributes, context),
1157
+ })), (input.FlowDefinitionArn != null && { FlowDefinitionArn: input.FlowDefinitionArn })), (input.HumanLoopName != null && { HumanLoopName: input.HumanLoopName }));
902
1158
  };
903
- const serializeAws_json1_1HumanLoopDataAttributes = (input, context) => {
904
- return {
905
- ...(input.ContentClassifiers != null && {
906
- ContentClassifiers: serializeAws_json1_1ContentClassifiers(input.ContentClassifiers, context),
907
- }),
908
- };
1159
+ var serializeAws_json1_1HumanLoopDataAttributes = function (input, context) {
1160
+ return __assign({}, (input.ContentClassifiers != null && {
1161
+ ContentClassifiers: serializeAws_json1_1ContentClassifiers(input.ContentClassifiers, context),
1162
+ }));
909
1163
  };
910
- const serializeAws_json1_1NotificationChannel = (input, context) => {
911
- return {
912
- ...(input.RoleArn != null && { RoleArn: input.RoleArn }),
913
- ...(input.SNSTopicArn != null && { SNSTopicArn: input.SNSTopicArn }),
914
- };
1164
+ var serializeAws_json1_1NotificationChannel = function (input, context) {
1165
+ return __assign(__assign({}, (input.RoleArn != null && { RoleArn: input.RoleArn })), (input.SNSTopicArn != null && { SNSTopicArn: input.SNSTopicArn }));
915
1166
  };
916
- const serializeAws_json1_1OutputConfig = (input, context) => {
917
- return {
918
- ...(input.S3Bucket != null && { S3Bucket: input.S3Bucket }),
919
- ...(input.S3Prefix != null && { S3Prefix: input.S3Prefix }),
920
- };
1167
+ var serializeAws_json1_1OutputConfig = function (input, context) {
1168
+ return __assign(__assign({}, (input.S3Bucket != null && { S3Bucket: input.S3Bucket })), (input.S3Prefix != null && { S3Prefix: input.S3Prefix }));
921
1169
  };
922
- const serializeAws_json1_1Queries = (input, context) => {
1170
+ var serializeAws_json1_1Queries = function (input, context) {
923
1171
  return input
924
- .filter((e) => e != null)
925
- .map((entry) => {
1172
+ .filter(function (e) { return e != null; })
1173
+ .map(function (entry) {
926
1174
  return serializeAws_json1_1Query(entry, context);
927
1175
  });
928
1176
  };
929
- const serializeAws_json1_1QueriesConfig = (input, context) => {
930
- return {
931
- ...(input.Queries != null && { Queries: serializeAws_json1_1Queries(input.Queries, context) }),
932
- };
1177
+ var serializeAws_json1_1QueriesConfig = function (input, context) {
1178
+ return __assign({}, (input.Queries != null && { Queries: serializeAws_json1_1Queries(input.Queries, context) }));
933
1179
  };
934
- const serializeAws_json1_1Query = (input, context) => {
935
- return {
936
- ...(input.Alias != null && { Alias: input.Alias }),
937
- ...(input.Pages != null && { Pages: serializeAws_json1_1QueryPages(input.Pages, context) }),
938
- ...(input.Text != null && { Text: input.Text }),
939
- };
1180
+ var serializeAws_json1_1Query = function (input, context) {
1181
+ return __assign(__assign(__assign({}, (input.Alias != null && { Alias: input.Alias })), (input.Pages != null && { Pages: serializeAws_json1_1QueryPages(input.Pages, context) })), (input.Text != null && { Text: input.Text }));
940
1182
  };
941
- const serializeAws_json1_1QueryPages = (input, context) => {
1183
+ var serializeAws_json1_1QueryPages = function (input, context) {
942
1184
  return input
943
- .filter((e) => e != null)
944
- .map((entry) => {
1185
+ .filter(function (e) { return e != null; })
1186
+ .map(function (entry) {
945
1187
  return entry;
946
1188
  });
947
1189
  };
948
- const serializeAws_json1_1S3Object = (input, context) => {
949
- return {
950
- ...(input.Bucket != null && { Bucket: input.Bucket }),
951
- ...(input.Name != null && { Name: input.Name }),
952
- ...(input.Version != null && { Version: input.Version }),
953
- };
954
- };
955
- const serializeAws_json1_1StartDocumentAnalysisRequest = (input, context) => {
956
- return {
957
- ...(input.ClientRequestToken != null && { ClientRequestToken: input.ClientRequestToken }),
958
- ...(input.DocumentLocation != null && {
959
- DocumentLocation: serializeAws_json1_1DocumentLocation(input.DocumentLocation, context),
960
- }),
961
- ...(input.FeatureTypes != null && { FeatureTypes: serializeAws_json1_1FeatureTypes(input.FeatureTypes, context) }),
962
- ...(input.JobTag != null && { JobTag: input.JobTag }),
963
- ...(input.KMSKeyId != null && { KMSKeyId: input.KMSKeyId }),
964
- ...(input.NotificationChannel != null && {
965
- NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context),
966
- }),
967
- ...(input.OutputConfig != null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }),
968
- ...(input.QueriesConfig != null && {
969
- QueriesConfig: serializeAws_json1_1QueriesConfig(input.QueriesConfig, context),
970
- }),
971
- };
972
- };
973
- const serializeAws_json1_1StartDocumentTextDetectionRequest = (input, context) => {
974
- return {
975
- ...(input.ClientRequestToken != null && { ClientRequestToken: input.ClientRequestToken }),
976
- ...(input.DocumentLocation != null && {
977
- DocumentLocation: serializeAws_json1_1DocumentLocation(input.DocumentLocation, context),
978
- }),
979
- ...(input.JobTag != null && { JobTag: input.JobTag }),
980
- ...(input.KMSKeyId != null && { KMSKeyId: input.KMSKeyId }),
981
- ...(input.NotificationChannel != null && {
982
- NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context),
983
- }),
984
- ...(input.OutputConfig != null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }),
985
- };
986
- };
987
- const serializeAws_json1_1StartExpenseAnalysisRequest = (input, context) => {
988
- return {
989
- ...(input.ClientRequestToken != null && { ClientRequestToken: input.ClientRequestToken }),
990
- ...(input.DocumentLocation != null && {
991
- DocumentLocation: serializeAws_json1_1DocumentLocation(input.DocumentLocation, context),
992
- }),
993
- ...(input.JobTag != null && { JobTag: input.JobTag }),
994
- ...(input.KMSKeyId != null && { KMSKeyId: input.KMSKeyId }),
995
- ...(input.NotificationChannel != null && {
996
- NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context),
997
- }),
998
- ...(input.OutputConfig != null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }),
999
- };
1000
- };
1001
- const deserializeAws_json1_1AccessDeniedException = (output, context) => {
1190
+ var serializeAws_json1_1S3Object = function (input, context) {
1191
+ return __assign(__assign(__assign({}, (input.Bucket != null && { Bucket: input.Bucket })), (input.Name != null && { Name: input.Name })), (input.Version != null && { Version: input.Version }));
1192
+ };
1193
+ var serializeAws_json1_1StartDocumentAnalysisRequest = function (input, context) {
1194
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ClientRequestToken != null && { ClientRequestToken: input.ClientRequestToken })), (input.DocumentLocation != null && {
1195
+ DocumentLocation: serializeAws_json1_1DocumentLocation(input.DocumentLocation, context),
1196
+ })), (input.FeatureTypes != null && { FeatureTypes: serializeAws_json1_1FeatureTypes(input.FeatureTypes, context) })), (input.JobTag != null && { JobTag: input.JobTag })), (input.KMSKeyId != null && { KMSKeyId: input.KMSKeyId })), (input.NotificationChannel != null && {
1197
+ NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context),
1198
+ })), (input.OutputConfig != null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) })), (input.QueriesConfig != null && {
1199
+ QueriesConfig: serializeAws_json1_1QueriesConfig(input.QueriesConfig, context),
1200
+ }));
1201
+ };
1202
+ var serializeAws_json1_1StartDocumentTextDetectionRequest = function (input, context) {
1203
+ return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.ClientRequestToken != null && { ClientRequestToken: input.ClientRequestToken })), (input.DocumentLocation != null && {
1204
+ DocumentLocation: serializeAws_json1_1DocumentLocation(input.DocumentLocation, context),
1205
+ })), (input.JobTag != null && { JobTag: input.JobTag })), (input.KMSKeyId != null && { KMSKeyId: input.KMSKeyId })), (input.NotificationChannel != null && {
1206
+ NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context),
1207
+ })), (input.OutputConfig != null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }));
1208
+ };
1209
+ var serializeAws_json1_1StartExpenseAnalysisRequest = function (input, context) {
1210
+ return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.ClientRequestToken != null && { ClientRequestToken: input.ClientRequestToken })), (input.DocumentLocation != null && {
1211
+ DocumentLocation: serializeAws_json1_1DocumentLocation(input.DocumentLocation, context),
1212
+ })), (input.JobTag != null && { JobTag: input.JobTag })), (input.KMSKeyId != null && { KMSKeyId: input.KMSKeyId })), (input.NotificationChannel != null && {
1213
+ NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context),
1214
+ })), (input.OutputConfig != null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }));
1215
+ };
1216
+ var deserializeAws_json1_1AccessDeniedException = function (output, context) {
1002
1217
  return {
1003
1218
  Code: __expectString(output.Code),
1004
1219
  Message: __expectString(output.Message),
1005
1220
  };
1006
1221
  };
1007
- const deserializeAws_json1_1AnalyzeDocumentResponse = (output, context) => {
1222
+ var deserializeAws_json1_1AnalyzeDocumentResponse = function (output, context) {
1008
1223
  return {
1009
1224
  AnalyzeDocumentModelVersion: __expectString(output.AnalyzeDocumentModelVersion),
1010
1225
  Blocks: output.Blocks != null ? deserializeAws_json1_1BlockList(output.Blocks, context) : undefined,
@@ -1016,7 +1231,7 @@ const deserializeAws_json1_1AnalyzeDocumentResponse = (output, context) => {
1016
1231
  : undefined,
1017
1232
  };
1018
1233
  };
1019
- const deserializeAws_json1_1AnalyzeExpenseResponse = (output, context) => {
1234
+ var deserializeAws_json1_1AnalyzeExpenseResponse = function (output, context) {
1020
1235
  return {
1021
1236
  DocumentMetadata: output.DocumentMetadata != null
1022
1237
  ? deserializeAws_json1_1DocumentMetadata(output.DocumentMetadata, context)
@@ -1026,7 +1241,7 @@ const deserializeAws_json1_1AnalyzeExpenseResponse = (output, context) => {
1026
1241
  : undefined,
1027
1242
  };
1028
1243
  };
1029
- const deserializeAws_json1_1AnalyzeIDDetections = (output, context) => {
1244
+ var deserializeAws_json1_1AnalyzeIDDetections = function (output, context) {
1030
1245
  return {
1031
1246
  Confidence: __limitedParseFloat32(output.Confidence),
1032
1247
  NormalizedValue: output.NormalizedValue != null
@@ -1035,7 +1250,7 @@ const deserializeAws_json1_1AnalyzeIDDetections = (output, context) => {
1035
1250
  Text: __expectString(output.Text),
1036
1251
  };
1037
1252
  };
1038
- const deserializeAws_json1_1AnalyzeIDResponse = (output, context) => {
1253
+ var deserializeAws_json1_1AnalyzeIDResponse = function (output, context) {
1039
1254
  return {
1040
1255
  AnalyzeIDModelVersion: __expectString(output.AnalyzeIDModelVersion),
1041
1256
  DocumentMetadata: output.DocumentMetadata != null
@@ -1046,13 +1261,13 @@ const deserializeAws_json1_1AnalyzeIDResponse = (output, context) => {
1046
1261
  : undefined,
1047
1262
  };
1048
1263
  };
1049
- const deserializeAws_json1_1BadDocumentException = (output, context) => {
1264
+ var deserializeAws_json1_1BadDocumentException = function (output, context) {
1050
1265
  return {
1051
1266
  Code: __expectString(output.Code),
1052
1267
  Message: __expectString(output.Message),
1053
1268
  };
1054
1269
  };
1055
- const deserializeAws_json1_1Block = (output, context) => {
1270
+ var deserializeAws_json1_1Block = function (output, context) {
1056
1271
  return {
1057
1272
  BlockType: __expectString(output.BlockType),
1058
1273
  ColumnIndex: __expectInt32(output.ColumnIndex),
@@ -1071,10 +1286,10 @@ const deserializeAws_json1_1Block = (output, context) => {
1071
1286
  TextType: __expectString(output.TextType),
1072
1287
  };
1073
1288
  };
1074
- const deserializeAws_json1_1BlockList = (output, context) => {
1075
- const retVal = (output || [])
1076
- .filter((e) => e != null)
1077
- .map((entry) => {
1289
+ var deserializeAws_json1_1BlockList = function (output, context) {
1290
+ var retVal = (output || [])
1291
+ .filter(function (e) { return e != null; })
1292
+ .map(function (entry) {
1078
1293
  if (entry === null) {
1079
1294
  return null;
1080
1295
  }
@@ -1082,7 +1297,7 @@ const deserializeAws_json1_1BlockList = (output, context) => {
1082
1297
  });
1083
1298
  return retVal;
1084
1299
  };
1085
- const deserializeAws_json1_1BoundingBox = (output, context) => {
1300
+ var deserializeAws_json1_1BoundingBox = function (output, context) {
1086
1301
  return {
1087
1302
  Height: __limitedParseFloat32(output.Height),
1088
1303
  Left: __limitedParseFloat32(output.Left),
@@ -1090,7 +1305,7 @@ const deserializeAws_json1_1BoundingBox = (output, context) => {
1090
1305
  Width: __limitedParseFloat32(output.Width),
1091
1306
  };
1092
1307
  };
1093
- const deserializeAws_json1_1DetectDocumentTextResponse = (output, context) => {
1308
+ var deserializeAws_json1_1DetectDocumentTextResponse = function (output, context) {
1094
1309
  return {
1095
1310
  Blocks: output.Blocks != null ? deserializeAws_json1_1BlockList(output.Blocks, context) : undefined,
1096
1311
  DetectDocumentTextModelVersion: __expectString(output.DetectDocumentTextModelVersion),
@@ -1099,21 +1314,21 @@ const deserializeAws_json1_1DetectDocumentTextResponse = (output, context) => {
1099
1314
  : undefined,
1100
1315
  };
1101
1316
  };
1102
- const deserializeAws_json1_1DocumentMetadata = (output, context) => {
1317
+ var deserializeAws_json1_1DocumentMetadata = function (output, context) {
1103
1318
  return {
1104
1319
  Pages: __expectInt32(output.Pages),
1105
1320
  };
1106
1321
  };
1107
- const deserializeAws_json1_1DocumentTooLargeException = (output, context) => {
1322
+ var deserializeAws_json1_1DocumentTooLargeException = function (output, context) {
1108
1323
  return {
1109
1324
  Code: __expectString(output.Code),
1110
1325
  Message: __expectString(output.Message),
1111
1326
  };
1112
1327
  };
1113
- const deserializeAws_json1_1EntityTypes = (output, context) => {
1114
- const retVal = (output || [])
1115
- .filter((e) => e != null)
1116
- .map((entry) => {
1328
+ var deserializeAws_json1_1EntityTypes = function (output, context) {
1329
+ var retVal = (output || [])
1330
+ .filter(function (e) { return e != null; })
1331
+ .map(function (entry) {
1117
1332
  if (entry === null) {
1118
1333
  return null;
1119
1334
  }
@@ -1121,14 +1336,14 @@ const deserializeAws_json1_1EntityTypes = (output, context) => {
1121
1336
  });
1122
1337
  return retVal;
1123
1338
  };
1124
- const deserializeAws_json1_1ExpenseDetection = (output, context) => {
1339
+ var deserializeAws_json1_1ExpenseDetection = function (output, context) {
1125
1340
  return {
1126
1341
  Confidence: __limitedParseFloat32(output.Confidence),
1127
1342
  Geometry: output.Geometry != null ? deserializeAws_json1_1Geometry(output.Geometry, context) : undefined,
1128
1343
  Text: __expectString(output.Text),
1129
1344
  };
1130
1345
  };
1131
- const deserializeAws_json1_1ExpenseDocument = (output, context) => {
1346
+ var deserializeAws_json1_1ExpenseDocument = function (output, context) {
1132
1347
  return {
1133
1348
  ExpenseIndex: __expectInt32(output.ExpenseIndex),
1134
1349
  LineItemGroups: output.LineItemGroups != null
@@ -1137,10 +1352,10 @@ const deserializeAws_json1_1ExpenseDocument = (output, context) => {
1137
1352
  SummaryFields: output.SummaryFields != null ? deserializeAws_json1_1ExpenseFieldList(output.SummaryFields, context) : undefined,
1138
1353
  };
1139
1354
  };
1140
- const deserializeAws_json1_1ExpenseDocumentList = (output, context) => {
1141
- const retVal = (output || [])
1142
- .filter((e) => e != null)
1143
- .map((entry) => {
1355
+ var deserializeAws_json1_1ExpenseDocumentList = function (output, context) {
1356
+ var retVal = (output || [])
1357
+ .filter(function (e) { return e != null; })
1358
+ .map(function (entry) {
1144
1359
  if (entry === null) {
1145
1360
  return null;
1146
1361
  }
@@ -1148,7 +1363,7 @@ const deserializeAws_json1_1ExpenseDocumentList = (output, context) => {
1148
1363
  });
1149
1364
  return retVal;
1150
1365
  };
1151
- const deserializeAws_json1_1ExpenseField = (output, context) => {
1366
+ var deserializeAws_json1_1ExpenseField = function (output, context) {
1152
1367
  return {
1153
1368
  LabelDetection: output.LabelDetection != null
1154
1369
  ? deserializeAws_json1_1ExpenseDetection(output.LabelDetection, context)
@@ -1160,10 +1375,10 @@ const deserializeAws_json1_1ExpenseField = (output, context) => {
1160
1375
  : undefined,
1161
1376
  };
1162
1377
  };
1163
- const deserializeAws_json1_1ExpenseFieldList = (output, context) => {
1164
- const retVal = (output || [])
1165
- .filter((e) => e != null)
1166
- .map((entry) => {
1378
+ var deserializeAws_json1_1ExpenseFieldList = function (output, context) {
1379
+ var retVal = (output || [])
1380
+ .filter(function (e) { return e != null; })
1381
+ .map(function (entry) {
1167
1382
  if (entry === null) {
1168
1383
  return null;
1169
1384
  }
@@ -1171,19 +1386,19 @@ const deserializeAws_json1_1ExpenseFieldList = (output, context) => {
1171
1386
  });
1172
1387
  return retVal;
1173
1388
  };
1174
- const deserializeAws_json1_1ExpenseType = (output, context) => {
1389
+ var deserializeAws_json1_1ExpenseType = function (output, context) {
1175
1390
  return {
1176
1391
  Confidence: __limitedParseFloat32(output.Confidence),
1177
1392
  Text: __expectString(output.Text),
1178
1393
  };
1179
1394
  };
1180
- const deserializeAws_json1_1Geometry = (output, context) => {
1395
+ var deserializeAws_json1_1Geometry = function (output, context) {
1181
1396
  return {
1182
1397
  BoundingBox: output.BoundingBox != null ? deserializeAws_json1_1BoundingBox(output.BoundingBox, context) : undefined,
1183
1398
  Polygon: output.Polygon != null ? deserializeAws_json1_1Polygon(output.Polygon, context) : undefined,
1184
1399
  };
1185
1400
  };
1186
- const deserializeAws_json1_1GetDocumentAnalysisResponse = (output, context) => {
1401
+ var deserializeAws_json1_1GetDocumentAnalysisResponse = function (output, context) {
1187
1402
  return {
1188
1403
  AnalyzeDocumentModelVersion: __expectString(output.AnalyzeDocumentModelVersion),
1189
1404
  Blocks: output.Blocks != null ? deserializeAws_json1_1BlockList(output.Blocks, context) : undefined,
@@ -1196,7 +1411,7 @@ const deserializeAws_json1_1GetDocumentAnalysisResponse = (output, context) => {
1196
1411
  Warnings: output.Warnings != null ? deserializeAws_json1_1Warnings(output.Warnings, context) : undefined,
1197
1412
  };
1198
1413
  };
1199
- const deserializeAws_json1_1GetDocumentTextDetectionResponse = (output, context) => {
1414
+ var deserializeAws_json1_1GetDocumentTextDetectionResponse = function (output, context) {
1200
1415
  return {
1201
1416
  Blocks: output.Blocks != null ? deserializeAws_json1_1BlockList(output.Blocks, context) : undefined,
1202
1417
  DetectDocumentTextModelVersion: __expectString(output.DetectDocumentTextModelVersion),
@@ -1209,7 +1424,7 @@ const deserializeAws_json1_1GetDocumentTextDetectionResponse = (output, context)
1209
1424
  Warnings: output.Warnings != null ? deserializeAws_json1_1Warnings(output.Warnings, context) : undefined,
1210
1425
  };
1211
1426
  };
1212
- const deserializeAws_json1_1GetExpenseAnalysisResponse = (output, context) => {
1427
+ var deserializeAws_json1_1GetExpenseAnalysisResponse = function (output, context) {
1213
1428
  return {
1214
1429
  AnalyzeExpenseModelVersion: __expectString(output.AnalyzeExpenseModelVersion),
1215
1430
  DocumentMetadata: output.DocumentMetadata != null
@@ -1224,7 +1439,7 @@ const deserializeAws_json1_1GetExpenseAnalysisResponse = (output, context) => {
1224
1439
  Warnings: output.Warnings != null ? deserializeAws_json1_1Warnings(output.Warnings, context) : undefined,
1225
1440
  };
1226
1441
  };
1227
- const deserializeAws_json1_1HumanLoopActivationOutput = (output, context) => {
1442
+ var deserializeAws_json1_1HumanLoopActivationOutput = function (output, context) {
1228
1443
  return {
1229
1444
  HumanLoopActivationConditionsEvaluationResults: output.HumanLoopActivationConditionsEvaluationResults != null
1230
1445
  ? new __LazyJsonString(output.HumanLoopActivationConditionsEvaluationResults)
@@ -1235,10 +1450,10 @@ const deserializeAws_json1_1HumanLoopActivationOutput = (output, context) => {
1235
1450
  HumanLoopArn: __expectString(output.HumanLoopArn),
1236
1451
  };
1237
1452
  };
1238
- const deserializeAws_json1_1HumanLoopActivationReasons = (output, context) => {
1239
- const retVal = (output || [])
1240
- .filter((e) => e != null)
1241
- .map((entry) => {
1453
+ var deserializeAws_json1_1HumanLoopActivationReasons = function (output, context) {
1454
+ var retVal = (output || [])
1455
+ .filter(function (e) { return e != null; })
1456
+ .map(function (entry) {
1242
1457
  if (entry === null) {
1243
1458
  return null;
1244
1459
  }
@@ -1246,7 +1461,7 @@ const deserializeAws_json1_1HumanLoopActivationReasons = (output, context) => {
1246
1461
  });
1247
1462
  return retVal;
1248
1463
  };
1249
- const deserializeAws_json1_1HumanLoopQuotaExceededException = (output, context) => {
1464
+ var deserializeAws_json1_1HumanLoopQuotaExceededException = function (output, context) {
1250
1465
  return {
1251
1466
  Code: __expectString(output.Code),
1252
1467
  Message: __expectString(output.Message),
@@ -1255,13 +1470,13 @@ const deserializeAws_json1_1HumanLoopQuotaExceededException = (output, context)
1255
1470
  ServiceCode: __expectString(output.ServiceCode),
1256
1471
  };
1257
1472
  };
1258
- const deserializeAws_json1_1IdempotentParameterMismatchException = (output, context) => {
1473
+ var deserializeAws_json1_1IdempotentParameterMismatchException = function (output, context) {
1259
1474
  return {
1260
1475
  Code: __expectString(output.Code),
1261
1476
  Message: __expectString(output.Message),
1262
1477
  };
1263
1478
  };
1264
- const deserializeAws_json1_1IdentityDocument = (output, context) => {
1479
+ var deserializeAws_json1_1IdentityDocument = function (output, context) {
1265
1480
  return {
1266
1481
  DocumentIndex: __expectInt32(output.DocumentIndex),
1267
1482
  IdentityDocumentFields: output.IdentityDocumentFields != null
@@ -1269,7 +1484,7 @@ const deserializeAws_json1_1IdentityDocument = (output, context) => {
1269
1484
  : undefined,
1270
1485
  };
1271
1486
  };
1272
- const deserializeAws_json1_1IdentityDocumentField = (output, context) => {
1487
+ var deserializeAws_json1_1IdentityDocumentField = function (output, context) {
1273
1488
  return {
1274
1489
  Type: output.Type != null ? deserializeAws_json1_1AnalyzeIDDetections(output.Type, context) : undefined,
1275
1490
  ValueDetection: output.ValueDetection != null
@@ -1277,10 +1492,10 @@ const deserializeAws_json1_1IdentityDocumentField = (output, context) => {
1277
1492
  : undefined,
1278
1493
  };
1279
1494
  };
1280
- const deserializeAws_json1_1IdentityDocumentFieldList = (output, context) => {
1281
- const retVal = (output || [])
1282
- .filter((e) => e != null)
1283
- .map((entry) => {
1495
+ var deserializeAws_json1_1IdentityDocumentFieldList = function (output, context) {
1496
+ var retVal = (output || [])
1497
+ .filter(function (e) { return e != null; })
1498
+ .map(function (entry) {
1284
1499
  if (entry === null) {
1285
1500
  return null;
1286
1501
  }
@@ -1288,10 +1503,10 @@ const deserializeAws_json1_1IdentityDocumentFieldList = (output, context) => {
1288
1503
  });
1289
1504
  return retVal;
1290
1505
  };
1291
- const deserializeAws_json1_1IdentityDocumentList = (output, context) => {
1292
- const retVal = (output || [])
1293
- .filter((e) => e != null)
1294
- .map((entry) => {
1506
+ var deserializeAws_json1_1IdentityDocumentList = function (output, context) {
1507
+ var retVal = (output || [])
1508
+ .filter(function (e) { return e != null; })
1509
+ .map(function (entry) {
1295
1510
  if (entry === null) {
1296
1511
  return null;
1297
1512
  }
@@ -1299,10 +1514,10 @@ const deserializeAws_json1_1IdentityDocumentList = (output, context) => {
1299
1514
  });
1300
1515
  return retVal;
1301
1516
  };
1302
- const deserializeAws_json1_1IdList = (output, context) => {
1303
- const retVal = (output || [])
1304
- .filter((e) => e != null)
1305
- .map((entry) => {
1517
+ var deserializeAws_json1_1IdList = function (output, context) {
1518
+ var retVal = (output || [])
1519
+ .filter(function (e) { return e != null; })
1520
+ .map(function (entry) {
1306
1521
  if (entry === null) {
1307
1522
  return null;
1308
1523
  }
@@ -1310,59 +1525,59 @@ const deserializeAws_json1_1IdList = (output, context) => {
1310
1525
  });
1311
1526
  return retVal;
1312
1527
  };
1313
- const deserializeAws_json1_1InternalServerError = (output, context) => {
1528
+ var deserializeAws_json1_1InternalServerError = function (output, context) {
1314
1529
  return {
1315
1530
  Code: __expectString(output.Code),
1316
1531
  Message: __expectString(output.Message),
1317
1532
  };
1318
1533
  };
1319
- const deserializeAws_json1_1InvalidJobIdException = (output, context) => {
1534
+ var deserializeAws_json1_1InvalidJobIdException = function (output, context) {
1320
1535
  return {
1321
1536
  Code: __expectString(output.Code),
1322
1537
  Message: __expectString(output.Message),
1323
1538
  };
1324
1539
  };
1325
- const deserializeAws_json1_1InvalidKMSKeyException = (output, context) => {
1540
+ var deserializeAws_json1_1InvalidKMSKeyException = function (output, context) {
1326
1541
  return {
1327
1542
  Code: __expectString(output.Code),
1328
1543
  Message: __expectString(output.Message),
1329
1544
  };
1330
1545
  };
1331
- const deserializeAws_json1_1InvalidParameterException = (output, context) => {
1546
+ var deserializeAws_json1_1InvalidParameterException = function (output, context) {
1332
1547
  return {
1333
1548
  Code: __expectString(output.Code),
1334
1549
  Message: __expectString(output.Message),
1335
1550
  };
1336
1551
  };
1337
- const deserializeAws_json1_1InvalidS3ObjectException = (output, context) => {
1552
+ var deserializeAws_json1_1InvalidS3ObjectException = function (output, context) {
1338
1553
  return {
1339
1554
  Code: __expectString(output.Code),
1340
1555
  Message: __expectString(output.Message),
1341
1556
  };
1342
1557
  };
1343
- const deserializeAws_json1_1LimitExceededException = (output, context) => {
1558
+ var deserializeAws_json1_1LimitExceededException = function (output, context) {
1344
1559
  return {
1345
1560
  Code: __expectString(output.Code),
1346
1561
  Message: __expectString(output.Message),
1347
1562
  };
1348
1563
  };
1349
- const deserializeAws_json1_1LineItemFields = (output, context) => {
1564
+ var deserializeAws_json1_1LineItemFields = function (output, context) {
1350
1565
  return {
1351
1566
  LineItemExpenseFields: output.LineItemExpenseFields != null
1352
1567
  ? deserializeAws_json1_1ExpenseFieldList(output.LineItemExpenseFields, context)
1353
1568
  : undefined,
1354
1569
  };
1355
1570
  };
1356
- const deserializeAws_json1_1LineItemGroup = (output, context) => {
1571
+ var deserializeAws_json1_1LineItemGroup = function (output, context) {
1357
1572
  return {
1358
1573
  LineItemGroupIndex: __expectInt32(output.LineItemGroupIndex),
1359
1574
  LineItems: output.LineItems != null ? deserializeAws_json1_1LineItemList(output.LineItems, context) : undefined,
1360
1575
  };
1361
1576
  };
1362
- const deserializeAws_json1_1LineItemGroupList = (output, context) => {
1363
- const retVal = (output || [])
1364
- .filter((e) => e != null)
1365
- .map((entry) => {
1577
+ var deserializeAws_json1_1LineItemGroupList = function (output, context) {
1578
+ var retVal = (output || [])
1579
+ .filter(function (e) { return e != null; })
1580
+ .map(function (entry) {
1366
1581
  if (entry === null) {
1367
1582
  return null;
1368
1583
  }
@@ -1370,10 +1585,10 @@ const deserializeAws_json1_1LineItemGroupList = (output, context) => {
1370
1585
  });
1371
1586
  return retVal;
1372
1587
  };
1373
- const deserializeAws_json1_1LineItemList = (output, context) => {
1374
- const retVal = (output || [])
1375
- .filter((e) => e != null)
1376
- .map((entry) => {
1588
+ var deserializeAws_json1_1LineItemList = function (output, context) {
1589
+ var retVal = (output || [])
1590
+ .filter(function (e) { return e != null; })
1591
+ .map(function (entry) {
1377
1592
  if (entry === null) {
1378
1593
  return null;
1379
1594
  }
@@ -1381,16 +1596,16 @@ const deserializeAws_json1_1LineItemList = (output, context) => {
1381
1596
  });
1382
1597
  return retVal;
1383
1598
  };
1384
- const deserializeAws_json1_1NormalizedValue = (output, context) => {
1599
+ var deserializeAws_json1_1NormalizedValue = function (output, context) {
1385
1600
  return {
1386
1601
  Value: __expectString(output.Value),
1387
1602
  ValueType: __expectString(output.ValueType),
1388
1603
  };
1389
1604
  };
1390
- const deserializeAws_json1_1Pages = (output, context) => {
1391
- const retVal = (output || [])
1392
- .filter((e) => e != null)
1393
- .map((entry) => {
1605
+ var deserializeAws_json1_1Pages = function (output, context) {
1606
+ var retVal = (output || [])
1607
+ .filter(function (e) { return e != null; })
1608
+ .map(function (entry) {
1394
1609
  if (entry === null) {
1395
1610
  return null;
1396
1611
  }
@@ -1398,16 +1613,16 @@ const deserializeAws_json1_1Pages = (output, context) => {
1398
1613
  });
1399
1614
  return retVal;
1400
1615
  };
1401
- const deserializeAws_json1_1Point = (output, context) => {
1616
+ var deserializeAws_json1_1Point = function (output, context) {
1402
1617
  return {
1403
1618
  X: __limitedParseFloat32(output.X),
1404
1619
  Y: __limitedParseFloat32(output.Y),
1405
1620
  };
1406
1621
  };
1407
- const deserializeAws_json1_1Polygon = (output, context) => {
1408
- const retVal = (output || [])
1409
- .filter((e) => e != null)
1410
- .map((entry) => {
1622
+ var deserializeAws_json1_1Polygon = function (output, context) {
1623
+ var retVal = (output || [])
1624
+ .filter(function (e) { return e != null; })
1625
+ .map(function (entry) {
1411
1626
  if (entry === null) {
1412
1627
  return null;
1413
1628
  }
@@ -1415,23 +1630,23 @@ const deserializeAws_json1_1Polygon = (output, context) => {
1415
1630
  });
1416
1631
  return retVal;
1417
1632
  };
1418
- const deserializeAws_json1_1ProvisionedThroughputExceededException = (output, context) => {
1633
+ var deserializeAws_json1_1ProvisionedThroughputExceededException = function (output, context) {
1419
1634
  return {
1420
1635
  Code: __expectString(output.Code),
1421
1636
  Message: __expectString(output.Message),
1422
1637
  };
1423
1638
  };
1424
- const deserializeAws_json1_1Query = (output, context) => {
1639
+ var deserializeAws_json1_1Query = function (output, context) {
1425
1640
  return {
1426
1641
  Alias: __expectString(output.Alias),
1427
1642
  Pages: output.Pages != null ? deserializeAws_json1_1QueryPages(output.Pages, context) : undefined,
1428
1643
  Text: __expectString(output.Text),
1429
1644
  };
1430
1645
  };
1431
- const deserializeAws_json1_1QueryPages = (output, context) => {
1432
- const retVal = (output || [])
1433
- .filter((e) => e != null)
1434
- .map((entry) => {
1646
+ var deserializeAws_json1_1QueryPages = function (output, context) {
1647
+ var retVal = (output || [])
1648
+ .filter(function (e) { return e != null; })
1649
+ .map(function (entry) {
1435
1650
  if (entry === null) {
1436
1651
  return null;
1437
1652
  }
@@ -1439,16 +1654,16 @@ const deserializeAws_json1_1QueryPages = (output, context) => {
1439
1654
  });
1440
1655
  return retVal;
1441
1656
  };
1442
- const deserializeAws_json1_1Relationship = (output, context) => {
1657
+ var deserializeAws_json1_1Relationship = function (output, context) {
1443
1658
  return {
1444
1659
  Ids: output.Ids != null ? deserializeAws_json1_1IdList(output.Ids, context) : undefined,
1445
1660
  Type: __expectString(output.Type),
1446
1661
  };
1447
1662
  };
1448
- const deserializeAws_json1_1RelationshipList = (output, context) => {
1449
- const retVal = (output || [])
1450
- .filter((e) => e != null)
1451
- .map((entry) => {
1663
+ var deserializeAws_json1_1RelationshipList = function (output, context) {
1664
+ var retVal = (output || [])
1665
+ .filter(function (e) { return e != null; })
1666
+ .map(function (entry) {
1452
1667
  if (entry === null) {
1453
1668
  return null;
1454
1669
  }
@@ -1456,43 +1671,43 @@ const deserializeAws_json1_1RelationshipList = (output, context) => {
1456
1671
  });
1457
1672
  return retVal;
1458
1673
  };
1459
- const deserializeAws_json1_1StartDocumentAnalysisResponse = (output, context) => {
1674
+ var deserializeAws_json1_1StartDocumentAnalysisResponse = function (output, context) {
1460
1675
  return {
1461
1676
  JobId: __expectString(output.JobId),
1462
1677
  };
1463
1678
  };
1464
- const deserializeAws_json1_1StartDocumentTextDetectionResponse = (output, context) => {
1679
+ var deserializeAws_json1_1StartDocumentTextDetectionResponse = function (output, context) {
1465
1680
  return {
1466
1681
  JobId: __expectString(output.JobId),
1467
1682
  };
1468
1683
  };
1469
- const deserializeAws_json1_1StartExpenseAnalysisResponse = (output, context) => {
1684
+ var deserializeAws_json1_1StartExpenseAnalysisResponse = function (output, context) {
1470
1685
  return {
1471
1686
  JobId: __expectString(output.JobId),
1472
1687
  };
1473
1688
  };
1474
- const deserializeAws_json1_1ThrottlingException = (output, context) => {
1689
+ var deserializeAws_json1_1ThrottlingException = function (output, context) {
1475
1690
  return {
1476
1691
  Code: __expectString(output.Code),
1477
1692
  Message: __expectString(output.Message),
1478
1693
  };
1479
1694
  };
1480
- const deserializeAws_json1_1UnsupportedDocumentException = (output, context) => {
1695
+ var deserializeAws_json1_1UnsupportedDocumentException = function (output, context) {
1481
1696
  return {
1482
1697
  Code: __expectString(output.Code),
1483
1698
  Message: __expectString(output.Message),
1484
1699
  };
1485
1700
  };
1486
- const deserializeAws_json1_1Warning = (output, context) => {
1701
+ var deserializeAws_json1_1Warning = function (output, context) {
1487
1702
  return {
1488
1703
  ErrorCode: __expectString(output.ErrorCode),
1489
1704
  Pages: output.Pages != null ? deserializeAws_json1_1Pages(output.Pages, context) : undefined,
1490
1705
  };
1491
1706
  };
1492
- const deserializeAws_json1_1Warnings = (output, context) => {
1493
- const retVal = (output || [])
1494
- .filter((e) => e != null)
1495
- .map((entry) => {
1707
+ var deserializeAws_json1_1Warnings = function (output, context) {
1708
+ var retVal = (output || [])
1709
+ .filter(function (e) { return e != null; })
1710
+ .map(function (entry) {
1496
1711
  if (entry === null) {
1497
1712
  return null;
1498
1713
  }
@@ -1500,52 +1715,75 @@ const deserializeAws_json1_1Warnings = (output, context) => {
1500
1715
  });
1501
1716
  return retVal;
1502
1717
  };
1503
- const deserializeMetadata = (output) => ({
1504
- httpStatusCode: output.statusCode,
1505
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
1506
- extendedRequestId: output.headers["x-amz-id-2"],
1507
- cfId: output.headers["x-amz-cf-id"],
1508
- });
1509
- const collectBody = (streamBody = new Uint8Array(), context) => {
1718
+ var deserializeMetadata = function (output) {
1719
+ var _a, _b;
1720
+ return ({
1721
+ httpStatusCode: output.statusCode,
1722
+ 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"],
1723
+ extendedRequestId: output.headers["x-amz-id-2"],
1724
+ cfId: output.headers["x-amz-cf-id"],
1725
+ });
1726
+ };
1727
+ var collectBody = function (streamBody, context) {
1728
+ if (streamBody === void 0) { streamBody = new Uint8Array(); }
1510
1729
  if (streamBody instanceof Uint8Array) {
1511
1730
  return Promise.resolve(streamBody);
1512
1731
  }
1513
1732
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1514
1733
  };
1515
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1516
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1517
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1518
- const contents = {
1519
- protocol,
1520
- hostname,
1521
- port,
1522
- method: "POST",
1523
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1524
- headers,
1525
- };
1526
- if (resolvedHostname !== undefined) {
1527
- contents.hostname = resolvedHostname;
1528
- }
1529
- if (body !== undefined) {
1530
- contents.body = body;
1531
- }
1532
- return new __HttpRequest(contents);
1734
+ var collectBodyString = function (streamBody, context) {
1735
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1736
+ };
1737
+ var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
1738
+ var _a, hostname, _b, protocol, port, basePath, contents;
1739
+ return __generator(this, function (_c) {
1740
+ switch (_c.label) {
1741
+ case 0: return [4, context.endpoint()];
1742
+ case 1:
1743
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1744
+ contents = {
1745
+ protocol: protocol,
1746
+ hostname: hostname,
1747
+ port: port,
1748
+ method: "POST",
1749
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1750
+ headers: headers,
1751
+ };
1752
+ if (resolvedHostname !== undefined) {
1753
+ contents.hostname = resolvedHostname;
1754
+ }
1755
+ if (body !== undefined) {
1756
+ contents.body = body;
1757
+ }
1758
+ return [2, new __HttpRequest(contents)];
1759
+ }
1760
+ });
1761
+ }); };
1762
+ var parseBody = function (streamBody, context) {
1763
+ return collectBodyString(streamBody, context).then(function (encoded) {
1764
+ if (encoded.length) {
1765
+ return JSON.parse(encoded);
1766
+ }
1767
+ return {};
1768
+ });
1533
1769
  };
1534
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1535
- if (encoded.length) {
1536
- return JSON.parse(encoded);
1537
- }
1538
- return {};
1539
- });
1540
- const parseErrorBody = async (errorBody, context) => {
1541
- const value = await parseBody(errorBody, context);
1542
- value.message = value.message ?? value.Message;
1543
- return value;
1544
- };
1545
- const loadRestJsonErrorCode = (output, data) => {
1546
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1547
- const sanitizeErrorCode = (rawValue) => {
1548
- let cleanValue = rawValue;
1770
+ var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1771
+ var value;
1772
+ var _a;
1773
+ return __generator(this, function (_b) {
1774
+ switch (_b.label) {
1775
+ case 0: return [4, parseBody(errorBody, context)];
1776
+ case 1:
1777
+ value = _b.sent();
1778
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1779
+ return [2, value];
1780
+ }
1781
+ });
1782
+ }); };
1783
+ var loadRestJsonErrorCode = function (output, data) {
1784
+ var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1785
+ var sanitizeErrorCode = function (rawValue) {
1786
+ var cleanValue = rawValue;
1549
1787
  if (typeof cleanValue === "number") {
1550
1788
  cleanValue = cleanValue.toString();
1551
1789
  }
@@ -1560,7 +1798,7 @@ const loadRestJsonErrorCode = (output, data) => {
1560
1798
  }
1561
1799
  return cleanValue;
1562
1800
  };
1563
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1801
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
1564
1802
  if (headerKey !== undefined) {
1565
1803
  return sanitizeErrorCode(output.headers[headerKey]);
1566
1804
  }