Class: ThePlaidApi::KycCheckDetails

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

Overview

Additional information for the ‘kyc_check` (Data Source Verification) step. This field will be `null` unless `steps.kyc_check` has reached a terminal state of either `success` or `failed`.

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(status:, address:, name:, date_of_birth:, id_number:, phone_number:, additional_properties: nil) ⇒ KycCheckDetails

Returns a new instance of KycCheckDetails.



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/the_plaid_api/models/kyc_check_details.rb', line 62

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

  @status = status
  @address = address
  @name = name
  @date_of_birth = date_of_birth
  @id_number = id_number
  @phone_number = phone_number
  @additional_properties = additional_properties
end

Instance Attribute Details

#addressKycCheckAddressSummary

Result summary object specifying how the ‘address` field matched.



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

def address
  @address
end

#date_of_birthKycCheckDateOfBirthSummary

Result summary object specifying how the ‘date_of_birth` field matched.



30
31
32
# File 'lib/the_plaid_api/models/kyc_check_details.rb', line 30

def date_of_birth
  @date_of_birth
end

#id_numberKycCheckIdNumberSummary

Result summary object specifying how the ‘id_number` field matched.



34
35
36
# File 'lib/the_plaid_api/models/kyc_check_details.rb', line 34

def id_number
  @id_number
end

#nameKycCheckNameSummary

Result summary object specifying how the ‘name` field matched.

Returns:



26
27
28
# File 'lib/the_plaid_api/models/kyc_check_details.rb', line 26

def name
  @name
end

#phone_numberKycCheckPhoneSummary

Result summary object specifying how the ‘phone` field matched.



38
39
40
# File 'lib/the_plaid_api/models/kyc_check_details.rb', line 38

def phone_number
  @phone_number
end

#statusString

The outcome status for the associated Identity Verification attempt’s ‘kyc_check` step. This field will always have the same value as `steps.kyc_check`.

Returns:

  • (String)


18
19
20
# File 'lib/the_plaid_api/models/kyc_check_details.rb', line 18

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/the_plaid_api/models/kyc_check_details.rb', line 77

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  status = hash.key?('status') ? hash['status'] : nil
  address = KycCheckAddressSummary.from_hash(hash['address']) if hash['address']
  name = KycCheckNameSummary.from_hash(hash['name']) if hash['name']
  date_of_birth = KycCheckDateOfBirthSummary.from_hash(hash['date_of_birth']) if
    hash['date_of_birth']
  id_number = KycCheckIdNumberSummary.from_hash(hash['id_number']) if hash['id_number']
  phone_number = KycCheckPhoneSummary.from_hash(hash['phone_number']) if hash['phone_number']

  # 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.
  KycCheckDetails.new(status: status,
                      address: address,
                      name: name,
                      date_of_birth: date_of_birth,
                      id_number: id_number,
                      phone_number: phone_number,
                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



41
42
43
44
45
46
47
48
49
50
# File 'lib/the_plaid_api/models/kyc_check_details.rb', line 41

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['status'] = 'status'
  @_hash['address'] = 'address'
  @_hash['name'] = 'name'
  @_hash['date_of_birth'] = 'date_of_birth'
  @_hash['id_number'] = 'id_number'
  @_hash['phone_number'] = 'phone_number'
  @_hash
end

.nullablesObject

An array for nullable fields



58
59
60
# File 'lib/the_plaid_api/models/kyc_check_details.rb', line 58

def self.nullables
  []
end

.optionalsObject

An array for optional fields



53
54
55
# File 'lib/the_plaid_api/models/kyc_check_details.rb', line 53

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



115
116
117
118
119
120
121
# File 'lib/the_plaid_api/models/kyc_check_details.rb', line 115

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

#to_sObject

Provides a human-readable string representation of the object.



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

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