Class: ThePlaidApi::InvestmentsHoldingsGetResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::InvestmentsHoldingsGetResponse
- Defined in:
- lib/the_plaid_api/models/investments_holdings_get_response.rb
Overview
InvestmentsHoldingsGetResponse defines the response schema for ‘/investments/holdings/get`
Instance Attribute Summary collapse
-
#accounts ⇒ Array[InvestmentAccount]
The accounts associated with the Item.
-
#holdings ⇒ Array[Holding]
The holdings belonging to investment accounts associated with the Item.
-
#is_investments_fallback_item ⇒ TrueClass | FalseClass
When true, this field indicates that the Item’s portfolio was manually created with the Investments Fallback flow.
-
#item ⇒ Item
Metadata about the Item.
-
#request_id ⇒ String
A unique identifier for the request, which can be used for troubleshooting.
-
#securities ⇒ Array[Security]
Objects describing the securities held in the accounts associated with the Item.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(accounts:, holdings:, securities:, item:, request_id:, is_investments_fallback_item: SKIP, additional_properties: nil) ⇒ InvestmentsHoldingsGetResponse
constructor
A new instance of InvestmentsHoldingsGetResponse.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(accounts:, holdings:, securities:, item:, request_id:, is_investments_fallback_item: SKIP, additional_properties: nil) ⇒ InvestmentsHoldingsGetResponse
Returns a new instance of InvestmentsHoldingsGetResponse.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/the_plaid_api/models/investments_holdings_get_response.rb', line 67 def initialize(accounts:, holdings:, securities:, item:, request_id:, is_investments_fallback_item: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @accounts = accounts @holdings = holdings @securities = securities @item = item @request_id = request_id unless is_investments_fallback_item == SKIP @is_investments_fallback_item = is_investments_fallback_item end @additional_properties = additional_properties end |
Instance Attribute Details
#accounts ⇒ Array[InvestmentAccount]
The accounts associated with the Item
15 16 17 |
# File 'lib/the_plaid_api/models/investments_holdings_get_response.rb', line 15 def accounts @accounts end |
#holdings ⇒ Array[Holding]
The holdings belonging to investment accounts associated with the Item. Details of the securities in the holdings are provided in the ‘securities` field.
21 22 23 |
# File 'lib/the_plaid_api/models/investments_holdings_get_response.rb', line 21 def holdings @holdings end |
#is_investments_fallback_item ⇒ TrueClass | FalseClass
When true, this field indicates that the Item’s portfolio was manually created with the Investments Fallback flow.
41 42 43 |
# File 'lib/the_plaid_api/models/investments_holdings_get_response.rb', line 41 def is_investments_fallback_item @is_investments_fallback_item end |
#item ⇒ Item
Metadata about the Item.
30 31 32 |
# File 'lib/the_plaid_api/models/investments_holdings_get_response.rb', line 30 def item @item end |
#request_id ⇒ String
A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.
36 37 38 |
# File 'lib/the_plaid_api/models/investments_holdings_get_response.rb', line 36 def request_id @request_id end |
#securities ⇒ Array[Security]
Objects describing the securities held in the accounts associated with the Item.
26 27 28 |
# File 'lib/the_plaid_api/models/investments_holdings_get_response.rb', line 26 def securities @securities end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 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 |
# File 'lib/the_plaid_api/models/investments_holdings_get_response.rb', line 86 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 accounts = nil unless hash['accounts'].nil? accounts = [] hash['accounts'].each do |structure| accounts << (InvestmentAccount.from_hash(structure) if structure) end end accounts = nil unless hash.key?('accounts') # 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') item = Item.from_hash(hash['item']) if hash['item'] request_id = hash.key?('request_id') ? hash['request_id'] : nil 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. InvestmentsHoldingsGetResponse.new(accounts: accounts, holdings: holdings, securities: securities, item: item, request_id: request_id, is_investments_fallback_item: is_investments_fallback_item, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/the_plaid_api/models/investments_holdings_get_response.rb', line 44 def self.names @_hash = {} if @_hash.nil? @_hash['accounts'] = 'accounts' @_hash['holdings'] = 'holdings' @_hash['securities'] = 'securities' @_hash['item'] = 'item' @_hash['request_id'] = 'request_id' @_hash['is_investments_fallback_item'] = 'is_investments_fallback_item' @_hash end |
.nullables ⇒ Object
An array for nullable fields
63 64 65 |
# File 'lib/the_plaid_api/models/investments_holdings_get_response.rb', line 63 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
56 57 58 59 60 |
# File 'lib/the_plaid_api/models/investments_holdings_get_response.rb', line 56 def self.optionals %w[ is_investments_fallback_item ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
151 152 153 154 155 156 157 |
# File 'lib/the_plaid_api/models/investments_holdings_get_response.rb', line 151 def inspect class_name = self.class.name.split('::').last "<#{class_name} accounts: #{@accounts.inspect}, holdings: #{@holdings.inspect}, securities:"\ " #{@securities.inspect}, item: #{@item.inspect}, request_id: #{@request_id.inspect},"\ " is_investments_fallback_item: #{@is_investments_fallback_item.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
143 144 145 146 147 148 |
# File 'lib/the_plaid_api/models/investments_holdings_get_response.rb', line 143 def to_s class_name = self.class.name.split('::').last "<#{class_name} accounts: #{@accounts}, holdings: #{@holdings}, securities: #{@securities},"\ " item: #{@item}, request_id: #{@request_id}, is_investments_fallback_item:"\ " #{@is_investments_fallback_item}, additional_properties: #{@additional_properties}>" end |