Class: ThePlaidApi::ProcessorInvestmentsAuthGetResponse

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

Overview

ProcessorInvestmentsAuthGetResponse defines the response schema for ‘/processor/investments/auth/get`

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:, holdings:, securities:, owners:, numbers:, data_sources:, request_id:, account_details_401k: SKIP, is_investments_fallback_item: SKIP, additional_properties: nil) ⇒ ProcessorInvestmentsAuthGetResponse

Returns a new instance of ProcessorInvestmentsAuthGetResponse.



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

def initialize(account:, holdings:, securities:, owners:, numbers:,
               data_sources:, request_id:, account_details_401k: SKIP,
               is_investments_fallback_item: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @account = 
  @holdings = holdings
  @securities = securities
  @owners = owners
  @numbers = numbers
  @data_sources = data_sources
  @account_details_401k =  unless  == SKIP
  unless is_investments_fallback_item == SKIP
    @is_investments_fallback_item =
      is_investments_fallback_item
  end
  @request_id = request_id
  @additional_properties = additional_properties
end

Instance Attribute Details

#accountAccount

A single account at a financial institution.

Returns:



15
16
17
# File 'lib/the_plaid_api/models/processor_investments_auth_get_response.rb', line 15

def 
  @account
end

#account_details_401kArray[InvestmentsAuthAccountDetails401K]

Additional information for accounts of 401k subtype.



42
43
44
# File 'lib/the_plaid_api/models/processor_investments_auth_get_response.rb', line 42

def 
  @account_details_401k
end

#data_sourcesInvestmentsAuthDataSources

Object with metadata pertaining to the source of data for the account numbers, owners, and holdings that are returned.



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

def data_sources
  @data_sources
end

#holdingsArray[Holding]

The holdings belonging to the investment account. Details of the securities in the holdings are provided in the ‘securities` field.

Returns:



20
21
22
# File 'lib/the_plaid_api/models/processor_investments_auth_get_response.rb', line 20

def holdings
  @holdings
end

#is_investments_fallback_itemTrueClass | FalseClass

When true, this field indicates that the Item’s portfolio was manually created with the Investments Fallback flow.

Returns:

  • (TrueClass | FalseClass)


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

def is_investments_fallback_item
  @is_investments_fallback_item
end

#numbersInvestmentsAuthGetNumbers

Identifying information for transferring holdings to an investments account.



33
34
35
# File 'lib/the_plaid_api/models/processor_investments_auth_get_response.rb', line 33

def numbers
  @numbers
end

#ownersArray[InvestmentsAuthOwner]

Information about the account owners for the account.

Returns:



28
29
30
# File 'lib/the_plaid_api/models/processor_investments_auth_get_response.rb', line 28

def owners
  @owners
end

#request_idString

A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.

Returns:

  • (String)


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

def request_id
  @request_id
end

#securitiesArray[Security]

Objects describing the securities held in the account.

Returns:



24
25
26
# File 'lib/the_plaid_api/models/processor_investments_auth_get_response.rb', line 24

def securities
  @securities
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/the_plaid_api/models/processor_investments_auth_get_response.rb', line 106

def self.from_hash(hash)
  return nil unless hash

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

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

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

  owners = nil unless hash.key?('owners')
  numbers = InvestmentsAuthGetNumbers.from_hash(hash['numbers']) if hash['numbers']
  data_sources = InvestmentsAuthDataSources.from_hash(hash['data_sources']) if
    hash['data_sources']
  request_id = hash.key?('request_id') ? hash['request_id'] : nil
  # Parameter is an array, so we need to iterate through it
   = nil
  unless hash['account_details_401k'].nil?
     = []
    hash['account_details_401k'].each do |structure|
       << (InvestmentsAuthAccountDetails401K.from_hash(structure) if structure)
    end
  end

   = SKIP unless hash.key?('account_details_401k')
  is_investments_fallback_item =
    hash.key?('is_investments_fallback_item') ? hash['is_investments_fallback_item'] : 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.
  ProcessorInvestmentsAuthGetResponse.new(account: ,
                                          holdings: holdings,
                                          securities: securities,
                                          owners: owners,
                                          numbers: numbers,
                                          data_sources: data_sources,
                                          request_id: request_id,
                                          account_details_401k: ,
                                          is_investments_fallback_item: is_investments_fallback_item,
                                          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/processor_investments_auth_get_response.rb', line 56

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account'] = 'account'
  @_hash['holdings'] = 'holdings'
  @_hash['securities'] = 'securities'
  @_hash['owners'] = 'owners'
  @_hash['numbers'] = 'numbers'
  @_hash['data_sources'] = 'data_sources'
  @_hash['account_details_401k'] = 'account_details_401k'
  @_hash['is_investments_fallback_item'] = 'is_investments_fallback_item'
  @_hash['request_id'] = 'request_id'
  @_hash
end

.nullablesObject

An array for nullable fields



79
80
81
# File 'lib/the_plaid_api/models/processor_investments_auth_get_response.rb', line 79

def self.nullables
  []
end

.optionalsObject

An array for optional fields



71
72
73
74
75
76
# File 'lib/the_plaid_api/models/processor_investments_auth_get_response.rb', line 71

def self.optionals
  %w[
    account_details_401k
    is_investments_fallback_item
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



189
190
191
192
193
194
195
196
197
# File 'lib/the_plaid_api/models/processor_investments_auth_get_response.rb', line 189

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account: #{@account.inspect}, holdings: #{@holdings.inspect}, securities:"\
  " #{@securities.inspect}, owners: #{@owners.inspect}, numbers: #{@numbers.inspect},"\
  " data_sources: #{@data_sources.inspect}, account_details_401k:"\
  " #{@account_details_401k.inspect}, is_investments_fallback_item:"\
  " #{@is_investments_fallback_item.inspect}, request_id: #{@request_id.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



179
180
181
182
183
184
185
186
# File 'lib/the_plaid_api/models/processor_investments_auth_get_response.rb', line 179

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account: #{@account}, holdings: #{@holdings}, securities: #{@securities},"\
  " owners: #{@owners}, numbers: #{@numbers}, data_sources: #{@data_sources},"\
  " account_details_401k: #{@account_details_401k}, is_investments_fallback_item:"\
  " #{@is_investments_fallback_item}, request_id: #{@request_id}, additional_properties:"\
  " #{@additional_properties}>"
end