Class: OCI::AiDocument::Models::AnalyzeDocumentResult
- Inherits:
-
Object
- Object
- OCI::AiDocument::Models::AnalyzeDocumentResult
- Defined in:
- lib/oci/ai_document/models/analyze_document_result.rb
Overview
The document analysis results.
Instance Attribute Summary collapse
-
#bar_code_extraction_model_version ⇒ String
The document bar code extraction model version.
-
#detected_document_types ⇒ Array<OCI::AiDocument::Models::DetectedDocumentType>
An array of detected document types.
-
#detected_languages ⇒ Array<OCI::AiDocument::Models::DetectedLanguage>
An array of detected languages.
-
#document_classification_model_version ⇒ String
The document classification model version.
-
#document_metadata ⇒ OCI::AiDocument::Models::DocumentMetadata
This attribute is required.
-
#errors ⇒ Array<OCI::AiDocument::Models::ProcessingError>
The errors encountered during document analysis.
-
#key_value_extraction_model_version ⇒ String
The document keyValue extraction model version.
-
#language_classification_model_version ⇒ String
The document language classification model version.
-
#pages ⇒ Array<OCI::AiDocument::Models::Page>
[Required] The array of a Page.
-
#searchable_pdf ⇒ String
The searchable PDF file that was generated.
-
#signature_extraction_model_version ⇒ String
The document signature extraction model version.
-
#table_extraction_model_version ⇒ String
The document table extraction model version.
-
#text_extraction_model_version ⇒ String
The document text extraction model version.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ AnalyzeDocumentResult
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ AnalyzeDocumentResult
Initializes the object
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 124 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self. = attributes[:'documentMetadata'] if attributes[:'documentMetadata'] raise 'You cannot provide both :documentMetadata and :document_metadata' if attributes.key?(:'documentMetadata') && attributes.key?(:'document_metadata') self. = attributes[:'document_metadata'] if attributes[:'document_metadata'] self.pages = attributes[:'pages'] if attributes[:'pages'] self.detected_document_types = attributes[:'detectedDocumentTypes'] if attributes[:'detectedDocumentTypes'] raise 'You cannot provide both :detectedDocumentTypes and :detected_document_types' if attributes.key?(:'detectedDocumentTypes') && attributes.key?(:'detected_document_types') self.detected_document_types = attributes[:'detected_document_types'] if attributes[:'detected_document_types'] self.detected_languages = attributes[:'detectedLanguages'] if attributes[:'detectedLanguages'] raise 'You cannot provide both :detectedLanguages and :detected_languages' if attributes.key?(:'detectedLanguages') && attributes.key?(:'detected_languages') self.detected_languages = attributes[:'detected_languages'] if attributes[:'detected_languages'] self.document_classification_model_version = attributes[:'documentClassificationModelVersion'] if attributes[:'documentClassificationModelVersion'] raise 'You cannot provide both :documentClassificationModelVersion and :document_classification_model_version' if attributes.key?(:'documentClassificationModelVersion') && attributes.key?(:'document_classification_model_version') self.document_classification_model_version = attributes[:'document_classification_model_version'] if attributes[:'document_classification_model_version'] self.language_classification_model_version = attributes[:'languageClassificationModelVersion'] if attributes[:'languageClassificationModelVersion'] raise 'You cannot provide both :languageClassificationModelVersion and :language_classification_model_version' if attributes.key?(:'languageClassificationModelVersion') && attributes.key?(:'language_classification_model_version') self.language_classification_model_version = attributes[:'language_classification_model_version'] if attributes[:'language_classification_model_version'] self.text_extraction_model_version = attributes[:'textExtractionModelVersion'] if attributes[:'textExtractionModelVersion'] raise 'You cannot provide both :textExtractionModelVersion and :text_extraction_model_version' if attributes.key?(:'textExtractionModelVersion') && attributes.key?(:'text_extraction_model_version') self.text_extraction_model_version = attributes[:'text_extraction_model_version'] if attributes[:'text_extraction_model_version'] self.key_value_extraction_model_version = attributes[:'keyValueExtractionModelVersion'] if attributes[:'keyValueExtractionModelVersion'] raise 'You cannot provide both :keyValueExtractionModelVersion and :key_value_extraction_model_version' if attributes.key?(:'keyValueExtractionModelVersion') && attributes.key?(:'key_value_extraction_model_version') self.key_value_extraction_model_version = attributes[:'key_value_extraction_model_version'] if attributes[:'key_value_extraction_model_version'] self.table_extraction_model_version = attributes[:'tableExtractionModelVersion'] if attributes[:'tableExtractionModelVersion'] raise 'You cannot provide both :tableExtractionModelVersion and :table_extraction_model_version' if attributes.key?(:'tableExtractionModelVersion') && attributes.key?(:'table_extraction_model_version') self.table_extraction_model_version = attributes[:'table_extraction_model_version'] if attributes[:'table_extraction_model_version'] self.signature_extraction_model_version = attributes[:'signatureExtractionModelVersion'] if attributes[:'signatureExtractionModelVersion'] raise 'You cannot provide both :signatureExtractionModelVersion and :signature_extraction_model_version' if attributes.key?(:'signatureExtractionModelVersion') && attributes.key?(:'signature_extraction_model_version') self.signature_extraction_model_version = attributes[:'signature_extraction_model_version'] if attributes[:'signature_extraction_model_version'] self. = attributes[:'barCodeExtractionModelVersion'] if attributes[:'barCodeExtractionModelVersion'] raise 'You cannot provide both :barCodeExtractionModelVersion and :bar_code_extraction_model_version' if attributes.key?(:'barCodeExtractionModelVersion') && attributes.key?(:'bar_code_extraction_model_version') self. = attributes[:'bar_code_extraction_model_version'] if attributes[:'bar_code_extraction_model_version'] self.errors = attributes[:'errors'] if attributes[:'errors'] self.searchable_pdf = attributes[:'searchablePdf'] if attributes[:'searchablePdf'] raise 'You cannot provide both :searchablePdf and :searchable_pdf' if attributes.key?(:'searchablePdf') && attributes.key?(:'searchable_pdf') self.searchable_pdf = attributes[:'searchable_pdf'] if attributes[:'searchable_pdf'] end |
Instance Attribute Details
#bar_code_extraction_model_version ⇒ String
The document bar code extraction model version.
53 54 55 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 53 def @bar_code_extraction_model_version end |
#detected_document_types ⇒ Array<OCI::AiDocument::Models::DetectedDocumentType>
An array of detected document types.
21 22 23 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 21 def detected_document_types @detected_document_types end |
#detected_languages ⇒ Array<OCI::AiDocument::Models::DetectedLanguage>
An array of detected languages.
25 26 27 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 25 def detected_languages @detected_languages end |
#document_classification_model_version ⇒ String
The document classification model version.
29 30 31 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 29 def document_classification_model_version @document_classification_model_version end |
#document_metadata ⇒ OCI::AiDocument::Models::DocumentMetadata
This attribute is required.
13 14 15 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 13 def @document_metadata end |
#errors ⇒ Array<OCI::AiDocument::Models::ProcessingError>
The errors encountered during document analysis.
57 58 59 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 57 def errors @errors end |
#key_value_extraction_model_version ⇒ String
The document keyValue extraction model version.
41 42 43 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 41 def key_value_extraction_model_version @key_value_extraction_model_version end |
#language_classification_model_version ⇒ String
The document language classification model version.
33 34 35 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 33 def language_classification_model_version @language_classification_model_version end |
#pages ⇒ Array<OCI::AiDocument::Models::Page>
[Required] The array of a Page.
17 18 19 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 17 def pages @pages end |
#searchable_pdf ⇒ String
The searchable PDF file that was generated.
61 62 63 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 61 def searchable_pdf @searchable_pdf end |
#signature_extraction_model_version ⇒ String
The document signature extraction model version.
49 50 51 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 49 def signature_extraction_model_version @signature_extraction_model_version end |
#table_extraction_model_version ⇒ String
The document table extraction model version.
45 46 47 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 45 def table_extraction_model_version @table_extraction_model_version end |
#text_extraction_model_version ⇒ String
The document text extraction model version.
37 38 39 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 37 def text_extraction_model_version @text_extraction_model_version end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 64 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'document_metadata': :'documentMetadata', 'pages': :'pages', 'detected_document_types': :'detectedDocumentTypes', 'detected_languages': :'detectedLanguages', 'document_classification_model_version': :'documentClassificationModelVersion', 'language_classification_model_version': :'languageClassificationModelVersion', 'text_extraction_model_version': :'textExtractionModelVersion', 'key_value_extraction_model_version': :'keyValueExtractionModelVersion', 'table_extraction_model_version': :'tableExtractionModelVersion', 'signature_extraction_model_version': :'signatureExtractionModelVersion', 'bar_code_extraction_model_version': :'barCodeExtractionModelVersion', 'errors': :'errors', 'searchable_pdf': :'searchablePdf' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 85 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'document_metadata': :'OCI::AiDocument::Models::DocumentMetadata', 'pages': :'Array<OCI::AiDocument::Models::Page>', 'detected_document_types': :'Array<OCI::AiDocument::Models::DetectedDocumentType>', 'detected_languages': :'Array<OCI::AiDocument::Models::DetectedLanguage>', 'document_classification_model_version': :'String', 'language_classification_model_version': :'String', 'text_extraction_model_version': :'String', 'key_value_extraction_model_version': :'String', 'table_extraction_model_version': :'String', 'signature_extraction_model_version': :'String', 'bar_code_extraction_model_version': :'String', 'errors': :'Array<OCI::AiDocument::Models::ProcessingError>', 'searchable_pdf': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 208 def ==(other) return true if equal?(other) self.class == other.class && == other. && pages == other.pages && detected_document_types == other.detected_document_types && detected_languages == other.detected_languages && document_classification_model_version == other.document_classification_model_version && language_classification_model_version == other.language_classification_model_version && text_extraction_model_version == other.text_extraction_model_version && key_value_extraction_model_version == other.key_value_extraction_model_version && table_extraction_model_version == other.table_extraction_model_version && signature_extraction_model_version == other.signature_extraction_model_version && == other. && errors == other.errors && searchable_pdf == other.searchable_pdf end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 250 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
230 231 232 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 230 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
239 240 241 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 239 def hash [, pages, detected_document_types, detected_languages, document_classification_model_version, language_classification_model_version, text_extraction_model_version, key_value_extraction_model_version, table_extraction_model_version, signature_extraction_model_version, , errors, searchable_pdf].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
283 284 285 286 287 288 289 290 291 292 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 283 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
277 278 279 |
# File 'lib/oci/ai_document/models/analyze_document_result.rb', line 277 def to_s to_hash.to_s end |