Skip to content

Commit

Permalink
feat(client-textract): Add ocr results in AnalyzeIDResponse as blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
awstools committed Nov 1, 2022
1 parent 80634b7 commit 0b08176
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 7 deletions.
52 changes: 48 additions & 4 deletions clients/client-textract/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,45 @@ export interface AnalyzeExpenseRequest {
*/
export interface ExpenseCurrency {
/**
* <p>Currency code for detected currency.</p>
* <p>Currency code for detected currency. the current supported codes are:</p>
* <ul>
* <li>
* <p>USD</p>
* </li>
* <li>
* <p>EUR</p>
* </li>
* <li>
* <p>GBP</p>
* </li>
* <li>
* <p>CAD</p>
* </li>
* <li>
* <p>INR</p>
* </li>
* <li>
* <p>JPY</p>
* </li>
* <li>
* <p>CHF</p>
* </li>
* <li>
* <p>AUD</p>
* </li>
* <li>
* <p>CNY</p>
* </li>
* <li>
* <p>BZR</p>
* </li>
* <li>
* <p>SEK</p>
* </li>
* <li>
* <p>HKD</p>
* </li>
* </ul>
*/
Code?: string;

Expand All @@ -902,12 +940,13 @@ export interface ExpenseCurrency {
}

/**
* <p>Shows the group that a certain key belongs to. This helps differentiate responses
* like addresses that can appear similar in response JSON.</p>
* <p>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.</p>
*/
export interface ExpenseGroupProperty {
/**
* <p>Informs you on the kind of label associated with the group</p>
* <p>Informs you on whether the expense group is a name or an address.</p>
*/
Types?: string[];

Expand Down Expand Up @@ -1134,6 +1173,11 @@ export interface IdentityDocument {
* Contains both normalized field and value of the extracted text.</p>
*/
IdentityDocumentFields?: IdentityDocumentField[];

/**
* <p>Individual word recognition, as returned by document detection.</p>
*/
Blocks?: Block[];
}

export interface AnalyzeIDResponse {
Expand Down
1 change: 1 addition & 0 deletions clients/client-textract/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions codegen/sdk-codegen/aws-models/textract.json
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@
"Code": {
"target": "com.amazonaws.textract#String",
"traits": {
"smithy.api#documentation": "<p>Currency code for detected currency.</p>"
"smithy.api#documentation": "<p>Currency code for detected currency. the current supported codes are:</p>\n <ul>\n <li>\n <p>USD</p>\n </li>\n <li>\n <p>EUR</p>\n </li>\n <li>\n <p>GBP</p>\n </li>\n <li>\n <p>CAD</p>\n </li>\n <li>\n <p>INR</p>\n </li>\n <li>\n <p>JPY</p>\n </li>\n <li>\n <p>CHF</p>\n </li>\n <li>\n <p>AUD</p>\n </li>\n <li>\n <p>CNY</p>\n </li>\n <li>\n <p>BZR</p>\n </li>\n <li>\n <p>SEK</p>\n </li>\n <li>\n <p>HKD</p>\n </li>\n </ul>"
}
},
"Confidence": {
Expand Down Expand Up @@ -899,7 +899,7 @@
"Types": {
"target": "com.amazonaws.textract#StringList",
"traits": {
"smithy.api#documentation": "<p>Informs you on the kind of label associated with the group</p>"
"smithy.api#documentation": "<p>Informs you on whether the expense group is a name or an address.</p>"
}
},
"Id": {
Expand All @@ -910,7 +910,7 @@
}
},
"traits": {
"smithy.api#documentation": "<p>Shows the group that a certain key belongs to. This helps differentiate responses\n like addresses that can appear similar in response JSON.</p>"
"smithy.api#documentation": "<p>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.</p>"
}
},
"com.amazonaws.textract#ExpenseGroupPropertyList": {
Expand Down Expand Up @@ -1500,6 +1500,12 @@
"traits": {
"smithy.api#documentation": "<p>The structure used to record information extracted from identity documents.\n Contains both normalized field and value of the extracted text.</p>"
}
},
"Blocks": {
"target": "com.amazonaws.textract#BlockList",
"traits": {
"smithy.api#documentation": "<p>Individual word recognition, as returned by document detection.</p>"
}
}
},
"traits": {
Expand Down

0 comments on commit 0b08176

Please sign in to comment.