azure_cognitiveservices_formrecognizer 0.17.0 → 0.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer.rb +27 -12
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/form_recognizer_client.rb +352 -49
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/computer_vision_error.rb +69 -0
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/element_reference.rb +46 -0
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/field_value.rb +79 -0
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/image_url.rb +47 -0
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/line.rb +85 -0
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/number_value.rb +86 -0
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/read_receipt_result.rb +91 -0
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/string_value.rb +86 -0
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/text_operation_status_codes.rb +18 -0
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/text_recognition_result.rb +114 -0
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/text_recognition_result_confidence_class.rb +16 -0
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/text_recognition_result_dimension_unit.rb +16 -0
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/train_request.rb +13 -0
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/train_source_filter.rb +65 -0
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/understanding_result.rb +78 -0
- data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/word.rb +78 -0
- data/lib/profiles/latest/modules/formrecognizer_profile_module.rb +98 -38
- data/lib/version.rb +1 -1
- metadata +20 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 02f31ada3d50b125f13913d2d32334fd4b3455cdaf2fe0eb85666b83dacfb14f
|
4
|
+
data.tar.gz: 1e3b32681968b1488c03183f56f5901107e76d6bbeb6627b49dc24e92fda6e98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0d40676b27890a76ba130d7a7de107987f8731749240ab4c3a77236161c73f9e7c4e750e14700049b75315a8d73bd7611c3247183fe60e1dd0837b3b88f44fe
|
7
|
+
data.tar.gz: 7e0c6ad6d93be1b2cb02a2a7b25038e96c61b3db6940629649cbfa6f6d3d62e2b710c84b2a223741a691b388693f9bb92bcee160caf013cdca04ba0e353d6d71
|
@@ -23,21 +23,36 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
23
23
|
autoload :FormRecognizerClient, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/form_recognizer_client.rb'
|
24
24
|
|
25
25
|
module Models
|
26
|
-
autoload :ErrorInformation, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/error_information.rb'
|
27
|
-
autoload :TrainRequest, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/train_request.rb'
|
28
|
-
autoload :ErrorResponse, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/error_response.rb'
|
29
|
-
autoload :FormOperationError, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/form_operation_error.rb'
|
30
|
-
autoload :ExtractedToken, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/extracted_token.rb'
|
31
|
-
autoload :KeysResult, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/keys_result.rb'
|
32
|
-
autoload :ExtractedKeyValuePair, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/extracted_key_value_pair.rb'
|
33
|
-
autoload :ModelsResult, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/models_result.rb'
|
34
|
-
autoload :ExtractedTableColumn, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/extracted_table_column.rb'
|
35
|
-
autoload :FormDocumentReport, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/form_document_report.rb'
|
36
26
|
autoload :ExtractedTable, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/extracted_table.rb'
|
37
|
-
autoload :
|
27
|
+
autoload :TrainSourceFilter, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/train_source_filter.rb'
|
38
28
|
autoload :ExtractedPage, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/extracted_page.rb'
|
39
|
-
autoload :
|
29
|
+
autoload :FormDocumentReport, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/form_document_report.rb'
|
40
30
|
autoload :AnalyzeResult, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/analyze_result.rb'
|
31
|
+
autoload :TrainResult, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/train_result.rb'
|
32
|
+
autoload :Word, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/word.rb'
|
33
|
+
autoload :ModelResult, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/model_result.rb'
|
34
|
+
autoload :Line, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/line.rb'
|
41
35
|
autoload :InnerError, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/inner_error.rb'
|
36
|
+
autoload :TextRecognitionResult, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/text_recognition_result.rb'
|
37
|
+
autoload :ErrorResponse, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/error_response.rb'
|
38
|
+
autoload :ElementReference, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/element_reference.rb'
|
39
|
+
autoload :ExtractedKeyValuePair, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/extracted_key_value_pair.rb'
|
40
|
+
autoload :FieldValue, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/field_value.rb'
|
41
|
+
autoload :TrainRequest, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/train_request.rb'
|
42
|
+
autoload :UnderstandingResult, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/understanding_result.rb'
|
43
|
+
autoload :KeysResult, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/keys_result.rb'
|
44
|
+
autoload :ReadReceiptResult, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/read_receipt_result.rb'
|
45
|
+
autoload :ErrorInformation, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/error_information.rb'
|
46
|
+
autoload :ExtractedToken, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/extracted_token.rb'
|
47
|
+
autoload :ExtractedTableColumn, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/extracted_table_column.rb'
|
48
|
+
autoload :ModelsResult, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/models_result.rb'
|
49
|
+
autoload :ImageUrl, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/image_url.rb'
|
50
|
+
autoload :FormOperationError, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/form_operation_error.rb'
|
51
|
+
autoload :ComputerVisionError, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/computer_vision_error.rb'
|
52
|
+
autoload :StringValue, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/string_value.rb'
|
53
|
+
autoload :NumberValue, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/number_value.rb'
|
54
|
+
autoload :TextOperationStatusCodes, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/text_operation_status_codes.rb'
|
55
|
+
autoload :TextRecognitionResultDimensionUnit, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/text_recognition_result_dimension_unit.rb'
|
56
|
+
autoload :TextRecognitionResultConfidenceClass, '1.0-preview/generated/azure_cognitiveservices_formrecognizer/models/text_recognition_result_confidence_class.rb'
|
42
57
|
end
|
43
58
|
end
|
data/lib/1.0-preview/generated/azure_cognitiveservices_formrecognizer/form_recognizer_client.rb
CHANGED
@@ -116,17 +116,18 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
116
116
|
#
|
117
117
|
# Train Model
|
118
118
|
#
|
119
|
-
# The train request must include a source
|
120
|
-
# externally accessible Azure Storage blob
|
121
|
-
# Access Signature Uri) or valid path to a
|
122
|
-
# drive. When local paths are specified, they
|
123
|
-
# format and be an absolute path rooted to the
|
119
|
+
# Create and train a custom model. The train request must include a source
|
120
|
+
# parameter that is either an externally accessible Azure Storage blob
|
121
|
+
# container Uri (preferably a Shared Access Signature Uri) or valid path to a
|
122
|
+
# data folder in a locally mounted drive. When local paths are specified, they
|
123
|
+
# must follow the Linux/Unix path format and be an absolute path rooted to the
|
124
|
+
# input mount configuration
|
124
125
|
# setting value e.g., if '{Mounts:Input}' configuration setting value is
|
125
126
|
# '/input' then a valid source path would be '/input/contosodataset'. All data
|
126
|
-
# to be trained
|
127
|
-
#
|
128
|
-
# 'image/jpeg' and 'image/png'."
|
129
|
-
# Other content is ignored
|
127
|
+
# to be trained is expected to be directly under the source folder. Subfolders
|
128
|
+
# are not supported. Models are trained using documents that are of the
|
129
|
+
# following content type - 'application/pdf', 'image/jpeg' and 'image/png'."
|
130
|
+
# Other type of content is ignored.
|
130
131
|
#
|
131
132
|
# @param train_request [TrainRequest] Request object for training.
|
132
133
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
@@ -142,17 +143,18 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
142
143
|
#
|
143
144
|
# Train Model
|
144
145
|
#
|
145
|
-
# The train request must include a source
|
146
|
-
# externally accessible Azure Storage blob
|
147
|
-
# Access Signature Uri) or valid path to a
|
148
|
-
# drive. When local paths are specified, they
|
149
|
-
# format and be an absolute path rooted to the
|
146
|
+
# Create and train a custom model. The train request must include a source
|
147
|
+
# parameter that is either an externally accessible Azure Storage blob
|
148
|
+
# container Uri (preferably a Shared Access Signature Uri) or valid path to a
|
149
|
+
# data folder in a locally mounted drive. When local paths are specified, they
|
150
|
+
# must follow the Linux/Unix path format and be an absolute path rooted to the
|
151
|
+
# input mount configuration
|
150
152
|
# setting value e.g., if '{Mounts:Input}' configuration setting value is
|
151
153
|
# '/input' then a valid source path would be '/input/contosodataset'. All data
|
152
|
-
# to be trained
|
153
|
-
#
|
154
|
-
# 'image/jpeg' and 'image/png'."
|
155
|
-
# Other content is ignored
|
154
|
+
# to be trained is expected to be directly under the source folder. Subfolders
|
155
|
+
# are not supported. Models are trained using documents that are of the
|
156
|
+
# following content type - 'application/pdf', 'image/jpeg' and 'image/png'."
|
157
|
+
# Other type of content is ignored.
|
156
158
|
#
|
157
159
|
# @param train_request [TrainRequest] Request object for training.
|
158
160
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
@@ -167,17 +169,18 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
167
169
|
#
|
168
170
|
# Train Model
|
169
171
|
#
|
170
|
-
# The train request must include a source
|
171
|
-
# externally accessible Azure Storage blob
|
172
|
-
# Access Signature Uri) or valid path to a
|
173
|
-
# drive. When local paths are specified, they
|
174
|
-
# format and be an absolute path rooted to the
|
172
|
+
# Create and train a custom model. The train request must include a source
|
173
|
+
# parameter that is either an externally accessible Azure Storage blob
|
174
|
+
# container Uri (preferably a Shared Access Signature Uri) or valid path to a
|
175
|
+
# data folder in a locally mounted drive. When local paths are specified, they
|
176
|
+
# must follow the Linux/Unix path format and be an absolute path rooted to the
|
177
|
+
# input mount configuration
|
175
178
|
# setting value e.g., if '{Mounts:Input}' configuration setting value is
|
176
179
|
# '/input' then a valid source path would be '/input/contosodataset'. All data
|
177
|
-
# to be trained
|
178
|
-
#
|
179
|
-
# 'image/jpeg' and 'image/png'."
|
180
|
-
# Other content is ignored
|
180
|
+
# to be trained is expected to be directly under the source folder. Subfolders
|
181
|
+
# are not supported. Models are trained using documents that are of the
|
182
|
+
# following content type - 'application/pdf', 'image/jpeg' and 'image/png'."
|
183
|
+
# Other type of content is ignored.
|
181
184
|
#
|
182
185
|
# @param train_request [TrainRequest] Request object for training.
|
183
186
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
@@ -225,6 +228,8 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
225
228
|
end
|
226
229
|
|
227
230
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
231
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
232
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
228
233
|
# Deserialize Response
|
229
234
|
if status_code == 200
|
230
235
|
begin
|
@@ -245,8 +250,8 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
245
250
|
#
|
246
251
|
# Get Keys
|
247
252
|
#
|
248
|
-
#
|
249
|
-
# extracted
|
253
|
+
# Retrieve the keys that were
|
254
|
+
# extracted during the training of the specified model.
|
250
255
|
#
|
251
256
|
# @param id Model identifier.
|
252
257
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
@@ -262,8 +267,8 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
262
267
|
#
|
263
268
|
# Get Keys
|
264
269
|
#
|
265
|
-
#
|
266
|
-
# extracted
|
270
|
+
# Retrieve the keys that were
|
271
|
+
# extracted during the training of the specified model.
|
267
272
|
#
|
268
273
|
# @param id Model identifier.
|
269
274
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
@@ -278,8 +283,8 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
278
283
|
#
|
279
284
|
# Get Keys
|
280
285
|
#
|
281
|
-
#
|
282
|
-
# extracted
|
286
|
+
# Retrieve the keys that were
|
287
|
+
# extracted during the training of the specified model.
|
283
288
|
#
|
284
289
|
# @param id Model identifier.
|
285
290
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
@@ -321,6 +326,8 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
321
326
|
end
|
322
327
|
|
323
328
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
329
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
330
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
324
331
|
# Deserialize Response
|
325
332
|
if status_code == 200
|
326
333
|
begin
|
@@ -341,7 +348,7 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
341
348
|
#
|
342
349
|
# Get Models
|
343
350
|
#
|
344
|
-
# Get information about all trained models
|
351
|
+
# Get information about all trained custom models
|
345
352
|
#
|
346
353
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
347
354
|
# will be added to the HTTP request.
|
@@ -356,7 +363,7 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
356
363
|
#
|
357
364
|
# Get Models
|
358
365
|
#
|
359
|
-
# Get information about all trained models
|
366
|
+
# Get information about all trained custom models
|
360
367
|
#
|
361
368
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
362
369
|
# will be added to the HTTP request.
|
@@ -370,7 +377,7 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
370
377
|
#
|
371
378
|
# Get Models
|
372
379
|
#
|
373
|
-
# Get information about all trained models
|
380
|
+
# Get information about all trained custom models
|
374
381
|
#
|
375
382
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
376
383
|
# to the HTTP request.
|
@@ -409,6 +416,8 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
409
416
|
end
|
410
417
|
|
411
418
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
419
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
420
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
412
421
|
# Deserialize Response
|
413
422
|
if status_code == 200
|
414
423
|
begin
|
@@ -502,6 +511,8 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
502
511
|
end
|
503
512
|
|
504
513
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
514
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
515
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
505
516
|
# Deserialize Response
|
506
517
|
if status_code == 200
|
507
518
|
begin
|
@@ -594,6 +605,8 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
594
605
|
end
|
595
606
|
|
596
607
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
608
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
609
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
597
610
|
|
598
611
|
result
|
599
612
|
end
|
@@ -604,10 +617,9 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
604
617
|
#
|
605
618
|
# Analyze Form
|
606
619
|
#
|
607
|
-
#
|
608
|
-
# 'application/pdf', 'image/jpeg' or
|
609
|
-
#
|
610
|
-
# about content that was not extracted along with a reason.
|
620
|
+
# Extract key-value pairs from a given document. The input document must be of
|
621
|
+
# one of the supported content types - 'application/pdf', 'image/jpeg' or
|
622
|
+
# 'image/png'. A success response is returned in JSON.
|
611
623
|
#
|
612
624
|
# @param id Model Identifier to analyze the document with.
|
613
625
|
# @param form_stream A pdf document or image (jpg,png) file to analyze.
|
@@ -626,10 +638,9 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
626
638
|
#
|
627
639
|
# Analyze Form
|
628
640
|
#
|
629
|
-
#
|
630
|
-
# 'application/pdf', 'image/jpeg' or
|
631
|
-
#
|
632
|
-
# about content that was not extracted along with a reason.
|
641
|
+
# Extract key-value pairs from a given document. The input document must be of
|
642
|
+
# one of the supported content types - 'application/pdf', 'image/jpeg' or
|
643
|
+
# 'image/png'. A success response is returned in JSON.
|
633
644
|
#
|
634
645
|
# @param id Model Identifier to analyze the document with.
|
635
646
|
# @param form_stream A pdf document or image (jpg,png) file to analyze.
|
@@ -647,10 +658,9 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
647
658
|
#
|
648
659
|
# Analyze Form
|
649
660
|
#
|
650
|
-
#
|
651
|
-
# 'application/pdf', 'image/jpeg' or
|
652
|
-
#
|
653
|
-
# about content that was not extracted along with a reason.
|
661
|
+
# Extract key-value pairs from a given document. The input document must be of
|
662
|
+
# one of the supported content types - 'application/pdf', 'image/jpeg' or
|
663
|
+
# 'image/png'. A success response is returned in JSON.
|
654
664
|
#
|
655
665
|
# @param id Model Identifier to analyze the document with.
|
656
666
|
# @param form_stream A pdf document or image (jpg,png) file to analyze.
|
@@ -703,6 +713,8 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
703
713
|
end
|
704
714
|
|
705
715
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
716
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
717
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
706
718
|
# Deserialize Response
|
707
719
|
if status_code == 200
|
708
720
|
begin
|
@@ -720,6 +732,297 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
720
732
|
promise.execute
|
721
733
|
end
|
722
734
|
|
735
|
+
#
|
736
|
+
# Batch Read Receipt operation. The response contains a field called
|
737
|
+
# 'Operation-Location', which contains the URL that you must use for your 'Get
|
738
|
+
# Read Receipt Result' operation.
|
739
|
+
#
|
740
|
+
# @param url [String] Publicly reachable URL of an image.
|
741
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
742
|
+
# will be added to the HTTP request.
|
743
|
+
#
|
744
|
+
#
|
745
|
+
def batch_read_receipt(url, custom_headers:nil)
|
746
|
+
response = batch_read_receipt_async(url, custom_headers:custom_headers).value!
|
747
|
+
nil
|
748
|
+
end
|
749
|
+
|
750
|
+
#
|
751
|
+
# Batch Read Receipt operation. The response contains a field called
|
752
|
+
# 'Operation-Location', which contains the URL that you must use for your 'Get
|
753
|
+
# Read Receipt Result' operation.
|
754
|
+
#
|
755
|
+
# @param url [String] Publicly reachable URL of an image.
|
756
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
757
|
+
# will be added to the HTTP request.
|
758
|
+
#
|
759
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
760
|
+
#
|
761
|
+
def batch_read_receipt_with_http_info(url, custom_headers:nil)
|
762
|
+
batch_read_receipt_async(url, custom_headers:custom_headers).value!
|
763
|
+
end
|
764
|
+
|
765
|
+
#
|
766
|
+
# Batch Read Receipt operation. The response contains a field called
|
767
|
+
# 'Operation-Location', which contains the URL that you must use for your 'Get
|
768
|
+
# Read Receipt Result' operation.
|
769
|
+
#
|
770
|
+
# @param url [String] Publicly reachable URL of an image.
|
771
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
772
|
+
# to the HTTP request.
|
773
|
+
#
|
774
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
775
|
+
#
|
776
|
+
def batch_read_receipt_async(url, custom_headers:nil)
|
777
|
+
fail ArgumentError, 'endpoint is nil' if endpoint.nil?
|
778
|
+
fail ArgumentError, 'url is nil' if url.nil?
|
779
|
+
|
780
|
+
image_url = ImageUrl.new
|
781
|
+
unless url.nil?
|
782
|
+
image_url.url = url
|
783
|
+
end
|
784
|
+
|
785
|
+
request_headers = {}
|
786
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
787
|
+
|
788
|
+
# Set Headers
|
789
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
790
|
+
request_headers['accept-language'] = accept_language unless accept_language.nil?
|
791
|
+
|
792
|
+
# Serialize Request
|
793
|
+
request_mapper = Azure::CognitiveServices::FormRecognizer::V1_0_preview::Models::ImageUrl.mapper()
|
794
|
+
request_content = self.serialize(request_mapper, image_url)
|
795
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
796
|
+
|
797
|
+
path_template = 'prebuilt/receipt/asyncBatchAnalyze'
|
798
|
+
|
799
|
+
request_url = @base_url || self.base_url
|
800
|
+
request_url = request_url.gsub('{Endpoint}', endpoint)
|
801
|
+
|
802
|
+
options = {
|
803
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
804
|
+
body: request_content,
|
805
|
+
headers: request_headers.merge(custom_headers || {}),
|
806
|
+
base_url: request_url
|
807
|
+
}
|
808
|
+
promise = self.make_request_async(:post, path_template, options)
|
809
|
+
|
810
|
+
promise = promise.then do |result|
|
811
|
+
http_response = result.response
|
812
|
+
status_code = http_response.status
|
813
|
+
response_content = http_response.body
|
814
|
+
unless status_code == 202
|
815
|
+
error_model = JSON.load(response_content)
|
816
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
817
|
+
end
|
818
|
+
|
819
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
820
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
821
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
822
|
+
|
823
|
+
result
|
824
|
+
end
|
825
|
+
|
826
|
+
promise.execute
|
827
|
+
end
|
828
|
+
|
829
|
+
#
|
830
|
+
# This interface is used for getting the analysis results of a 'Batch Read
|
831
|
+
# Receipt' operation. The URL to this interface should be retrieved from the
|
832
|
+
# 'Operation-Location' field returned from the 'Batch Read Receipt' operation.
|
833
|
+
#
|
834
|
+
# @param operation_id [String] Id of read operation returned in the response of
|
835
|
+
# a 'Batch Read Receipt' operation.
|
836
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
837
|
+
# will be added to the HTTP request.
|
838
|
+
#
|
839
|
+
# @return [ReadReceiptResult] operation results.
|
840
|
+
#
|
841
|
+
def get_read_receipt_result(operation_id, custom_headers:nil)
|
842
|
+
response = get_read_receipt_result_async(operation_id, custom_headers:custom_headers).value!
|
843
|
+
response.body unless response.nil?
|
844
|
+
end
|
845
|
+
|
846
|
+
#
|
847
|
+
# This interface is used for getting the analysis results of a 'Batch Read
|
848
|
+
# Receipt' operation. The URL to this interface should be retrieved from the
|
849
|
+
# 'Operation-Location' field returned from the 'Batch Read Receipt' operation.
|
850
|
+
#
|
851
|
+
# @param operation_id [String] Id of read operation returned in the response of
|
852
|
+
# a 'Batch Read Receipt' operation.
|
853
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
854
|
+
# will be added to the HTTP request.
|
855
|
+
#
|
856
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
857
|
+
#
|
858
|
+
def get_read_receipt_result_with_http_info(operation_id, custom_headers:nil)
|
859
|
+
get_read_receipt_result_async(operation_id, custom_headers:custom_headers).value!
|
860
|
+
end
|
861
|
+
|
862
|
+
#
|
863
|
+
# This interface is used for getting the analysis results of a 'Batch Read
|
864
|
+
# Receipt' operation. The URL to this interface should be retrieved from the
|
865
|
+
# 'Operation-Location' field returned from the 'Batch Read Receipt' operation.
|
866
|
+
#
|
867
|
+
# @param operation_id [String] Id of read operation returned in the response of
|
868
|
+
# a 'Batch Read Receipt' operation.
|
869
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
870
|
+
# to the HTTP request.
|
871
|
+
#
|
872
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
873
|
+
#
|
874
|
+
def get_read_receipt_result_async(operation_id, custom_headers:nil)
|
875
|
+
fail ArgumentError, 'endpoint is nil' if endpoint.nil?
|
876
|
+
fail ArgumentError, 'operation_id is nil' if operation_id.nil?
|
877
|
+
|
878
|
+
|
879
|
+
request_headers = {}
|
880
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
881
|
+
|
882
|
+
# Set Headers
|
883
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
884
|
+
request_headers['accept-language'] = accept_language unless accept_language.nil?
|
885
|
+
path_template = 'prebuilt/receipt/operations/{operationId}'
|
886
|
+
|
887
|
+
request_url = @base_url || self.base_url
|
888
|
+
request_url = request_url.gsub('{Endpoint}', endpoint)
|
889
|
+
|
890
|
+
options = {
|
891
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
892
|
+
path_params: {'operationId' => operation_id},
|
893
|
+
headers: request_headers.merge(custom_headers || {}),
|
894
|
+
base_url: request_url
|
895
|
+
}
|
896
|
+
promise = self.make_request_async(:get, path_template, options)
|
897
|
+
|
898
|
+
promise = promise.then do |result|
|
899
|
+
http_response = result.response
|
900
|
+
status_code = http_response.status
|
901
|
+
response_content = http_response.body
|
902
|
+
unless status_code == 200
|
903
|
+
error_model = JSON.load(response_content)
|
904
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
905
|
+
end
|
906
|
+
|
907
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
908
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
909
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
910
|
+
# Deserialize Response
|
911
|
+
if status_code == 200
|
912
|
+
begin
|
913
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
914
|
+
result_mapper = Azure::CognitiveServices::FormRecognizer::V1_0_preview::Models::ReadReceiptResult.mapper()
|
915
|
+
result.body = self.deserialize(result_mapper, parsed_response)
|
916
|
+
rescue Exception => e
|
917
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
918
|
+
end
|
919
|
+
end
|
920
|
+
|
921
|
+
result
|
922
|
+
end
|
923
|
+
|
924
|
+
promise.execute
|
925
|
+
end
|
926
|
+
|
927
|
+
#
|
928
|
+
# Read Receipt operation. When you use the 'Batch Read Receipt' interface, the
|
929
|
+
# response contains a field called 'Operation-Location'. The
|
930
|
+
# 'Operation-Location' field contains the URL that you must use for your 'Get
|
931
|
+
# Read Receipt Result' operation.
|
932
|
+
#
|
933
|
+
# @param image An image stream.
|
934
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
935
|
+
# will be added to the HTTP request.
|
936
|
+
#
|
937
|
+
#
|
938
|
+
def batch_read_receipt_in_stream(image, custom_headers:nil)
|
939
|
+
response = batch_read_receipt_in_stream_async(image, custom_headers:custom_headers).value!
|
940
|
+
nil
|
941
|
+
end
|
942
|
+
|
943
|
+
#
|
944
|
+
# Read Receipt operation. When you use the 'Batch Read Receipt' interface, the
|
945
|
+
# response contains a field called 'Operation-Location'. The
|
946
|
+
# 'Operation-Location' field contains the URL that you must use for your 'Get
|
947
|
+
# Read Receipt Result' operation.
|
948
|
+
#
|
949
|
+
# @param image An image stream.
|
950
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
951
|
+
# will be added to the HTTP request.
|
952
|
+
#
|
953
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
954
|
+
#
|
955
|
+
def batch_read_receipt_in_stream_with_http_info(image, custom_headers:nil)
|
956
|
+
batch_read_receipt_in_stream_async(image, custom_headers:custom_headers).value!
|
957
|
+
end
|
958
|
+
|
959
|
+
#
|
960
|
+
# Read Receipt operation. When you use the 'Batch Read Receipt' interface, the
|
961
|
+
# response contains a field called 'Operation-Location'. The
|
962
|
+
# 'Operation-Location' field contains the URL that you must use for your 'Get
|
963
|
+
# Read Receipt Result' operation.
|
964
|
+
#
|
965
|
+
# @param image An image stream.
|
966
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
967
|
+
# to the HTTP request.
|
968
|
+
#
|
969
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
970
|
+
#
|
971
|
+
def batch_read_receipt_in_stream_async(image, custom_headers:nil)
|
972
|
+
fail ArgumentError, 'endpoint is nil' if endpoint.nil?
|
973
|
+
fail ArgumentError, 'image is nil' if image.nil?
|
974
|
+
|
975
|
+
|
976
|
+
request_headers = {}
|
977
|
+
request_headers['Content-Type'] = 'application/octet-stream'
|
978
|
+
|
979
|
+
# Set Headers
|
980
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
981
|
+
request_headers['accept-language'] = accept_language unless accept_language.nil?
|
982
|
+
|
983
|
+
# Serialize Request
|
984
|
+
request_mapper = {
|
985
|
+
client_side_validation: true,
|
986
|
+
required: true,
|
987
|
+
serialized_name: 'Image',
|
988
|
+
type: {
|
989
|
+
name: 'Stream'
|
990
|
+
}
|
991
|
+
}
|
992
|
+
request_content = self.serialize(request_mapper, image)
|
993
|
+
|
994
|
+
path_template = 'prebuilt/receipt/asyncBatchAnalyze'
|
995
|
+
|
996
|
+
request_url = @base_url || self.base_url
|
997
|
+
request_url = request_url.gsub('{Endpoint}', endpoint)
|
998
|
+
|
999
|
+
options = {
|
1000
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1001
|
+
body: request_content,
|
1002
|
+
headers: request_headers.merge(custom_headers || {}),
|
1003
|
+
base_url: request_url
|
1004
|
+
}
|
1005
|
+
promise = self.make_request_async(:post, path_template, options)
|
1006
|
+
|
1007
|
+
promise = promise.then do |result|
|
1008
|
+
http_response = result.response
|
1009
|
+
status_code = http_response.status
|
1010
|
+
response_content = http_response.body
|
1011
|
+
unless status_code == 202
|
1012
|
+
error_model = JSON.load(response_content)
|
1013
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
1014
|
+
end
|
1015
|
+
|
1016
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1017
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1018
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1019
|
+
|
1020
|
+
result
|
1021
|
+
end
|
1022
|
+
|
1023
|
+
promise.execute
|
1024
|
+
end
|
1025
|
+
|
723
1026
|
|
724
1027
|
private
|
725
1028
|
#
|
@@ -727,7 +1030,7 @@ module Azure::CognitiveServices::FormRecognizer::V1_0_preview
|
|
727
1030
|
#
|
728
1031
|
def add_telemetry
|
729
1032
|
sdk_information = 'azure_cognitiveservices_formrecognizer'
|
730
|
-
sdk_information = "#{sdk_information}/0.17.
|
1033
|
+
sdk_information = "#{sdk_information}/0.17.1"
|
731
1034
|
add_user_agent_information(sdk_information)
|
732
1035
|
end
|
733
1036
|
end
|