@aws-sdk/client-textract 3.36.0 → 3.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/dist-cjs/Textract.js +30 -5
- package/dist-cjs/TextractClient.js +0 -10
- package/dist-cjs/commands/AnalyzeDocumentCommand.js +0 -54
- package/dist-cjs/commands/AnalyzeExpenseCommand.js +0 -37
- package/dist-cjs/commands/DetectDocumentTextCommand.js +0 -34
- package/dist-cjs/commands/GetDocumentAnalysisCommand.js +0 -68
- package/dist-cjs/commands/GetDocumentTextDetectionCommand.js +0 -48
- package/dist-cjs/commands/GetExpenseAnalysisCommand.js +36 -0
- package/dist-cjs/commands/StartDocumentAnalysisCommand.js +0 -41
- package/dist-cjs/commands/StartDocumentTextDetectionCommand.js +0 -40
- package/dist-cjs/commands/StartExpenseAnalysisCommand.js +36 -0
- package/dist-cjs/commands/index.js +12 -0
- package/dist-cjs/endpoints.js +42 -3
- package/dist-cjs/index.js +3 -9
- package/dist-cjs/models/models_0.js +26 -149
- package/dist-cjs/protocols/Aws_json1_1.js +306 -6
- package/dist-cjs/runtimeConfig.browser.js +1 -5
- package/dist-cjs/runtimeConfig.js +1 -5
- package/dist-cjs/runtimeConfig.native.js +0 -3
- package/dist-cjs/runtimeConfig.shared.js +0 -3
- package/dist-es/Textract.js +30 -0
- package/dist-es/commands/GetExpenseAnalysisCommand.js +39 -0
- package/dist-es/commands/StartExpenseAnalysisCommand.js +39 -0
- package/dist-es/commands/index.js +9 -0
- package/dist-es/endpoints.js +42 -3
- package/dist-es/index.js +3 -9
- package/dist-es/models/models_0.js +16 -0
- package/dist-es/protocols/Aws_json1_1.js +314 -0
- package/dist-types/Textract.d.ts +47 -2
- package/dist-types/TextractClient.d.ts +4 -2
- package/dist-types/commands/GetExpenseAnalysisCommand.d.ts +51 -0
- package/dist-types/commands/StartDocumentAnalysisCommand.d.ts +1 -1
- package/dist-types/commands/StartDocumentTextDetectionCommand.d.ts +1 -1
- package/dist-types/commands/StartExpenseAnalysisCommand.d.ts +50 -0
- package/dist-types/commands/index.d.ts +9 -0
- package/dist-types/index.d.ts +3 -9
- package/dist-types/models/models_0.d.ts +123 -2
- package/dist-types/protocols/Aws_json1_1.d.ts +6 -0
- package/dist-types/ts3.4/Textract.d.ts +18 -180
- package/dist-types/ts3.4/TextractClient.d.ts +28 -93
- package/dist-types/ts3.4/commands/AnalyzeDocumentCommand.d.ts +2 -50
- package/dist-types/ts3.4/commands/AnalyzeExpenseCommand.d.ts +2 -33
- package/dist-types/ts3.4/commands/DetectDocumentTextCommand.d.ts +2 -30
- package/dist-types/ts3.4/commands/GetDocumentAnalysisCommand.d.ts +2 -64
- package/dist-types/ts3.4/commands/GetDocumentTextDetectionCommand.d.ts +2 -44
- package/dist-types/ts3.4/commands/GetExpenseAnalysisCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/StartDocumentAnalysisCommand.d.ts +2 -37
- package/dist-types/ts3.4/commands/StartDocumentTextDetectionCommand.d.ts +2 -36
- package/dist-types/ts3.4/commands/StartExpenseAnalysisCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/index.d.ts +9 -0
- package/dist-types/ts3.4/index.d.ts +3 -9
- package/dist-types/ts3.4/models/models_0.d.ts +253 -893
- package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +6 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -3
- package/dist-types/ts3.4/runtimeConfig.d.ts +1 -3
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -3
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +1 -3
- package/package.json +32 -32
package/dist-es/endpoints.js
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
2
|
import { getRegionInfo } from "@aws-sdk/config-resolver";
|
|
3
|
-
var regionHash = {
|
|
3
|
+
var regionHash = {
|
|
4
|
+
"fips-ca-central-1": {
|
|
5
|
+
hostname: "textract-fips.ca-central-1.amazonaws.com",
|
|
6
|
+
signingRegion: "ca-central-1",
|
|
7
|
+
},
|
|
8
|
+
"fips-us-east-1": {
|
|
9
|
+
hostname: "textract-fips.us-east-1.amazonaws.com",
|
|
10
|
+
signingRegion: "us-east-1",
|
|
11
|
+
},
|
|
12
|
+
"fips-us-east-2": {
|
|
13
|
+
hostname: "textract-fips.us-east-2.amazonaws.com",
|
|
14
|
+
signingRegion: "us-east-2",
|
|
15
|
+
},
|
|
16
|
+
"fips-us-gov-east-1": {
|
|
17
|
+
hostname: "textract-fips.us-gov-east-1.amazonaws.com",
|
|
18
|
+
signingRegion: "us-gov-east-1",
|
|
19
|
+
},
|
|
20
|
+
"fips-us-gov-west-1": {
|
|
21
|
+
hostname: "textract-fips.us-gov-west-1.amazonaws.com",
|
|
22
|
+
signingRegion: "us-gov-west-1",
|
|
23
|
+
},
|
|
24
|
+
"fips-us-west-1": {
|
|
25
|
+
hostname: "textract-fips.us-west-1.amazonaws.com",
|
|
26
|
+
signingRegion: "us-west-1",
|
|
27
|
+
},
|
|
28
|
+
"fips-us-west-2": {
|
|
29
|
+
hostname: "textract-fips.us-west-2.amazonaws.com",
|
|
30
|
+
signingRegion: "us-west-2",
|
|
31
|
+
},
|
|
32
|
+
};
|
|
4
33
|
var partitionHash = {
|
|
5
34
|
aws: {
|
|
6
35
|
regions: [
|
|
@@ -19,6 +48,11 @@ var partitionHash = {
|
|
|
19
48
|
"eu-west-1",
|
|
20
49
|
"eu-west-2",
|
|
21
50
|
"eu-west-3",
|
|
51
|
+
"fips-ca-central-1",
|
|
52
|
+
"fips-us-east-1",
|
|
53
|
+
"fips-us-east-2",
|
|
54
|
+
"fips-us-west-1",
|
|
55
|
+
"fips-us-west-2",
|
|
22
56
|
"me-south-1",
|
|
23
57
|
"sa-east-1",
|
|
24
58
|
"us-east-1",
|
|
@@ -26,22 +60,27 @@ var partitionHash = {
|
|
|
26
60
|
"us-west-1",
|
|
27
61
|
"us-west-2",
|
|
28
62
|
],
|
|
63
|
+
regionRegex: "^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",
|
|
29
64
|
hostname: "textract.{region}.amazonaws.com",
|
|
30
65
|
},
|
|
31
66
|
"aws-cn": {
|
|
32
67
|
regions: ["cn-north-1", "cn-northwest-1"],
|
|
68
|
+
regionRegex: "^cn\\-\\w+\\-\\d+$",
|
|
33
69
|
hostname: "textract.{region}.amazonaws.com.cn",
|
|
34
70
|
},
|
|
35
71
|
"aws-iso": {
|
|
36
|
-
regions: ["us-iso-east-1"],
|
|
72
|
+
regions: ["us-iso-east-1", "us-iso-west-1"],
|
|
73
|
+
regionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
|
|
37
74
|
hostname: "textract.{region}.c2s.ic.gov",
|
|
38
75
|
},
|
|
39
76
|
"aws-iso-b": {
|
|
40
77
|
regions: ["us-isob-east-1"],
|
|
78
|
+
regionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
|
|
41
79
|
hostname: "textract.{region}.sc2s.sgov.gov",
|
|
42
80
|
},
|
|
43
81
|
"aws-us-gov": {
|
|
44
|
-
regions: ["us-gov-east-1", "us-gov-west-1"],
|
|
82
|
+
regions: ["fips-us-gov-east-1", "fips-us-gov-west-1", "us-gov-east-1", "us-gov-west-1"],
|
|
83
|
+
regionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
|
|
45
84
|
hostname: "textract.{region}.amazonaws.com",
|
|
46
85
|
},
|
|
47
86
|
};
|
package/dist-es/index.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
export * from "./TextractClient";
|
|
2
1
|
export * from "./Textract";
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./commands
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./commands/GetDocumentAnalysisCommand";
|
|
7
|
-
export * from "./commands/GetDocumentTextDetectionCommand";
|
|
8
|
-
export * from "./commands/StartDocumentAnalysisCommand";
|
|
9
|
-
export * from "./commands/StartDocumentTextDetectionCommand";
|
|
10
|
-
export * from "./models/index";
|
|
2
|
+
export * from "./TextractClient";
|
|
3
|
+
export * from "./commands";
|
|
4
|
+
export * from "./models";
|
|
@@ -211,6 +211,14 @@ export var GetDocumentTextDetectionResponse;
|
|
|
211
211
|
(function (GetDocumentTextDetectionResponse) {
|
|
212
212
|
GetDocumentTextDetectionResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
213
213
|
})(GetDocumentTextDetectionResponse || (GetDocumentTextDetectionResponse = {}));
|
|
214
|
+
export var GetExpenseAnalysisRequest;
|
|
215
|
+
(function (GetExpenseAnalysisRequest) {
|
|
216
|
+
GetExpenseAnalysisRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
217
|
+
})(GetExpenseAnalysisRequest || (GetExpenseAnalysisRequest = {}));
|
|
218
|
+
export var GetExpenseAnalysisResponse;
|
|
219
|
+
(function (GetExpenseAnalysisResponse) {
|
|
220
|
+
GetExpenseAnalysisResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
221
|
+
})(GetExpenseAnalysisResponse || (GetExpenseAnalysisResponse = {}));
|
|
214
222
|
export var IdempotentParameterMismatchException;
|
|
215
223
|
(function (IdempotentParameterMismatchException) {
|
|
216
224
|
IdempotentParameterMismatchException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -243,3 +251,11 @@ export var StartDocumentTextDetectionResponse;
|
|
|
243
251
|
(function (StartDocumentTextDetectionResponse) {
|
|
244
252
|
StartDocumentTextDetectionResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
245
253
|
})(StartDocumentTextDetectionResponse || (StartDocumentTextDetectionResponse = {}));
|
|
254
|
+
export var StartExpenseAnalysisRequest;
|
|
255
|
+
(function (StartExpenseAnalysisRequest) {
|
|
256
|
+
StartExpenseAnalysisRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
257
|
+
})(StartExpenseAnalysisRequest || (StartExpenseAnalysisRequest = {}));
|
|
258
|
+
export var StartExpenseAnalysisResponse;
|
|
259
|
+
(function (StartExpenseAnalysisResponse) {
|
|
260
|
+
StartExpenseAnalysisResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
261
|
+
})(StartExpenseAnalysisResponse || (StartExpenseAnalysisResponse = {}));
|
|
@@ -56,6 +56,17 @@ export var serializeAws_json1_1GetDocumentTextDetectionCommand = function (input
|
|
|
56
56
|
return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
|
|
57
57
|
});
|
|
58
58
|
}); };
|
|
59
|
+
export var serializeAws_json1_1GetExpenseAnalysisCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
60
|
+
var headers, body;
|
|
61
|
+
return __generator(this, function (_a) {
|
|
62
|
+
headers = {
|
|
63
|
+
"content-type": "application/x-amz-json-1.1",
|
|
64
|
+
"x-amz-target": "Textract.GetExpenseAnalysis",
|
|
65
|
+
};
|
|
66
|
+
body = JSON.stringify(serializeAws_json1_1GetExpenseAnalysisRequest(input, context));
|
|
67
|
+
return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
|
|
68
|
+
});
|
|
69
|
+
}); };
|
|
59
70
|
export var serializeAws_json1_1StartDocumentAnalysisCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
60
71
|
var headers, body;
|
|
61
72
|
return __generator(this, function (_a) {
|
|
@@ -78,6 +89,17 @@ export var serializeAws_json1_1StartDocumentTextDetectionCommand = function (inp
|
|
|
78
89
|
return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
|
|
79
90
|
});
|
|
80
91
|
}); };
|
|
92
|
+
export var serializeAws_json1_1StartExpenseAnalysisCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
93
|
+
var headers, body;
|
|
94
|
+
return __generator(this, function (_a) {
|
|
95
|
+
headers = {
|
|
96
|
+
"content-type": "application/x-amz-json-1.1",
|
|
97
|
+
"x-amz-target": "Textract.StartExpenseAnalysis",
|
|
98
|
+
};
|
|
99
|
+
body = JSON.stringify(serializeAws_json1_1StartExpenseAnalysisRequest(input, context));
|
|
100
|
+
return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
|
|
101
|
+
});
|
|
102
|
+
}); };
|
|
81
103
|
export var deserializeAws_json1_1AnalyzeDocumentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
82
104
|
var data, contents, response;
|
|
83
105
|
return __generator(this, function (_a) {
|
|
@@ -670,6 +692,118 @@ var deserializeAws_json1_1GetDocumentTextDetectionCommandError = function (outpu
|
|
|
670
692
|
}
|
|
671
693
|
});
|
|
672
694
|
}); };
|
|
695
|
+
export var deserializeAws_json1_1GetExpenseAnalysisCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
696
|
+
var data, contents, response;
|
|
697
|
+
return __generator(this, function (_a) {
|
|
698
|
+
switch (_a.label) {
|
|
699
|
+
case 0:
|
|
700
|
+
if (output.statusCode >= 300) {
|
|
701
|
+
return [2, deserializeAws_json1_1GetExpenseAnalysisCommandError(output, context)];
|
|
702
|
+
}
|
|
703
|
+
return [4, parseBody(output.body, context)];
|
|
704
|
+
case 1:
|
|
705
|
+
data = _a.sent();
|
|
706
|
+
contents = {};
|
|
707
|
+
contents = deserializeAws_json1_1GetExpenseAnalysisResponse(data, context);
|
|
708
|
+
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
709
|
+
return [2, Promise.resolve(response)];
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
}); };
|
|
713
|
+
var deserializeAws_json1_1GetExpenseAnalysisCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
714
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, _k, parsedBody, message;
|
|
715
|
+
var _l;
|
|
716
|
+
return __generator(this, function (_m) {
|
|
717
|
+
switch (_m.label) {
|
|
718
|
+
case 0:
|
|
719
|
+
_a = [__assign({}, output)];
|
|
720
|
+
_l = {};
|
|
721
|
+
return [4, parseBody(output.body, context)];
|
|
722
|
+
case 1:
|
|
723
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_l.body = _m.sent(), _l)]));
|
|
724
|
+
errorCode = "UnknownError";
|
|
725
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
726
|
+
_b = errorCode;
|
|
727
|
+
switch (_b) {
|
|
728
|
+
case "AccessDeniedException": return [3, 2];
|
|
729
|
+
case "com.amazonaws.textract#AccessDeniedException": return [3, 2];
|
|
730
|
+
case "InternalServerError": return [3, 4];
|
|
731
|
+
case "com.amazonaws.textract#InternalServerError": return [3, 4];
|
|
732
|
+
case "InvalidJobIdException": return [3, 6];
|
|
733
|
+
case "com.amazonaws.textract#InvalidJobIdException": return [3, 6];
|
|
734
|
+
case "InvalidKMSKeyException": return [3, 8];
|
|
735
|
+
case "com.amazonaws.textract#InvalidKMSKeyException": return [3, 8];
|
|
736
|
+
case "InvalidParameterException": return [3, 10];
|
|
737
|
+
case "com.amazonaws.textract#InvalidParameterException": return [3, 10];
|
|
738
|
+
case "InvalidS3ObjectException": return [3, 12];
|
|
739
|
+
case "com.amazonaws.textract#InvalidS3ObjectException": return [3, 12];
|
|
740
|
+
case "ProvisionedThroughputExceededException": return [3, 14];
|
|
741
|
+
case "com.amazonaws.textract#ProvisionedThroughputExceededException": return [3, 14];
|
|
742
|
+
case "ThrottlingException": return [3, 16];
|
|
743
|
+
case "com.amazonaws.textract#ThrottlingException": return [3, 16];
|
|
744
|
+
}
|
|
745
|
+
return [3, 18];
|
|
746
|
+
case 2:
|
|
747
|
+
_c = [{}];
|
|
748
|
+
return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
749
|
+
case 3:
|
|
750
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
751
|
+
return [3, 19];
|
|
752
|
+
case 4:
|
|
753
|
+
_d = [{}];
|
|
754
|
+
return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
|
|
755
|
+
case 5:
|
|
756
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
757
|
+
return [3, 19];
|
|
758
|
+
case 6:
|
|
759
|
+
_e = [{}];
|
|
760
|
+
return [4, deserializeAws_json1_1InvalidJobIdExceptionResponse(parsedOutput, context)];
|
|
761
|
+
case 7:
|
|
762
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
763
|
+
return [3, 19];
|
|
764
|
+
case 8:
|
|
765
|
+
_f = [{}];
|
|
766
|
+
return [4, deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context)];
|
|
767
|
+
case 9:
|
|
768
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
769
|
+
return [3, 19];
|
|
770
|
+
case 10:
|
|
771
|
+
_g = [{}];
|
|
772
|
+
return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
|
|
773
|
+
case 11:
|
|
774
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
775
|
+
return [3, 19];
|
|
776
|
+
case 12:
|
|
777
|
+
_h = [{}];
|
|
778
|
+
return [4, deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)];
|
|
779
|
+
case 13:
|
|
780
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
781
|
+
return [3, 19];
|
|
782
|
+
case 14:
|
|
783
|
+
_j = [{}];
|
|
784
|
+
return [4, deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)];
|
|
785
|
+
case 15:
|
|
786
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
787
|
+
return [3, 19];
|
|
788
|
+
case 16:
|
|
789
|
+
_k = [{}];
|
|
790
|
+
return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
791
|
+
case 17:
|
|
792
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _k.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
793
|
+
return [3, 19];
|
|
794
|
+
case 18:
|
|
795
|
+
parsedBody = parsedOutput.body;
|
|
796
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
797
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
798
|
+
_m.label = 19;
|
|
799
|
+
case 19:
|
|
800
|
+
message = response.message || response.Message || errorCode;
|
|
801
|
+
response.message = message;
|
|
802
|
+
delete response.Message;
|
|
803
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
804
|
+
}
|
|
805
|
+
});
|
|
806
|
+
}); };
|
|
673
807
|
export var deserializeAws_json1_1StartDocumentAnalysisCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
674
808
|
var data, contents, response;
|
|
675
809
|
return __generator(this, function (_a) {
|
|
@@ -958,6 +1092,150 @@ var deserializeAws_json1_1StartDocumentTextDetectionCommandError = function (out
|
|
|
958
1092
|
}
|
|
959
1093
|
});
|
|
960
1094
|
}); };
|
|
1095
|
+
export var deserializeAws_json1_1StartExpenseAnalysisCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1096
|
+
var data, contents, response;
|
|
1097
|
+
return __generator(this, function (_a) {
|
|
1098
|
+
switch (_a.label) {
|
|
1099
|
+
case 0:
|
|
1100
|
+
if (output.statusCode >= 300) {
|
|
1101
|
+
return [2, deserializeAws_json1_1StartExpenseAnalysisCommandError(output, context)];
|
|
1102
|
+
}
|
|
1103
|
+
return [4, parseBody(output.body, context)];
|
|
1104
|
+
case 1:
|
|
1105
|
+
data = _a.sent();
|
|
1106
|
+
contents = {};
|
|
1107
|
+
contents = deserializeAws_json1_1StartExpenseAnalysisResponse(data, context);
|
|
1108
|
+
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
1109
|
+
return [2, Promise.resolve(response)];
|
|
1110
|
+
}
|
|
1111
|
+
});
|
|
1112
|
+
}); };
|
|
1113
|
+
var deserializeAws_json1_1StartExpenseAnalysisCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1114
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, parsedBody, message;
|
|
1115
|
+
var _q;
|
|
1116
|
+
return __generator(this, function (_r) {
|
|
1117
|
+
switch (_r.label) {
|
|
1118
|
+
case 0:
|
|
1119
|
+
_a = [__assign({}, output)];
|
|
1120
|
+
_q = {};
|
|
1121
|
+
return [4, parseBody(output.body, context)];
|
|
1122
|
+
case 1:
|
|
1123
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_q.body = _r.sent(), _q)]));
|
|
1124
|
+
errorCode = "UnknownError";
|
|
1125
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1126
|
+
_b = errorCode;
|
|
1127
|
+
switch (_b) {
|
|
1128
|
+
case "AccessDeniedException": return [3, 2];
|
|
1129
|
+
case "com.amazonaws.textract#AccessDeniedException": return [3, 2];
|
|
1130
|
+
case "BadDocumentException": return [3, 4];
|
|
1131
|
+
case "com.amazonaws.textract#BadDocumentException": return [3, 4];
|
|
1132
|
+
case "DocumentTooLargeException": return [3, 6];
|
|
1133
|
+
case "com.amazonaws.textract#DocumentTooLargeException": return [3, 6];
|
|
1134
|
+
case "IdempotentParameterMismatchException": return [3, 8];
|
|
1135
|
+
case "com.amazonaws.textract#IdempotentParameterMismatchException": return [3, 8];
|
|
1136
|
+
case "InternalServerError": return [3, 10];
|
|
1137
|
+
case "com.amazonaws.textract#InternalServerError": return [3, 10];
|
|
1138
|
+
case "InvalidKMSKeyException": return [3, 12];
|
|
1139
|
+
case "com.amazonaws.textract#InvalidKMSKeyException": return [3, 12];
|
|
1140
|
+
case "InvalidParameterException": return [3, 14];
|
|
1141
|
+
case "com.amazonaws.textract#InvalidParameterException": return [3, 14];
|
|
1142
|
+
case "InvalidS3ObjectException": return [3, 16];
|
|
1143
|
+
case "com.amazonaws.textract#InvalidS3ObjectException": return [3, 16];
|
|
1144
|
+
case "LimitExceededException": return [3, 18];
|
|
1145
|
+
case "com.amazonaws.textract#LimitExceededException": return [3, 18];
|
|
1146
|
+
case "ProvisionedThroughputExceededException": return [3, 20];
|
|
1147
|
+
case "com.amazonaws.textract#ProvisionedThroughputExceededException": return [3, 20];
|
|
1148
|
+
case "ThrottlingException": return [3, 22];
|
|
1149
|
+
case "com.amazonaws.textract#ThrottlingException": return [3, 22];
|
|
1150
|
+
case "UnsupportedDocumentException": return [3, 24];
|
|
1151
|
+
case "com.amazonaws.textract#UnsupportedDocumentException": return [3, 24];
|
|
1152
|
+
}
|
|
1153
|
+
return [3, 26];
|
|
1154
|
+
case 2:
|
|
1155
|
+
_c = [{}];
|
|
1156
|
+
return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
1157
|
+
case 3:
|
|
1158
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_r.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1159
|
+
return [3, 27];
|
|
1160
|
+
case 4:
|
|
1161
|
+
_d = [{}];
|
|
1162
|
+
return [4, deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context)];
|
|
1163
|
+
case 5:
|
|
1164
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_r.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1165
|
+
return [3, 27];
|
|
1166
|
+
case 6:
|
|
1167
|
+
_e = [{}];
|
|
1168
|
+
return [4, deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context)];
|
|
1169
|
+
case 7:
|
|
1170
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_r.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1171
|
+
return [3, 27];
|
|
1172
|
+
case 8:
|
|
1173
|
+
_f = [{}];
|
|
1174
|
+
return [4, deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)];
|
|
1175
|
+
case 9:
|
|
1176
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_r.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1177
|
+
return [3, 27];
|
|
1178
|
+
case 10:
|
|
1179
|
+
_g = [{}];
|
|
1180
|
+
return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
|
|
1181
|
+
case 11:
|
|
1182
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_r.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1183
|
+
return [3, 27];
|
|
1184
|
+
case 12:
|
|
1185
|
+
_h = [{}];
|
|
1186
|
+
return [4, deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context)];
|
|
1187
|
+
case 13:
|
|
1188
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_r.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1189
|
+
return [3, 27];
|
|
1190
|
+
case 14:
|
|
1191
|
+
_j = [{}];
|
|
1192
|
+
return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
|
|
1193
|
+
case 15:
|
|
1194
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_r.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1195
|
+
return [3, 27];
|
|
1196
|
+
case 16:
|
|
1197
|
+
_k = [{}];
|
|
1198
|
+
return [4, deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)];
|
|
1199
|
+
case 17:
|
|
1200
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _k.concat([(_r.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1201
|
+
return [3, 27];
|
|
1202
|
+
case 18:
|
|
1203
|
+
_l = [{}];
|
|
1204
|
+
return [4, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
1205
|
+
case 19:
|
|
1206
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _l.concat([(_r.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1207
|
+
return [3, 27];
|
|
1208
|
+
case 20:
|
|
1209
|
+
_m = [{}];
|
|
1210
|
+
return [4, deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)];
|
|
1211
|
+
case 21:
|
|
1212
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _m.concat([(_r.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1213
|
+
return [3, 27];
|
|
1214
|
+
case 22:
|
|
1215
|
+
_o = [{}];
|
|
1216
|
+
return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
1217
|
+
case 23:
|
|
1218
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _o.concat([(_r.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1219
|
+
return [3, 27];
|
|
1220
|
+
case 24:
|
|
1221
|
+
_p = [{}];
|
|
1222
|
+
return [4, deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context)];
|
|
1223
|
+
case 25:
|
|
1224
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _p.concat([(_r.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
1225
|
+
return [3, 27];
|
|
1226
|
+
case 26:
|
|
1227
|
+
parsedBody = parsedOutput.body;
|
|
1228
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1229
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
1230
|
+
_r.label = 27;
|
|
1231
|
+
case 27:
|
|
1232
|
+
message = response.message || response.Message || errorCode;
|
|
1233
|
+
response.message = message;
|
|
1234
|
+
delete response.Message;
|
|
1235
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
1236
|
+
}
|
|
1237
|
+
});
|
|
1238
|
+
}); };
|
|
961
1239
|
var deserializeAws_json1_1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
962
1240
|
var body, deserialized, contents;
|
|
963
1241
|
return __generator(this, function (_a) {
|
|
@@ -1134,6 +1412,9 @@ var serializeAws_json1_1GetDocumentAnalysisRequest = function (input, context) {
|
|
|
1134
1412
|
var serializeAws_json1_1GetDocumentTextDetectionRequest = function (input, context) {
|
|
1135
1413
|
return __assign(__assign(__assign({}, (input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId })), (input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }));
|
|
1136
1414
|
};
|
|
1415
|
+
var serializeAws_json1_1GetExpenseAnalysisRequest = function (input, context) {
|
|
1416
|
+
return __assign(__assign(__assign({}, (input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId })), (input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }));
|
|
1417
|
+
};
|
|
1137
1418
|
var serializeAws_json1_1HumanLoopConfig = function (input, context) {
|
|
1138
1419
|
return __assign(__assign(__assign({}, (input.DataAttributes !== undefined &&
|
|
1139
1420
|
input.DataAttributes !== null && {
|
|
@@ -1179,6 +1460,17 @@ var serializeAws_json1_1StartDocumentTextDetectionRequest = function (input, con
|
|
|
1179
1460
|
})), (input.OutputConfig !== undefined &&
|
|
1180
1461
|
input.OutputConfig !== null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }));
|
|
1181
1462
|
};
|
|
1463
|
+
var serializeAws_json1_1StartExpenseAnalysisRequest = function (input, context) {
|
|
1464
|
+
return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.ClientRequestToken !== undefined &&
|
|
1465
|
+
input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken })), (input.DocumentLocation !== undefined &&
|
|
1466
|
+
input.DocumentLocation !== null && {
|
|
1467
|
+
DocumentLocation: serializeAws_json1_1DocumentLocation(input.DocumentLocation, context),
|
|
1468
|
+
})), (input.JobTag !== undefined && input.JobTag !== null && { JobTag: input.JobTag })), (input.KMSKeyId !== undefined && input.KMSKeyId !== null && { KMSKeyId: input.KMSKeyId })), (input.NotificationChannel !== undefined &&
|
|
1469
|
+
input.NotificationChannel !== null && {
|
|
1470
|
+
NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context),
|
|
1471
|
+
})), (input.OutputConfig !== undefined &&
|
|
1472
|
+
input.OutputConfig !== null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }));
|
|
1473
|
+
};
|
|
1182
1474
|
var deserializeAws_json1_1AccessDeniedException = function (output, context) {
|
|
1183
1475
|
return {
|
|
1184
1476
|
Code: __expectString(output.Code),
|
|
@@ -1393,6 +1685,23 @@ var deserializeAws_json1_1GetDocumentTextDetectionResponse = function (output, c
|
|
|
1393
1685
|
: undefined,
|
|
1394
1686
|
};
|
|
1395
1687
|
};
|
|
1688
|
+
var deserializeAws_json1_1GetExpenseAnalysisResponse = function (output, context) {
|
|
1689
|
+
return {
|
|
1690
|
+
AnalyzeExpenseModelVersion: __expectString(output.AnalyzeExpenseModelVersion),
|
|
1691
|
+
DocumentMetadata: output.DocumentMetadata !== undefined && output.DocumentMetadata !== null
|
|
1692
|
+
? deserializeAws_json1_1DocumentMetadata(output.DocumentMetadata, context)
|
|
1693
|
+
: undefined,
|
|
1694
|
+
ExpenseDocuments: output.ExpenseDocuments !== undefined && output.ExpenseDocuments !== null
|
|
1695
|
+
? deserializeAws_json1_1ExpenseDocumentList(output.ExpenseDocuments, context)
|
|
1696
|
+
: undefined,
|
|
1697
|
+
JobStatus: __expectString(output.JobStatus),
|
|
1698
|
+
NextToken: __expectString(output.NextToken),
|
|
1699
|
+
StatusMessage: __expectString(output.StatusMessage),
|
|
1700
|
+
Warnings: output.Warnings !== undefined && output.Warnings !== null
|
|
1701
|
+
? deserializeAws_json1_1Warnings(output.Warnings, context)
|
|
1702
|
+
: undefined,
|
|
1703
|
+
};
|
|
1704
|
+
};
|
|
1396
1705
|
var deserializeAws_json1_1HumanLoopActivationOutput = function (output, context) {
|
|
1397
1706
|
return {
|
|
1398
1707
|
HumanLoopActivationConditionsEvaluationResults: output.HumanLoopActivationConditionsEvaluationResults !== undefined &&
|
|
@@ -1569,6 +1878,11 @@ var deserializeAws_json1_1StartDocumentTextDetectionResponse = function (output,
|
|
|
1569
1878
|
JobId: __expectString(output.JobId),
|
|
1570
1879
|
};
|
|
1571
1880
|
};
|
|
1881
|
+
var deserializeAws_json1_1StartExpenseAnalysisResponse = function (output, context) {
|
|
1882
|
+
return {
|
|
1883
|
+
JobId: __expectString(output.JobId),
|
|
1884
|
+
};
|
|
1885
|
+
};
|
|
1572
1886
|
var deserializeAws_json1_1ThrottlingException = function (output, context) {
|
|
1573
1887
|
return {
|
|
1574
1888
|
Code: __expectString(output.Code),
|
package/dist-types/Textract.d.ts
CHANGED
|
@@ -4,8 +4,10 @@ import { AnalyzeExpenseCommandInput, AnalyzeExpenseCommandOutput } from "./comma
|
|
|
4
4
|
import { DetectDocumentTextCommandInput, DetectDocumentTextCommandOutput } from "./commands/DetectDocumentTextCommand";
|
|
5
5
|
import { GetDocumentAnalysisCommandInput, GetDocumentAnalysisCommandOutput } from "./commands/GetDocumentAnalysisCommand";
|
|
6
6
|
import { GetDocumentTextDetectionCommandInput, GetDocumentTextDetectionCommandOutput } from "./commands/GetDocumentTextDetectionCommand";
|
|
7
|
+
import { GetExpenseAnalysisCommandInput, GetExpenseAnalysisCommandOutput } from "./commands/GetExpenseAnalysisCommand";
|
|
7
8
|
import { StartDocumentAnalysisCommandInput, StartDocumentAnalysisCommandOutput } from "./commands/StartDocumentAnalysisCommand";
|
|
8
9
|
import { StartDocumentTextDetectionCommandInput, StartDocumentTextDetectionCommandOutput } from "./commands/StartDocumentTextDetectionCommand";
|
|
10
|
+
import { StartExpenseAnalysisCommandInput, StartExpenseAnalysisCommandOutput } from "./commands/StartExpenseAnalysisCommand";
|
|
9
11
|
import { TextractClient } from "./TextractClient";
|
|
10
12
|
/**
|
|
11
13
|
* <p>Amazon Textract detects and analyzes text in documents and converts it
|
|
@@ -164,12 +166,34 @@ export declare class Textract extends TextractClient {
|
|
|
164
166
|
getDocumentTextDetection(args: GetDocumentTextDetectionCommandInput, options?: __HttpHandlerOptions): Promise<GetDocumentTextDetectionCommandOutput>;
|
|
165
167
|
getDocumentTextDetection(args: GetDocumentTextDetectionCommandInput, cb: (err: any, data?: GetDocumentTextDetectionCommandOutput) => void): void;
|
|
166
168
|
getDocumentTextDetection(args: GetDocumentTextDetectionCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetDocumentTextDetectionCommandOutput) => void): void;
|
|
169
|
+
/**
|
|
170
|
+
* <p>Gets the results for an Amazon Textract asynchronous operation that analyzes invoices and
|
|
171
|
+
* receipts. Amazon Textract finds contact information, items purchased, and vendor name, from input
|
|
172
|
+
* invoices and receipts.</p>
|
|
173
|
+
* <p>You start asynchronous invoice/receipt analysis by calling <a>StartExpenseAnalysis</a>, which returns a job identifier (<code>JobId</code>). Upon
|
|
174
|
+
* completion of the invoice/receipt analysis, Amazon Textract publishes the completion status to the
|
|
175
|
+
* Amazon Simple Notification Service (Amazon SNS) topic. This topic must be registered in the initial call to
|
|
176
|
+
* <code>StartExpenseAnalysis</code>. To get the results of the invoice/receipt analysis operation,
|
|
177
|
+
* first ensure that the status value published to the Amazon SNS topic is <code>SUCCEEDED</code>. If so,
|
|
178
|
+
* call <code>GetExpenseAnalysis</code>, and pass the job identifier (<code>JobId</code>) from the
|
|
179
|
+
* initial call to <code>StartExpenseAnalysis</code>.</p>
|
|
180
|
+
* <p>Use the MaxResults parameter to limit the number of blocks that are returned. If there are
|
|
181
|
+
* more results than specified in <code>MaxResults</code>, the value of <code>NextToken</code> in
|
|
182
|
+
* the operation response contains a pagination token for getting the next set of results. To get
|
|
183
|
+
* the next page of results, call <code>GetExpenseAnalysis</code>, and populate the
|
|
184
|
+
* <code>NextToken</code> request parameter with the token value that's returned from the previous
|
|
185
|
+
* call to <code>GetExpenseAnalysis</code>.</p>
|
|
186
|
+
* <p>For more information, see <a href="https://docs.aws.amazon.com/textract/latest/dg/invoices-receipts.html">Analyzing Invoices and Receipts</a>.</p>
|
|
187
|
+
*/
|
|
188
|
+
getExpenseAnalysis(args: GetExpenseAnalysisCommandInput, options?: __HttpHandlerOptions): Promise<GetExpenseAnalysisCommandOutput>;
|
|
189
|
+
getExpenseAnalysis(args: GetExpenseAnalysisCommandInput, cb: (err: any, data?: GetExpenseAnalysisCommandOutput) => void): void;
|
|
190
|
+
getExpenseAnalysis(args: GetExpenseAnalysisCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetExpenseAnalysisCommandOutput) => void): void;
|
|
167
191
|
/**
|
|
168
192
|
* <p>Starts the asynchronous analysis of an input document for relationships between detected
|
|
169
193
|
* items such as key-value pairs, tables, and selection elements.</p>
|
|
170
194
|
*
|
|
171
195
|
* <p>
|
|
172
|
-
* <code>StartDocumentAnalysis</code> can analyze text in documents that are in JPEG, PNG, and PDF format. The
|
|
196
|
+
* <code>StartDocumentAnalysis</code> can analyze text in documents that are in JPEG, PNG, TIFF, and PDF format. The
|
|
173
197
|
* documents are stored in an Amazon S3 bucket. Use <a>DocumentLocation</a> to specify the bucket name and file name
|
|
174
198
|
* of the document.
|
|
175
199
|
* </p>
|
|
@@ -191,7 +215,7 @@ export declare class Textract extends TextractClient {
|
|
|
191
215
|
* <p>Starts the asynchronous detection of text in a document. Amazon Textract can detect lines of
|
|
192
216
|
* text and the words that make up a line of text.</p>
|
|
193
217
|
* <p>
|
|
194
|
-
* <code>StartDocumentTextDetection</code> can analyze text in documents that are in JPEG, PNG, and PDF format. The
|
|
218
|
+
* <code>StartDocumentTextDetection</code> can analyze text in documents that are in JPEG, PNG, TIFF, and PDF format. The
|
|
195
219
|
* documents are stored in an Amazon S3 bucket. Use <a>DocumentLocation</a> to specify the bucket name and file name
|
|
196
220
|
* of the document.
|
|
197
221
|
* </p>
|
|
@@ -209,4 +233,25 @@ export declare class Textract extends TextractClient {
|
|
|
209
233
|
startDocumentTextDetection(args: StartDocumentTextDetectionCommandInput, options?: __HttpHandlerOptions): Promise<StartDocumentTextDetectionCommandOutput>;
|
|
210
234
|
startDocumentTextDetection(args: StartDocumentTextDetectionCommandInput, cb: (err: any, data?: StartDocumentTextDetectionCommandOutput) => void): void;
|
|
211
235
|
startDocumentTextDetection(args: StartDocumentTextDetectionCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: StartDocumentTextDetectionCommandOutput) => void): void;
|
|
236
|
+
/**
|
|
237
|
+
* <p>Starts the asynchronous analysis of invoices or receipts for data like contact information,
|
|
238
|
+
* items purchased, and vendor names.</p>
|
|
239
|
+
*
|
|
240
|
+
* <p>
|
|
241
|
+
* <code>StartExpenseAnalysis</code> can analyze text in documents that are in JPEG, PNG, and
|
|
242
|
+
* PDF format. The documents must be stored in an Amazon S3 bucket. Use the <a>DocumentLocation</a> parameter to specify the name of your S3 bucket and the name of the
|
|
243
|
+
* document in that bucket. </p>
|
|
244
|
+
* <p>
|
|
245
|
+
* <code>StartExpenseAnalysis</code> returns a job identifier (<code>JobId</code>) that you
|
|
246
|
+
* will provide to <code>GetExpenseAnalysis</code> to retrieve the results of the operation. When
|
|
247
|
+
* the analysis of the input invoices/receipts is finished, Amazon Textract publishes a completion
|
|
248
|
+
* status to the Amazon Simple Notification Service (Amazon SNS) topic that you provide to the <code>NotificationChannel</code>.
|
|
249
|
+
* To obtain the results of the invoice and receipt analysis operation, ensure that the status value
|
|
250
|
+
* published to the Amazon SNS topic is <code>SUCCEEDED</code>. If so, call <a>GetExpenseAnalysis</a>, and pass the job identifier (<code>JobId</code>) that was
|
|
251
|
+
* returned by your call to <code>StartExpenseAnalysis</code>.</p>
|
|
252
|
+
* <p>For more information, see <a href="https://docs.aws.amazon.com/textract/latest/dg/invoice-receipts.html">Analyzing Invoices and Receipts</a>.</p>
|
|
253
|
+
*/
|
|
254
|
+
startExpenseAnalysis(args: StartExpenseAnalysisCommandInput, options?: __HttpHandlerOptions): Promise<StartExpenseAnalysisCommandOutput>;
|
|
255
|
+
startExpenseAnalysis(args: StartExpenseAnalysisCommandInput, cb: (err: any, data?: StartExpenseAnalysisCommandOutput) => void): void;
|
|
256
|
+
startExpenseAnalysis(args: StartExpenseAnalysisCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: StartExpenseAnalysisCommandOutput) => void): void;
|
|
212
257
|
}
|
|
@@ -11,10 +11,12 @@ import { AnalyzeExpenseCommandInput, AnalyzeExpenseCommandOutput } from "./comma
|
|
|
11
11
|
import { DetectDocumentTextCommandInput, DetectDocumentTextCommandOutput } from "./commands/DetectDocumentTextCommand";
|
|
12
12
|
import { GetDocumentAnalysisCommandInput, GetDocumentAnalysisCommandOutput } from "./commands/GetDocumentAnalysisCommand";
|
|
13
13
|
import { GetDocumentTextDetectionCommandInput, GetDocumentTextDetectionCommandOutput } from "./commands/GetDocumentTextDetectionCommand";
|
|
14
|
+
import { GetExpenseAnalysisCommandInput, GetExpenseAnalysisCommandOutput } from "./commands/GetExpenseAnalysisCommand";
|
|
14
15
|
import { StartDocumentAnalysisCommandInput, StartDocumentAnalysisCommandOutput } from "./commands/StartDocumentAnalysisCommand";
|
|
15
16
|
import { StartDocumentTextDetectionCommandInput, StartDocumentTextDetectionCommandOutput } from "./commands/StartDocumentTextDetectionCommand";
|
|
16
|
-
|
|
17
|
-
export declare type
|
|
17
|
+
import { StartExpenseAnalysisCommandInput, StartExpenseAnalysisCommandOutput } from "./commands/StartExpenseAnalysisCommand";
|
|
18
|
+
export declare type ServiceInputTypes = AnalyzeDocumentCommandInput | AnalyzeExpenseCommandInput | DetectDocumentTextCommandInput | GetDocumentAnalysisCommandInput | GetDocumentTextDetectionCommandInput | GetExpenseAnalysisCommandInput | StartDocumentAnalysisCommandInput | StartDocumentTextDetectionCommandInput | StartExpenseAnalysisCommandInput;
|
|
19
|
+
export declare type ServiceOutputTypes = AnalyzeDocumentCommandOutput | AnalyzeExpenseCommandOutput | DetectDocumentTextCommandOutput | GetDocumentAnalysisCommandOutput | GetDocumentTextDetectionCommandOutput | GetExpenseAnalysisCommandOutput | StartDocumentAnalysisCommandOutput | StartDocumentTextDetectionCommandOutput | StartExpenseAnalysisCommandOutput;
|
|
18
20
|
export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
|
|
19
21
|
/**
|
|
20
22
|
* The HTTP handler to use. Fetch in browser and Https in Nodejs.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
2
|
+
import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
|
|
3
|
+
import { GetExpenseAnalysisRequest, GetExpenseAnalysisResponse } from "../models/models_0";
|
|
4
|
+
import { ServiceInputTypes, ServiceOutputTypes, TextractClientResolvedConfig } from "../TextractClient";
|
|
5
|
+
export interface GetExpenseAnalysisCommandInput extends GetExpenseAnalysisRequest {
|
|
6
|
+
}
|
|
7
|
+
export interface GetExpenseAnalysisCommandOutput extends GetExpenseAnalysisResponse, __MetadataBearer {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* <p>Gets the results for an Amazon Textract asynchronous operation that analyzes invoices and
|
|
11
|
+
* receipts. Amazon Textract finds contact information, items purchased, and vendor name, from input
|
|
12
|
+
* invoices and receipts.</p>
|
|
13
|
+
* <p>You start asynchronous invoice/receipt analysis by calling <a>StartExpenseAnalysis</a>, which returns a job identifier (<code>JobId</code>). Upon
|
|
14
|
+
* completion of the invoice/receipt analysis, Amazon Textract publishes the completion status to the
|
|
15
|
+
* Amazon Simple Notification Service (Amazon SNS) topic. This topic must be registered in the initial call to
|
|
16
|
+
* <code>StartExpenseAnalysis</code>. To get the results of the invoice/receipt analysis operation,
|
|
17
|
+
* first ensure that the status value published to the Amazon SNS topic is <code>SUCCEEDED</code>. If so,
|
|
18
|
+
* call <code>GetExpenseAnalysis</code>, and pass the job identifier (<code>JobId</code>) from the
|
|
19
|
+
* initial call to <code>StartExpenseAnalysis</code>.</p>
|
|
20
|
+
* <p>Use the MaxResults parameter to limit the number of blocks that are returned. If there are
|
|
21
|
+
* more results than specified in <code>MaxResults</code>, the value of <code>NextToken</code> in
|
|
22
|
+
* the operation response contains a pagination token for getting the next set of results. To get
|
|
23
|
+
* the next page of results, call <code>GetExpenseAnalysis</code>, and populate the
|
|
24
|
+
* <code>NextToken</code> request parameter with the token value that's returned from the previous
|
|
25
|
+
* call to <code>GetExpenseAnalysis</code>.</p>
|
|
26
|
+
* <p>For more information, see <a href="https://docs.aws.amazon.com/textract/latest/dg/invoices-receipts.html">Analyzing Invoices and Receipts</a>.</p>
|
|
27
|
+
* @example
|
|
28
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
29
|
+
* ```javascript
|
|
30
|
+
* import { TextractClient, GetExpenseAnalysisCommand } from "@aws-sdk/client-textract"; // ES Modules import
|
|
31
|
+
* // const { TextractClient, GetExpenseAnalysisCommand } = require("@aws-sdk/client-textract"); // CommonJS import
|
|
32
|
+
* const client = new TextractClient(config);
|
|
33
|
+
* const command = new GetExpenseAnalysisCommand(input);
|
|
34
|
+
* const response = await client.send(command);
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @see {@link GetExpenseAnalysisCommandInput} for command's `input` shape.
|
|
38
|
+
* @see {@link GetExpenseAnalysisCommandOutput} for command's `response` shape.
|
|
39
|
+
* @see {@link TextractClientResolvedConfig | config} for command's `input` shape.
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
export declare class GetExpenseAnalysisCommand extends $Command<GetExpenseAnalysisCommandInput, GetExpenseAnalysisCommandOutput, TextractClientResolvedConfig> {
|
|
43
|
+
readonly input: GetExpenseAnalysisCommandInput;
|
|
44
|
+
constructor(input: GetExpenseAnalysisCommandInput);
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: TextractClientResolvedConfig, options?: __HttpHandlerOptions): Handler<GetExpenseAnalysisCommandInput, GetExpenseAnalysisCommandOutput>;
|
|
49
|
+
private serialize;
|
|
50
|
+
private deserialize;
|
|
51
|
+
}
|