Class: ThePlaidApi::ClientProvidedEnrichedTransaction
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::ClientProvidedEnrichedTransaction
- Defined in:
- lib/the_plaid_api/models/client_provided_enriched_transaction.rb
Overview
A client-provided transaction that Plaid has enriched.
Instance Attribute Summary collapse
-
#account_subtype ⇒ String
The account subtype associated with the transaction.
-
#account_type ⇒ String
The account type associated with the transaction.
-
#amount ⇒ Float
The absolute value of the transaction (>= 0).
-
#client_account_id ⇒ String
A unique account id used to group transactions for a given account, as a unique identifier from your application.
-
#client_customization ⇒ ClientCustomization
Custom client fields.
-
#client_user_id ⇒ String
A unique user id used to group transactions for a given user, as a unique identifier from your application.
-
#description ⇒ String
The raw description of the transaction.
-
#direction ⇒ EnrichTransactionDirection
The direction of the transaction from the perspective of the account holder: ‘OUTFLOW` - Includes outgoing transfers, purchases, and fees.
-
#enrichments ⇒ Enrichments
A grouping of the Plaid produced transaction enrichment fields.
-
#id ⇒ String
The unique ID for the transaction as provided by you in the request.
-
#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:, enrichments:, client_user_id: SKIP, client_account_id: SKIP, account_type: SKIP, account_subtype: SKIP, direction: SKIP, client_customization: SKIP, additional_properties: nil) ⇒ ClientProvidedEnrichedTransaction
constructor
A new instance of ClientProvidedEnrichedTransaction.
-
#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:, enrichments:, client_user_id: SKIP, client_account_id: SKIP, account_type: SKIP, account_subtype: SKIP, direction: SKIP, client_customization: SKIP, additional_properties: nil) ⇒ ClientProvidedEnrichedTransaction
Returns a new instance of ClientProvidedEnrichedTransaction.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 109 def initialize(id:, description:, amount:, iso_currency_code:, enrichments:, client_user_id: SKIP, client_account_id: SKIP, account_type: SKIP, account_subtype: SKIP, direction: SKIP, client_customization: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id @client_user_id = client_user_id unless client_user_id == SKIP @client_account_id = client_account_id unless client_account_id == SKIP @account_type = account_type unless account_type == SKIP @account_subtype = account_subtype unless account_subtype == SKIP @description = description @amount = amount @direction = direction unless direction == SKIP @iso_currency_code = iso_currency_code @enrichments = enrichments @client_customization = client_customization unless client_customization == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_subtype ⇒ String
The account subtype associated with the transaction. For a full list of valid types and subtypes, see the [Account schema](plaid.com/docs/api/accounts#account-type-schema).
40 41 42 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 40 def account_subtype @account_subtype end |
#account_type ⇒ String
The account type associated with the transaction. For a full list of valid types and subtypes, see the [Account schema](plaid.com/docs/api/accounts#account-type-schema).
34 35 36 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 34 def account_type @account_type end |
#amount ⇒ Float
The absolute value of the transaction (>= 0)
48 49 50 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 48 def amount @amount end |
#client_account_id ⇒ String
A unique account id used to group transactions for a given account, as a unique identifier from your application. Personally identifiable information, such as an email address or phone number, should not be used in the ‘client_account_id`.
28 29 30 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 28 def client_account_id @client_account_id end |
#client_customization ⇒ ClientCustomization
Custom client fields
71 72 73 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 71 def client_customization @client_customization end |
#client_user_id ⇒ String
A unique user id used to group transactions for a given user, as a unique identifier from your application. Personally identifiable information, such as an email address or phone number, should not be used in the ‘client_user_id`.
21 22 23 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 21 def client_user_id @client_user_id end |
#description ⇒ String
The raw description of the transaction.
44 45 46 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 44 def description @description end |
#direction ⇒ EnrichTransactionDirection
The direction of the transaction from the perspective of the account holder: ‘OUTFLOW` - Includes outgoing transfers, purchases, and fees. (Typically represented as a negative value on checking accounts and debit cards and a positive value on credit cards.) `INFLOW` - Includes incoming transfers, refunds, and income. (Typically represented as a positive value on checking accounts and debit cards and a negative value on credit cards.)
59 60 61 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 59 def direction @direction end |
#enrichments ⇒ Enrichments
A grouping of the Plaid produced transaction enrichment fields.
67 68 69 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 67 def enrichments @enrichments end |
#id ⇒ String
The unique ID for the transaction as provided by you in the request.
14 15 16 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 14 def id @id end |
#iso_currency_code ⇒ String
The ISO-4217 currency code of the transaction e.g. USD.
63 64 65 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 63 def iso_currency_code @iso_currency_code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 131 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 enrichments = Enrichments.from_hash(hash['enrichments']) if hash['enrichments'] client_user_id = hash.key?('client_user_id') ? hash['client_user_id'] : SKIP client_account_id = hash.key?('client_account_id') ? hash['client_account_id'] : SKIP account_type = hash.key?('account_type') ? hash['account_type'] : SKIP account_subtype = hash.key?('account_subtype') ? hash['account_subtype'] : SKIP direction = hash.key?('direction') ? hash['direction'] : SKIP client_customization = ClientCustomization.from_hash(hash['client_customization']) if hash['client_customization'] # 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. ClientProvidedEnrichedTransaction.new(id: id, description: description, amount: amount, iso_currency_code: iso_currency_code, enrichments: enrichments, client_user_id: client_user_id, client_account_id: client_account_id, account_type: account_type, account_subtype: account_subtype, direction: direction, client_customization: client_customization, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 74 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['client_user_id'] = 'client_user_id' @_hash['client_account_id'] = 'client_account_id' @_hash['account_type'] = 'account_type' @_hash['account_subtype'] = 'account_subtype' @_hash['description'] = 'description' @_hash['amount'] = 'amount' @_hash['direction'] = 'direction' @_hash['iso_currency_code'] = 'iso_currency_code' @_hash['enrichments'] = 'enrichments' @_hash['client_customization'] = 'client_customization' @_hash end |
.nullables ⇒ Object
An array for nullable fields
103 104 105 106 107 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 103 def self.nullables %w[ client_customization ] end |
.optionals ⇒ Object
An array for optional fields
91 92 93 94 95 96 97 98 99 100 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 91 def self.optionals %w[ client_user_id client_account_id account_type account_subtype direction client_customization ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
186 187 188 189 190 191 192 193 194 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 186 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, client_user_id: #{@client_user_id.inspect},"\ " client_account_id: #{@client_account_id.inspect}, account_type: #{@account_type.inspect},"\ " account_subtype: #{@account_subtype.inspect}, description: #{@description.inspect},"\ " amount: #{@amount.inspect}, direction: #{@direction.inspect}, iso_currency_code:"\ " #{@iso_currency_code.inspect}, enrichments: #{@enrichments.inspect}, client_customization:"\ " #{@client_customization.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
175 176 177 178 179 180 181 182 183 |
# File 'lib/the_plaid_api/models/client_provided_enriched_transaction.rb', line 175 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, client_user_id: #{@client_user_id}, client_account_id:"\ " #{@client_account_id}, account_type: #{@account_type}, account_subtype:"\ " #{@account_subtype}, description: #{@description}, amount: #{@amount}, direction:"\ " #{@direction}, iso_currency_code: #{@iso_currency_code}, enrichments: #{@enrichments},"\ " client_customization: #{@client_customization}, additional_properties:"\ " #{@additional_properties}>" end |