Class: ThePlaidApi::UserAccountIdentityEditHistory

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

Overview

Statistics tracking the number of edits made to identity fields over various time periods.

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: SKIP, address: SKIP, email: SKIP, date_of_birth: SKIP, official_document: SKIP, additional_properties: nil) ⇒ UserAccountIdentityEditHistory

Returns a new instance of UserAccountIdentityEditHistory.



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

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

  @name = name unless name == SKIP
  @address = address unless address == SKIP
  @email = email unless email == SKIP
  @date_of_birth = date_of_birth unless date_of_birth == SKIP
  @official_document = official_document unless official_document == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#addressUserAccountIdentityEditCounts

Edit counts over various time periods.



19
20
21
# File 'lib/the_plaid_api/models/user_account_identity_edit_history.rb', line 19

def address
  @address
end

#date_of_birthUserAccountIdentityEditCounts

Edit counts over various time periods.



27
28
29
# File 'lib/the_plaid_api/models/user_account_identity_edit_history.rb', line 27

def date_of_birth
  @date_of_birth
end

#emailUserAccountIdentityEditCounts

Edit counts over various time periods.



23
24
25
# File 'lib/the_plaid_api/models/user_account_identity_edit_history.rb', line 23

def email
  @email
end

#nameUserAccountIdentityEditCounts

Edit counts over various time periods.



15
16
17
# File 'lib/the_plaid_api/models/user_account_identity_edit_history.rb', line 15

def name
  @name
end

#official_documentUserAccountIdentityOfficialDocument

Official identity document edit statistics.



31
32
33
# File 'lib/the_plaid_api/models/user_account_identity_edit_history.rb', line 31

def official_document
  @official_document
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



76
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
# File 'lib/the_plaid_api/models/user_account_identity_edit_history.rb', line 76

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = UserAccountIdentityEditCounts.from_hash(hash['name']) if hash['name']
  address = UserAccountIdentityEditCounts.from_hash(hash['address']) if hash['address']
  email = UserAccountIdentityEditCounts.from_hash(hash['email']) if hash['email']
  date_of_birth = UserAccountIdentityEditCounts.from_hash(hash['date_of_birth']) if
    hash['date_of_birth']
  if hash['official_document']
    official_document = UserAccountIdentityOfficialDocument.from_hash(hash['official_document'])
  end

  # 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.
  UserAccountIdentityEditHistory.new(name: name,
                                     address: address,
                                     email: email,
                                     date_of_birth: date_of_birth,
                                     official_document: official_document,
                                     additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



34
35
36
37
38
39
40
41
42
# File 'lib/the_plaid_api/models/user_account_identity_edit_history.rb', line 34

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['address'] = 'address'
  @_hash['email'] = 'email'
  @_hash['date_of_birth'] = 'date_of_birth'
  @_hash['official_document'] = 'official_document'
  @_hash
end

.nullablesObject

An array for nullable fields



56
57
58
59
60
# File 'lib/the_plaid_api/models/user_account_identity_edit_history.rb', line 56

def self.nullables
  %w[
    official_document
  ]
end

.optionalsObject

An array for optional fields



45
46
47
48
49
50
51
52
53
# File 'lib/the_plaid_api/models/user_account_identity_edit_history.rb', line 45

def self.optionals
  %w[
    name
    address
    email
    date_of_birth
    official_document
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



114
115
116
117
118
119
# File 'lib/the_plaid_api/models/user_account_identity_edit_history.rb', line 114

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

#to_sObject

Provides a human-readable string representation of the object.



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

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