Class: ThePlaidApi::ClientProvidedRawTransaction
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::ClientProvidedRawTransaction
- Defined in:
- lib/the_plaid_api/models/client_provided_raw_transaction.rb
Overview
A client-provided transaction for Plaid to enhance.
Instance Attribute Summary collapse
-
#amount ⇒ Float
The value of the transaction with direction.
-
#description ⇒ String
The raw description of the transaction.
-
#id ⇒ String
A unique ID for the transaction used to help you tie data back to your systems.
-
#iso_currency_code ⇒ String
The ISO-4217 currency code of the transaction e.g.
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(id:, description:, amount:, iso_currency_code:, additional_properties: nil) ⇒ ClientProvidedRawTransaction
constructor
A new instance of ClientProvidedRawTransaction.
-
#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(id:, description:, amount:, iso_currency_code:, additional_properties: nil) ⇒ ClientProvidedRawTransaction
Returns a new instance of ClientProvidedRawTransaction.
52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/the_plaid_api/models/client_provided_raw_transaction.rb', line 52 def initialize(id:, description:, amount:, iso_currency_code:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id @description = description @amount = amount @iso_currency_code = iso_currency_code @additional_properties = additional_properties end |
Instance Attribute Details
#amount ⇒ Float
The value of the transaction with direction. (NOTE: this will affect enrichment results, so directions are important):.
Negative (-) for credits (e.g., incoming transfers, refunds)
Positive (+) for debits (e.g., purchases, fees, outgoing transfers)
26 27 28 |
# File 'lib/the_plaid_api/models/client_provided_raw_transaction.rb', line 26 def amount @amount end |
#description ⇒ String
The raw description of the transaction.
19 20 21 |
# File 'lib/the_plaid_api/models/client_provided_raw_transaction.rb', line 19 def description @description end |
#id ⇒ String
A unique ID for the transaction used to help you tie data back to your systems.
15 16 17 |
# File 'lib/the_plaid_api/models/client_provided_raw_transaction.rb', line 15 def id @id end |
#iso_currency_code ⇒ String
The ISO-4217 currency code of the transaction e.g. USD.
30 31 32 |
# File 'lib/the_plaid_api/models/client_provided_raw_transaction.rb', line 30 def iso_currency_code @iso_currency_code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/the_plaid_api/models/client_provided_raw_transaction.rb', line 65 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil description = hash.key?('description') ? hash['description'] : nil amount = hash.key?('amount') ? hash['amount'] : nil iso_currency_code = hash.key?('iso_currency_code') ? hash['iso_currency_code'] : 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. ClientProvidedRawTransaction.new(id: id, description: description, amount: amount, iso_currency_code: iso_currency_code, 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/client_provided_raw_transaction.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['description'] = 'description' @_hash['amount'] = 'amount' @_hash['iso_currency_code'] = 'iso_currency_code' @_hash end |
.nullables ⇒ Object
An array for nullable fields
48 49 50 |
# File 'lib/the_plaid_api/models/client_provided_raw_transaction.rb', line 48 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
43 44 45 |
# File 'lib/the_plaid_api/models/client_provided_raw_transaction.rb', line 43 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
99 100 101 102 103 104 |
# File 'lib/the_plaid_api/models/client_provided_raw_transaction.rb', line 99 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, description: #{@description.inspect}, amount:"\ " #{@amount.inspect}, iso_currency_code: #{@iso_currency_code.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
91 92 93 94 95 96 |
# File 'lib/the_plaid_api/models/client_provided_raw_transaction.rb', line 91 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, description: #{@description}, amount: #{@amount},"\ " iso_currency_code: #{@iso_currency_code}, additional_properties:"\ " #{@additional_properties}>" end |