@aws-sdk/client-textract 3.180.0 → 3.183.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 CHANGED
@@ -3,6 +3,26 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/client-textract
9
+
10
+
11
+
12
+
13
+
14
+ # [3.181.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.180.0...v3.181.0) (2022-09-29)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **clients:** make parseErrorBody async ([#3999](https://github.com/aws/aws-sdk-js-v3/issues/3999)) ([2558c93](https://github.com/aws/aws-sdk-js-v3/commit/2558c93c050357ac6dc47aa0452b15b12ebfd676))
20
+ * **clients:** populate message field when parsing errors ([#3995](https://github.com/aws/aws-sdk-js-v3/issues/3995)) ([02e47f1](https://github.com/aws/aws-sdk-js-v3/commit/02e47f14397ae0a5d2e2883350d038b307fdcdb4))
21
+
22
+
23
+
24
+
25
+
6
26
  # [3.180.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.179.0...v3.180.0) (2022-09-27)
7
27
 
8
28
  **Note:** Version bump only for package @aws-sdk/client-textract
@@ -122,7 +122,7 @@ exports.deserializeAws_json1_1AnalyzeDocumentCommand = deserializeAws_json1_1Ana
122
122
  const deserializeAws_json1_1AnalyzeDocumentCommandError = async (output, context) => {
123
123
  const parsedOutput = {
124
124
  ...output,
125
- body: await parseBody(output.body, context),
125
+ body: await parseErrorBody(output.body, context),
126
126
  };
127
127
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
128
128
  switch (errorCode) {
@@ -183,7 +183,7 @@ exports.deserializeAws_json1_1AnalyzeExpenseCommand = deserializeAws_json1_1Anal
183
183
  const deserializeAws_json1_1AnalyzeExpenseCommandError = async (output, context) => {
184
184
  const parsedOutput = {
185
185
  ...output,
186
- body: await parseBody(output.body, context),
186
+ body: await parseErrorBody(output.body, context),
187
187
  };
188
188
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
189
189
  switch (errorCode) {
@@ -241,7 +241,7 @@ exports.deserializeAws_json1_1AnalyzeIDCommand = deserializeAws_json1_1AnalyzeID
241
241
  const deserializeAws_json1_1AnalyzeIDCommandError = async (output, context) => {
242
242
  const parsedOutput = {
243
243
  ...output,
244
- body: await parseBody(output.body, context),
244
+ body: await parseErrorBody(output.body, context),
245
245
  };
246
246
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
247
247
  switch (errorCode) {
@@ -299,7 +299,7 @@ exports.deserializeAws_json1_1DetectDocumentTextCommand = deserializeAws_json1_1
299
299
  const deserializeAws_json1_1DetectDocumentTextCommandError = async (output, context) => {
300
300
  const parsedOutput = {
301
301
  ...output,
302
- body: await parseBody(output.body, context),
302
+ body: await parseErrorBody(output.body, context),
303
303
  };
304
304
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
305
305
  switch (errorCode) {
@@ -357,7 +357,7 @@ exports.deserializeAws_json1_1GetDocumentAnalysisCommand = deserializeAws_json1_
357
357
  const deserializeAws_json1_1GetDocumentAnalysisCommandError = async (output, context) => {
358
358
  const parsedOutput = {
359
359
  ...output,
360
- body: await parseBody(output.body, context),
360
+ body: await parseErrorBody(output.body, context),
361
361
  };
362
362
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
363
363
  switch (errorCode) {
@@ -412,7 +412,7 @@ exports.deserializeAws_json1_1GetDocumentTextDetectionCommand = deserializeAws_j
412
412
  const deserializeAws_json1_1GetDocumentTextDetectionCommandError = async (output, context) => {
413
413
  const parsedOutput = {
414
414
  ...output,
415
- body: await parseBody(output.body, context),
415
+ body: await parseErrorBody(output.body, context),
416
416
  };
417
417
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
418
418
  switch (errorCode) {
@@ -467,7 +467,7 @@ exports.deserializeAws_json1_1GetExpenseAnalysisCommand = deserializeAws_json1_1
467
467
  const deserializeAws_json1_1GetExpenseAnalysisCommandError = async (output, context) => {
468
468
  const parsedOutput = {
469
469
  ...output,
470
- body: await parseBody(output.body, context),
470
+ body: await parseErrorBody(output.body, context),
471
471
  };
472
472
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
473
473
  switch (errorCode) {
@@ -522,7 +522,7 @@ exports.deserializeAws_json1_1StartDocumentAnalysisCommand = deserializeAws_json
522
522
  const deserializeAws_json1_1StartDocumentAnalysisCommandError = async (output, context) => {
523
523
  const parsedOutput = {
524
524
  ...output,
525
- body: await parseBody(output.body, context),
525
+ body: await parseErrorBody(output.body, context),
526
526
  };
527
527
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
528
528
  switch (errorCode) {
@@ -589,7 +589,7 @@ exports.deserializeAws_json1_1StartDocumentTextDetectionCommand = deserializeAws
589
589
  const deserializeAws_json1_1StartDocumentTextDetectionCommandError = async (output, context) => {
590
590
  const parsedOutput = {
591
591
  ...output,
592
- body: await parseBody(output.body, context),
592
+ body: await parseErrorBody(output.body, context),
593
593
  };
594
594
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
595
595
  switch (errorCode) {
@@ -656,7 +656,7 @@ exports.deserializeAws_json1_1StartExpenseAnalysisCommand = deserializeAws_json1
656
656
  const deserializeAws_json1_1StartExpenseAnalysisCommandError = async (output, context) => {
657
657
  const parsedOutput = {
658
658
  ...output,
659
- body: await parseBody(output.body, context),
659
+ body: await parseErrorBody(output.body, context),
660
660
  };
661
661
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
662
662
  switch (errorCode) {
@@ -1563,6 +1563,12 @@ const parseBody = (streamBody, context) => collectBodyString(streamBody, context
1563
1563
  }
1564
1564
  return {};
1565
1565
  });
1566
+ const parseErrorBody = async (errorBody, context) => {
1567
+ var _a;
1568
+ const value = await parseBody(errorBody, context);
1569
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1570
+ return value;
1571
+ };
1566
1572
  const loadRestJsonErrorCode = (output, data) => {
1567
1573
  const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1568
1574
  const sanitizeErrorCode = (rawValue) => {
@@ -1,4 +1,3 @@
1
- import { __extends } from "tslib";
2
1
  import { AnalyzeDocumentCommand, } from "./commands/AnalyzeDocumentCommand";
3
2
  import { AnalyzeExpenseCommand, } from "./commands/AnalyzeExpenseCommand";
4
3
  import { AnalyzeIDCommand } from "./commands/AnalyzeIDCommand";
@@ -10,151 +9,145 @@ import { StartDocumentAnalysisCommand, } from "./commands/StartDocumentAnalysisC
10
9
  import { StartDocumentTextDetectionCommand, } from "./commands/StartDocumentTextDetectionCommand";
11
10
  import { StartExpenseAnalysisCommand, } from "./commands/StartExpenseAnalysisCommand";
12
11
  import { TextractClient } from "./TextractClient";
13
- var Textract = (function (_super) {
14
- __extends(Textract, _super);
15
- function Textract() {
16
- return _super !== null && _super.apply(this, arguments) || this;
17
- }
18
- Textract.prototype.analyzeDocument = function (args, optionsOrCb, cb) {
19
- var command = new AnalyzeDocumentCommand(args);
12
+ export class Textract extends TextractClient {
13
+ analyzeDocument(args, optionsOrCb, cb) {
14
+ const command = new AnalyzeDocumentCommand(args);
20
15
  if (typeof optionsOrCb === "function") {
21
16
  this.send(command, optionsOrCb);
22
17
  }
23
18
  else if (typeof cb === "function") {
24
19
  if (typeof optionsOrCb !== "object")
25
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
20
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
26
21
  this.send(command, optionsOrCb || {}, cb);
27
22
  }
28
23
  else {
29
24
  return this.send(command, optionsOrCb);
30
25
  }
31
- };
32
- Textract.prototype.analyzeExpense = function (args, optionsOrCb, cb) {
33
- var command = new AnalyzeExpenseCommand(args);
26
+ }
27
+ analyzeExpense(args, optionsOrCb, cb) {
28
+ const command = new AnalyzeExpenseCommand(args);
34
29
  if (typeof optionsOrCb === "function") {
35
30
  this.send(command, optionsOrCb);
36
31
  }
37
32
  else if (typeof cb === "function") {
38
33
  if (typeof optionsOrCb !== "object")
39
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
34
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
40
35
  this.send(command, optionsOrCb || {}, cb);
41
36
  }
42
37
  else {
43
38
  return this.send(command, optionsOrCb);
44
39
  }
45
- };
46
- Textract.prototype.analyzeID = function (args, optionsOrCb, cb) {
47
- var command = new AnalyzeIDCommand(args);
40
+ }
41
+ analyzeID(args, optionsOrCb, cb) {
42
+ const command = new AnalyzeIDCommand(args);
48
43
  if (typeof optionsOrCb === "function") {
49
44
  this.send(command, optionsOrCb);
50
45
  }
51
46
  else if (typeof cb === "function") {
52
47
  if (typeof optionsOrCb !== "object")
53
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
48
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
54
49
  this.send(command, optionsOrCb || {}, cb);
55
50
  }
56
51
  else {
57
52
  return this.send(command, optionsOrCb);
58
53
  }
59
- };
60
- Textract.prototype.detectDocumentText = function (args, optionsOrCb, cb) {
61
- var command = new DetectDocumentTextCommand(args);
54
+ }
55
+ detectDocumentText(args, optionsOrCb, cb) {
56
+ const command = new DetectDocumentTextCommand(args);
62
57
  if (typeof optionsOrCb === "function") {
63
58
  this.send(command, optionsOrCb);
64
59
  }
65
60
  else if (typeof cb === "function") {
66
61
  if (typeof optionsOrCb !== "object")
67
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
62
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
68
63
  this.send(command, optionsOrCb || {}, cb);
69
64
  }
70
65
  else {
71
66
  return this.send(command, optionsOrCb);
72
67
  }
73
- };
74
- Textract.prototype.getDocumentAnalysis = function (args, optionsOrCb, cb) {
75
- var command = new GetDocumentAnalysisCommand(args);
68
+ }
69
+ getDocumentAnalysis(args, optionsOrCb, cb) {
70
+ const command = new GetDocumentAnalysisCommand(args);
76
71
  if (typeof optionsOrCb === "function") {
77
72
  this.send(command, optionsOrCb);
78
73
  }
79
74
  else if (typeof cb === "function") {
80
75
  if (typeof optionsOrCb !== "object")
81
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
76
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
82
77
  this.send(command, optionsOrCb || {}, cb);
83
78
  }
84
79
  else {
85
80
  return this.send(command, optionsOrCb);
86
81
  }
87
- };
88
- Textract.prototype.getDocumentTextDetection = function (args, optionsOrCb, cb) {
89
- var command = new GetDocumentTextDetectionCommand(args);
82
+ }
83
+ getDocumentTextDetection(args, optionsOrCb, cb) {
84
+ const command = new GetDocumentTextDetectionCommand(args);
90
85
  if (typeof optionsOrCb === "function") {
91
86
  this.send(command, optionsOrCb);
92
87
  }
93
88
  else if (typeof cb === "function") {
94
89
  if (typeof optionsOrCb !== "object")
95
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
90
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
96
91
  this.send(command, optionsOrCb || {}, cb);
97
92
  }
98
93
  else {
99
94
  return this.send(command, optionsOrCb);
100
95
  }
101
- };
102
- Textract.prototype.getExpenseAnalysis = function (args, optionsOrCb, cb) {
103
- var command = new GetExpenseAnalysisCommand(args);
96
+ }
97
+ getExpenseAnalysis(args, optionsOrCb, cb) {
98
+ const command = new GetExpenseAnalysisCommand(args);
104
99
  if (typeof optionsOrCb === "function") {
105
100
  this.send(command, optionsOrCb);
106
101
  }
107
102
  else if (typeof cb === "function") {
108
103
  if (typeof optionsOrCb !== "object")
109
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
104
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
110
105
  this.send(command, optionsOrCb || {}, cb);
111
106
  }
112
107
  else {
113
108
  return this.send(command, optionsOrCb);
114
109
  }
115
- };
116
- Textract.prototype.startDocumentAnalysis = function (args, optionsOrCb, cb) {
117
- var command = new StartDocumentAnalysisCommand(args);
110
+ }
111
+ startDocumentAnalysis(args, optionsOrCb, cb) {
112
+ const command = new StartDocumentAnalysisCommand(args);
118
113
  if (typeof optionsOrCb === "function") {
119
114
  this.send(command, optionsOrCb);
120
115
  }
121
116
  else if (typeof cb === "function") {
122
117
  if (typeof optionsOrCb !== "object")
123
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
118
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
124
119
  this.send(command, optionsOrCb || {}, cb);
125
120
  }
126
121
  else {
127
122
  return this.send(command, optionsOrCb);
128
123
  }
129
- };
130
- Textract.prototype.startDocumentTextDetection = function (args, optionsOrCb, cb) {
131
- var command = new StartDocumentTextDetectionCommand(args);
124
+ }
125
+ startDocumentTextDetection(args, optionsOrCb, cb) {
126
+ const command = new StartDocumentTextDetectionCommand(args);
132
127
  if (typeof optionsOrCb === "function") {
133
128
  this.send(command, optionsOrCb);
134
129
  }
135
130
  else if (typeof cb === "function") {
136
131
  if (typeof optionsOrCb !== "object")
137
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
132
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
138
133
  this.send(command, optionsOrCb || {}, cb);
139
134
  }
140
135
  else {
141
136
  return this.send(command, optionsOrCb);
142
137
  }
143
- };
144
- Textract.prototype.startExpenseAnalysis = function (args, optionsOrCb, cb) {
145
- var command = new StartExpenseAnalysisCommand(args);
138
+ }
139
+ startExpenseAnalysis(args, optionsOrCb, cb) {
140
+ const command = new StartExpenseAnalysisCommand(args);
146
141
  if (typeof optionsOrCb === "function") {
147
142
  this.send(command, optionsOrCb);
148
143
  }
149
144
  else if (typeof cb === "function") {
150
145
  if (typeof optionsOrCb !== "object")
151
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
146
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
152
147
  this.send(command, optionsOrCb || {}, cb);
153
148
  }
154
149
  else {
155
150
  return this.send(command, optionsOrCb);
156
151
  }
157
- };
158
- return Textract;
159
- }(TextractClient));
160
- export { Textract };
152
+ }
153
+ }
@@ -1,4 +1,3 @@
1
- import { __extends } from "tslib";
2
1
  import { resolveEndpointsConfig, resolveRegionConfig, } from "@aws-sdk/config-resolver";
3
2
  import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length";
4
3
  import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
@@ -9,31 +8,26 @@ import { getAwsAuthPlugin, resolveAwsAuthConfig, } from "@aws-sdk/middleware-sig
9
8
  import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
10
9
  import { Client as __Client, } from "@aws-sdk/smithy-client";
11
10
  import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
12
- var TextractClient = (function (_super) {
13
- __extends(TextractClient, _super);
14
- function TextractClient(configuration) {
15
- var _this = this;
16
- var _config_0 = __getRuntimeConfig(configuration);
17
- var _config_1 = resolveRegionConfig(_config_0);
18
- var _config_2 = resolveEndpointsConfig(_config_1);
19
- var _config_3 = resolveRetryConfig(_config_2);
20
- var _config_4 = resolveHostHeaderConfig(_config_3);
21
- var _config_5 = resolveAwsAuthConfig(_config_4);
22
- var _config_6 = resolveUserAgentConfig(_config_5);
23
- _this = _super.call(this, _config_6) || this;
24
- _this.config = _config_6;
25
- _this.middlewareStack.use(getRetryPlugin(_this.config));
26
- _this.middlewareStack.use(getContentLengthPlugin(_this.config));
27
- _this.middlewareStack.use(getHostHeaderPlugin(_this.config));
28
- _this.middlewareStack.use(getLoggerPlugin(_this.config));
29
- _this.middlewareStack.use(getRecursionDetectionPlugin(_this.config));
30
- _this.middlewareStack.use(getAwsAuthPlugin(_this.config));
31
- _this.middlewareStack.use(getUserAgentPlugin(_this.config));
32
- return _this;
11
+ export class TextractClient extends __Client {
12
+ constructor(configuration) {
13
+ const _config_0 = __getRuntimeConfig(configuration);
14
+ const _config_1 = resolveRegionConfig(_config_0);
15
+ const _config_2 = resolveEndpointsConfig(_config_1);
16
+ const _config_3 = resolveRetryConfig(_config_2);
17
+ const _config_4 = resolveHostHeaderConfig(_config_3);
18
+ const _config_5 = resolveAwsAuthConfig(_config_4);
19
+ const _config_6 = resolveUserAgentConfig(_config_5);
20
+ super(_config_6);
21
+ this.config = _config_6;
22
+ this.middlewareStack.use(getRetryPlugin(this.config));
23
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
24
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
25
+ this.middlewareStack.use(getLoggerPlugin(this.config));
26
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
27
+ this.middlewareStack.use(getAwsAuthPlugin(this.config));
28
+ this.middlewareStack.use(getUserAgentPlugin(this.config));
33
29
  }
34
- TextractClient.prototype.destroy = function () {
35
- _super.prototype.destroy.call(this);
36
- };
37
- return TextractClient;
38
- }(__Client));
39
- export { TextractClient };
30
+ destroy() {
31
+ super.destroy();
32
+ }
33
+ }
@@ -1,39 +1,32 @@
1
- import { __extends } from "tslib";
2
1
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
3
  import { AnalyzeDocumentRequestFilterSensitiveLog, AnalyzeDocumentResponseFilterSensitiveLog, } from "../models/models_0";
5
4
  import { deserializeAws_json1_1AnalyzeDocumentCommand, serializeAws_json1_1AnalyzeDocumentCommand, } from "../protocols/Aws_json1_1";
6
- var AnalyzeDocumentCommand = (function (_super) {
7
- __extends(AnalyzeDocumentCommand, _super);
8
- function AnalyzeDocumentCommand(input) {
9
- var _this = _super.call(this) || this;
10
- _this.input = input;
11
- return _this;
5
+ export class AnalyzeDocumentCommand extends $Command {
6
+ constructor(input) {
7
+ super();
8
+ this.input = input;
12
9
  }
13
- AnalyzeDocumentCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
10
+ resolveMiddleware(clientStack, configuration, options) {
14
11
  this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
15
- var stack = clientStack.concat(this.middlewareStack);
16
- var logger = configuration.logger;
17
- var clientName = "TextractClient";
18
- var commandName = "AnalyzeDocumentCommand";
19
- var handlerExecutionContext = {
20
- logger: logger,
21
- clientName: clientName,
22
- commandName: commandName,
12
+ const stack = clientStack.concat(this.middlewareStack);
13
+ const { logger } = configuration;
14
+ const clientName = "TextractClient";
15
+ const commandName = "AnalyzeDocumentCommand";
16
+ const handlerExecutionContext = {
17
+ logger,
18
+ clientName,
19
+ commandName,
23
20
  inputFilterSensitiveLog: AnalyzeDocumentRequestFilterSensitiveLog,
24
21
  outputFilterSensitiveLog: AnalyzeDocumentResponseFilterSensitiveLog,
25
22
  };
26
- var requestHandler = configuration.requestHandler;
27
- return stack.resolve(function (request) {
28
- return requestHandler.handle(request.request, options || {});
29
- }, handlerExecutionContext);
30
- };
31
- AnalyzeDocumentCommand.prototype.serialize = function (input, context) {
23
+ const { requestHandler } = configuration;
24
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
25
+ }
26
+ serialize(input, context) {
32
27
  return serializeAws_json1_1AnalyzeDocumentCommand(input, context);
33
- };
34
- AnalyzeDocumentCommand.prototype.deserialize = function (output, context) {
28
+ }
29
+ deserialize(output, context) {
35
30
  return deserializeAws_json1_1AnalyzeDocumentCommand(output, context);
36
- };
37
- return AnalyzeDocumentCommand;
38
- }($Command));
39
- export { AnalyzeDocumentCommand };
31
+ }
32
+ }
@@ -1,39 +1,32 @@
1
- import { __extends } from "tslib";
2
1
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
3
  import { AnalyzeExpenseRequestFilterSensitiveLog, AnalyzeExpenseResponseFilterSensitiveLog, } from "../models/models_0";
5
4
  import { deserializeAws_json1_1AnalyzeExpenseCommand, serializeAws_json1_1AnalyzeExpenseCommand, } from "../protocols/Aws_json1_1";
6
- var AnalyzeExpenseCommand = (function (_super) {
7
- __extends(AnalyzeExpenseCommand, _super);
8
- function AnalyzeExpenseCommand(input) {
9
- var _this = _super.call(this) || this;
10
- _this.input = input;
11
- return _this;
5
+ export class AnalyzeExpenseCommand extends $Command {
6
+ constructor(input) {
7
+ super();
8
+ this.input = input;
12
9
  }
13
- AnalyzeExpenseCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
10
+ resolveMiddleware(clientStack, configuration, options) {
14
11
  this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
15
- var stack = clientStack.concat(this.middlewareStack);
16
- var logger = configuration.logger;
17
- var clientName = "TextractClient";
18
- var commandName = "AnalyzeExpenseCommand";
19
- var handlerExecutionContext = {
20
- logger: logger,
21
- clientName: clientName,
22
- commandName: commandName,
12
+ const stack = clientStack.concat(this.middlewareStack);
13
+ const { logger } = configuration;
14
+ const clientName = "TextractClient";
15
+ const commandName = "AnalyzeExpenseCommand";
16
+ const handlerExecutionContext = {
17
+ logger,
18
+ clientName,
19
+ commandName,
23
20
  inputFilterSensitiveLog: AnalyzeExpenseRequestFilterSensitiveLog,
24
21
  outputFilterSensitiveLog: AnalyzeExpenseResponseFilterSensitiveLog,
25
22
  };
26
- var requestHandler = configuration.requestHandler;
27
- return stack.resolve(function (request) {
28
- return requestHandler.handle(request.request, options || {});
29
- }, handlerExecutionContext);
30
- };
31
- AnalyzeExpenseCommand.prototype.serialize = function (input, context) {
23
+ const { requestHandler } = configuration;
24
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
25
+ }
26
+ serialize(input, context) {
32
27
  return serializeAws_json1_1AnalyzeExpenseCommand(input, context);
33
- };
34
- AnalyzeExpenseCommand.prototype.deserialize = function (output, context) {
28
+ }
29
+ deserialize(output, context) {
35
30
  return deserializeAws_json1_1AnalyzeExpenseCommand(output, context);
36
- };
37
- return AnalyzeExpenseCommand;
38
- }($Command));
39
- export { AnalyzeExpenseCommand };
31
+ }
32
+ }
@@ -1,39 +1,32 @@
1
- import { __extends } from "tslib";
2
1
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
3
  import { AnalyzeIDRequestFilterSensitiveLog, AnalyzeIDResponseFilterSensitiveLog, } from "../models/models_0";
5
4
  import { deserializeAws_json1_1AnalyzeIDCommand, serializeAws_json1_1AnalyzeIDCommand } from "../protocols/Aws_json1_1";
6
- var AnalyzeIDCommand = (function (_super) {
7
- __extends(AnalyzeIDCommand, _super);
8
- function AnalyzeIDCommand(input) {
9
- var _this = _super.call(this) || this;
10
- _this.input = input;
11
- return _this;
5
+ export class AnalyzeIDCommand extends $Command {
6
+ constructor(input) {
7
+ super();
8
+ this.input = input;
12
9
  }
13
- AnalyzeIDCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
10
+ resolveMiddleware(clientStack, configuration, options) {
14
11
  this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
15
- var stack = clientStack.concat(this.middlewareStack);
16
- var logger = configuration.logger;
17
- var clientName = "TextractClient";
18
- var commandName = "AnalyzeIDCommand";
19
- var handlerExecutionContext = {
20
- logger: logger,
21
- clientName: clientName,
22
- commandName: commandName,
12
+ const stack = clientStack.concat(this.middlewareStack);
13
+ const { logger } = configuration;
14
+ const clientName = "TextractClient";
15
+ const commandName = "AnalyzeIDCommand";
16
+ const handlerExecutionContext = {
17
+ logger,
18
+ clientName,
19
+ commandName,
23
20
  inputFilterSensitiveLog: AnalyzeIDRequestFilterSensitiveLog,
24
21
  outputFilterSensitiveLog: AnalyzeIDResponseFilterSensitiveLog,
25
22
  };
26
- var requestHandler = configuration.requestHandler;
27
- return stack.resolve(function (request) {
28
- return requestHandler.handle(request.request, options || {});
29
- }, handlerExecutionContext);
30
- };
31
- AnalyzeIDCommand.prototype.serialize = function (input, context) {
23
+ const { requestHandler } = configuration;
24
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
25
+ }
26
+ serialize(input, context) {
32
27
  return serializeAws_json1_1AnalyzeIDCommand(input, context);
33
- };
34
- AnalyzeIDCommand.prototype.deserialize = function (output, context) {
28
+ }
29
+ deserialize(output, context) {
35
30
  return deserializeAws_json1_1AnalyzeIDCommand(output, context);
36
- };
37
- return AnalyzeIDCommand;
38
- }($Command));
39
- export { AnalyzeIDCommand };
31
+ }
32
+ }
@@ -1,39 +1,32 @@
1
- import { __extends } from "tslib";
2
1
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
3
  import { DetectDocumentTextRequestFilterSensitiveLog, DetectDocumentTextResponseFilterSensitiveLog, } from "../models/models_0";
5
4
  import { deserializeAws_json1_1DetectDocumentTextCommand, serializeAws_json1_1DetectDocumentTextCommand, } from "../protocols/Aws_json1_1";
6
- var DetectDocumentTextCommand = (function (_super) {
7
- __extends(DetectDocumentTextCommand, _super);
8
- function DetectDocumentTextCommand(input) {
9
- var _this = _super.call(this) || this;
10
- _this.input = input;
11
- return _this;
5
+ export class DetectDocumentTextCommand extends $Command {
6
+ constructor(input) {
7
+ super();
8
+ this.input = input;
12
9
  }
13
- DetectDocumentTextCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
10
+ resolveMiddleware(clientStack, configuration, options) {
14
11
  this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
15
- var stack = clientStack.concat(this.middlewareStack);
16
- var logger = configuration.logger;
17
- var clientName = "TextractClient";
18
- var commandName = "DetectDocumentTextCommand";
19
- var handlerExecutionContext = {
20
- logger: logger,
21
- clientName: clientName,
22
- commandName: commandName,
12
+ const stack = clientStack.concat(this.middlewareStack);
13
+ const { logger } = configuration;
14
+ const clientName = "TextractClient";
15
+ const commandName = "DetectDocumentTextCommand";
16
+ const handlerExecutionContext = {
17
+ logger,
18
+ clientName,
19
+ commandName,
23
20
  inputFilterSensitiveLog: DetectDocumentTextRequestFilterSensitiveLog,
24
21
  outputFilterSensitiveLog: DetectDocumentTextResponseFilterSensitiveLog,
25
22
  };
26
- var requestHandler = configuration.requestHandler;
27
- return stack.resolve(function (request) {
28
- return requestHandler.handle(request.request, options || {});
29
- }, handlerExecutionContext);
30
- };
31
- DetectDocumentTextCommand.prototype.serialize = function (input, context) {
23
+ const { requestHandler } = configuration;
24
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
25
+ }
26
+ serialize(input, context) {
32
27
  return serializeAws_json1_1DetectDocumentTextCommand(input, context);
33
- };
34
- DetectDocumentTextCommand.prototype.deserialize = function (output, context) {
28
+ }
29
+ deserialize(output, context) {
35
30
  return deserializeAws_json1_1DetectDocumentTextCommand(output, context);
36
- };
37
- return DetectDocumentTextCommand;
38
- }($Command));
39
- export { DetectDocumentTextCommand };
31
+ }
32
+ }