Class: ThePlaidApi::AssetDetail

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

Overview

Details about an asset.

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(asset_unique_identifier:, asset_account_identifier:, asset_as_of_date:, asset_description:, asset_available_balance_amount:, asset_current_balance_amount:, asset_type:, asset_type_additional_description:, asset_days_requested_count:, asset_ownership_type:, asset_holding_balance_amount: SKIP, asset_holding_balance_net_margin_amount: SKIP, asset_bonds_balance_amount: SKIP, asset_stocks_balance_amount: SKIP, asset_crypto_balance_amount: SKIP, asset_other_balance_amount: SKIP, asset_margin_amount_balance: SKIP, asset_available_cash_balance_amount: SKIP, asset_cash_balance_amount: SKIP, asset_retirement_indicator: SKIP, asset_employer_sponsored_indicator: SKIP, additional_properties: nil) ⇒ AssetDetail

Returns a new instance of AssetDetail.



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/the_plaid_api/models/asset_detail.rb', line 180

def initialize(asset_unique_identifier:, asset_account_identifier:,
               asset_as_of_date:, asset_description:,
               asset_available_balance_amount:,
               asset_current_balance_amount:, asset_type:,
               asset_type_additional_description:,
               asset_days_requested_count:, asset_ownership_type:,
               asset_holding_balance_amount: SKIP,
               asset_holding_balance_net_margin_amount: SKIP,
               asset_bonds_balance_amount: SKIP,
               asset_stocks_balance_amount: SKIP,
               asset_crypto_balance_amount: SKIP,
               asset_other_balance_amount: SKIP,
               asset_margin_amount_balance: SKIP,
               asset_available_cash_balance_amount: SKIP,
               asset_cash_balance_amount: SKIP,
               asset_retirement_indicator: SKIP,
               asset_employer_sponsored_indicator: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @asset_unique_identifier = asset_unique_identifier
  @asset_account_identifier = 
  @asset_as_of_date = asset_as_of_date
  @asset_description = asset_description
  @asset_available_balance_amount = asset_available_balance_amount
  @asset_current_balance_amount = asset_current_balance_amount
  unless asset_holding_balance_amount == SKIP
    @asset_holding_balance_amount =
      asset_holding_balance_amount
  end
  unless asset_holding_balance_net_margin_amount == SKIP
    @asset_holding_balance_net_margin_amount =
      asset_holding_balance_net_margin_amount
  end
  unless asset_bonds_balance_amount == SKIP
    @asset_bonds_balance_amount =
      asset_bonds_balance_amount
  end
  unless asset_stocks_balance_amount == SKIP
    @asset_stocks_balance_amount =
      asset_stocks_balance_amount
  end
  unless asset_crypto_balance_amount == SKIP
    @asset_crypto_balance_amount =
      asset_crypto_balance_amount
  end
  unless asset_other_balance_amount == SKIP
    @asset_other_balance_amount =
      asset_other_balance_amount
  end
  unless asset_margin_amount_balance == SKIP
    @asset_margin_amount_balance =
      asset_margin_amount_balance
  end
  unless asset_available_cash_balance_amount == SKIP
    @asset_available_cash_balance_amount =
      asset_available_cash_balance_amount
  end
  unless asset_cash_balance_amount == SKIP
    @asset_cash_balance_amount =
      asset_cash_balance_amount
  end
  @asset_type = asset_type
  @asset_type_additional_description = asset_type_additional_description
  @asset_days_requested_count = asset_days_requested_count
  @asset_ownership_type = asset_ownership_type
  unless asset_retirement_indicator == SKIP
    @asset_retirement_indicator =
      asset_retirement_indicator
  end
  unless asset_employer_sponsored_indicator == SKIP
    @asset_employer_sponsored_indicator =
      asset_employer_sponsored_indicator
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#asset_account_identifierString

A unique alphanumeric string identifying an asset.

Returns:

  • (String)


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

def 
  @asset_account_identifier
end

#asset_as_of_dateString

Account Report As of Date / Create Date. Format YYYY-MM-DD

Returns:

  • (String)


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

def asset_as_of_date
  @asset_as_of_date
end

#asset_available_balance_amountFloat

Asset Account Available Balance.

Returns:

  • (Float)


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

def asset_available_balance_amount
  @asset_available_balance_amount
end

#asset_available_cash_balance_amountFloat

amount available for cash withdrawal

Returns:

  • (Float)


72
73
74
# File 'lib/the_plaid_api/models/asset_detail.rb', line 72

def asset_available_cash_balance_amount
  @asset_available_cash_balance_amount
end

#asset_bonds_balance_amountFloat

Total market value of all bonds held (non-restricted, vested)

Returns:

  • (Float)


51
52
53
# File 'lib/the_plaid_api/models/asset_detail.rb', line 51

def asset_bonds_balance_amount
  @asset_bonds_balance_amount
end

#asset_cash_balance_amountFloat

cash balance of the account

Returns:

  • (Float)


76
77
78
# File 'lib/the_plaid_api/models/asset_detail.rb', line 76

def asset_cash_balance_amount
  @asset_cash_balance_amount
end

#asset_crypto_balance_amountFloat

Total balance of all cryptocurrency held (non-restricted, vested)

Returns:

  • (Float)


60
61
62
# File 'lib/the_plaid_api/models/asset_detail.rb', line 60

def asset_crypto_balance_amount
  @asset_crypto_balance_amount
end

#asset_current_balance_amountFloat

A vendor created unique Identifier

Returns:

  • (Float)


37
38
39
# File 'lib/the_plaid_api/models/asset_detail.rb', line 37

def asset_current_balance_amount
  @asset_current_balance_amount
end

#asset_days_requested_countInteger

The Number of days requested made to the Financial Institution. Example When looking for 3 months of data from the FI, pass in 90 days.

Returns:

  • (Integer)


94
95
96
# File 'lib/the_plaid_api/models/asset_detail.rb', line 94

def asset_days_requested_count
  @asset_days_requested_count
end

#asset_descriptionString

A text description that further defines the Asset. This could be used to describe the shares associated with the stocks, bonds or mutual funds, retirement funds or business owned that the borrower has disclosed (named) as an asset.

Returns:

  • (String)


29
30
31
# File 'lib/the_plaid_api/models/asset_detail.rb', line 29

def asset_description
  @asset_description
end

#asset_employer_sponsored_indicatorAssetEmployerSponsoredIndicator

Whether the account is employer sponsored retirement account or not (e.g., 401K, 403b, 457, thrift savings plan)



110
111
112
# File 'lib/the_plaid_api/models/asset_detail.rb', line 110

def asset_employer_sponsored_indicator
  @asset_employer_sponsored_indicator
end

#asset_holding_balance_amountFloat

Total market value of holdings (non-restricted, vested, not crypto, not other, not cash) Note: Any employer stock plan balance must be excluded from the total account balance (identification is ‘stock plan’)

Returns:

  • (Float)


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

def asset_holding_balance_amount
  @asset_holding_balance_amount
end

#asset_holding_balance_net_margin_amountFloat

HoldingsBalance net MarginAmount

Returns:

  • (Float)


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

def asset_holding_balance_net_margin_amount
  @asset_holding_balance_net_margin_amount
end

#asset_margin_amount_balanceFloat

loan balance (amount owed by account owner)

Returns:

  • (Float)


68
69
70
# File 'lib/the_plaid_api/models/asset_detail.rb', line 68

def asset_margin_amount_balance
  @asset_margin_amount_balance
end

#asset_other_balance_amountFloat

Total balance of all other holding types (non-restricted, vested)

Returns:

  • (Float)


64
65
66
# File 'lib/the_plaid_api/models/asset_detail.rb', line 64

def asset_other_balance_amount
  @asset_other_balance_amount
end

#asset_ownership_typeString

Ownership type of the asset account.

Returns:

  • (String)


98
99
100
# File 'lib/the_plaid_api/models/asset_detail.rb', line 98

def asset_ownership_type
  @asset_ownership_type
end

#asset_retirement_indicatorAssetRetirementIndicator

Whether or not the account is a retirement account (e.g., 401K, 403b, 457, thrift savings plans, traditional and Roth, IRAs, SEP-IRA, SIMPLE-IRA, KEOGH, state retirement savings plans, other independent and IRS-qualified employer retirement plans)



105
106
107
# File 'lib/the_plaid_api/models/asset_detail.rb', line 105

def asset_retirement_indicator
  @asset_retirement_indicator
end

#asset_stocks_balance_amountFloat

Total market value of all stocks held (non-restricted, vested, not employer sponsored stock plan)

Returns:

  • (Float)


56
57
58
# File 'lib/the_plaid_api/models/asset_detail.rb', line 56

def asset_stocks_balance_amount
  @asset_stocks_balance_amount
end

#asset_typeAssetType

A value from a MISMO prescribed list that specifies financial assets in a mortgage loan transaction. Assets may be either liquid or fixed and are associated with a corresponding asset amount.

Returns:



82
83
84
# File 'lib/the_plaid_api/models/asset_detail.rb', line 82

def asset_type
  @asset_type
end

#asset_type_additional_descriptionString

Additional Asset Decription some examples are Investment Tax-Deferred , Loan, 401K, 403B, Checking, Money Market, Credit Card,ROTH,529,Biller,ROLLOVER,CD,Savings,Investment Taxable, IRA, Mortgage, Line Of Credit.

Returns:

  • (String)


89
90
91
# File 'lib/the_plaid_api/models/asset_detail.rb', line 89

def asset_type_additional_description
  @asset_type_additional_description
end

#asset_unique_identifierString

A vendor created unique Identifier.

Returns:

  • (String)


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

def asset_unique_identifier
  @asset_unique_identifier
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/the_plaid_api/models/asset_detail.rb', line 259

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  asset_unique_identifier =
    hash.key?('AssetUniqueIdentifier') ? hash['AssetUniqueIdentifier'] : nil
   =
    hash.key?('AssetAccountIdentifier') ? hash['AssetAccountIdentifier'] : nil
  asset_as_of_date =
    hash.key?('AssetAsOfDate') ? hash['AssetAsOfDate'] : nil
  asset_description =
    hash.key?('AssetDescription') ? hash['AssetDescription'] : nil
  asset_available_balance_amount =
    hash.key?('AssetAvailableBalanceAmount') ? hash['AssetAvailableBalanceAmount'] : nil
  asset_current_balance_amount =
    hash.key?('AssetCurrentBalanceAmount') ? hash['AssetCurrentBalanceAmount'] : nil
  asset_type = hash.key?('AssetType') ? hash['AssetType'] : nil
  asset_type_additional_description =
    hash.key?('AssetTypeAdditionalDescription') ? hash['AssetTypeAdditionalDescription'] : nil
  asset_days_requested_count =
    hash.key?('AssetDaysRequestedCount') ? hash['AssetDaysRequestedCount'] : nil
  asset_ownership_type =
    hash.key?('AssetOwnershipType') ? hash['AssetOwnershipType'] : nil
  asset_holding_balance_amount =
    hash.key?('AssetHoldingBalanceAmount') ? hash['AssetHoldingBalanceAmount'] : SKIP
  asset_holding_balance_net_margin_amount =
    hash.key?('AssetHoldingBalanceNetMarginAmount') ? hash['AssetHoldingBalanceNetMarginAmount'] : SKIP
  asset_bonds_balance_amount =
    hash.key?('AssetBondsBalanceAmount') ? hash['AssetBondsBalanceAmount'] : SKIP
  asset_stocks_balance_amount =
    hash.key?('AssetStocksBalanceAmount') ? hash['AssetStocksBalanceAmount'] : SKIP
  asset_crypto_balance_amount =
    hash.key?('AssetCryptoBalanceAmount') ? hash['AssetCryptoBalanceAmount'] : SKIP
  asset_other_balance_amount =
    hash.key?('AssetOtherBalanceAmount') ? hash['AssetOtherBalanceAmount'] : SKIP
  asset_margin_amount_balance =
    hash.key?('AssetMarginAmountBalance') ? hash['AssetMarginAmountBalance'] : SKIP
  asset_available_cash_balance_amount =
    hash.key?('AssetAvailableCashBalanceAmount') ? hash['AssetAvailableCashBalanceAmount'] : SKIP
  asset_cash_balance_amount =
    hash.key?('AssetCashBalanceAmount') ? hash['AssetCashBalanceAmount'] : SKIP
  asset_retirement_indicator =
    hash.key?('AssetRetirementIndicator') ? hash['AssetRetirementIndicator'] : SKIP
  asset_employer_sponsored_indicator =
    hash.key?('AssetEmployerSponsoredIndicator') ? hash['AssetEmployerSponsoredIndicator'] : 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.
  AssetDetail.new(asset_unique_identifier: asset_unique_identifier,
                  asset_account_identifier: ,
                  asset_as_of_date: asset_as_of_date,
                  asset_description: asset_description,
                  asset_available_balance_amount: asset_available_balance_amount,
                  asset_current_balance_amount: asset_current_balance_amount,
                  asset_type: asset_type,
                  asset_type_additional_description: asset_type_additional_description,
                  asset_days_requested_count: asset_days_requested_count,
                  asset_ownership_type: asset_ownership_type,
                  asset_holding_balance_amount: asset_holding_balance_amount,
                  asset_holding_balance_net_margin_amount: asset_holding_balance_net_margin_amount,
                  asset_bonds_balance_amount: asset_bonds_balance_amount,
                  asset_stocks_balance_amount: asset_stocks_balance_amount,
                  asset_crypto_balance_amount: asset_crypto_balance_amount,
                  asset_other_balance_amount: asset_other_balance_amount,
                  asset_margin_amount_balance: asset_margin_amount_balance,
                  asset_available_cash_balance_amount: asset_available_cash_balance_amount,
                  asset_cash_balance_amount: asset_cash_balance_amount,
                  asset_retirement_indicator: asset_retirement_indicator,
                  asset_employer_sponsored_indicator: asset_employer_sponsored_indicator,
                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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
# File 'lib/the_plaid_api/models/asset_detail.rb', line 113

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['asset_unique_identifier'] = 'AssetUniqueIdentifier'
  @_hash['asset_account_identifier'] = 'AssetAccountIdentifier'
  @_hash['asset_as_of_date'] = 'AssetAsOfDate'
  @_hash['asset_description'] = 'AssetDescription'
  @_hash['asset_available_balance_amount'] = 'AssetAvailableBalanceAmount'
  @_hash['asset_current_balance_amount'] = 'AssetCurrentBalanceAmount'
  @_hash['asset_holding_balance_amount'] = 'AssetHoldingBalanceAmount'
  @_hash['asset_holding_balance_net_margin_amount'] =
    'AssetHoldingBalanceNetMarginAmount'
  @_hash['asset_bonds_balance_amount'] = 'AssetBondsBalanceAmount'
  @_hash['asset_stocks_balance_amount'] = 'AssetStocksBalanceAmount'
  @_hash['asset_crypto_balance_amount'] = 'AssetCryptoBalanceAmount'
  @_hash['asset_other_balance_amount'] = 'AssetOtherBalanceAmount'
  @_hash['asset_margin_amount_balance'] = 'AssetMarginAmountBalance'
  @_hash['asset_available_cash_balance_amount'] =
    'AssetAvailableCashBalanceAmount'
  @_hash['asset_cash_balance_amount'] = 'AssetCashBalanceAmount'
  @_hash['asset_type'] = 'AssetType'
  @_hash['asset_type_additional_description'] =
    'AssetTypeAdditionalDescription'
  @_hash['asset_days_requested_count'] = 'AssetDaysRequestedCount'
  @_hash['asset_ownership_type'] = 'AssetOwnershipType'
  @_hash['asset_retirement_indicator'] = 'AssetRetirementIndicator'
  @_hash['asset_employer_sponsored_indicator'] =
    'AssetEmployerSponsoredIndicator'
  @_hash
end

.nullablesObject

An array for nullable fields



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/the_plaid_api/models/asset_detail.rb', line 161

def self.nullables
  %w[
    asset_description
    asset_holding_balance_amount
    asset_holding_balance_net_margin_amount
    asset_bonds_balance_amount
    asset_stocks_balance_amount
    asset_crypto_balance_amount
    asset_other_balance_amount
    asset_margin_amount_balance
    asset_available_cash_balance_amount
    asset_cash_balance_amount
    asset_type_additional_description
    asset_ownership_type
    asset_retirement_indicator
    asset_employer_sponsored_indicator
  ]
end

.optionalsObject

An array for optional fields



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/the_plaid_api/models/asset_detail.rb', line 144

def self.optionals
  %w[
    asset_holding_balance_amount
    asset_holding_balance_net_margin_amount
    asset_bonds_balance_amount
    asset_stocks_balance_amount
    asset_crypto_balance_amount
    asset_other_balance_amount
    asset_margin_amount_balance
    asset_available_cash_balance_amount
    asset_cash_balance_amount
    asset_retirement_indicator
    asset_employer_sponsored_indicator
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
# File 'lib/the_plaid_api/models/asset_detail.rb', line 362

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} asset_unique_identifier: #{@asset_unique_identifier.inspect},"\
  " asset_account_identifier: #{@asset_account_identifier.inspect}, asset_as_of_date:"\
  " #{@asset_as_of_date.inspect}, asset_description: #{@asset_description.inspect},"\
  " asset_available_balance_amount: #{@asset_available_balance_amount.inspect},"\
  " asset_current_balance_amount: #{@asset_current_balance_amount.inspect},"\
  " asset_holding_balance_amount: #{@asset_holding_balance_amount.inspect},"\
  ' asset_holding_balance_net_margin_amount:'\
  " #{@asset_holding_balance_net_margin_amount.inspect}, asset_bonds_balance_amount:"\
  " #{@asset_bonds_balance_amount.inspect}, asset_stocks_balance_amount:"\
  " #{@asset_stocks_balance_amount.inspect}, asset_crypto_balance_amount:"\
  " #{@asset_crypto_balance_amount.inspect}, asset_other_balance_amount:"\
  " #{@asset_other_balance_amount.inspect}, asset_margin_amount_balance:"\
  " #{@asset_margin_amount_balance.inspect}, asset_available_cash_balance_amount:"\
  " #{@asset_available_cash_balance_amount.inspect}, asset_cash_balance_amount:"\
  " #{@asset_cash_balance_amount.inspect}, asset_type: #{@asset_type.inspect},"\
  " asset_type_additional_description: #{@asset_type_additional_description.inspect},"\
  " asset_days_requested_count: #{@asset_days_requested_count.inspect}, asset_ownership_type:"\
  " #{@asset_ownership_type.inspect}, asset_retirement_indicator:"\
  " #{@asset_retirement_indicator.inspect}, asset_employer_sponsored_indicator:"\
  " #{@asset_employer_sponsored_indicator.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/the_plaid_api/models/asset_detail.rb', line 338

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} asset_unique_identifier: #{@asset_unique_identifier},"\
  " asset_account_identifier: #{@asset_account_identifier}, asset_as_of_date:"\
  " #{@asset_as_of_date}, asset_description: #{@asset_description},"\
  " asset_available_balance_amount: #{@asset_available_balance_amount},"\
  " asset_current_balance_amount: #{@asset_current_balance_amount},"\
  " asset_holding_balance_amount: #{@asset_holding_balance_amount},"\
  " asset_holding_balance_net_margin_amount: #{@asset_holding_balance_net_margin_amount},"\
  " asset_bonds_balance_amount: #{@asset_bonds_balance_amount}, asset_stocks_balance_amount:"\
  " #{@asset_stocks_balance_amount}, asset_crypto_balance_amount:"\
  " #{@asset_crypto_balance_amount}, asset_other_balance_amount:"\
  " #{@asset_other_balance_amount}, asset_margin_amount_balance:"\
  " #{@asset_margin_amount_balance}, asset_available_cash_balance_amount:"\
  " #{@asset_available_cash_balance_amount}, asset_cash_balance_amount:"\
  " #{@asset_cash_balance_amount}, asset_type: #{@asset_type},"\
  " asset_type_additional_description: #{@asset_type_additional_description},"\
  " asset_days_requested_count: #{@asset_days_requested_count}, asset_ownership_type:"\
  " #{@asset_ownership_type}, asset_retirement_indicator: #{@asset_retirement_indicator},"\
  " asset_employer_sponsored_indicator: #{@asset_employer_sponsored_indicator},"\
  " additional_properties: #{@additional_properties}>"
end