From 0b0817642a2279f34fbc3615ac520f193f64ba5f Mon Sep 17 00:00:00 2001 From: awstools Date: Tue, 1 Nov 2022 18:49:34 +0000 Subject: [PATCH] feat(client-textract): Add ocr results in AnalyzeIDResponse as blocks --- .../client-textract/src/models/models_0.ts | 52 +++++++++++++++++-- .../src/protocols/Aws_json1_1.ts | 1 + codegen/sdk-codegen/aws-models/textract.json | 12 +++-- 3 files changed, 58 insertions(+), 7 deletions(-) diff --git a/clients/client-textract/src/models/models_0.ts b/clients/client-textract/src/models/models_0.ts index 9bcd651bf7ea..1b4dda42d665 100644 --- a/clients/client-textract/src/models/models_0.ts +++ b/clients/client-textract/src/models/models_0.ts @@ -891,7 +891,45 @@ export interface AnalyzeExpenseRequest { */ export interface ExpenseCurrency { /** - *

Currency code for detected currency.

+ *

Currency code for detected currency. the current supported codes are:

+ * */ Code?: string; @@ -902,12 +940,13 @@ export interface ExpenseCurrency { } /** - *

Shows the group that a certain key belongs to. This helps differentiate responses - * like addresses that can appear similar in response JSON.

+ *

Shows the group that a certain key belongs to. This helps differentiate between + * names and addresses for different organizations, that can be hard to determine + * via JSON response.

*/ export interface ExpenseGroupProperty { /** - *

Informs you on the kind of label associated with the group

+ *

Informs you on whether the expense group is a name or an address.

*/ Types?: string[]; @@ -1134,6 +1173,11 @@ export interface IdentityDocument { * Contains both normalized field and value of the extracted text.

*/ IdentityDocumentFields?: IdentityDocumentField[]; + + /** + *

Individual word recognition, as returned by document detection.

+ */ + Blocks?: Block[]; } export interface AnalyzeIDResponse { diff --git a/clients/client-textract/src/protocols/Aws_json1_1.ts b/clients/client-textract/src/protocols/Aws_json1_1.ts index dad637c16c22..eff2c3ccc6a4 100644 --- a/clients/client-textract/src/protocols/Aws_json1_1.ts +++ b/clients/client-textract/src/protocols/Aws_json1_1.ts @@ -1705,6 +1705,7 @@ const deserializeAws_json1_1IdempotentParameterMismatchException = ( const deserializeAws_json1_1IdentityDocument = (output: any, context: __SerdeContext): IdentityDocument => { return { + Blocks: output.Blocks != null ? deserializeAws_json1_1BlockList(output.Blocks, context) : undefined, DocumentIndex: __expectInt32(output.DocumentIndex), IdentityDocumentFields: output.IdentityDocumentFields != null diff --git a/codegen/sdk-codegen/aws-models/textract.json b/codegen/sdk-codegen/aws-models/textract.json index a626ae98c81b..f3564eb6cc23 100644 --- a/codegen/sdk-codegen/aws-models/textract.json +++ b/codegen/sdk-codegen/aws-models/textract.json @@ -768,7 +768,7 @@ "Code": { "target": "com.amazonaws.textract#String", "traits": { - "smithy.api#documentation": "

Currency code for detected currency.

" + "smithy.api#documentation": "

Currency code for detected currency. the current supported codes are:

\n " } }, "Confidence": { @@ -899,7 +899,7 @@ "Types": { "target": "com.amazonaws.textract#StringList", "traits": { - "smithy.api#documentation": "

Informs you on the kind of label associated with the group

" + "smithy.api#documentation": "

Informs you on whether the expense group is a name or an address.

" } }, "Id": { @@ -910,7 +910,7 @@ } }, "traits": { - "smithy.api#documentation": "

Shows the group that a certain key belongs to. This helps differentiate responses\n like addresses that can appear similar in response JSON.

" + "smithy.api#documentation": "

Shows the group that a certain key belongs to. This helps differentiate between\n names and addresses for different organizations, that can be hard to determine\n via JSON response.

" } }, "com.amazonaws.textract#ExpenseGroupPropertyList": { @@ -1500,6 +1500,12 @@ "traits": { "smithy.api#documentation": "

The structure used to record information extracted from identity documents.\n Contains both normalized field and value of the extracted text.

" } + }, + "Blocks": { + "target": "com.amazonaws.textract#BlockList", + "traits": { + "smithy.api#documentation": "

Individual word recognition, as returned by document detection.

" + } } }, "traits": {