Class: ThePlaidApi::ProcessorInvestmentsTransactionsGetResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::ProcessorInvestmentsTransactionsGetResponse
- Defined in:
- lib/the_plaid_api/models/processor_investments_transactions_get_response.rb
Overview
ProcessorInvestmentsTransactionsGetRequest defines the response schema for ‘/processor/investments/transactions/get`
Instance Attribute Summary collapse
-
#account ⇒ InvestmentAccount
A single account at a financial institution, with additional investment-specific balance information.
-
#investment_transactions ⇒ Array[InvestmentTransaction]
An array containing investment transactions from the account.
-
#is_investments_fallback_item ⇒ TrueClass | FalseClass
When true, this field indicates that the Item’s portfolio was manually created with the Investments Fallback flow.
-
#request_id ⇒ String
A unique identifier for the request, which can be used for troubleshooting.
-
#securities ⇒ Array[Security]
All securities for which there is a corresponding transaction being fetched.
-
#total_investment_transactions ⇒ Integer
The total number of transactions available within the date range specified.
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(account:, investment_transactions:, securities:, total_investment_transactions:, request_id:, is_investments_fallback_item: SKIP, additional_properties: nil) ⇒ ProcessorInvestmentsTransactionsGetResponse
constructor
A new instance of ProcessorInvestmentsTransactionsGetResponse.
-
#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(account:, investment_transactions:, securities:, total_investment_transactions:, request_id:, is_investments_fallback_item: SKIP, additional_properties: nil) ⇒ ProcessorInvestmentsTransactionsGetResponse
Returns a new instance of ProcessorInvestmentsTransactionsGetResponse.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/the_plaid_api/models/processor_investments_transactions_get_response.rb', line 73 def initialize(account:, investment_transactions:, securities:, total_investment_transactions:, request_id:, is_investments_fallback_item: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account = account @investment_transactions = investment_transactions @securities = securities @total_investment_transactions = total_investment_transactions @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
#account ⇒ InvestmentAccount
A single account at a financial institution, with additional investment-specific balance information.
16 17 18 |
# File 'lib/the_plaid_api/models/processor_investments_transactions_get_response.rb', line 16 def account @account end |
#investment_transactions ⇒ Array[InvestmentTransaction]
An array containing investment transactions from the account. Investments transactions are returned in reverse chronological order, with the most recent at the beginning of the array. The maximum number of transactions returned is determined by the ‘count` parameter.
23 24 25 |
# File 'lib/the_plaid_api/models/processor_investments_transactions_get_response.rb', line 23 def investment_transactions @investment_transactions 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.
46 47 48 |
# File 'lib/the_plaid_api/models/processor_investments_transactions_get_response.rb', line 46 def is_investments_fallback_item @is_investments_fallback_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.
41 42 43 |
# File 'lib/the_plaid_api/models/processor_investments_transactions_get_response.rb', line 41 def request_id @request_id end |
#securities ⇒ Array[Security]
All securities for which there is a corresponding transaction being fetched.
28 29 30 |
# File 'lib/the_plaid_api/models/processor_investments_transactions_get_response.rb', line 28 def securities @securities end |
#total_investment_transactions ⇒ Integer
The total number of transactions available within the date range specified. If ‘total_investment_transactions` is larger than the size of the `transactions` array, more transactions are available and can be fetched via manipulating the `offset` parameter.
35 36 37 |
# File 'lib/the_plaid_api/models/processor_investments_transactions_get_response.rb', line 35 def total_investment_transactions @total_investment_transactions end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/the_plaid_api/models/processor_investments_transactions_get_response.rb', line 93 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account = InvestmentAccount.from_hash(hash['account']) if hash['account'] # Parameter is an array, so we need to iterate through it investment_transactions = nil unless hash['investment_transactions'].nil? investment_transactions = [] hash['investment_transactions'].each do |structure| investment_transactions << (InvestmentTransaction.from_hash(structure) if structure) end end investment_transactions = nil unless hash.key?('investment_transactions') # 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') total_investment_transactions = hash.key?('total_investment_transactions') ? hash['total_investment_transactions'] : nil 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. ProcessorInvestmentsTransactionsGetResponse.new(account: account, investment_transactions: investment_transactions, securities: securities, total_investment_transactions: total_investment_transactions, 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.
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/the_plaid_api/models/processor_investments_transactions_get_response.rb', line 49 def self.names @_hash = {} if @_hash.nil? @_hash['account'] = 'account' @_hash['investment_transactions'] = 'investment_transactions' @_hash['securities'] = 'securities' @_hash['total_investment_transactions'] = 'total_investment_transactions' @_hash['request_id'] = 'request_id' @_hash['is_investments_fallback_item'] = 'is_investments_fallback_item' @_hash end |
.nullables ⇒ Object
An array for nullable fields
69 70 71 |
# File 'lib/the_plaid_api/models/processor_investments_transactions_get_response.rb', line 69 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
62 63 64 65 66 |
# File 'lib/the_plaid_api/models/processor_investments_transactions_get_response.rb', line 62 def self.optionals %w[ is_investments_fallback_item ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
152 153 154 155 156 157 158 159 160 |
# File 'lib/the_plaid_api/models/processor_investments_transactions_get_response.rb', line 152 def inspect class_name = self.class.name.split('::').last "<#{class_name} account: #{@account.inspect}, investment_transactions:"\ " #{@investment_transactions.inspect}, securities: #{@securities.inspect},"\ " total_investment_transactions: #{@total_investment_transactions.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.
142 143 144 145 146 147 148 149 |
# File 'lib/the_plaid_api/models/processor_investments_transactions_get_response.rb', line 142 def to_s class_name = self.class.name.split('::').last "<#{class_name} account: #{@account}, investment_transactions: #{@investment_transactions},"\ " securities: #{@securities}, total_investment_transactions:"\ " #{@total_investment_transactions}, request_id: #{@request_id},"\ " is_investments_fallback_item: #{@is_investments_fallback_item}, additional_properties:"\ " #{@additional_properties}>" end |