Class: ThePlaidApi::LinkTokenCreateRequestIncomeVerificationBankIncome

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

Overview

Specifies options for initializing Link for use with Bank Income. This field is required if ‘income_verification` is included in the `products` array and `bank` is specified in `income_source_types`.

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(days_requested:, enable_multiple_items: false, additional_properties: nil) ⇒ LinkTokenCreateRequestIncomeVerificationBankIncome

Returns a new instance of LinkTokenCreateRequestIncomeVerificationBankIncome.



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

def initialize(days_requested:, enable_multiple_items: false,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @days_requested = days_requested
  @enable_multiple_items = enable_multiple_items unless enable_multiple_items == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#days_requestedInteger

The number of days of data to request for the Bank Income product

Returns:

  • (Integer)


16
17
18
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification_bank_income.rb', line 16

def days_requested
  @days_requested
end

#enable_multiple_itemsTrueClass | FalseClass

Whether to enable multiple Items to be added in the Link session. This setting is deprecated and has been replaced by the more general ‘enable_multi_item_link` setting, which supports all products.

Returns:

  • (TrueClass | FalseClass)


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

def enable_multiple_items
  @enable_multiple_items
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification_bank_income.rb', line 57

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  days_requested =
    hash.key?('days_requested') ? hash['days_requested'] : nil
  enable_multiple_items = hash['enable_multiple_items'] ||= false

  # 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.
  LinkTokenCreateRequestIncomeVerificationBankIncome.new(days_requested: days_requested,
                                                         enable_multiple_items: enable_multiple_items,
                                                         additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification_bank_income.rb', line 25

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['days_requested'] = 'days_requested'
  @_hash['enable_multiple_items'] = 'enable_multiple_items'
  @_hash
end

.nullablesObject

An array for nullable fields



40
41
42
43
44
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification_bank_income.rb', line 40

def self.nullables
  %w[
    enable_multiple_items
  ]
end

.optionalsObject

An array for optional fields



33
34
35
36
37
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification_bank_income.rb', line 33

def self.optionals
  %w[
    enable_multiple_items
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



86
87
88
89
90
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification_bank_income.rb', line 86

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

#to_sObject

Provides a human-readable string representation of the object.



79
80
81
82
83
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification_bank_income.rb', line 79

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