Class: ThePlaidApi::RecurringTransactions
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::RecurringTransactions
- Defined in:
- lib/the_plaid_api/models/recurring_transactions.rb
Overview
Insights object for recurring transactions for ‘/beta/transactions/user_insights/v1/get` endpoint
Instance Attribute Summary collapse
-
#inflow_streams ⇒ Array[RecurringInsightsStream]
An array of inflow transaction streams (e.g., income).
-
#outflow_streams ⇒ Array[RecurringInsightsStream]
An array of outflow transaction streams (e.g., subscriptions, bills, loan payments).
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(inflow_streams:, outflow_streams:, additional_properties: nil) ⇒ RecurringTransactions
constructor
A new instance of RecurringTransactions.
-
#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(inflow_streams:, outflow_streams:, additional_properties: nil) ⇒ RecurringTransactions
Returns a new instance of RecurringTransactions.
40 41 42 43 44 45 46 47 48 |
# File 'lib/the_plaid_api/models/recurring_transactions.rb', line 40 def initialize(inflow_streams:, outflow_streams:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @inflow_streams = inflow_streams @outflow_streams = outflow_streams @additional_properties = additional_properties end |
Instance Attribute Details
#inflow_streams ⇒ Array[RecurringInsightsStream]
An array of inflow transaction streams (e.g., income).
15 16 17 |
# File 'lib/the_plaid_api/models/recurring_transactions.rb', line 15 def inflow_streams @inflow_streams end |
#outflow_streams ⇒ Array[RecurringInsightsStream]
An array of outflow transaction streams (e.g., subscriptions, bills, loan payments).
20 21 22 |
# File 'lib/the_plaid_api/models/recurring_transactions.rb', line 20 def outflow_streams @outflow_streams end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
51 52 53 54 55 56 57 58 59 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 |
# File 'lib/the_plaid_api/models/recurring_transactions.rb', line 51 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 inflow_streams = nil unless hash['inflow_streams'].nil? inflow_streams = [] hash['inflow_streams'].each do |structure| inflow_streams << (RecurringInsightsStream.from_hash(structure) if structure) end end inflow_streams = nil unless hash.key?('inflow_streams') # Parameter is an array, so we need to iterate through it outflow_streams = nil unless hash['outflow_streams'].nil? outflow_streams = [] hash['outflow_streams'].each do |structure| outflow_streams << (RecurringInsightsStream.from_hash(structure) if structure) end end outflow_streams = nil unless hash.key?('outflow_streams') # 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. RecurringTransactions.new(inflow_streams: inflow_streams, outflow_streams: outflow_streams, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
23 24 25 26 27 28 |
# File 'lib/the_plaid_api/models/recurring_transactions.rb', line 23 def self.names @_hash = {} if @_hash.nil? @_hash['inflow_streams'] = 'inflow_streams' @_hash['outflow_streams'] = 'outflow_streams' @_hash end |
.nullables ⇒ Object
An array for nullable fields
36 37 38 |
# File 'lib/the_plaid_api/models/recurring_transactions.rb', line 36 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
31 32 33 |
# File 'lib/the_plaid_api/models/recurring_transactions.rb', line 31 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
97 98 99 100 101 |
# File 'lib/the_plaid_api/models/recurring_transactions.rb', line 97 def inspect class_name = self.class.name.split('::').last "<#{class_name} inflow_streams: #{@inflow_streams.inspect}, outflow_streams:"\ " #{@outflow_streams.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
90 91 92 93 94 |
# File 'lib/the_plaid_api/models/recurring_transactions.rb', line 90 def to_s class_name = self.class.name.split('::').last "<#{class_name} inflow_streams: #{@inflow_streams}, outflow_streams: #{@outflow_streams},"\ " additional_properties: #{@additional_properties}>" end |