Class: ThePlaidApi::PhysicalDocumentExtractedDataAnalysis

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/physical_document_extracted_data_analysis.rb

Overview

Analysis of the data extracted from the submitted document.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(name:, date_of_birth:, expiration_date:, issuing_country:, additional_properties: nil) ⇒ PhysicalDocumentExtractedDataAnalysis

Returns a new instance of PhysicalDocumentExtractedDataAnalysis.



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/the_plaid_api/models/physical_document_extracted_data_analysis.rb', line 59

def initialize(name:, date_of_birth:, expiration_date:, issuing_country:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @name = name
  @date_of_birth = date_of_birth
  @expiration_date = expiration_date
  @issuing_country = issuing_country
  @additional_properties = additional_properties
end

Instance Attribute Details

#date_of_birthDocumentDateOfBirthMatchCode

A match summary describing the cross comparison between the subject’s date of birth, extracted from the document image, and the date of birth they separately provided to the identity verification attempt.



22
23
24
# File 'lib/the_plaid_api/models/physical_document_extracted_data_analysis.rb', line 22

def date_of_birth
  @date_of_birth
end

#expiration_dateExpirationDate

A description of whether the associated document was expired when the verification was performed. Note: In the case where an expiration date is not present on the document or failed to be extracted, this value will be ‘no_data`.

Returns:



29
30
31
# File 'lib/the_plaid_api/models/physical_document_extracted_data_analysis.rb', line 29

def expiration_date
  @expiration_date
end

#issuing_countryIssuingCountry

A binary match indicator specifying whether the country that issued the provided document matches the country that the user separately provided to Plaid. Note: You can configure whether a ‘no_match` on `issuing_country` fails the `documentary_verification` by editing your Plaid Template.

Returns:



37
38
39
# File 'lib/the_plaid_api/models/physical_document_extracted_data_analysis.rb', line 37

def issuing_country
  @issuing_country
end

#nameDocumentNameMatchCode

A match summary describing the cross comparison between the subject’s name, extracted from the document image, and the name they separately provided to identity verification attempt.



16
17
18
# File 'lib/the_plaid_api/models/physical_document_extracted_data_analysis.rb', line 16

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/the_plaid_api/models/physical_document_extracted_data_analysis.rb', line 72

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : nil
  date_of_birth = hash.key?('date_of_birth') ? hash['date_of_birth'] : nil
  expiration_date =
    hash.key?('expiration_date') ? hash['expiration_date'] : nil
  issuing_country =
    hash.key?('issuing_country') ? hash['issuing_country'] : nil

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  PhysicalDocumentExtractedDataAnalysis.new(name: name,
                                            date_of_birth: date_of_birth,
                                            expiration_date: expiration_date,
                                            issuing_country: issuing_country,
                                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



40
41
42
43
44
45
46
47
# File 'lib/the_plaid_api/models/physical_document_extracted_data_analysis.rb', line 40

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['date_of_birth'] = 'date_of_birth'
  @_hash['expiration_date'] = 'expiration_date'
  @_hash['issuing_country'] = 'issuing_country'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/the_plaid_api/models/physical_document_extracted_data_analysis.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



50
51
52
# File 'lib/the_plaid_api/models/physical_document_extracted_data_analysis.rb', line 50

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



107
108
109
110
111
112
# File 'lib/the_plaid_api/models/physical_document_extracted_data_analysis.rb', line 107

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name.inspect}, date_of_birth: #{@date_of_birth.inspect},"\
  " expiration_date: #{@expiration_date.inspect}, issuing_country:"\
  " #{@issuing_country.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



99
100
101
102
103
104
# File 'lib/the_plaid_api/models/physical_document_extracted_data_analysis.rb', line 99

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name}, date_of_birth: #{@date_of_birth}, expiration_date:"\
  " #{@expiration_date}, issuing_country: #{@issuing_country}, additional_properties:"\
  " #{@additional_properties}>"
end