aws-sdk-textract 1.24.0 → 1.25.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-textract.rb +1 -1
- data/lib/aws-sdk-textract/client.rb +119 -1
- data/lib/aws-sdk-textract/client_api.rb +73 -0
- data/lib/aws-sdk-textract/types.rb +235 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4407b51ac41473054e7a4ecf865a72886d9564aef97c1525f8ac29b3c878afd3
|
4
|
+
data.tar.gz: 0ab236473f861694b100af2c06a4e40bcb29557d33ce0f7c307b3bc7cdc23a0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1100d59f3f1f051e175289087cd599562850d2524bb51ed46e96a1b46e31d5d5a2bb78d15e1f54a754998f2c5db52dede16297296d1c82420abbe43c92180db1
|
7
|
+
data.tar.gz: f2a03d26c08509cf5ef86858ef1922620be657be09cc46d8e863fc6c8a23ff61f6cf71c0d031d198b2529796b8cf2f97dc7e9bbc3a2249aead5a5ec2ba13a7ed
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
Unreleased Changes
|
2
2
|
------------------
|
3
3
|
|
4
|
+
1.25.0 (2021-07-26)
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Feature - Adds support for AnalyzeExpense, a new API to extract relevant data such as contact information, items purchased, and vendor name, from almost any invoice or receipt without the need for any templates or configuration.
|
8
|
+
|
4
9
|
1.24.0 (2021-03-10)
|
5
10
|
------------------
|
6
11
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.25.0
|
data/lib/aws-sdk-textract.rb
CHANGED
@@ -467,6 +467,124 @@ module Aws::Textract
|
|
467
467
|
req.send_request(options)
|
468
468
|
end
|
469
469
|
|
470
|
+
# Analyzes an input document for financially related relationships
|
471
|
+
# between text.
|
472
|
+
#
|
473
|
+
# Information is returned as `ExpenseDocuments` and seperated as
|
474
|
+
# follows.
|
475
|
+
#
|
476
|
+
# * `LineItemGroups`- A data set containing `LineItems` which store
|
477
|
+
# information about the lines of text, such as an item purchased and
|
478
|
+
# its price on a receipt.
|
479
|
+
#
|
480
|
+
# * `SummaryFields`- Contains all other information a receipt, such as
|
481
|
+
# header information or the vendors name.
|
482
|
+
#
|
483
|
+
# @option params [required, Types::Document] :document
|
484
|
+
# The input document, either as bytes or as an S3 object.
|
485
|
+
#
|
486
|
+
# You pass image bytes to an Amazon Textract API operation by using the
|
487
|
+
# `Bytes` property. For example, you would use the `Bytes` property to
|
488
|
+
# pass a document loaded from a local file system. Image bytes passed by
|
489
|
+
# using the `Bytes` property must be base64 encoded. Your code might not
|
490
|
+
# need to encode document file bytes if you're using an AWS SDK to call
|
491
|
+
# Amazon Textract API operations.
|
492
|
+
#
|
493
|
+
# You pass images stored in an S3 bucket to an Amazon Textract API
|
494
|
+
# operation by using the `S3Object` property. Documents stored in an S3
|
495
|
+
# bucket don't need to be base64 encoded.
|
496
|
+
#
|
497
|
+
# The AWS Region for the S3 bucket that contains the S3 object must
|
498
|
+
# match the AWS Region that you use for Amazon Textract operations.
|
499
|
+
#
|
500
|
+
# If you use the AWS CLI to call Amazon Textract operations, passing
|
501
|
+
# image bytes using the Bytes property isn't supported. You must first
|
502
|
+
# upload the document to an Amazon S3 bucket, and then call the
|
503
|
+
# operation using the S3Object property.
|
504
|
+
#
|
505
|
+
# For Amazon Textract to process an S3 object, the user must have
|
506
|
+
# permission to access the S3 object.
|
507
|
+
#
|
508
|
+
# @return [Types::AnalyzeExpenseResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
509
|
+
#
|
510
|
+
# * {Types::AnalyzeExpenseResponse#document_metadata #document_metadata} => Types::DocumentMetadata
|
511
|
+
# * {Types::AnalyzeExpenseResponse#expense_documents #expense_documents} => Array<Types::ExpenseDocument>
|
512
|
+
#
|
513
|
+
# @example Request syntax with placeholder values
|
514
|
+
#
|
515
|
+
# resp = client.analyze_expense({
|
516
|
+
# document: { # required
|
517
|
+
# bytes: "data",
|
518
|
+
# s3_object: {
|
519
|
+
# bucket: "S3Bucket",
|
520
|
+
# name: "S3ObjectName",
|
521
|
+
# version: "S3ObjectVersion",
|
522
|
+
# },
|
523
|
+
# },
|
524
|
+
# })
|
525
|
+
#
|
526
|
+
# @example Response structure
|
527
|
+
#
|
528
|
+
# resp.document_metadata.pages #=> Integer
|
529
|
+
# resp.expense_documents #=> Array
|
530
|
+
# resp.expense_documents[0].expense_index #=> Integer
|
531
|
+
# resp.expense_documents[0].summary_fields #=> Array
|
532
|
+
# resp.expense_documents[0].summary_fields[0].type.text #=> String
|
533
|
+
# resp.expense_documents[0].summary_fields[0].type.confidence #=> Float
|
534
|
+
# resp.expense_documents[0].summary_fields[0].label_detection.text #=> String
|
535
|
+
# resp.expense_documents[0].summary_fields[0].label_detection.geometry.bounding_box.width #=> Float
|
536
|
+
# resp.expense_documents[0].summary_fields[0].label_detection.geometry.bounding_box.height #=> Float
|
537
|
+
# resp.expense_documents[0].summary_fields[0].label_detection.geometry.bounding_box.left #=> Float
|
538
|
+
# resp.expense_documents[0].summary_fields[0].label_detection.geometry.bounding_box.top #=> Float
|
539
|
+
# resp.expense_documents[0].summary_fields[0].label_detection.geometry.polygon #=> Array
|
540
|
+
# resp.expense_documents[0].summary_fields[0].label_detection.geometry.polygon[0].x #=> Float
|
541
|
+
# resp.expense_documents[0].summary_fields[0].label_detection.geometry.polygon[0].y #=> Float
|
542
|
+
# resp.expense_documents[0].summary_fields[0].label_detection.confidence #=> Float
|
543
|
+
# resp.expense_documents[0].summary_fields[0].value_detection.text #=> String
|
544
|
+
# resp.expense_documents[0].summary_fields[0].value_detection.geometry.bounding_box.width #=> Float
|
545
|
+
# resp.expense_documents[0].summary_fields[0].value_detection.geometry.bounding_box.height #=> Float
|
546
|
+
# resp.expense_documents[0].summary_fields[0].value_detection.geometry.bounding_box.left #=> Float
|
547
|
+
# resp.expense_documents[0].summary_fields[0].value_detection.geometry.bounding_box.top #=> Float
|
548
|
+
# resp.expense_documents[0].summary_fields[0].value_detection.geometry.polygon #=> Array
|
549
|
+
# resp.expense_documents[0].summary_fields[0].value_detection.geometry.polygon[0].x #=> Float
|
550
|
+
# resp.expense_documents[0].summary_fields[0].value_detection.geometry.polygon[0].y #=> Float
|
551
|
+
# resp.expense_documents[0].summary_fields[0].value_detection.confidence #=> Float
|
552
|
+
# resp.expense_documents[0].summary_fields[0].page_number #=> Integer
|
553
|
+
# resp.expense_documents[0].line_item_groups #=> Array
|
554
|
+
# resp.expense_documents[0].line_item_groups[0].line_item_group_index #=> Integer
|
555
|
+
# resp.expense_documents[0].line_item_groups[0].line_items #=> Array
|
556
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields #=> Array
|
557
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].type.text #=> String
|
558
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].type.confidence #=> Float
|
559
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].label_detection.text #=> String
|
560
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].label_detection.geometry.bounding_box.width #=> Float
|
561
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].label_detection.geometry.bounding_box.height #=> Float
|
562
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].label_detection.geometry.bounding_box.left #=> Float
|
563
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].label_detection.geometry.bounding_box.top #=> Float
|
564
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].label_detection.geometry.polygon #=> Array
|
565
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].label_detection.geometry.polygon[0].x #=> Float
|
566
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].label_detection.geometry.polygon[0].y #=> Float
|
567
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].label_detection.confidence #=> Float
|
568
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].value_detection.text #=> String
|
569
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].value_detection.geometry.bounding_box.width #=> Float
|
570
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].value_detection.geometry.bounding_box.height #=> Float
|
571
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].value_detection.geometry.bounding_box.left #=> Float
|
572
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].value_detection.geometry.bounding_box.top #=> Float
|
573
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].value_detection.geometry.polygon #=> Array
|
574
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].value_detection.geometry.polygon[0].x #=> Float
|
575
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].value_detection.geometry.polygon[0].y #=> Float
|
576
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].value_detection.confidence #=> Float
|
577
|
+
# resp.expense_documents[0].line_item_groups[0].line_items[0].line_item_expense_fields[0].page_number #=> Integer
|
578
|
+
#
|
579
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27/AnalyzeExpense AWS API Documentation
|
580
|
+
#
|
581
|
+
# @overload analyze_expense(params = {})
|
582
|
+
# @param [Hash] params ({})
|
583
|
+
def analyze_expense(params = {}, options = {})
|
584
|
+
req = build_request(:analyze_expense, params)
|
585
|
+
req.send_request(options)
|
586
|
+
end
|
587
|
+
|
470
588
|
# Detects text in the input document. Amazon Textract can detect lines
|
471
589
|
# of text and the words that make up a line of text. The input document
|
472
590
|
# must be an image in JPEG or PNG format. `DetectDocumentText` returns
|
@@ -1029,7 +1147,7 @@ module Aws::Textract
|
|
1029
1147
|
params: params,
|
1030
1148
|
config: config)
|
1031
1149
|
context[:gem_name] = 'aws-sdk-textract'
|
1032
|
-
context[:gem_version] = '1.
|
1150
|
+
context[:gem_version] = '1.25.0'
|
1033
1151
|
Seahorse::Client::Request.new(handlers, context)
|
1034
1152
|
end
|
1035
1153
|
|
@@ -16,6 +16,8 @@ module Aws::Textract
|
|
16
16
|
AccessDeniedException = Shapes::StructureShape.new(name: 'AccessDeniedException')
|
17
17
|
AnalyzeDocumentRequest = Shapes::StructureShape.new(name: 'AnalyzeDocumentRequest')
|
18
18
|
AnalyzeDocumentResponse = Shapes::StructureShape.new(name: 'AnalyzeDocumentResponse')
|
19
|
+
AnalyzeExpenseRequest = Shapes::StructureShape.new(name: 'AnalyzeExpenseRequest')
|
20
|
+
AnalyzeExpenseResponse = Shapes::StructureShape.new(name: 'AnalyzeExpenseResponse')
|
19
21
|
BadDocumentException = Shapes::StructureShape.new(name: 'BadDocumentException')
|
20
22
|
Block = Shapes::StructureShape.new(name: 'Block')
|
21
23
|
BlockList = Shapes::ListShape.new(name: 'BlockList')
|
@@ -33,6 +35,12 @@ module Aws::Textract
|
|
33
35
|
EntityType = Shapes::StringShape.new(name: 'EntityType')
|
34
36
|
EntityTypes = Shapes::ListShape.new(name: 'EntityTypes')
|
35
37
|
ErrorCode = Shapes::StringShape.new(name: 'ErrorCode')
|
38
|
+
ExpenseDetection = Shapes::StructureShape.new(name: 'ExpenseDetection')
|
39
|
+
ExpenseDocument = Shapes::StructureShape.new(name: 'ExpenseDocument')
|
40
|
+
ExpenseDocumentList = Shapes::ListShape.new(name: 'ExpenseDocumentList')
|
41
|
+
ExpenseField = Shapes::StructureShape.new(name: 'ExpenseField')
|
42
|
+
ExpenseFieldList = Shapes::ListShape.new(name: 'ExpenseFieldList')
|
43
|
+
ExpenseType = Shapes::StructureShape.new(name: 'ExpenseType')
|
36
44
|
FeatureType = Shapes::StringShape.new(name: 'FeatureType')
|
37
45
|
FeatureTypes = Shapes::ListShape.new(name: 'FeatureTypes')
|
38
46
|
Float = Shapes::FloatShape.new(name: 'Float')
|
@@ -64,6 +72,10 @@ module Aws::Textract
|
|
64
72
|
JobTag = Shapes::StringShape.new(name: 'JobTag')
|
65
73
|
KMSKeyId = Shapes::StringShape.new(name: 'KMSKeyId')
|
66
74
|
LimitExceededException = Shapes::StructureShape.new(name: 'LimitExceededException')
|
75
|
+
LineItemFields = Shapes::StructureShape.new(name: 'LineItemFields')
|
76
|
+
LineItemGroup = Shapes::StructureShape.new(name: 'LineItemGroup')
|
77
|
+
LineItemGroupList = Shapes::ListShape.new(name: 'LineItemGroupList')
|
78
|
+
LineItemList = Shapes::ListShape.new(name: 'LineItemList')
|
67
79
|
MaxResults = Shapes::IntegerShape.new(name: 'MaxResults')
|
68
80
|
NonEmptyString = Shapes::StringShape.new(name: 'NonEmptyString')
|
69
81
|
NotificationChannel = Shapes::StructureShape.new(name: 'NotificationChannel')
|
@@ -110,6 +122,13 @@ module Aws::Textract
|
|
110
122
|
AnalyzeDocumentResponse.add_member(:analyze_document_model_version, Shapes::ShapeRef.new(shape: String, location_name: "AnalyzeDocumentModelVersion"))
|
111
123
|
AnalyzeDocumentResponse.struct_class = Types::AnalyzeDocumentResponse
|
112
124
|
|
125
|
+
AnalyzeExpenseRequest.add_member(:document, Shapes::ShapeRef.new(shape: Document, required: true, location_name: "Document"))
|
126
|
+
AnalyzeExpenseRequest.struct_class = Types::AnalyzeExpenseRequest
|
127
|
+
|
128
|
+
AnalyzeExpenseResponse.add_member(:document_metadata, Shapes::ShapeRef.new(shape: DocumentMetadata, location_name: "DocumentMetadata"))
|
129
|
+
AnalyzeExpenseResponse.add_member(:expense_documents, Shapes::ShapeRef.new(shape: ExpenseDocumentList, location_name: "ExpenseDocuments"))
|
130
|
+
AnalyzeExpenseResponse.struct_class = Types::AnalyzeExpenseResponse
|
131
|
+
|
113
132
|
BadDocumentException.struct_class = Types::BadDocumentException
|
114
133
|
|
115
134
|
Block.add_member(:block_type, Shapes::ShapeRef.new(shape: BlockType, location_name: "BlockType"))
|
@@ -160,6 +179,30 @@ module Aws::Textract
|
|
160
179
|
|
161
180
|
EntityTypes.member = Shapes::ShapeRef.new(shape: EntityType)
|
162
181
|
|
182
|
+
ExpenseDetection.add_member(:text, Shapes::ShapeRef.new(shape: String, location_name: "Text"))
|
183
|
+
ExpenseDetection.add_member(:geometry, Shapes::ShapeRef.new(shape: Geometry, location_name: "Geometry"))
|
184
|
+
ExpenseDetection.add_member(:confidence, Shapes::ShapeRef.new(shape: Percent, location_name: "Confidence"))
|
185
|
+
ExpenseDetection.struct_class = Types::ExpenseDetection
|
186
|
+
|
187
|
+
ExpenseDocument.add_member(:expense_index, Shapes::ShapeRef.new(shape: UInteger, location_name: "ExpenseIndex"))
|
188
|
+
ExpenseDocument.add_member(:summary_fields, Shapes::ShapeRef.new(shape: ExpenseFieldList, location_name: "SummaryFields"))
|
189
|
+
ExpenseDocument.add_member(:line_item_groups, Shapes::ShapeRef.new(shape: LineItemGroupList, location_name: "LineItemGroups"))
|
190
|
+
ExpenseDocument.struct_class = Types::ExpenseDocument
|
191
|
+
|
192
|
+
ExpenseDocumentList.member = Shapes::ShapeRef.new(shape: ExpenseDocument)
|
193
|
+
|
194
|
+
ExpenseField.add_member(:type, Shapes::ShapeRef.new(shape: ExpenseType, location_name: "Type"))
|
195
|
+
ExpenseField.add_member(:label_detection, Shapes::ShapeRef.new(shape: ExpenseDetection, location_name: "LabelDetection"))
|
196
|
+
ExpenseField.add_member(:value_detection, Shapes::ShapeRef.new(shape: ExpenseDetection, location_name: "ValueDetection"))
|
197
|
+
ExpenseField.add_member(:page_number, Shapes::ShapeRef.new(shape: UInteger, location_name: "PageNumber"))
|
198
|
+
ExpenseField.struct_class = Types::ExpenseField
|
199
|
+
|
200
|
+
ExpenseFieldList.member = Shapes::ShapeRef.new(shape: ExpenseField)
|
201
|
+
|
202
|
+
ExpenseType.add_member(:text, Shapes::ShapeRef.new(shape: String, location_name: "Text"))
|
203
|
+
ExpenseType.add_member(:confidence, Shapes::ShapeRef.new(shape: Percent, location_name: "Confidence"))
|
204
|
+
ExpenseType.struct_class = Types::ExpenseType
|
205
|
+
|
163
206
|
FeatureTypes.member = Shapes::ShapeRef.new(shape: FeatureType)
|
164
207
|
|
165
208
|
Geometry.add_member(:bounding_box, Shapes::ShapeRef.new(shape: BoundingBox, location_name: "BoundingBox"))
|
@@ -230,6 +273,17 @@ module Aws::Textract
|
|
230
273
|
|
231
274
|
LimitExceededException.struct_class = Types::LimitExceededException
|
232
275
|
|
276
|
+
LineItemFields.add_member(:line_item_expense_fields, Shapes::ShapeRef.new(shape: ExpenseFieldList, location_name: "LineItemExpenseFields"))
|
277
|
+
LineItemFields.struct_class = Types::LineItemFields
|
278
|
+
|
279
|
+
LineItemGroup.add_member(:line_item_group_index, Shapes::ShapeRef.new(shape: UInteger, location_name: "LineItemGroupIndex"))
|
280
|
+
LineItemGroup.add_member(:line_items, Shapes::ShapeRef.new(shape: LineItemList, location_name: "LineItems"))
|
281
|
+
LineItemGroup.struct_class = Types::LineItemGroup
|
282
|
+
|
283
|
+
LineItemGroupList.member = Shapes::ShapeRef.new(shape: LineItemGroup)
|
284
|
+
|
285
|
+
LineItemList.member = Shapes::ShapeRef.new(shape: LineItemFields)
|
286
|
+
|
233
287
|
NotificationChannel.add_member(:sns_topic_arn, Shapes::ShapeRef.new(shape: SNSTopicArn, required: true, location_name: "SNSTopicArn"))
|
234
288
|
NotificationChannel.add_member(:role_arn, Shapes::ShapeRef.new(shape: RoleArn, required: true, location_name: "RoleArn"))
|
235
289
|
NotificationChannel.struct_class = Types::NotificationChannel
|
@@ -328,6 +382,23 @@ module Aws::Textract
|
|
328
382
|
o.errors << Shapes::ShapeRef.new(shape: HumanLoopQuotaExceededException)
|
329
383
|
end)
|
330
384
|
|
385
|
+
api.add_operation(:analyze_expense, Seahorse::Model::Operation.new.tap do |o|
|
386
|
+
o.name = "AnalyzeExpense"
|
387
|
+
o.http_method = "POST"
|
388
|
+
o.http_request_uri = "/"
|
389
|
+
o.input = Shapes::ShapeRef.new(shape: AnalyzeExpenseRequest)
|
390
|
+
o.output = Shapes::ShapeRef.new(shape: AnalyzeExpenseResponse)
|
391
|
+
o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
|
392
|
+
o.errors << Shapes::ShapeRef.new(shape: InvalidS3ObjectException)
|
393
|
+
o.errors << Shapes::ShapeRef.new(shape: UnsupportedDocumentException)
|
394
|
+
o.errors << Shapes::ShapeRef.new(shape: DocumentTooLargeException)
|
395
|
+
o.errors << Shapes::ShapeRef.new(shape: BadDocumentException)
|
396
|
+
o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
|
397
|
+
o.errors << Shapes::ShapeRef.new(shape: ProvisionedThroughputExceededException)
|
398
|
+
o.errors << Shapes::ShapeRef.new(shape: InternalServerError)
|
399
|
+
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
400
|
+
end)
|
401
|
+
|
331
402
|
api.add_operation(:detect_document_text, Seahorse::Model::Operation.new.tap do |o|
|
332
403
|
o.name = "DetectDocumentText"
|
333
404
|
o.http_method = "POST"
|
@@ -358,6 +429,7 @@ module Aws::Textract
|
|
358
429
|
o.errors << Shapes::ShapeRef.new(shape: InternalServerError)
|
359
430
|
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
360
431
|
o.errors << Shapes::ShapeRef.new(shape: InvalidS3ObjectException)
|
432
|
+
o.errors << Shapes::ShapeRef.new(shape: InvalidKMSKeyException)
|
361
433
|
end)
|
362
434
|
|
363
435
|
api.add_operation(:get_document_text_detection, Seahorse::Model::Operation.new.tap do |o|
|
@@ -373,6 +445,7 @@ module Aws::Textract
|
|
373
445
|
o.errors << Shapes::ShapeRef.new(shape: InternalServerError)
|
374
446
|
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
375
447
|
o.errors << Shapes::ShapeRef.new(shape: InvalidS3ObjectException)
|
448
|
+
o.errors << Shapes::ShapeRef.new(shape: InvalidKMSKeyException)
|
376
449
|
end)
|
377
450
|
|
378
451
|
api.add_operation(:start_document_analysis, Seahorse::Model::Operation.new.tap do |o|
|
@@ -103,6 +103,71 @@ module Aws::Textract
|
|
103
103
|
include Aws::Structure
|
104
104
|
end
|
105
105
|
|
106
|
+
# @note When making an API call, you may pass AnalyzeExpenseRequest
|
107
|
+
# data as a hash:
|
108
|
+
#
|
109
|
+
# {
|
110
|
+
# document: { # required
|
111
|
+
# bytes: "data",
|
112
|
+
# s3_object: {
|
113
|
+
# bucket: "S3Bucket",
|
114
|
+
# name: "S3ObjectName",
|
115
|
+
# version: "S3ObjectVersion",
|
116
|
+
# },
|
117
|
+
# },
|
118
|
+
# }
|
119
|
+
#
|
120
|
+
# @!attribute [rw] document
|
121
|
+
# The input document, either as bytes or as an S3 object.
|
122
|
+
#
|
123
|
+
# You pass image bytes to an Amazon Textract API operation by using
|
124
|
+
# the `Bytes` property. For example, you would use the `Bytes`
|
125
|
+
# property to pass a document loaded from a local file system. Image
|
126
|
+
# bytes passed by using the `Bytes` property must be base64 encoded.
|
127
|
+
# Your code might not need to encode document file bytes if you're
|
128
|
+
# using an AWS SDK to call Amazon Textract API operations.
|
129
|
+
#
|
130
|
+
# You pass images stored in an S3 bucket to an Amazon Textract API
|
131
|
+
# operation by using the `S3Object` property. Documents stored in an
|
132
|
+
# S3 bucket don't need to be base64 encoded.
|
133
|
+
#
|
134
|
+
# The AWS Region for the S3 bucket that contains the S3 object must
|
135
|
+
# match the AWS Region that you use for Amazon Textract operations.
|
136
|
+
#
|
137
|
+
# If you use the AWS CLI to call Amazon Textract operations, passing
|
138
|
+
# image bytes using the Bytes property isn't supported. You must
|
139
|
+
# first upload the document to an Amazon S3 bucket, and then call the
|
140
|
+
# operation using the S3Object property.
|
141
|
+
#
|
142
|
+
# For Amazon Textract to process an S3 object, the user must have
|
143
|
+
# permission to access the S3 object.
|
144
|
+
# @return [Types::Document]
|
145
|
+
#
|
146
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27/AnalyzeExpenseRequest AWS API Documentation
|
147
|
+
#
|
148
|
+
class AnalyzeExpenseRequest < Struct.new(
|
149
|
+
:document)
|
150
|
+
SENSITIVE = []
|
151
|
+
include Aws::Structure
|
152
|
+
end
|
153
|
+
|
154
|
+
# @!attribute [rw] document_metadata
|
155
|
+
# Information about the input document.
|
156
|
+
# @return [Types::DocumentMetadata]
|
157
|
+
#
|
158
|
+
# @!attribute [rw] expense_documents
|
159
|
+
# The expenses detected by Amazon Textract.
|
160
|
+
# @return [Array<Types::ExpenseDocument>]
|
161
|
+
#
|
162
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27/AnalyzeExpenseResponse AWS API Documentation
|
163
|
+
#
|
164
|
+
class AnalyzeExpenseResponse < Struct.new(
|
165
|
+
:document_metadata,
|
166
|
+
:expense_documents)
|
167
|
+
SENSITIVE = []
|
168
|
+
include Aws::Structure
|
169
|
+
end
|
170
|
+
|
106
171
|
# Amazon Textract isn't able to read the document. For more information
|
107
172
|
# on the document limits in Amazon Textract, see limits.
|
108
173
|
#
|
@@ -499,6 +564,111 @@ module Aws::Textract
|
|
499
564
|
#
|
500
565
|
class DocumentTooLargeException < Aws::EmptyStructure; end
|
501
566
|
|
567
|
+
# An object used to store information about the Value or Label detected
|
568
|
+
# by Amazon Textract.
|
569
|
+
#
|
570
|
+
# @!attribute [rw] text
|
571
|
+
# The word or line of text recognized by Amazon Textract
|
572
|
+
# @return [String]
|
573
|
+
#
|
574
|
+
# @!attribute [rw] geometry
|
575
|
+
# Information about where the following items are located on a
|
576
|
+
# document page: detected page, text, key-value pairs, tables, table
|
577
|
+
# cells, and selection elements.
|
578
|
+
# @return [Types::Geometry]
|
579
|
+
#
|
580
|
+
# @!attribute [rw] confidence
|
581
|
+
# The confidence in detection, as a percentage
|
582
|
+
# @return [Float]
|
583
|
+
#
|
584
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27/ExpenseDetection AWS API Documentation
|
585
|
+
#
|
586
|
+
class ExpenseDetection < Struct.new(
|
587
|
+
:text,
|
588
|
+
:geometry,
|
589
|
+
:confidence)
|
590
|
+
SENSITIVE = []
|
591
|
+
include Aws::Structure
|
592
|
+
end
|
593
|
+
|
594
|
+
# The structure holding all the information returned by AnalyzeExpense
|
595
|
+
#
|
596
|
+
# @!attribute [rw] expense_index
|
597
|
+
# Denotes which invoice or receipt in the document the information is
|
598
|
+
# coming from. First document will be 1, the second 2, and so on.
|
599
|
+
# @return [Integer]
|
600
|
+
#
|
601
|
+
# @!attribute [rw] summary_fields
|
602
|
+
# Any information found outside of a table by Amazon Textract.
|
603
|
+
# @return [Array<Types::ExpenseField>]
|
604
|
+
#
|
605
|
+
# @!attribute [rw] line_item_groups
|
606
|
+
# Information detected on each table of a document, seperated into
|
607
|
+
# `LineItems`.
|
608
|
+
# @return [Array<Types::LineItemGroup>]
|
609
|
+
#
|
610
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27/ExpenseDocument AWS API Documentation
|
611
|
+
#
|
612
|
+
class ExpenseDocument < Struct.new(
|
613
|
+
:expense_index,
|
614
|
+
:summary_fields,
|
615
|
+
:line_item_groups)
|
616
|
+
SENSITIVE = []
|
617
|
+
include Aws::Structure
|
618
|
+
end
|
619
|
+
|
620
|
+
# Breakdown of detected information, seperated into the catagories Type,
|
621
|
+
# LableDetection, and ValueDetection
|
622
|
+
#
|
623
|
+
# @!attribute [rw] type
|
624
|
+
# The implied label of a detected element. Present alongside
|
625
|
+
# LabelDetection for explicit elements.
|
626
|
+
# @return [Types::ExpenseType]
|
627
|
+
#
|
628
|
+
# @!attribute [rw] label_detection
|
629
|
+
# The explicitly stated label of a detected element.
|
630
|
+
# @return [Types::ExpenseDetection]
|
631
|
+
#
|
632
|
+
# @!attribute [rw] value_detection
|
633
|
+
# The value of a detected element. Present in explicit and implicit
|
634
|
+
# elements.
|
635
|
+
# @return [Types::ExpenseDetection]
|
636
|
+
#
|
637
|
+
# @!attribute [rw] page_number
|
638
|
+
# The page number the value was detected on.
|
639
|
+
# @return [Integer]
|
640
|
+
#
|
641
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27/ExpenseField AWS API Documentation
|
642
|
+
#
|
643
|
+
class ExpenseField < Struct.new(
|
644
|
+
:type,
|
645
|
+
:label_detection,
|
646
|
+
:value_detection,
|
647
|
+
:page_number)
|
648
|
+
SENSITIVE = []
|
649
|
+
include Aws::Structure
|
650
|
+
end
|
651
|
+
|
652
|
+
# An object used to store information about the Type detected by Amazon
|
653
|
+
# Textract.
|
654
|
+
#
|
655
|
+
# @!attribute [rw] text
|
656
|
+
# The word or line of text detected by Amazon Textract.
|
657
|
+
# @return [String]
|
658
|
+
#
|
659
|
+
# @!attribute [rw] confidence
|
660
|
+
# The confidence of accuracy, as a percentage.
|
661
|
+
# @return [Float]
|
662
|
+
#
|
663
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27/ExpenseType AWS API Documentation
|
664
|
+
#
|
665
|
+
class ExpenseType < Struct.new(
|
666
|
+
:text,
|
667
|
+
:confidence)
|
668
|
+
SENSITIVE = []
|
669
|
+
include Aws::Structure
|
670
|
+
end
|
671
|
+
|
502
672
|
# Information about where the following items are located on a document
|
503
673
|
# page: detected page, text, key-value pairs, tables, table cells, and
|
504
674
|
# selection elements.
|
@@ -869,6 +1039,44 @@ module Aws::Textract
|
|
869
1039
|
#
|
870
1040
|
class LimitExceededException < Aws::EmptyStructure; end
|
871
1041
|
|
1042
|
+
# A structure that holds information about the different lines found in
|
1043
|
+
# a document's tables.
|
1044
|
+
#
|
1045
|
+
# @!attribute [rw] line_item_expense_fields
|
1046
|
+
# ExpenseFields used to show information from detected lines on a
|
1047
|
+
# table.
|
1048
|
+
# @return [Array<Types::ExpenseField>]
|
1049
|
+
#
|
1050
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27/LineItemFields AWS API Documentation
|
1051
|
+
#
|
1052
|
+
class LineItemFields < Struct.new(
|
1053
|
+
:line_item_expense_fields)
|
1054
|
+
SENSITIVE = []
|
1055
|
+
include Aws::Structure
|
1056
|
+
end
|
1057
|
+
|
1058
|
+
# A grouping of tables which contain LineItems, with each table
|
1059
|
+
# identified by the table's `LineItemGroupIndex`.
|
1060
|
+
#
|
1061
|
+
# @!attribute [rw] line_item_group_index
|
1062
|
+
# The number used to identify a specific table in a document. The
|
1063
|
+
# first table encountered will have a LineItemGroupIndex of 1, the
|
1064
|
+
# second 2, etc.
|
1065
|
+
# @return [Integer]
|
1066
|
+
#
|
1067
|
+
# @!attribute [rw] line_items
|
1068
|
+
# The breakdown of information on a particular line of a table.
|
1069
|
+
# @return [Array<Types::LineItemFields>]
|
1070
|
+
#
|
1071
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27/LineItemGroup AWS API Documentation
|
1072
|
+
#
|
1073
|
+
class LineItemGroup < Struct.new(
|
1074
|
+
:line_item_group_index,
|
1075
|
+
:line_items)
|
1076
|
+
SENSITIVE = []
|
1077
|
+
include Aws::Structure
|
1078
|
+
end
|
1079
|
+
|
872
1080
|
# The Amazon Simple Notification Service (Amazon SNS) topic to which
|
873
1081
|
# Amazon Textract publishes the completion status of an asynchronous
|
874
1082
|
# document operation, such as StartDocumentTextDetection.
|
@@ -903,6 +1111,31 @@ module Aws::Textract
|
|
903
1111
|
# Sets whether or not your output will go to a user created bucket. Used
|
904
1112
|
# to set the name of the bucket, and the prefix on the output file.
|
905
1113
|
#
|
1114
|
+
# `OutputConfig` is an optional parameter which lets you adjust where
|
1115
|
+
# your output will be placed. By default, Amazon Textract will store the
|
1116
|
+
# results internally and can only be accessed by the Get API operations.
|
1117
|
+
# With OutputConfig enabled, you can set the name of the bucket the
|
1118
|
+
# output will be sent to and the file prefix of the results where you
|
1119
|
+
# can download your results. Additionally, you can set the `KMSKeyID`
|
1120
|
+
# parameter to a customer master key (CMK) to encrypt your output.
|
1121
|
+
# Without this parameter set Amazon Textract will encrypt server-side
|
1122
|
+
# using the AWS managed CMK for Amazon S3.
|
1123
|
+
#
|
1124
|
+
# Decryption of Customer Content is necessary for processing of the
|
1125
|
+
# documents by Amazon Textract. If your account is opted out under an AI
|
1126
|
+
# services opt out policy then all unencrypted Customer Content is
|
1127
|
+
# immediately and permanently deleted after the Customer Content has
|
1128
|
+
# been processed by the service. No copy of of the output is retained by
|
1129
|
+
# Amazon Textract. For information about how to opt out, see [ Managing
|
1130
|
+
# AI services opt-out policy. ][1]
|
1131
|
+
#
|
1132
|
+
# For more information on data privacy, see the [Data Privacy FAQ][2].
|
1133
|
+
#
|
1134
|
+
#
|
1135
|
+
#
|
1136
|
+
# [1]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html
|
1137
|
+
# [2]: https://aws.amazon.com/compliance/data-privacy-faq/
|
1138
|
+
#
|
906
1139
|
# @note When making an API call, you may pass OutputConfig
|
907
1140
|
# data as a hash:
|
908
1141
|
#
|
@@ -1013,7 +1246,8 @@ module Aws::Textract
|
|
1013
1246
|
# }
|
1014
1247
|
#
|
1015
1248
|
# @!attribute [rw] bucket
|
1016
|
-
# The name of the S3 bucket.
|
1249
|
+
# The name of the S3 bucket. Note that the # character is not valid in
|
1250
|
+
# the file name.
|
1017
1251
|
# @return [String]
|
1018
1252
|
#
|
1019
1253
|
# @!attribute [rw] name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-textract
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.25.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|
@@ -66,8 +66,8 @@ homepage: https://github.com/aws/aws-sdk-ruby
|
|
66
66
|
licenses:
|
67
67
|
- Apache-2.0
|
68
68
|
metadata:
|
69
|
-
source_code_uri: https://github.com/aws/aws-sdk-ruby/tree/
|
70
|
-
changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/
|
69
|
+
source_code_uri: https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-textract
|
70
|
+
changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-textract/CHANGELOG.md
|
71
71
|
post_install_message:
|
72
72
|
rdoc_options: []
|
73
73
|
require_paths:
|
@@ -83,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
|
-
|
87
|
-
rubygems_version: 2.7.6.2
|
86
|
+
rubygems_version: 3.1.6
|
88
87
|
signing_key:
|
89
88
|
specification_version: 4
|
90
89
|
summary: AWS SDK for Ruby - Amazon Textract
|