Class: ThePlaidApi::InvestmentsAuthGetNumbers

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

Overview

Identifying information for transferring holdings to an investments account.

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(acats: SKIP, aton: SKIP, retirement_401k: SKIP, additional_properties: nil) ⇒ InvestmentsAuthGetNumbers

Returns a new instance of InvestmentsAuthGetNumbers.



47
48
49
50
51
52
53
54
55
56
# File 'lib/the_plaid_api/models/investments_auth_get_numbers.rb', line 47

def initialize(acats: SKIP, aton: SKIP, retirement_401k: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @acats = acats unless acats == SKIP
  @aton = aton unless aton == SKIP
  @retirement_401k = retirement_401k unless retirement_401k == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#acatsArray[NumbersAcats]

TODO: Write general description for this method

Returns:



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

def acats
  @acats
end

#atonArray[NumbersAton]

TODO: Write general description for this method

Returns:



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

def aton
  @aton
end

#retirement_401kArray[NumbersRetirement401K]

TODO: Write general description for this method

Returns:



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

def retirement_401k
  @retirement_401k
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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
104
105
106
# File 'lib/the_plaid_api/models/investments_auth_get_numbers.rb', line 59

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  # Parameter is an array, so we need to iterate through it
  acats = nil
  unless hash['acats'].nil?
    acats = []
    hash['acats'].each do |structure|
      acats << (NumbersAcats.from_hash(structure) if structure)
    end
  end

  acats = SKIP unless hash.key?('acats')
  # Parameter is an array, so we need to iterate through it
  aton = nil
  unless hash['aton'].nil?
    aton = []
    hash['aton'].each do |structure|
      aton << (NumbersAton.from_hash(structure) if structure)
    end
  end

  aton = SKIP unless hash.key?('aton')
  # Parameter is an array, so we need to iterate through it
  retirement_401k = nil
  unless hash['retirement_401k'].nil?
    retirement_401k = []
    hash['retirement_401k'].each do |structure|
      retirement_401k << (NumbersRetirement401K.from_hash(structure) if structure)
    end
  end

  retirement_401k = SKIP unless hash.key?('retirement_401k')

  # 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.
  InvestmentsAuthGetNumbers.new(acats: acats,
                                aton: aton,
                                retirement_401k: retirement_401k,
                                additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['acats'] = 'acats'
  @_hash['aton'] = 'aton'
  @_hash['retirement_401k'] = 'retirement_401k'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    acats
    aton
    retirement_401k
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



116
117
118
119
120
# File 'lib/the_plaid_api/models/investments_auth_get_numbers.rb', line 116

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

#to_sObject

Provides a human-readable string representation of the object.



109
110
111
112
113
# File 'lib/the_plaid_api/models/investments_auth_get_numbers.rb', line 109

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