Class: ThePlaidApi::BaseReportAccount
- Defined in:
- lib/the_plaid_api/models/base_report_account.rb
Overview
Base Report information about an account
Instance Attribute Summary collapse
-
#account_id ⇒ String
Plaid’s unique identifier for the account.
-
#account_insights ⇒ BaseReportAccountInsights
Calculated insights derived from transaction-level data.
-
#attributes ⇒ BaseReportAttributes
Calculated attributes derived from transaction-level data.
-
#balances ⇒ BaseReportAccountBalances
Information about an account’s balances.
-
#consumer_disputes ⇒ Array[ConsumerDispute]
The information about previously submitted valid dispute statements by the consumer.
-
#days_available ⇒ Float
The duration of transaction history available within this report for this Item, typically defined as the time since the date of the earliest transaction in that account.
-
#historical_balances ⇒ Array[BaseReportHistoricalBalance]
Calculated data about the historical balances on the account.
-
#mask ⇒ String
The last 2-4 alphanumeric characters of an account’s official account number.
-
#metadata ⇒ BaseReportAccountMetadata
Metadata about the extracted account.
-
#name ⇒ String
The name of the account, either assigned by the user or by the financial institution itself.
-
#official_name ⇒ String
The official name of the account as given by the financial institution.
-
#owners ⇒ Array[Owner]
Data returned by the financial institution about the account owner or owners.
-
#ownership_type ⇒ OwnershipType
How an asset is owned.
-
#subtype ⇒ AccountSubtype
See the [Account type schema](plaid.com/docs/api/accounts/#account-type-schema) for a full listing of account types and corresponding subtypes.
-
#transactions ⇒ Array[BaseReportTransaction]
Transaction history associated with the account.
-
#type ⇒ AccountType
‘investment:` Investment account.
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_id:, balances:, consumer_disputes:, mask:, metadata:, name:, official_name:, type:, subtype:, days_available:, transactions:, owners:, ownership_type:, historical_balances: SKIP, account_insights: SKIP, attributes: SKIP, additional_properties: nil) ⇒ BaseReportAccount
constructor
A new instance of BaseReportAccount.
-
#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_id:, balances:, consumer_disputes:, mask:, metadata:, name:, official_name:, type:, subtype:, days_available:, transactions:, owners:, ownership_type:, historical_balances: SKIP, account_insights: SKIP, attributes: SKIP, additional_properties: nil) ⇒ BaseReportAccount
Returns a new instance of BaseReportAccount.
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 161 def initialize(account_id:, balances:, consumer_disputes:, mask:, metadata:, name:, official_name:, type:, subtype:, days_available:, transactions:, owners:, ownership_type:, historical_balances: SKIP, account_insights: SKIP, attributes: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_id = account_id @balances = balances @consumer_disputes = consumer_disputes @mask = mask @metadata = @name = name @official_name = official_name @type = type @subtype = subtype @days_available = days_available @transactions = transactions @owners = owners @ownership_type = ownership_type @historical_balances = historical_balances unless historical_balances == SKIP @account_insights = account_insights unless account_insights == SKIP @attributes = attributes unless attributes == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_id ⇒ String
Plaid’s unique identifier for the account. This value will not change unless Plaid can’t reconcile the account with the data returned by the financial institution. This may occur, for example, when the name of the account changes. If this happens a new ‘account_id` will be assigned to the account. If an account with a specific `account_id` disappears instead of changing, the account is likely closed. Closed accounts are not returned by the Plaid API. Like all Plaid identifiers, the `account_id` is case sensitive.
22 23 24 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 22 def account_id @account_id end |
#account_insights ⇒ BaseReportAccountInsights
Calculated insights derived from transaction-level data. This field has been deprecated in favor of [Base Report attributes aggregated across accounts](plaid.com/docs/api/products/check/#cra-check_report-base _report-get-response-report-attributes) and will be removed in a future release.
114 115 116 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 114 def account_insights @account_insights end |
#attributes ⇒ BaseReportAttributes
Calculated attributes derived from transaction-level data.
118 119 120 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 118 def attributes @attributes end |
#balances ⇒ BaseReportAccountBalances
Information about an account’s balances.
26 27 28 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 26 def balances @balances end |
#consumer_disputes ⇒ Array[ConsumerDispute]
The information about previously submitted valid dispute statements by the consumer
31 32 33 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 31 def consumer_disputes @consumer_disputes end |
#days_available ⇒ Float
The duration of transaction history available within this report for this Item, typically defined as the time since the date of the earliest transaction in that account.
74 75 76 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 74 def days_available @days_available end |
#historical_balances ⇒ Array[BaseReportHistoricalBalance]
Calculated data about the historical balances on the account. Currently not supported by ‘brokerage` or `investment` accounts.
106 107 108 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 106 def historical_balances @historical_balances end |
#mask ⇒ String
The last 2-4 alphanumeric characters of an account’s official account number. Note that the mask may be non-unique between an Item’s accounts, and it may also not match the mask that the bank displays to the user.
37 38 39 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 37 def mask @mask end |
#metadata ⇒ BaseReportAccountMetadata
Metadata about the extracted account.
41 42 43 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 41 def @metadata end |
#name ⇒ String
The name of the account, either assigned by the user or by the financial institution itself
46 47 48 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 46 def name @name end |
#official_name ⇒ String
The official name of the account as given by the financial institution
50 51 52 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 50 def official_name @official_name end |
#owners ⇒ Array[Owner]
Data returned by the financial institution about the account owner or owners. For business accounts, the name reported may be either the name of the individual or the name of the business, depending on the institution. Multiple owners on a single account will be represented in the same ‘owner` object, not in multiple owner objects within the array. This array can also be empty if no owners are found.
92 93 94 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 92 def owners @owners end |
#ownership_type ⇒ OwnershipType
How an asset is owned. ‘association`: Ownership by a corporation, partnership, or unincorporated association, including for-profit and not-for-profit organizations. `individual`: Ownership by an individual. `joint`: Joint ownership by multiple parties. `trust`: Ownership by a revocable or irrevocable trust.
101 102 103 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 101 def ownership_type @ownership_type end |
#subtype ⇒ AccountSubtype
See the [Account type schema](plaid.com/docs/api/accounts/#account-type-schema) for a full listing of account types and corresponding subtypes.
68 69 70 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 68 def subtype @subtype end |
#transactions ⇒ Array[BaseReportTransaction]
Transaction history associated with the account. Transaction history returned by endpoints such as ‘/transactions/get` or `/investments/transactions/get` will be returned in the top-level `transactions` field instead. Some transactions may have their details masked in accordance to the FCRA. These will appear with a `credit_category` of `MASKED_TRANSACTION_CATEGORY`.
83 84 85 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 83 def transactions @transactions end |
#type ⇒ AccountType
‘investment:` Investment account. In API versions 2018-05-22 and earlier, this type is called `brokerage` instead. `credit:` Credit card `depository:` Depository account `loan:` Loan account `other:` Non-specified account type See the [Account type schema](plaid.com/docs/api/accounts#account-type-schema) for a full listing of account types and corresponding subtypes.
62 63 64 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 62 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 189 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_id = hash.key?('account_id') ? hash['account_id'] : nil balances = BaseReportAccountBalances.from_hash(hash['balances']) if hash['balances'] # Parameter is an array, so we need to iterate through it consumer_disputes = nil unless hash['consumer_disputes'].nil? consumer_disputes = [] hash['consumer_disputes'].each do |structure| consumer_disputes << (ConsumerDispute.from_hash(structure) if structure) end end consumer_disputes = nil unless hash.key?('consumer_disputes') mask = hash.key?('mask') ? hash['mask'] : nil = BaseReportAccountMetadata.from_hash(hash['metadata']) if hash['metadata'] name = hash.key?('name') ? hash['name'] : nil official_name = hash.key?('official_name') ? hash['official_name'] : nil type = hash.key?('type') ? hash['type'] : nil subtype = hash.key?('subtype') ? hash['subtype'] : nil days_available = hash.key?('days_available') ? hash['days_available'] : nil # Parameter is an array, so we need to iterate through it transactions = nil unless hash['transactions'].nil? transactions = [] hash['transactions'].each do |structure| transactions << (BaseReportTransaction.from_hash(structure) if structure) end end transactions = nil unless hash.key?('transactions') # Parameter is an array, so we need to iterate through it owners = nil unless hash['owners'].nil? owners = [] hash['owners'].each do |structure| owners << (Owner.from_hash(structure) if structure) end end owners = nil unless hash.key?('owners') ownership_type = hash.key?('ownership_type') ? hash['ownership_type'] : nil # Parameter is an array, so we need to iterate through it historical_balances = nil unless hash['historical_balances'].nil? historical_balances = [] hash['historical_balances'].each do |structure| historical_balances << (BaseReportHistoricalBalance.from_hash(structure) if structure) end end historical_balances = SKIP unless hash.key?('historical_balances') account_insights = BaseReportAccountInsights.from_hash(hash['account_insights']) if hash['account_insights'] attributes = BaseReportAttributes.from_hash(hash['attributes']) if hash['attributes'] # 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. BaseReportAccount.new(account_id: account_id, balances: balances, consumer_disputes: consumer_disputes, mask: mask, metadata: , name: name, official_name: official_name, type: type, subtype: subtype, days_available: days_available, transactions: transactions, owners: owners, ownership_type: ownership_type, historical_balances: historical_balances, account_insights: account_insights, attributes: attributes, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
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/base_report_account.rb', line 121 def self.names @_hash = {} if @_hash.nil? @_hash['account_id'] = 'account_id' @_hash['balances'] = 'balances' @_hash['consumer_disputes'] = 'consumer_disputes' @_hash['mask'] = 'mask' @_hash['metadata'] = 'metadata' @_hash['name'] = 'name' @_hash['official_name'] = 'official_name' @_hash['type'] = 'type' @_hash['subtype'] = 'subtype' @_hash['days_available'] = 'days_available' @_hash['transactions'] = 'transactions' @_hash['owners'] = 'owners' @_hash['ownership_type'] = 'ownership_type' @_hash['historical_balances'] = 'historical_balances' @_hash['account_insights'] = 'account_insights' @_hash['attributes'] = 'attributes' @_hash end |
.nullables ⇒ Object
An array for nullable fields
152 153 154 155 156 157 158 159 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 152 def self.nullables %w[ mask official_name subtype ownership_type ] end |
.optionals ⇒ Object
An array for optional fields
143 144 145 146 147 148 149 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 143 def self.optionals %w[ historical_balances account_insights attributes ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 289 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id.inspect}, balances: #{@balances.inspect},"\ " consumer_disputes: #{@consumer_disputes.inspect}, mask: #{@mask.inspect}, metadata:"\ " #{@metadata.inspect}, name: #{@name.inspect}, official_name: #{@official_name.inspect},"\ " type: #{@type.inspect}, subtype: #{@subtype.inspect}, days_available:"\ " #{@days_available.inspect}, transactions: #{@transactions.inspect}, owners:"\ " #{@owners.inspect}, ownership_type: #{@ownership_type.inspect}, historical_balances:"\ " #{@historical_balances.inspect}, account_insights: #{@account_insights.inspect},"\ " attributes: #{@attributes.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
277 278 279 280 281 282 283 284 285 286 |
# File 'lib/the_plaid_api/models/base_report_account.rb', line 277 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id}, balances: #{@balances}, consumer_disputes:"\ " #{@consumer_disputes}, mask: #{@mask}, metadata: #{@metadata}, name: #{@name},"\ " official_name: #{@official_name}, type: #{@type}, subtype: #{@subtype}, days_available:"\ " #{@days_available}, transactions: #{@transactions}, owners: #{@owners}, ownership_type:"\ " #{@ownership_type}, historical_balances: #{@historical_balances}, account_insights:"\ " #{@account_insights}, attributes: #{@attributes}, additional_properties:"\ " #{@additional_properties}>" end |