Class: ThePlaidApi::CreditEmploymentVerification

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

Overview

The object containing proof of employment data for an individual.

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(account_id:, status:, start_date:, end_date:, employer:, title:, platform_ids:, employee_type:, last_paystub_date:, additional_properties: nil) ⇒ CreditEmploymentVerification

Returns a new instance of CreditEmploymentVerification.



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

def initialize(account_id:, status:, start_date:, end_date:, employer:,
               title:, platform_ids:, employee_type:, last_paystub_date:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @account_id = 
  @status = status
  @start_date = start_date
  @end_date = end_date
  @employer = employer
  @title = title
  @platform_ids = platform_ids
  @employee_type = employee_type
  @last_paystub_date = last_paystub_date
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_idString

ID of the payroll provider account.

Returns:

  • (String)


14
15
16
# File 'lib/the_plaid_api/models/credit_employment_verification.rb', line 14

def 
  @account_id
end

#employee_typeString

The type of employment for the individual. ‘“FULL_TIME”`: A full-time employee. `“PART_TIME”`: A part-time employee. `“CONTRACTOR”`: An employee typically hired externally through a contracting group. `“TEMPORARY”`: A temporary employee. `“OTHER”`: The employee type is not one of the above defined types.

Returns:

  • (String)


48
49
50
# File 'lib/the_plaid_api/models/credit_employment_verification.rb', line 48

def employee_type
  @employee_type
end

#employerCreditEmployerVerification

An object containing employer data.



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

def employer
  @employer
end

#end_dateDate

End of employment, if applicable. Provided in ISO 8601 format (YYY-MM-DD).

Returns:

  • (Date)


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

def end_date
  @end_date
end

#last_paystub_dateDate

The date of the employee’s most recent paystub in ISO 8601 format (YYYY-MM-DD).

Returns:

  • (Date)


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

def last_paystub_date
  @last_paystub_date
end

#platform_idsCreditPlatformIds

The object containing a set of ids related to an employee.

Returns:



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

def platform_ids
  @platform_ids
end

#start_dateDate

Start of employment in ISO 8601 format (YYYY-MM-DD).

Returns:

  • (Date)


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

def start_date
  @start_date
end

#statusString

Current employment status.

Returns:

  • (String)


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

def status
  @status
end

#titleString

Current title of employee.

Returns:

  • (String)


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

def title
  @title
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
135
136
137
138
139
140
# File 'lib/the_plaid_api/models/credit_employment_verification.rb', line 107

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('account_id') ? hash['account_id'] : nil
  status = hash.key?('status') ? hash['status'] : nil
  start_date = hash.key?('start_date') ? hash['start_date'] : nil
  end_date = hash.key?('end_date') ? hash['end_date'] : nil
  employer = CreditEmployerVerification.from_hash(hash['employer']) if hash['employer']
  title = hash.key?('title') ? hash['title'] : nil
  platform_ids = CreditPlatformIds.from_hash(hash['platform_ids']) if hash['platform_ids']
  employee_type = hash.key?('employee_type') ? hash['employee_type'] : nil
  last_paystub_date =
    hash.key?('last_paystub_date') ? hash['last_paystub_date'] : 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.
  CreditEmploymentVerification.new(account_id: ,
                                   status: status,
                                   start_date: start_date,
                                   end_date: end_date,
                                   employer: employer,
                                   title: title,
                                   platform_ids: platform_ids,
                                   employee_type: employee_type,
                                   last_paystub_date: last_paystub_date,
                                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/the_plaid_api/models/credit_employment_verification.rb', line 56

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_id'] = 'account_id'
  @_hash['status'] = 'status'
  @_hash['start_date'] = 'start_date'
  @_hash['end_date'] = 'end_date'
  @_hash['employer'] = 'employer'
  @_hash['title'] = 'title'
  @_hash['platform_ids'] = 'platform_ids'
  @_hash['employee_type'] = 'employee_type'
  @_hash['last_paystub_date'] = 'last_paystub_date'
  @_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/credit_employment_verification.rb', line 76

def self.nullables
  %w[
    account_id
    status
    start_date
    end_date
    title
    employee_type
    last_paystub_date
  ]
end

.optionalsObject

An array for optional fields



71
72
73
# File 'lib/the_plaid_api/models/credit_employment_verification.rb', line 71

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



152
153
154
155
156
157
158
159
# File 'lib/the_plaid_api/models/credit_employment_verification.rb', line 152

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id.inspect}, status: #{@status.inspect}, start_date:"\
  " #{@start_date.inspect}, end_date: #{@end_date.inspect}, employer: #{@employer.inspect},"\
  " title: #{@title.inspect}, platform_ids: #{@platform_ids.inspect}, employee_type:"\
  " #{@employee_type.inspect}, last_paystub_date: #{@last_paystub_date.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



143
144
145
146
147
148
149
# File 'lib/the_plaid_api/models/credit_employment_verification.rb', line 143

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id}, status: #{@status}, start_date: #{@start_date},"\
  " end_date: #{@end_date}, employer: #{@employer}, title: #{@title}, platform_ids:"\
  " #{@platform_ids}, employee_type: #{@employee_type}, last_paystub_date:"\
  " #{@last_paystub_date}, additional_properties: #{@additional_properties}>"
end