Class: ThePlaidApi::CraVoaReportTransactionsInsights
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::CraVoaReportTransactionsInsights
- Defined in:
- lib/the_plaid_api/models/cra_voa_report_transactions_insights.rb
Overview
Transaction data associated with the account.
Instance Attribute Summary collapse
-
#all_transactions ⇒ Array[BaseReportTransaction]
Transaction history associated with the account.
-
#end_date ⇒ Date
The latest timeframe provided by the FI, in an ISO 8601 format (YYYY-MM-DD).
-
#start_date ⇒ Date
The earliest timeframe provided by the FI, in an ISO 8601 format (YYYY-MM-DD).
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(all_transactions:, end_date:, start_date:, additional_properties: nil) ⇒ CraVoaReportTransactionsInsights
constructor
A new instance of CraVoaReportTransactionsInsights.
-
#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(all_transactions:, end_date:, start_date:, additional_properties: nil) ⇒ CraVoaReportTransactionsInsights
Returns a new instance of CraVoaReportTransactionsInsights.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/the_plaid_api/models/cra_voa_report_transactions_insights.rb', line 48 def initialize(all_transactions:, end_date:, start_date:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @all_transactions = all_transactions @end_date = end_date @start_date = start_date @additional_properties = additional_properties end |
Instance Attribute Details
#all_transactions ⇒ Array[BaseReportTransaction]
Transaction history associated with the account.
14 15 16 |
# File 'lib/the_plaid_api/models/cra_voa_report_transactions_insights.rb', line 14 def all_transactions @all_transactions end |
#end_date ⇒ Date
The latest timeframe provided by the FI, in an ISO 8601 format (YYYY-MM-DD).
19 20 21 |
# File 'lib/the_plaid_api/models/cra_voa_report_transactions_insights.rb', line 19 def end_date @end_date end |
#start_date ⇒ Date
The earliest timeframe provided by the FI, in an ISO 8601 format (YYYY-MM-DD).
24 25 26 |
# File 'lib/the_plaid_api/models/cra_voa_report_transactions_insights.rb', line 24 def start_date @start_date end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/the_plaid_api/models/cra_voa_report_transactions_insights.rb', line 60 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it all_transactions = nil unless hash['all_transactions'].nil? all_transactions = [] hash['all_transactions'].each do |structure| all_transactions << (BaseReportTransaction.from_hash(structure) if structure) end end all_transactions = nil unless hash.key?('all_transactions') end_date = hash.key?('end_date') ? hash['end_date'] : nil start_date = hash.key?('start_date') ? hash['start_date'] : 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. CraVoaReportTransactionsInsights.new(all_transactions: all_transactions, end_date: end_date, start_date: start_date, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
27 28 29 30 31 32 33 |
# File 'lib/the_plaid_api/models/cra_voa_report_transactions_insights.rb', line 27 def self.names @_hash = {} if @_hash.nil? @_hash['all_transactions'] = 'all_transactions' @_hash['end_date'] = 'end_date' @_hash['start_date'] = 'start_date' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 44 45 46 |
# File 'lib/the_plaid_api/models/cra_voa_report_transactions_insights.rb', line 41 def self.nullables %w[ end_date start_date ] end |
.optionals ⇒ Object
An array for optional fields
36 37 38 |
# File 'lib/the_plaid_api/models/cra_voa_report_transactions_insights.rb', line 36 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/cra_voa_report_transactions_insights.rb', line 99 def inspect class_name = self.class.name.split('::').last "<#{class_name} all_transactions: #{@all_transactions.inspect}, end_date:"\ " #{@end_date.inspect}, start_date: #{@start_date.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
92 93 94 95 96 |
# File 'lib/the_plaid_api/models/cra_voa_report_transactions_insights.rb', line 92 def to_s class_name = self.class.name.split('::').last "<#{class_name} all_transactions: #{@all_transactions}, end_date: #{@end_date}, start_date:"\ " #{@start_date}, additional_properties: #{@additional_properties}>" end |