cloudmersive-documentai-api-client 2.2.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.
Files changed (96) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +140 -0
  4. data/Rakefile +8 -0
  5. data/cloudmersive-documentai-api-client.gemspec +45 -0
  6. data/docs/AdvancedExtractClassificationRequest.md +10 -0
  7. data/docs/AdvancedExtractFieldsRequest.md +10 -0
  8. data/docs/AnalyzeApi.md +64 -0
  9. data/docs/DocumentAdvancedClassificationResult.md +9 -0
  10. data/docs/DocumentCategories.md +9 -0
  11. data/docs/DocumentClassificationResult.md +9 -0
  12. data/docs/DocumentPolicyRequest.md +9 -0
  13. data/docs/DocumentPolicyResult.md +10 -0
  14. data/docs/ExtractApi.md +534 -0
  15. data/docs/ExtractBarcodesAiResponse.md +9 -0
  16. data/docs/ExtractDocumentBatchJobResult.md +9 -0
  17. data/docs/ExtractDocumentJobStatusResult.md +15 -0
  18. data/docs/ExtractFieldsAndTablesResponse.md +10 -0
  19. data/docs/ExtractFieldsResponse.md +9 -0
  20. data/docs/ExtractTablesResponse.md +9 -0
  21. data/docs/ExtractTextResponse.md +9 -0
  22. data/docs/ExtractedBarcodeItem.md +9 -0
  23. data/docs/ExtractedTextPage.md +9 -0
  24. data/docs/FieldToExtract.md +11 -0
  25. data/docs/FieldValue.md +9 -0
  26. data/docs/PolicyRule.md +10 -0
  27. data/docs/PolicyRuleViolation.md +10 -0
  28. data/docs/RunBatchJobApi.md +298 -0
  29. data/docs/SummarizeDocumentResponse.md +9 -0
  30. data/docs/TableResult.md +9 -0
  31. data/docs/TableResultCell.md +9 -0
  32. data/docs/TableResultRow.md +8 -0
  33. data/git_push.sh +55 -0
  34. data/lib/cloudmersive-documentai-api-client/api/analyze_api.rb +73 -0
  35. data/lib/cloudmersive-documentai-api-client/api/extract_api.rb +513 -0
  36. data/lib/cloudmersive-documentai-api-client/api/run_batch_job_api.rb +290 -0
  37. data/lib/cloudmersive-documentai-api-client/api_client.rb +391 -0
  38. data/lib/cloudmersive-documentai-api-client/api_error.rb +38 -0
  39. data/lib/cloudmersive-documentai-api-client/configuration.rb +209 -0
  40. data/lib/cloudmersive-documentai-api-client/models/advanced_extract_classification_request.rb +223 -0
  41. data/lib/cloudmersive-documentai-api-client/models/advanced_extract_fields_request.rb +223 -0
  42. data/lib/cloudmersive-documentai-api-client/models/document_advanced_classification_result.rb +196 -0
  43. data/lib/cloudmersive-documentai-api-client/models/document_categories.rb +196 -0
  44. data/lib/cloudmersive-documentai-api-client/models/document_classification_result.rb +196 -0
  45. data/lib/cloudmersive-documentai-api-client/models/document_policy_request.rb +213 -0
  46. data/lib/cloudmersive-documentai-api-client/models/document_policy_result.rb +208 -0
  47. data/lib/cloudmersive-documentai-api-client/models/extract_barcodes_ai_response.rb +198 -0
  48. data/lib/cloudmersive-documentai-api-client/models/extract_document_batch_job_result.rb +196 -0
  49. data/lib/cloudmersive-documentai-api-client/models/extract_document_job_status_result.rb +252 -0
  50. data/lib/cloudmersive-documentai-api-client/models/extract_fields_and_tables_response.rb +210 -0
  51. data/lib/cloudmersive-documentai-api-client/models/extract_fields_response.rb +198 -0
  52. data/lib/cloudmersive-documentai-api-client/models/extract_tables_response.rb +198 -0
  53. data/lib/cloudmersive-documentai-api-client/models/extract_text_response.rb +198 -0
  54. data/lib/cloudmersive-documentai-api-client/models/extracted_barcode_item.rb +196 -0
  55. data/lib/cloudmersive-documentai-api-client/models/extracted_text_page.rb +196 -0
  56. data/lib/cloudmersive-documentai-api-client/models/field_to_extract.rb +216 -0
  57. data/lib/cloudmersive-documentai-api-client/models/field_value.rb +196 -0
  58. data/lib/cloudmersive-documentai-api-client/models/policy_rule.rb +205 -0
  59. data/lib/cloudmersive-documentai-api-client/models/policy_rule_violation.rb +206 -0
  60. data/lib/cloudmersive-documentai-api-client/models/summarize_document_response.rb +196 -0
  61. data/lib/cloudmersive-documentai-api-client/models/table_result.rb +198 -0
  62. data/lib/cloudmersive-documentai-api-client/models/table_result_cell.rb +196 -0
  63. data/lib/cloudmersive-documentai-api-client/models/table_result_row.rb +188 -0
  64. data/lib/cloudmersive-documentai-api-client/version.rb +15 -0
  65. data/lib/cloudmersive-documentai-api-client.rb +66 -0
  66. data/spec/api/analyze_api_spec.rb +47 -0
  67. data/spec/api/extract_api_spec.rb +154 -0
  68. data/spec/api/run_batch_job_api_spec.rb +100 -0
  69. data/spec/api_client_spec.rb +243 -0
  70. data/spec/configuration_spec.rb +42 -0
  71. data/spec/models/advanced_extract_classification_request_spec.rb +53 -0
  72. data/spec/models/advanced_extract_fields_request_spec.rb +53 -0
  73. data/spec/models/document_advanced_classification_result_spec.rb +47 -0
  74. data/spec/models/document_categories_spec.rb +47 -0
  75. data/spec/models/document_classification_result_spec.rb +47 -0
  76. data/spec/models/document_policy_request_spec.rb +47 -0
  77. data/spec/models/document_policy_result_spec.rb +53 -0
  78. data/spec/models/extract_barcodes_ai_response_spec.rb +47 -0
  79. data/spec/models/extract_document_batch_job_result_spec.rb +47 -0
  80. data/spec/models/extract_document_job_status_result_spec.rb +83 -0
  81. data/spec/models/extract_fields_and_tables_response_spec.rb +53 -0
  82. data/spec/models/extract_fields_response_spec.rb +47 -0
  83. data/spec/models/extract_tables_response_spec.rb +47 -0
  84. data/spec/models/extract_text_response_spec.rb +47 -0
  85. data/spec/models/extracted_barcode_item_spec.rb +47 -0
  86. data/spec/models/extracted_text_page_spec.rb +47 -0
  87. data/spec/models/field_to_extract_spec.rb +59 -0
  88. data/spec/models/field_value_spec.rb +47 -0
  89. data/spec/models/policy_rule_spec.rb +53 -0
  90. data/spec/models/policy_rule_violation_spec.rb +53 -0
  91. data/spec/models/summarize_document_response_spec.rb +47 -0
  92. data/spec/models/table_result_cell_spec.rb +47 -0
  93. data/spec/models/table_result_row_spec.rb +41 -0
  94. data/spec/models/table_result_spec.rb +47 -0
  95. data/spec/spec_helper.rb +111 -0
  96. metadata +319 -0
