Class: ThePlaidApi::CreditBankStatementUploadTransaction
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::CreditBankStatementUploadTransaction
- Defined in:
- lib/the_plaid_api/models/credit_bank_statement_upload_transaction.rb
Overview
An object containing data about a transaction appearing on a user-uploaded bank statement.
Instance Attribute Summary collapse
-
#account_id ⇒ String
The unique id of the bank account that this transaction occurs in.
-
#amount ⇒ Float
The value of the transaction.
-
#date ⇒ Date
The date of when the transaction was made, in ISO 8601 format (YYYY-MM-DD).
-
#original_description ⇒ String
The raw description of the transaction as it appears on the bank statement.
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(amount:, date:, original_description:, account_id:, additional_properties: nil) ⇒ CreditBankStatementUploadTransaction
constructor
A new instance of CreditBankStatementUploadTransaction.
-
#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(amount:, date:, original_description:, account_id:, additional_properties: nil) ⇒ CreditBankStatementUploadTransaction
Returns a new instance of CreditBankStatementUploadTransaction.
57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/the_plaid_api/models/credit_bank_statement_upload_transaction.rb', line 57 def initialize(amount:, date:, original_description:, account_id:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @amount = amount @date = date @original_description = original_description @account_id = account_id @additional_properties = additional_properties end |
Instance Attribute Details
#account_id ⇒ String
The unique id of the bank account that this transaction occurs in
30 31 32 |
# File 'lib/the_plaid_api/models/credit_bank_statement_upload_transaction.rb', line 30 def account_id @account_id end |
#amount ⇒ Float
The value of the transaction. A negative amount indicates that money moved into the account (such as a paycheck being deposited).
16 17 18 |
# File 'lib/the_plaid_api/models/credit_bank_statement_upload_transaction.rb', line 16 def amount @amount end |
#date ⇒ Date
The date of when the transaction was made, in ISO 8601 format (YYYY-MM-DD).
21 22 23 |
# File 'lib/the_plaid_api/models/credit_bank_statement_upload_transaction.rb', line 21 def date @date end |
#original_description ⇒ String
The raw description of the transaction as it appears on the bank statement.
26 27 28 |
# File 'lib/the_plaid_api/models/credit_bank_statement_upload_transaction.rb', line 26 def original_description @original_description end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/the_plaid_api/models/credit_bank_statement_upload_transaction.rb', line 70 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. amount = hash.key?('amount') ? hash['amount'] : nil date = hash.key?('date') ? hash['date'] : nil original_description = hash.key?('original_description') ? hash['original_description'] : nil account_id = hash.key?('account_id') ? hash['account_id'] : nil # 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. CreditBankStatementUploadTransaction.new(amount: amount, date: date, original_description: original_description, account_id: account_id, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 |
# File 'lib/the_plaid_api/models/credit_bank_statement_upload_transaction.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['amount'] = 'amount' @_hash['date'] = 'date' @_hash['original_description'] = 'original_description' @_hash['account_id'] = 'account_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
48 49 50 51 52 53 54 55 |
# File 'lib/the_plaid_api/models/credit_bank_statement_upload_transaction.rb', line 48 def self.nullables %w[ amount date original_description account_id ] end |
.optionals ⇒ Object
An array for optional fields
43 44 45 |
# File 'lib/the_plaid_api/models/credit_bank_statement_upload_transaction.rb', line 43 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
104 105 106 107 108 109 |
# File 'lib/the_plaid_api/models/credit_bank_statement_upload_transaction.rb', line 104 def inspect class_name = self.class.name.split('::').last "<#{class_name} amount: #{@amount.inspect}, date: #{@date.inspect}, original_description:"\ " #{@original_description.inspect}, account_id: #{@account_id.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
96 97 98 99 100 101 |
# File 'lib/the_plaid_api/models/credit_bank_statement_upload_transaction.rb', line 96 def to_s class_name = self.class.name.split('::').last "<#{class_name} amount: #{@amount}, date: #{@date}, original_description:"\ " #{@original_description}, account_id: #{@account_id}, additional_properties:"\ " #{@additional_properties}>" end |