cloudmersive-documentai-api-client 2.2.0 → 2.2.1
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/README.md +24 -10
- data/cloudmersive-documentai-api-client.gemspec +3 -3
- data/docs/AdvancedExtractClassificationRequest.md +3 -0
- data/docs/AdvancedExtractFieldsRequest.md +3 -0
- data/docs/AnalyzeApi.md +58 -2
- data/docs/DocumentAdvancedClassificationResult.md +1 -0
- data/docs/DocumentPolicyRequest.md +1 -0
- data/docs/DocumentQuestionAnswerItem.md +11 -0
- data/docs/DocumentQuestionAnswersResult.md +10 -0
- data/docs/DocumentQuestionBoolean.md +9 -0
- data/docs/DocumentQuestionChoiceItem.md +9 -0
- data/docs/DocumentQuestionFreeResponse.md +9 -0
- data/docs/DocumentQuestionMultipleChoice.md +10 -0
- data/docs/DocumentQuestionsRequest.md +12 -0
- data/docs/ExtractApi.md +76 -14
- data/docs/ExtractFieldsAdvancedResponse.md +10 -0
- data/docs/FieldAdvancedValue.md +9 -0
- data/docs/FieldValue.md +2 -1
- data/docs/RunBatchJobApi.md +9 -9
- data/docs/SplitDocumentResponse.md +9 -0
- data/docs/SubDocument.md +11 -0
- data/lib/cloudmersive-documentai-api-client/api/analyze_api.rb +54 -4
- data/lib/cloudmersive-documentai-api-client/api/extract_api.rb +85 -25
- data/lib/cloudmersive-documentai-api-client/api/run_batch_job_api.rb +14 -14
- data/lib/cloudmersive-documentai-api-client/api_client.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/api_error.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/configuration.rb +3 -3
- data/lib/cloudmersive-documentai-api-client/models/advanced_extract_classification_request.rb +36 -6
- data/lib/cloudmersive-documentai-api-client/models/advanced_extract_fields_request.rb +36 -6
- data/lib/cloudmersive-documentai-api-client/models/document_advanced_classification_result.rb +16 -6
- data/lib/cloudmersive-documentai-api-client/models/document_categories.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/document_classification_result.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/document_policy_request.rb +16 -6
- data/lib/cloudmersive-documentai-api-client/models/document_policy_result.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/document_question_answer_item.rb +216 -0
- data/lib/cloudmersive-documentai-api-client/models/document_question_answers_result.rb +207 -0
- data/lib/cloudmersive-documentai-api-client/models/document_question_boolean.rb +196 -0
- data/lib/cloudmersive-documentai-api-client/models/document_question_choice_item.rb +196 -0
- data/lib/cloudmersive-documentai-api-client/models/document_question_free_response.rb +196 -0
- data/lib/cloudmersive-documentai-api-client/models/document_question_multiple_choice.rb +208 -0
- data/lib/cloudmersive-documentai-api-client/models/document_questions_request.rb +246 -0
- data/lib/cloudmersive-documentai-api-client/models/extract_barcodes_ai_response.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/extract_document_batch_job_result.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/extract_document_job_status_result.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/extract_fields_advanced_response.rb +208 -0
- data/lib/cloudmersive-documentai-api-client/models/extract_fields_and_tables_response.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/extract_fields_response.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/extract_tables_response.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/extract_text_response.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/extracted_barcode_item.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/extracted_text_page.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/field_advanced_value.rb +196 -0
- data/lib/cloudmersive-documentai-api-client/models/field_to_extract.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/field_value.rb +19 -7
- data/lib/cloudmersive-documentai-api-client/models/policy_rule.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/policy_rule_violation.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/split_document_response.rb +198 -0
- data/lib/cloudmersive-documentai-api-client/models/sub_document.rb +231 -0
- data/lib/cloudmersive-documentai-api-client/models/summarize_document_response.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/table_result.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/table_result_cell.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/models/table_result_row.rb +2 -2
- data/lib/cloudmersive-documentai-api-client/version.rb +3 -3
- data/lib/cloudmersive-documentai-api-client.rb +13 -2
- data/spec/api/analyze_api_spec.rb +15 -3
- data/spec/api/extract_api_spec.rb +28 -13
- data/spec/api/run_batch_job_api_spec.rb +8 -8
- data/spec/api_client_spec.rb +2 -2
- data/spec/configuration_spec.rb +5 -5
- data/spec/models/advanced_extract_classification_request_spec.rb +20 -2
- data/spec/models/advanced_extract_fields_request_spec.rb +20 -2
- data/spec/models/document_advanced_classification_result_spec.rb +8 -2
- data/spec/models/document_categories_spec.rb +2 -2
- data/spec/models/document_classification_result_spec.rb +2 -2
- data/spec/models/document_policy_request_spec.rb +8 -2
- data/spec/models/document_policy_result_spec.rb +2 -2
- data/spec/models/document_question_answer_item_spec.rb +59 -0
- data/spec/models/document_question_answers_result_spec.rb +53 -0
- data/spec/models/document_question_boolean_spec.rb +47 -0
- data/spec/models/document_question_choice_item_spec.rb +47 -0
- data/spec/models/document_question_free_response_spec.rb +47 -0
- data/spec/models/document_question_multiple_choice_spec.rb +53 -0
- data/spec/models/document_questions_request_spec.rb +65 -0
- data/spec/models/extract_barcodes_ai_response_spec.rb +2 -2
- data/spec/models/extract_document_batch_job_result_spec.rb +2 -2
- data/spec/models/extract_document_job_status_result_spec.rb +2 -2
- data/spec/models/extract_fields_advanced_response_spec.rb +53 -0
- data/spec/models/extract_fields_and_tables_response_spec.rb +2 -2
- data/spec/models/extract_fields_response_spec.rb +2 -2
- data/spec/models/extract_tables_response_spec.rb +2 -2
- data/spec/models/extract_text_response_spec.rb +2 -2
- data/spec/models/extracted_barcode_item_spec.rb +2 -2
- data/spec/models/extracted_text_page_spec.rb +2 -2
- data/spec/models/field_advanced_value_spec.rb +47 -0
- data/spec/models/field_to_extract_spec.rb +2 -2
- data/spec/models/field_value_spec.rb +8 -2
- data/spec/models/policy_rule_spec.rb +2 -2
- data/spec/models/policy_rule_violation_spec.rb +2 -2
- data/spec/models/split_document_response_spec.rb +47 -0
- data/spec/models/sub_document_spec.rb +59 -0
- data/spec/models/summarize_document_response_spec.rb +2 -2
- data/spec/models/table_result_cell_spec.rb +2 -2
- data/spec/models/table_result_row_spec.rb +2 -2
- data/spec/models/table_result_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -2
- metadata +36 -3
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Document AI API
|
|
3
|
+
|
|
4
|
+
#Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: v1
|
|
7
|
+
Contact: support@cloudmersive.com
|
|
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
|
+
# Result of extracting fields from a document
|
|
17
|
+
class ExtractFieldsAdvancedResponse
|
|
18
|
+
# True if successful, false otherwise
|
|
19
|
+
attr_accessor :successful
|
|
20
|
+
|
|
21
|
+
# Field value results from the extraction operation
|
|
22
|
+
attr_accessor :results
|
|
23
|
+
|
|
24
|
+
# Confidence score between 0.0 and 1.0, where values > 0.8 indicate high confidence
|
|
25
|
+
attr_accessor :confidence_score
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'successful' => :'Successful',
|
|
31
|
+
:'results' => :'Results',
|
|
32
|
+
:'confidence_score' => :'ConfidenceScore'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Attribute type mapping.
|
|
37
|
+
def self.swagger_types
|
|
38
|
+
{
|
|
39
|
+
:'successful' => :'BOOLEAN',
|
|
40
|
+
:'results' => :'Array<FieldAdvancedValue>',
|
|
41
|
+
:'confidence_score' => :'Float'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Initializes the object
|
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
47
|
+
def initialize(attributes = {})
|
|
48
|
+
return unless attributes.is_a?(Hash)
|
|
49
|
+
|
|
50
|
+
# convert string to symbol for hash key
|
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
52
|
+
|
|
53
|
+
if attributes.has_key?(:'Successful')
|
|
54
|
+
self.successful = attributes[:'Successful']
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
if attributes.has_key?(:'Results')
|
|
58
|
+
if (value = attributes[:'Results']).is_a?(Array)
|
|
59
|
+
self.results = value
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
if attributes.has_key?(:'ConfidenceScore')
|
|
64
|
+
self.confidence_score = attributes[:'ConfidenceScore']
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
69
|
+
# @return Array for valid properties with the reasons
|
|
70
|
+
def list_invalid_properties
|
|
71
|
+
invalid_properties = Array.new
|
|
72
|
+
invalid_properties
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Check to see if the all the properties in the model are valid
|
|
76
|
+
# @return true if the model is valid
|
|
77
|
+
def valid?
|
|
78
|
+
true
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Checks equality by comparing each attribute.
|
|
82
|
+
# @param [Object] Object to be compared
|
|
83
|
+
def ==(o)
|
|
84
|
+
return true if self.equal?(o)
|
|
85
|
+
self.class == o.class &&
|
|
86
|
+
successful == o.successful &&
|
|
87
|
+
results == o.results &&
|
|
88
|
+
confidence_score == o.confidence_score
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# @see the `==` method
|
|
92
|
+
# @param [Object] Object to be compared
|
|
93
|
+
def eql?(o)
|
|
94
|
+
self == o
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Calculates hash code according to all attributes.
|
|
98
|
+
# @return [Fixnum] Hash code
|
|
99
|
+
def hash
|
|
100
|
+
[successful, results, confidence_score].hash
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Builds the object from hash
|
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
105
|
+
# @return [Object] Returns the model itself
|
|
106
|
+
def build_from_hash(attributes)
|
|
107
|
+
return nil unless attributes.is_a?(Hash)
|
|
108
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
109
|
+
if type =~ /\AArray<(.*)>/i
|
|
110
|
+
# check to ensure the input is an array given that the attribute
|
|
111
|
+
# is documented as an array but the input is not
|
|
112
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
113
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
114
|
+
end
|
|
115
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
116
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
117
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
self
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Deserializes the data based on type
|
|
124
|
+
# @param string type Data type
|
|
125
|
+
# @param string value Value to be deserialized
|
|
126
|
+
# @return [Object] Deserialized data
|
|
127
|
+
def _deserialize(type, value)
|
|
128
|
+
case type.to_sym
|
|
129
|
+
when :DateTime
|
|
130
|
+
DateTime.parse(value)
|
|
131
|
+
when :Date
|
|
132
|
+
Date.parse(value)
|
|
133
|
+
when :String
|
|
134
|
+
value.to_s
|
|
135
|
+
when :Integer
|
|
136
|
+
value.to_i
|
|
137
|
+
when :Float
|
|
138
|
+
value.to_f
|
|
139
|
+
when :BOOLEAN
|
|
140
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
141
|
+
true
|
|
142
|
+
else
|
|
143
|
+
false
|
|
144
|
+
end
|
|
145
|
+
when :Object
|
|
146
|
+
# generic object (usually a Hash), return directly
|
|
147
|
+
value
|
|
148
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
149
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
150
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
151
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
152
|
+
k_type = Regexp.last_match[:k_type]
|
|
153
|
+
v_type = Regexp.last_match[:v_type]
|
|
154
|
+
{}.tap do |hash|
|
|
155
|
+
value.each do |k, v|
|
|
156
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
else # model
|
|
160
|
+
temp_model = CloudmersiveDocumentaiApiClient.const_get(type).new
|
|
161
|
+
temp_model.build_from_hash(value)
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Returns the string representation of the object
|
|
166
|
+
# @return [String] String presentation of the object
|
|
167
|
+
def to_s
|
|
168
|
+
to_hash.to_s
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
172
|
+
# @return [Hash] Returns the object in the form of hash
|
|
173
|
+
def to_body
|
|
174
|
+
to_hash
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Returns the object in the form of hash
|
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
|
179
|
+
def to_hash
|
|
180
|
+
hash = {}
|
|
181
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
182
|
+
value = self.send(attr)
|
|
183
|
+
next if value.nil?
|
|
184
|
+
hash[param] = _to_hash(value)
|
|
185
|
+
end
|
|
186
|
+
hash
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Outputs non-array value in the form of hash
|
|
190
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
191
|
+
# @param [Object] value Any valid value
|
|
192
|
+
# @return [Hash] Returns the value in the form of hash
|
|
193
|
+
def _to_hash(value)
|
|
194
|
+
if value.is_a?(Array)
|
|
195
|
+
value.compact.map { |v| _to_hash(v) }
|
|
196
|
+
elsif value.is_a?(Hash)
|
|
197
|
+
{}.tap do |hash|
|
|
198
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
199
|
+
end
|
|
200
|
+
elsif value.respond_to? :to_hash
|
|
201
|
+
value.to_hash
|
|
202
|
+
else
|
|
203
|
+
value
|
|
204
|
+
end
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
end
|
|
208
|
+
end
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Document AI API
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
|
-
|
|
7
|
+
Contact: support@cloudmersive.com
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
9
|
Swagger Codegen version: 2.4.14
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Document AI API
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
|
-
|
|
7
|
+
Contact: support@cloudmersive.com
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
9
|
Swagger Codegen version: 2.4.14
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Document AI API
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
|
-
|
|
7
|
+
Contact: support@cloudmersive.com
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
9
|
Swagger Codegen version: 2.4.14
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Document AI API
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
|
-
|
|
7
|
+
Contact: support@cloudmersive.com
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
9
|
Swagger Codegen version: 2.4.14
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Document AI API
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
|
-
|
|
7
|
+
Contact: support@cloudmersive.com
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
9
|
Swagger Codegen version: 2.4.14
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Document AI API
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
|
-
|
|
7
|
+
Contact: support@cloudmersive.com
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
9
|
Swagger Codegen version: 2.4.14
|
|
10
10
|
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Document AI API
|
|
3
|
+
|
|
4
|
+
#Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: v1
|
|
7
|
+
Contact: support@cloudmersive.com
|
|
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
|
+
# Field value result of extracting fields from a document
|
|
17
|
+
class FieldAdvancedValue
|
|
18
|
+
# Name of the field (note that spaces will be replaced with underscore)
|
|
19
|
+
attr_accessor :field_name
|
|
20
|
+
|
|
21
|
+
# String value of the field that was extractged from the document
|
|
22
|
+
attr_accessor :field_string_value
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'field_name' => :'FieldName',
|
|
28
|
+
:'field_string_value' => :'FieldStringValue'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Attribute type mapping.
|
|
33
|
+
def self.swagger_types
|
|
34
|
+
{
|
|
35
|
+
:'field_name' => :'String',
|
|
36
|
+
:'field_string_value' => :'String'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Initializes the object
|
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
42
|
+
def initialize(attributes = {})
|
|
43
|
+
return unless attributes.is_a?(Hash)
|
|
44
|
+
|
|
45
|
+
# convert string to symbol for hash key
|
|
46
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
47
|
+
|
|
48
|
+
if attributes.has_key?(:'FieldName')
|
|
49
|
+
self.field_name = attributes[:'FieldName']
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
if attributes.has_key?(:'FieldStringValue')
|
|
53
|
+
self.field_string_value = attributes[:'FieldStringValue']
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
58
|
+
# @return Array for valid properties with the reasons
|
|
59
|
+
def list_invalid_properties
|
|
60
|
+
invalid_properties = Array.new
|
|
61
|
+
invalid_properties
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Check to see if the all the properties in the model are valid
|
|
65
|
+
# @return true if the model is valid
|
|
66
|
+
def valid?
|
|
67
|
+
true
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Checks equality by comparing each attribute.
|
|
71
|
+
# @param [Object] Object to be compared
|
|
72
|
+
def ==(o)
|
|
73
|
+
return true if self.equal?(o)
|
|
74
|
+
self.class == o.class &&
|
|
75
|
+
field_name == o.field_name &&
|
|
76
|
+
field_string_value == o.field_string_value
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# @see the `==` method
|
|
80
|
+
# @param [Object] Object to be compared
|
|
81
|
+
def eql?(o)
|
|
82
|
+
self == o
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Calculates hash code according to all attributes.
|
|
86
|
+
# @return [Fixnum] Hash code
|
|
87
|
+
def hash
|
|
88
|
+
[field_name, field_string_value].hash
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Builds the object from hash
|
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
93
|
+
# @return [Object] Returns the model itself
|
|
94
|
+
def build_from_hash(attributes)
|
|
95
|
+
return nil unless attributes.is_a?(Hash)
|
|
96
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
97
|
+
if type =~ /\AArray<(.*)>/i
|
|
98
|
+
# check to ensure the input is an array given that the attribute
|
|
99
|
+
# is documented as an array but the input is not
|
|
100
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
101
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
102
|
+
end
|
|
103
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
104
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
105
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
self
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Deserializes the data based on type
|
|
112
|
+
# @param string type Data type
|
|
113
|
+
# @param string value Value to be deserialized
|
|
114
|
+
# @return [Object] Deserialized data
|
|
115
|
+
def _deserialize(type, value)
|
|
116
|
+
case type.to_sym
|
|
117
|
+
when :DateTime
|
|
118
|
+
DateTime.parse(value)
|
|
119
|
+
when :Date
|
|
120
|
+
Date.parse(value)
|
|
121
|
+
when :String
|
|
122
|
+
value.to_s
|
|
123
|
+
when :Integer
|
|
124
|
+
value.to_i
|
|
125
|
+
when :Float
|
|
126
|
+
value.to_f
|
|
127
|
+
when :BOOLEAN
|
|
128
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
129
|
+
true
|
|
130
|
+
else
|
|
131
|
+
false
|
|
132
|
+
end
|
|
133
|
+
when :Object
|
|
134
|
+
# generic object (usually a Hash), return directly
|
|
135
|
+
value
|
|
136
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
137
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
138
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
139
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
140
|
+
k_type = Regexp.last_match[:k_type]
|
|
141
|
+
v_type = Regexp.last_match[:v_type]
|
|
142
|
+
{}.tap do |hash|
|
|
143
|
+
value.each do |k, v|
|
|
144
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
else # model
|
|
148
|
+
temp_model = CloudmersiveDocumentaiApiClient.const_get(type).new
|
|
149
|
+
temp_model.build_from_hash(value)
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Returns the string representation of the object
|
|
154
|
+
# @return [String] String presentation of the object
|
|
155
|
+
def to_s
|
|
156
|
+
to_hash.to_s
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
160
|
+
# @return [Hash] Returns the object in the form of hash
|
|
161
|
+
def to_body
|
|
162
|
+
to_hash
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Returns the object in the form of hash
|
|
166
|
+
# @return [Hash] Returns the object in the form of hash
|
|
167
|
+
def to_hash
|
|
168
|
+
hash = {}
|
|
169
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
170
|
+
value = self.send(attr)
|
|
171
|
+
next if value.nil?
|
|
172
|
+
hash[param] = _to_hash(value)
|
|
173
|
+
end
|
|
174
|
+
hash
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Outputs non-array value in the form of hash
|
|
178
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
179
|
+
# @param [Object] value Any valid value
|
|
180
|
+
# @return [Hash] Returns the value in the form of hash
|
|
181
|
+
def _to_hash(value)
|
|
182
|
+
if value.is_a?(Array)
|
|
183
|
+
value.compact.map { |v| _to_hash(v) }
|
|
184
|
+
elsif value.is_a?(Hash)
|
|
185
|
+
{}.tap do |hash|
|
|
186
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
187
|
+
end
|
|
188
|
+
elsif value.respond_to? :to_hash
|
|
189
|
+
value.to_hash
|
|
190
|
+
else
|
|
191
|
+
value
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
end
|
|
196
|
+
end
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Document AI API
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
|
-
|
|
7
|
+
Contact: support@cloudmersive.com
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
9
|
Swagger Codegen version: 2.4.14
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Document AI API
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
|
-
|
|
7
|
+
Contact: support@cloudmersive.com
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
9
|
Swagger Codegen version: 2.4.14
|
|
10
10
|
|
|
@@ -18,14 +18,18 @@ module CloudmersiveDocumentaiApiClient
|
|
|
18
18
|
# Name of the field (note that spaces will be replaced with underscore)
|
|
19
19
|
attr_accessor :field_name
|
|
20
20
|
|
|
21
|
-
#
|
|
21
|
+
# Primary or first string value of the field that was extractged from the document
|
|
22
22
|
attr_accessor :field_string_value
|
|
23
23
|
|
|
24
|
+
# Additional values for this field when the same field is present with multiple values, for example, if two instances of the same form occur in the same document
|
|
25
|
+
attr_accessor :additional_field_string_values
|
|
26
|
+
|
|
24
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
28
|
def self.attribute_map
|
|
26
29
|
{
|
|
27
30
|
:'field_name' => :'FieldName',
|
|
28
|
-
:'field_string_value' => :'FieldStringValue'
|
|
31
|
+
:'field_string_value' => :'FieldStringValue',
|
|
32
|
+
:'additional_field_string_values' => :'AdditionalFieldStringValues'
|
|
29
33
|
}
|
|
30
34
|
end
|
|
31
35
|
|
|
@@ -33,7 +37,8 @@ module CloudmersiveDocumentaiApiClient
|
|
|
33
37
|
def self.swagger_types
|
|
34
38
|
{
|
|
35
39
|
:'field_name' => :'String',
|
|
36
|
-
:'field_string_value' => :'String'
|
|
40
|
+
:'field_string_value' => :'String',
|
|
41
|
+
:'additional_field_string_values' => :'Array<String>'
|
|
37
42
|
}
|
|
38
43
|
end
|
|
39
44
|
|
|
@@ -52,6 +57,12 @@ module CloudmersiveDocumentaiApiClient
|
|
|
52
57
|
if attributes.has_key?(:'FieldStringValue')
|
|
53
58
|
self.field_string_value = attributes[:'FieldStringValue']
|
|
54
59
|
end
|
|
60
|
+
|
|
61
|
+
if attributes.has_key?(:'AdditionalFieldStringValues')
|
|
62
|
+
if (value = attributes[:'AdditionalFieldStringValues']).is_a?(Array)
|
|
63
|
+
self.additional_field_string_values = value
|
|
64
|
+
end
|
|
65
|
+
end
|
|
55
66
|
end
|
|
56
67
|
|
|
57
68
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -73,7 +84,8 @@ module CloudmersiveDocumentaiApiClient
|
|
|
73
84
|
return true if self.equal?(o)
|
|
74
85
|
self.class == o.class &&
|
|
75
86
|
field_name == o.field_name &&
|
|
76
|
-
field_string_value == o.field_string_value
|
|
87
|
+
field_string_value == o.field_string_value &&
|
|
88
|
+
additional_field_string_values == o.additional_field_string_values
|
|
77
89
|
end
|
|
78
90
|
|
|
79
91
|
# @see the `==` method
|
|
@@ -85,7 +97,7 @@ module CloudmersiveDocumentaiApiClient
|
|
|
85
97
|
# Calculates hash code according to all attributes.
|
|
86
98
|
# @return [Fixnum] Hash code
|
|
87
99
|
def hash
|
|
88
|
-
[field_name, field_string_value].hash
|
|
100
|
+
[field_name, field_string_value, additional_field_string_values].hash
|
|
89
101
|
end
|
|
90
102
|
|
|
91
103
|
# Builds the object from hash
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Document AI API
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
|
-
|
|
7
|
+
Contact: support@cloudmersive.com
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
9
|
Swagger Codegen version: 2.4.14
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Document AI API
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
|
-
|
|
7
|
+
Contact: support@cloudmersive.com
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
9
|
Swagger Codegen version: 2.4.14
|
|
10
10
|
|