@@ -0,0 +1,188 @@
1
+ =begin
2
+ #Document AI API
3
+
4
+ #Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveDocumentaiApiClient
16
+ # Row of a table extracted from a document
17
+ class TableResultRow
18
+ # Cells in the row
19
+ attr_accessor :cells
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'cells' => :'Cells'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'cells' => :'Array<TableResultCell>'
32
+ }
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ return unless attributes.is_a?(Hash)
39
+
40
+ # convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
42
+
43
+ if attributes.has_key?(:'Cells')
44
+ if (value = attributes[:'Cells']).is_a?(Array)
45
+ self.cells = value
46
+ end
47
+ end
48
+ end
49
+
50
+ # Show invalid properties with the reasons. Usually used together with valid?
51
+ # @return Array for valid properties with the reasons
52
+ def list_invalid_properties
53
+ invalid_properties = Array.new
54
+ invalid_properties
55
+ end
56
+
57
+ # Check to see if the all the properties in the model are valid
58
+ # @return true if the model is valid
59
+ def valid?
60
+ true
61
+ end
62
+
63
+ # Checks equality by comparing each attribute.
64
+ # @param [Object] Object to be compared
65
+ def ==(o)
66
+ return true if self.equal?(o)
67
+ self.class == o.class &&
68
+ cells == o.cells
69
+ end
70
+
71
+ # @see the `==` method
72
+ # @param [Object] Object to be compared
73
+ def eql?(o)
74
+ self == o
75
+ end
76
+
77
+ # Calculates hash code according to all attributes.
78
+ # @return [Fixnum] Hash code
79
+ def hash
80
+ [cells].hash
81
+ end
82
+
83
+ # Builds the object from hash
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ # @return [Object] Returns the model itself
86
+ def build_from_hash(attributes)
87
+ return nil unless attributes.is_a?(Hash)
88
+ self.class.swagger_types.each_pair do |key, type|
89
+ if type =~ /\AArray<(.*)>/i
90
+ # check to ensure the input is an array given that the attribute
91
+ # is documented as an array but the input is not
92
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
93
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
94
+ end
95
+ elsif !attributes[self.class.attribute_map[key]].nil?
96
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
97
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
98
+ end
99
+
100
+ self
101
+ end
102
+
103
+ # Deserializes the data based on type
104
+ # @param string type Data type
105
+ # @param string value Value to be deserialized
106
+ # @return [Object] Deserialized data
107
+ def _deserialize(type, value)
108
+ case type.to_sym
109
+ when :DateTime
110
+ DateTime.parse(value)
111
+ when :Date
112
+ Date.parse(value)
113
+ when :String
114
+ value.to_s
115
+ when :Integer
116
+ value.to_i
117
+ when :Float
118
+ value.to_f
119
+ when :BOOLEAN
120
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
121
+ true
122
+ else
123
+ false
124
+ end
125
+ when :Object
126
+ # generic object (usually a Hash), return directly
127
+ value
128
+ when /\AArray<(?<inner_type>.+)>\z/
129
+ inner_type = Regexp.last_match[:inner_type]
130
+ value.map { |v| _deserialize(inner_type, v) }
131
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
132
+ k_type = Regexp.last_match[:k_type]
133
+ v_type = Regexp.last_match[:v_type]
134
+ {}.tap do |hash|
135
+ value.each do |k, v|
136
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
137
+ end
138
+ end
139
+ else # model
140
+ temp_model = CloudmersiveDocumentaiApiClient.const_get(type).new
141
+ temp_model.build_from_hash(value)
142
+ end
143
+ end
144
+
145
+ # Returns the string representation of the object
146
+ # @return [String] String presentation of the object
147
+ def to_s
148
+ to_hash.to_s
149
+ end
150
+
151
+ # to_body is an alias to to_hash (backward compatibility)
152
+ # @return [Hash] Returns the object in the form of hash
153
+ def to_body
154
+ to_hash
155
+ end
156
+
157
+ # Returns the object in the form of hash
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_hash
160
+ hash = {}
161
+ self.class.attribute_map.each_pair do |attr, param|
162
+ value = self.send(attr)
163
+ next if value.nil?
164
+ hash[param] = _to_hash(value)
165
+ end
166
+ hash
167
+ end
168
+
169
+ # Outputs non-array value in the form of hash
170
+ # For object, use to_hash. Otherwise, just return the value
171
+ # @param [Object] value Any valid value
172
+ # @return [Hash] Returns the value in the form of hash
173
+ def _to_hash(value)
174
+ if value.is_a?(Array)
175
+ value.compact.map { |v| _to_hash(v) }
176
+ elsif value.is_a?(Hash)
177
+ {}.tap do |hash|
178
+ value.each { |k, v| hash[k] = _to_hash(v) }
179
+ end
180
+ elsif value.respond_to? :to_hash
181
+ value.to_hash
182
+ else
183
+ value
184
+ end
185
+ end
186
+
187
+ end
188
+ end
@@ -0,0 +1,15 @@
1
+ =begin
2
+ #Document AI API
3
+
4
+ #Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ module CloudmersiveDocumentaiApiClient
14
+ VERSION = '2.2.0'
15
+ end
@@ -0,0 +1,66 @@
1
+ =begin
2
+ #Document AI API
3
+
4
+ #Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ # Common files
14
+ require 'cloudmersive-documentai-api-client/api_client'
15
+ require 'cloudmersive-documentai-api-client/api_error'
16
+ require 'cloudmersive-documentai-api-client/version'
17
+ require 'cloudmersive-documentai-api-client/configuration'
18
+
19
+ # Models
20
+ require 'cloudmersive-documentai-api-client/models/advanced_extract_classification_request'
21
+ require 'cloudmersive-documentai-api-client/models/advanced_extract_fields_request'
22
+ require 'cloudmersive-documentai-api-client/models/document_advanced_classification_result'
23
+ require 'cloudmersive-documentai-api-client/models/document_categories'
24
+ require 'cloudmersive-documentai-api-client/models/document_classification_result'
25
+ require 'cloudmersive-documentai-api-client/models/document_policy_request'
26
+ require 'cloudmersive-documentai-api-client/models/document_policy_result'
27
+ require 'cloudmersive-documentai-api-client/models/extract_barcodes_ai_response'
28
+ require 'cloudmersive-documentai-api-client/models/extract_document_batch_job_result'
29
+ require 'cloudmersive-documentai-api-client/models/extract_document_job_status_result'
30
+ require 'cloudmersive-documentai-api-client/models/extract_fields_and_tables_response'
31
+ require 'cloudmersive-documentai-api-client/models/extract_fields_response'
32
+ require 'cloudmersive-documentai-api-client/models/extract_tables_response'
33
+ require 'cloudmersive-documentai-api-client/models/extract_text_response'
34
+ require 'cloudmersive-documentai-api-client/models/extracted_barcode_item'
35
+ require 'cloudmersive-documentai-api-client/models/extracted_text_page'
36
+ require 'cloudmersive-documentai-api-client/models/field_to_extract'
37
+ require 'cloudmersive-documentai-api-client/models/field_value'
38
+ require 'cloudmersive-documentai-api-client/models/policy_rule'
39
+ require 'cloudmersive-documentai-api-client/models/policy_rule_violation'
40
+ require 'cloudmersive-documentai-api-client/models/summarize_document_response'
41
+ require 'cloudmersive-documentai-api-client/models/table_result'
42
+ require 'cloudmersive-documentai-api-client/models/table_result_cell'
43
+ require 'cloudmersive-documentai-api-client/models/table_result_row'
44
+
45
+ # APIs
46
+ require 'cloudmersive-documentai-api-client/api/analyze_api'
47
+ require 'cloudmersive-documentai-api-client/api/extract_api'
48
+ require 'cloudmersive-documentai-api-client/api/run_batch_job_api'
49
+
50
+ module CloudmersiveDocumentaiApiClient
51
+ class << self
52
+ # Customize default settings for the SDK using block.
53
+ # CloudmersiveDocumentaiApiClient.configure do |config|
54
+ # config.username = "xxx"
55
+ # config.password = "xxx"
56
+ # end
57
+ # If no block given, return the default Configuration object.
58
+ def configure
59
+ if block_given?
60
+ yield(Configuration.default)
61
+ else
62
+ Configuration.default
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,47 @@
1
+ =begin
2
+ #Document AI API
3
+
4
+ #Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for CloudmersiveDocumentaiApiClient::AnalyzeApi
17
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
+ # Please update as you see appropriate
19
+ describe 'AnalyzeApi' do
20
+ before do
21
+ # run before each test
22
+ @instance = CloudmersiveDocumentaiApiClient::AnalyzeApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of AnalyzeApi' do
30
+ it 'should create an instance of AnalyzeApi' do
31
+ expect(@instance).to be_instance_of(CloudmersiveDocumentaiApiClient::AnalyzeApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for apply_rules
36
+ # Enforce Policies to a Document to allow or block it using Advanced AI
37
+ # Enforce Policies to a Document to allow or block it using Advanced AI. Input document formats supported include DOCX, PDF, PNG and JPG.
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [DocumentPolicyRequest] :body Input request, including document and policy rules
40
+ # @return [DocumentPolicyResult]
41
+ describe 'apply_rules test' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ end
@@ -0,0 +1,154 @@
1
+ =begin
2
+ #Document AI API
3
+
4
+ #Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for CloudmersiveDocumentaiApiClient::ExtractApi
17
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
+ # Please update as you see appropriate
19
+ describe 'ExtractApi' do
20
+ before do
21
+ # run before each test
22
+ @instance = CloudmersiveDocumentaiApiClient::ExtractApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of ExtractApi' do
30
+ it 'should create an instance of ExtractApi' do
31
+ expect(@instance).to be_instance_of(CloudmersiveDocumentaiApiClient::ExtractApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for extract_all_fields_and_tables
36
+ # Extract All Fields and Tables of Data from a Document using AI
37
+ # Extract all Fields and Tables, comprised of rows and columns of data, from a document using AI. Input document formats supported include DOCX, PDF, PNG and JPG.
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [String] :recognition_mode Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
40
+ # @option opts [File] :input_file Input document, or photos of a document, to extract data from
41
+ # @return [ExtractFieldsAndTablesResponse]
42
+ describe 'extract_all_fields_and_tables test' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
45
+ end
46
+ end
47
+
48
+ # unit tests for extract_barcodes
49
+ # Extract Barcodes of from a Document using AI
50
+ # Extract all barcodes from a document using AI. Input document formats supported include DOCX, PDF, PNG and JPG.
51
+ # @param [Hash] opts the optional parameters
52
+ # @option opts [String] :recognition_mode Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
53
+ # @option opts [File] :input_file Input document, or photos of a document, to extract data from
54
+ # @return [ExtractBarcodesAiResponse]
55
+ describe 'extract_barcodes test' do
56
+ it 'should work' do
57
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
58
+ end
59
+ end
60
+
61
+ # unit tests for extract_classification
62
+ # Extract Classification or Category from a Document using AI
63
+ # Extract Classification or Category (e.g. Invoice, Receipt, Tax Form, or Form 1040, Form 1040 EZ, etc.) from a document using AI. Input document formats supported include DOCX, PDF, PNG and JPG.
64
+ # @param [Hash] opts the optional parameters
65
+ # @option opts [String] :categories Desired classification to extract
66
+ # @option opts [String] :recognition_mode Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
67
+ # @option opts [File] :input_file Input document, or photos of a document, to extract data from
68
+ # @return [DocumentClassificationResult]
69
+ describe 'extract_classification test' do
70
+ it 'should work' do
71
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
72
+ end
73
+ end
74
+
75
+ # unit tests for extract_classification_advanced
76
+ # Extract Classification or Category from a Document using Advanced AI
77
+ # Extract Classification or Category (e.g. Invoice, Receipt, Tax Form, or Form 1040, Form 1040 EZ, etc.) from a document using Advanced AI. Input document formats supported include DOCX, PDF, PNG and JPG.
78
+ # @param [Hash] opts the optional parameters
79
+ # @option opts [String] :recognition_mode Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
80
+ # @option opts [AdvancedExtractClassificationRequest] :body Input request to perform the classification on
81
+ # @return [DocumentAdvancedClassificationResult]
82
+ describe 'extract_classification_advanced test' do
83
+ it 'should work' do
84
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
85
+ end
86
+ end
87
+
88
+ # unit tests for extract_fields
89
+ # Extract Field Values from a Document using AI
90
+ # Extract Field Values (e.g. Invoice Number, Invoice Date, Business Card Phone Number, etc.) from a document using AI. Input document formats supported include DOCX, PDF, PNG and JPG.
91
+ # @param [Hash] opts the optional parameters
92
+ # @option opts [String] :field_names Desired fields to extract, comma separated
93
+ # @option opts [String] :recognition_mode Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
94
+ # @option opts [File] :input_file Input document, or photos of a document, to extract data from
95
+ # @return [ExtractFieldsResponse]
96
+ describe 'extract_fields test' do
97
+ it 'should work' do
98
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
99
+ end
100
+ end
101
+
102
+ # unit tests for extract_fields_advanced
103
+ # Extract Field Values from a Document using Advanced AI
104
+ # Extract Field Values (e.g. Invoice Number, Invoice Date, Business Card Phone Number, etc.) from a document using Advanced AI. Input document formats supported include DOCX, PDF, PNG and JPG.
105
+ # @param [Hash] opts the optional parameters
106
+ # @option opts [String] :recognition_mode Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
107
+ # @option opts [AdvancedExtractFieldsRequest] :body Input request, including document file as byte array, and information on which fields to extract
108
+ # @return [ExtractFieldsResponse]
109
+ describe 'extract_fields_advanced test' do
110
+ it 'should work' do
111
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
112
+ end
113
+ end
114
+
115
+ # unit tests for extract_summary
116
+ # Extract Summary from a Document using AI
117
+ # Creates a 1 paragraph summary of the input document using Artificial Intelligence. Input document formats supported include DOCX, PDF, PNG and JPG.
118
+ # @param [Hash] opts the optional parameters
119
+ # @option opts [String] :recognition_mode Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
120
+ # @option opts [File] :input_file Input document, or photos of a document, to extract data from
121
+ # @return [SummarizeDocumentResponse]
122
+ describe 'extract_summary test' do
123
+ it 'should work' do
124
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
125
+ end
126
+ end
127
+
128
+ # unit tests for extract_tables
129
+ # Extract Tables of Data from a Document using AI
130
+ # Extract Tables, comprised of rows and columns of data, from a document using AI. Input document formats supported include DOCX, PDF, PNG and JPG.
131
+ # @param [Hash] opts the optional parameters
132
+ # @option opts [String] :recognition_mode Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
133
+ # @option opts [File] :input_file Input document, or photos of a document, to extract data from
134
+ # @return [ExtractTablesResponse]
135
+ describe 'extract_tables test' do
136
+ it 'should work' do
137
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
138
+ end
139
+ end
140
+
141
+ # unit tests for extract_text
142
+ # Extract Text from a Document using AI
143
+ # Extract raw text from a document using AI. Input document formats supported include DOCX, PDF, PNG and JPG. Supports a wide range of languages.
144
+ # @param [Hash] opts the optional parameters
145
+ # @option opts [String] :recognition_mode Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
146
+ # @option opts [File] :input_file Input document, or photos of a document, to extract data from
147
+ # @return [ExtractTextResponse]
148
+ describe 'extract_text test' do
149
+ it 'should work' do
150
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
151
+ end
152
+ end
153
+
154
+ end
@@ -0,0 +1,100 @@
1
+ =begin
2
+ #Document AI API
3
+
4
+ #Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for CloudmersiveDocumentaiApiClient::RunBatchJobApi
17
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
+ # Please update as you see appropriate
19
+ describe 'RunBatchJobApi' do
20
+ before do
21
+ # run before each test
22
+ @instance = CloudmersiveDocumentaiApiClient::RunBatchJobApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of RunBatchJobApi' do
30
+ it 'should create an instance of RunBatchJobApi' do
31
+ expect(@instance).to be_instance_of(CloudmersiveDocumentaiApiClient::RunBatchJobApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for extract_all_fields_and_tables_from_document_batch_job
36
+ # Extract All Fields and Tables of Data from a Document using AI as a Batch Job
37
+ # Creates an async batch job for processing a large document as an AI batch job. Extract all Fields and Tables, comprised of rows and columns of data, from a document using AI. Input document formats supported include DOCX, PDF, PNG and JPG.
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [String] :recognition_mode Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
40
+ # @option opts [File] :input_file Input document, or photos of a document, to extract data from
41
+ # @return [ExtractDocumentBatchJobResult]
42
+ describe 'extract_all_fields_and_tables_from_document_batch_job test' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
45
+ end
46
+ end
47
+
48
+ # unit tests for extract_classification_from_document_batch_job
49
+ # Extract Classification or Category from a Document using AI as a Batch Job
50
+ # Creates an async batch job for processing a large document as an AI batch job. Extract Classification or Category (e.g. Invoice, Receipt, Tax Form, or Form 1040, Form 1040 EZ, etc.) from a document using AI. Input document formats supported include DOCX, PDF, PNG and JPG.
51
+ # @param [Hash] opts the optional parameters
52
+ # @option opts [String] :categories Desired classification to extract
53
+ # @option opts [String] :recognition_mode Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
54
+ # @option opts [File] :input_file Input document, or photos of a document, to extract data from
55
+ # @return [ExtractDocumentBatchJobResult]
56
+ describe 'extract_classification_from_document_batch_job test' do
57
+ it 'should work' do
58
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
59
+ end
60
+ end
61
+
62
+ # unit tests for extract_fields_from_document_advanced_batch_job
63
+ # Extract Field Values from a Document using Advanced AI as a Batch Job
64
+ # Creates an async batch job for processing a large document as an AI batch job. Extract Field Values (e.g. Invoice Number, Invoice Date, Business Card Phone Number, etc.) from a document using Advanced AI. Input document formats supported include DOCX, PDF, PNG and JPG.
65
+ # @param [Hash] opts the optional parameters
66
+ # @option opts [String] :recognition_mode Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
67
+ # @option opts [AdvancedExtractFieldsRequest] :body
68
+ # @return [ExtractDocumentBatchJobResult]
69
+ describe 'extract_fields_from_document_advanced_batch_job test' do
70
+ it 'should work' do
71
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
72
+ end
73
+ end
74
+
75
+ # unit tests for extract_text_from_document_batch_job
76
+ # Extract Text from a Document using AI as a Batch Job
77
+ # Creates an async batch job for processing a large document as an AI batch job. Input document formats supported include DOCX, PDF, PNG and JPG. Supports a wide range of languages.
78
+ # @param [Hash] opts the optional parameters
79
+ # @option opts [String] :recognition_mode Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
80
+ # @option opts [File] :input_file Input document, or photos of a document, to extract data from
81
+ # @return [ExtractDocumentBatchJobResult]
82
+ describe 'extract_text_from_document_batch_job test' do
83
+ it 'should work' do
84
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
85
+ end
86
+ end
87
+
88
+ # unit tests for get_async_job_status
89
+ # Get the status and result of an Extract Document Batch Job
90
+ # Returns the result of the Async Job - possible states can be STARTED or COMPLETED. This API is only available for Cloudmersive Managed Instance and Private Cloud deployments.
91
+ # @param [Hash] opts the optional parameters
92
+ # @option opts [String] :async_job_id
93
+ # @return [ExtractDocumentJobStatusResult]
94
+ describe 'get_async_job_status test' do
95
+ it 'should work' do
96
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
97
+ end
98
+ end
99
+
100
+ end