Class: ThePlaidApi::LinkTokenCreateRequestUserStatedIncomeSource

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

Overview

Specifies user stated income sources for the Income product

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(employer: SKIP, category: SKIP, pay_per_cycle: SKIP, pay_annual: SKIP, pay_type: SKIP, pay_frequency: SKIP, additional_properties: nil) ⇒ LinkTokenCreateRequestUserStatedIncomeSource

Returns a new instance of LinkTokenCreateRequestUserStatedIncomeSource.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/the_plaid_api/models/link_token_create_request_user_stated_income_source.rb', line 65

def initialize(employer: SKIP, category: SKIP, pay_per_cycle: SKIP,
               pay_annual: SKIP, pay_type: SKIP, pay_frequency: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @employer = employer unless employer == SKIP
  @category = category unless category == SKIP
  @pay_per_cycle = pay_per_cycle unless pay_per_cycle == SKIP
  @pay_annual = pay_annual unless pay_annual == SKIP
  @pay_type = pay_type unless pay_type == SKIP
  @pay_frequency = pay_frequency unless pay_frequency == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#categoryUserStatedIncomeSourceCategory

The income category for a specified income source



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

def category
  @category
end

#employerString

The employer corresponding to an income source specified by the user

Returns:

  • (String)


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

def employer
  @employer
end

#pay_annualFloat

The income amount paid annually for a specified income source

Returns:

  • (Float)


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

def pay_annual
  @pay_annual
end

#pay_frequencyUserStatedIncomeSourceFrequency

The pay frequency of a specified income source



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

def pay_frequency
  @pay_frequency
end

#pay_per_cycleFloat

The income amount paid per cycle for a specified income source

Returns:

  • (Float)


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

def pay_per_cycle
  @pay_per_cycle
end

#pay_typeUserStatedIncomeSourcePayType

The pay type - ‘GROSS`, `NET`, or `UNKNOWN` for a specified income source



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

def pay_type
  @pay_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/the_plaid_api/models/link_token_create_request_user_stated_income_source.rb', line 81

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  employer = hash.key?('employer') ? hash['employer'] : SKIP
  category = hash.key?('category') ? hash['category'] : SKIP
  pay_per_cycle = hash.key?('pay_per_cycle') ? hash['pay_per_cycle'] : SKIP
  pay_annual = hash.key?('pay_annual') ? hash['pay_annual'] : SKIP
  pay_type = hash.key?('pay_type') ? hash['pay_type'] : SKIP
  pay_frequency = hash.key?('pay_frequency') ? hash['pay_frequency'] : 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.
  LinkTokenCreateRequestUserStatedIncomeSource.new(employer: employer,
                                                   category: category,
                                                   pay_per_cycle: pay_per_cycle,
                                                   pay_annual: pay_annual,
                                                   pay_type: pay_type,
                                                   pay_frequency: pay_frequency,
                                                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
46
# File 'lib/the_plaid_api/models/link_token_create_request_user_stated_income_source.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['employer'] = 'employer'
  @_hash['category'] = 'category'
  @_hash['pay_per_cycle'] = 'pay_per_cycle'
  @_hash['pay_annual'] = 'pay_annual'
  @_hash['pay_type'] = 'pay_type'
  @_hash['pay_frequency'] = 'pay_frequency'
  @_hash
end

.nullablesObject

An array for nullable fields



61
62
63
# File 'lib/the_plaid_api/models/link_token_create_request_user_stated_income_source.rb', line 61

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    employer
    category
    pay_per_cycle
    pay_annual
    pay_type
    pay_frequency
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



118
119
120
121
122
123
124
# File 'lib/the_plaid_api/models/link_token_create_request_user_stated_income_source.rb', line 118

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} employer: #{@employer.inspect}, category: #{@category.inspect},"\
  " pay_per_cycle: #{@pay_per_cycle.inspect}, pay_annual: #{@pay_annual.inspect}, pay_type:"\
  " #{@pay_type.inspect}, pay_frequency: #{@pay_frequency.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



110
111
112
113
114
115
# File 'lib/the_plaid_api/models/link_token_create_request_user_stated_income_source.rb', line 110

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} employer: #{@employer}, category: #{@category}, pay_per_cycle:"\
  " #{@pay_per_cycle}, pay_annual: #{@pay_annual}, pay_type: #{@pay_type}, pay_frequency:"\
  " #{@pay_frequency}, additional_properties: #{@additional_properties}>"
end