Class: ThePlaidApi::CreditBankIncomeSource
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::CreditBankIncomeSource
- Defined in:
- lib/the_plaid_api/models/credit_bank_income_source.rb
Overview
Detailed information for the income source.
Instance Attribute Summary collapse
-
#account_id ⇒ String
Plaid’s unique identifier for the account.
-
#end_date ⇒ Date
Maximum of all dates within the specific income sources in the user’s bank account for days requested by the client.
-
#historical_summary ⇒ Array[CreditBankIncomeHistoricalSummary]
Number of transactions for the income source within the start and end date.
-
#income_category ⇒ CreditBankIncomeCategory
The income category.
-
#income_description ⇒ String
The most common name or original description for the underlying income transactions.
-
#income_source_id ⇒ String
A unique identifier for an income source.
-
#pay_frequency ⇒ CreditBankIncomePayFrequency
The income pay frequency.
-
#start_date ⇒ Date
Minimum of all dates within the specific income sources in the user’s bank account for days requested by the client.
-
#total_amount ⇒ Float
Total amount of earnings in the user’s bank account for the specific income source for days requested by the client.
-
#transaction_count ⇒ Integer
Number of transactions for the income source within the start and end date.
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(income_source_id: SKIP, income_description: SKIP, income_category: SKIP, account_id: SKIP, start_date: SKIP, end_date: SKIP, pay_frequency: SKIP, total_amount: SKIP, transaction_count: SKIP, historical_summary: SKIP, additional_properties: nil) ⇒ CreditBankIncomeSource
constructor
A new instance of CreditBankIncomeSource.
-
#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(income_source_id: SKIP, income_description: SKIP, income_category: SKIP, account_id: SKIP, start_date: SKIP, end_date: SKIP, pay_frequency: SKIP, total_amount: SKIP, transaction_count: SKIP, historical_summary: SKIP, additional_properties: nil) ⇒ CreditBankIncomeSource
Returns a new instance of CreditBankIncomeSource.
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 128 def initialize(income_source_id: SKIP, income_description: SKIP, income_category: SKIP, account_id: SKIP, start_date: SKIP, end_date: SKIP, pay_frequency: SKIP, total_amount: SKIP, transaction_count: SKIP, historical_summary: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @income_source_id = income_source_id unless income_source_id == SKIP @income_description = income_description unless income_description == SKIP @income_category = income_category unless income_category == SKIP @account_id = account_id unless account_id == SKIP @start_date = start_date unless start_date == SKIP @end_date = end_date unless end_date == SKIP @pay_frequency = pay_frequency unless pay_frequency == SKIP @total_amount = total_amount unless total_amount == SKIP @transaction_count = transaction_count unless transaction_count == SKIP @historical_summary = historical_summary unless historical_summary == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_id ⇒ String
Plaid’s unique identifier for the account.
58 59 60 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 58 def account_id @account_id end |
#end_date ⇒ Date
Maximum of all dates within the specific income sources in the user’s bank account for days requested by the client. The date will be returned in an ISO 8601 format (YYYY-MM-DD).
70 71 72 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 70 def end_date @end_date end |
#historical_summary ⇒ Array[CreditBankIncomeHistoricalSummary]
Number of transactions for the income source within the start and end date.
89 90 91 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 89 def historical_summary @historical_summary end |
#income_category ⇒ CreditBankIncomeCategory
The income category. ‘BANK_INTEREST`: Interest earned from a bank account. `BENEFIT_OTHER`: Government benefits other than retirement, unemployment, child support, or disability. Currently used only in the UK, to represent benefits such as Cost of Living Payments. `CASH`: Deprecated and used only for existing legacy implementations. Has been replaced by `CASH_DEPOSIT` and `TRANSFER_FROM_APPLICATION`. `CASH_DEPOSIT`: A cash or check deposit. `CHILD_SUPPORT`: Child support payments received. `GIG_ECONOMY`: Income earned as a gig economy worker, e.g. driving for Uber, Lyft, Postmates, DoorDash, etc. `LONG_TERM_DISABILITY`: Disability payments, including Social Security disability benefits. `OTHER`: Income that could not be categorized as any other income category. `MILITARY`: Veterans benefits. Income earned as salary for serving in the military (e.g. through DFAS) will be classified as `SALARY` rather than `MILITARY`. `RENTAL`: Income earned from a rental property. Income may be identified as rental when the payment is received through a rental platform, e.g. Airbnb; rent paid directly by the tenant to the property owner (e.g. via cash, check, or ACH) will typically not be classified as rental income. `RETIREMENT`: Payments from private retirement systems, pensions, and government retirement programs, including Social Security retirement benefits. `SALARY`: Payment from an employer to an earner or other form of permanent employment. `TAX_REFUND`: A tax refund. `TRANSFER_FROM_APPLICATION`: Deposits from a money transfer app, such as Venmo, Cash App, or Zelle. `UNEMPLOYMENT`: Unemployment benefits. In the UK, includes certain low-income benefits such as the Universal Credit.
54 55 56 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 54 def income_category @income_category end |
#income_description ⇒ String
The most common name or original description for the underlying income transactions.
19 20 21 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 19 def income_description @income_description end |
#income_source_id ⇒ String
A unique identifier for an income source.
14 15 16 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 14 def income_source_id @income_source_id end |
#pay_frequency ⇒ CreditBankIncomePayFrequency
The income pay frequency.
74 75 76 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 74 def pay_frequency @pay_frequency end |
#start_date ⇒ Date
Minimum of all dates within the specific income sources in the user’s bank account for days requested by the client. The date will be returned in an ISO 8601 format (YYYY-MM-DD).
64 65 66 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 64 def start_date @start_date end |
#total_amount ⇒ Float
Total amount of earnings in the user’s bank account for the specific income source for days requested by the client.
79 80 81 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 79 def total_amount @total_amount end |
#transaction_count ⇒ Integer
Number of transactions for the income source within the start and end date.
84 85 86 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 84 def transaction_count @transaction_count end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 150 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. income_source_id = hash.key?('income_source_id') ? hash['income_source_id'] : SKIP income_description = hash.key?('income_description') ? hash['income_description'] : SKIP income_category = hash.key?('income_category') ? hash['income_category'] : SKIP account_id = hash.key?('account_id') ? hash['account_id'] : SKIP start_date = hash.key?('start_date') ? hash['start_date'] : SKIP end_date = hash.key?('end_date') ? hash['end_date'] : SKIP pay_frequency = hash.key?('pay_frequency') ? hash['pay_frequency'] : SKIP total_amount = hash.key?('total_amount') ? hash['total_amount'] : SKIP transaction_count = hash.key?('transaction_count') ? hash['transaction_count'] : SKIP # Parameter is an array, so we need to iterate through it historical_summary = nil unless hash['historical_summary'].nil? historical_summary = [] hash['historical_summary'].each do |structure| historical_summary << (CreditBankIncomeHistoricalSummary.from_hash(structure) if structure) end end historical_summary = SKIP unless hash.key?('historical_summary') # 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. CreditBankIncomeSource.new(income_source_id: income_source_id, income_description: income_description, income_category: income_category, account_id: account_id, start_date: start_date, end_date: end_date, pay_frequency: pay_frequency, total_amount: total_amount, transaction_count: transaction_count, historical_summary: historical_summary, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 92 def self.names @_hash = {} if @_hash.nil? @_hash['income_source_id'] = 'income_source_id' @_hash['income_description'] = 'income_description' @_hash['income_category'] = 'income_category' @_hash['account_id'] = 'account_id' @_hash['start_date'] = 'start_date' @_hash['end_date'] = 'end_date' @_hash['pay_frequency'] = 'pay_frequency' @_hash['total_amount'] = 'total_amount' @_hash['transaction_count'] = 'transaction_count' @_hash['historical_summary'] = 'historical_summary' @_hash end |
.nullables ⇒ Object
An array for nullable fields
124 125 126 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 124 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 108 def self.optionals %w[ income_source_id income_description income_category account_id start_date end_date pay_frequency total_amount transaction_count historical_summary ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
211 212 213 214 215 216 217 218 219 220 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 211 def inspect class_name = self.class.name.split('::').last "<#{class_name} income_source_id: #{@income_source_id.inspect}, income_description:"\ " #{@income_description.inspect}, income_category: #{@income_category.inspect}, account_id:"\ " #{@account_id.inspect}, start_date: #{@start_date.inspect}, end_date:"\ " #{@end_date.inspect}, pay_frequency: #{@pay_frequency.inspect}, total_amount:"\ " #{@total_amount.inspect}, transaction_count: #{@transaction_count.inspect},"\ " historical_summary: #{@historical_summary.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
200 201 202 203 204 205 206 207 208 |
# File 'lib/the_plaid_api/models/credit_bank_income_source.rb', line 200 def to_s class_name = self.class.name.split('::').last "<#{class_name} income_source_id: #{@income_source_id}, income_description:"\ " #{@income_description}, income_category: #{@income_category}, account_id: #{@account_id},"\ " start_date: #{@start_date}, end_date: #{@end_date}, pay_frequency: #{@pay_frequency},"\ " total_amount: #{@total_amount}, transaction_count: #{@transaction_count},"\ " historical_summary: #{@historical_summary}, additional_properties:"\ " #{@additional_properties}>" end |