Class: ThePlaidApi::AssetReportUser

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

Overview

The user object allows you to provide additional information about the user to be appended to the Asset Report. All fields are optional. The ‘first_name`, `last_name`, and `ssn` fields are required if you would like the Report to be eligible for Fannie Mae’s Day 1 Certainty™ program.

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(client_user_id: SKIP, first_name: SKIP, middle_name: SKIP, last_name: SKIP, ssn: SKIP, phone_number: SKIP, email: SKIP, additional_properties: nil) ⇒ AssetReportUser

Returns a new instance of AssetReportUser.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/the_plaid_api/models/asset_report_user.rb', line 88

def initialize(client_user_id: SKIP, first_name: SKIP, middle_name: SKIP,
               last_name: SKIP, ssn: SKIP, phone_number: SKIP, email: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @client_user_id = client_user_id unless client_user_id == SKIP
  @first_name = first_name unless first_name == SKIP
  @middle_name = middle_name unless middle_name == SKIP
  @last_name = last_name unless last_name == SKIP
  @ssn = ssn unless ssn == SKIP
  @phone_number = phone_number unless phone_number == SKIP
  @email = email unless email == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#client_user_idString

An identifier you determine and submit for the user.

Returns:

  • (String)


17
18
19
# File 'lib/the_plaid_api/models/asset_report_user.rb', line 17

def client_user_id
  @client_user_id
end

#emailString

The user’s email address.

Returns:

  • (String)


47
48
49
# File 'lib/the_plaid_api/models/asset_report_user.rb', line 47

def email
  @email
end

#first_nameString

The user’s first name. Required for the Fannie Mae Day 1 Certainty™program.

Returns:

  • (String)


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

def first_name
  @first_name
end

#last_nameString

The user’s last name. Required for the Fannie Mae Day 1 Certainty™program.

Returns:

  • (String)


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

def last_name
  @last_name
end

#middle_nameString

The user’s middle name

Returns:

  • (String)


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

def middle_name
  @middle_name
end

#phone_numberString

The user’s phone number, in E.164 format: {countrycode}{number}. For example: “14151234567”. Phone numbers provided in other formats will be parsed on a best-effort basis.

Returns:

  • (String)


43
44
45
# File 'lib/the_plaid_api/models/asset_report_user.rb', line 43

def phone_number
  @phone_number
end

#ssnString

The user’s Social Security Number. Required for the Fannie Mae Day 1 Certainty™ program. Format: “ddd-dd-dddd”

Returns:

  • (String)


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

def ssn
  @ssn
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/the_plaid_api/models/asset_report_user.rb', line 105

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  client_user_id =
    hash.key?('client_user_id') ? hash['client_user_id'] : SKIP
  first_name = hash.key?('first_name') ? hash['first_name'] : SKIP
  middle_name = hash.key?('middle_name') ? hash['middle_name'] : SKIP
  last_name = hash.key?('last_name') ? hash['last_name'] : SKIP
  ssn = hash.key?('ssn') ? hash['ssn'] : SKIP
  phone_number = hash.key?('phone_number') ? hash['phone_number'] : SKIP
  email = hash.key?('email') ? hash['email'] : SKIP

  # 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.
  AssetReportUser.new(client_user_id: client_user_id,
                      first_name: first_name,
                      middle_name: middle_name,
                      last_name: last_name,
                      ssn: ssn,
                      phone_number: phone_number,
                      email: email,
                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/the_plaid_api/models/asset_report_user.rb', line 50

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_user_id'] = 'client_user_id'
  @_hash['first_name'] = 'first_name'
  @_hash['middle_name'] = 'middle_name'
  @_hash['last_name'] = 'last_name'
  @_hash['ssn'] = 'ssn'
  @_hash['phone_number'] = 'phone_number'
  @_hash['email'] = 'email'
  @_hash
end

.nullablesObject

An array for nullable fields



76
77
78
79
80
81
82
83
84
85
86
# File 'lib/the_plaid_api/models/asset_report_user.rb', line 76

def self.nullables
  %w[
    client_user_id
    first_name
    middle_name
    last_name
    ssn
    phone_number
    email
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    client_user_id
    first_name
    middle_name
    last_name
    ssn
    phone_number
    email
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



145
146
147
148
149
150
151
# File 'lib/the_plaid_api/models/asset_report_user.rb', line 145

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_user_id: #{@client_user_id.inspect}, first_name:"\
  " #{@first_name.inspect}, middle_name: #{@middle_name.inspect}, last_name:"\
  " #{@last_name.inspect}, ssn: #{@ssn.inspect}, phone_number: #{@phone_number.inspect},"\
  " email: #{@email.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



137
138
139
140
141
142
# File 'lib/the_plaid_api/models/asset_report_user.rb', line 137

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_user_id: #{@client_user_id}, first_name: #{@first_name},"\
  " middle_name: #{@middle_name}, last_name: #{@last_name}, ssn: #{@ssn}, phone_number:"\
  " #{@phone_number}, email: #{@email}, additional_properties: #{@additional_properties}>"
end