Class: ThePlaidApi::CashflowReportInsightsGetResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::CashflowReportInsightsGetResponse
- Defined in:
- lib/the_plaid_api/models/cashflow_report_insights_get_response.rb
Overview
CashflowReportInsightsGetResponse defines the response schema for ‘/cashflow_report/insights/get`
Instance Attribute Summary collapse
-
#account_insights ⇒ CashflowAccountInsights
Insights on the account level.
-
#accounts ⇒ Array[BusinessAccount]
An array containing the ‘accounts` associated with the Item for which transactions are being returned.
-
#item ⇒ Item
Metadata about the Item.
-
#last_generated_time ⇒ DateTime
Datetime of last cashflow report generation in [ISO 8601](wikipedia.org/wiki/ISO_8601) format ( ‘YYYY-MM-DDTHH:mm:ssZ` ).
-
#request_id ⇒ String
A unique identifier for the request, which can be used for troubleshooting.
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(item:, accounts:, account_insights:, last_generated_time:, request_id:, additional_properties: nil) ⇒ CashflowReportInsightsGetResponse
constructor
A new instance of CashflowReportInsightsGetResponse.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_last_generated_time ⇒ Object
-
#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(item:, accounts:, account_insights:, last_generated_time:, request_id:, additional_properties: nil) ⇒ CashflowReportInsightsGetResponse
Returns a new instance of CashflowReportInsightsGetResponse.
62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/the_plaid_api/models/cashflow_report_insights_get_response.rb', line 62 def initialize(item:, accounts:, account_insights:, last_generated_time:, request_id:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @item = item @accounts = accounts @account_insights = account_insights @last_generated_time = last_generated_time @request_id = request_id @additional_properties = additional_properties end |
Instance Attribute Details
#account_insights ⇒ CashflowAccountInsights
Insights on the account level. These are only returned for Credit and Depository type accounts.
27 28 29 |
# File 'lib/the_plaid_api/models/cashflow_report_insights_get_response.rb', line 27 def account_insights @account_insights end |
#accounts ⇒ Array[BusinessAccount]
An array containing the ‘accounts` associated with the Item for which transactions are being returned. Each transaction can be mapped to its corresponding account via the `account_id` field.
22 23 24 |
# File 'lib/the_plaid_api/models/cashflow_report_insights_get_response.rb', line 22 def accounts @accounts end |
#item ⇒ Item
Metadata about the Item.
16 17 18 |
# File 'lib/the_plaid_api/models/cashflow_report_insights_get_response.rb', line 16 def item @item end |
#last_generated_time ⇒ DateTime
Datetime of last cashflow report generation in [ISO 8601](wikipedia.org/wiki/ISO_8601) format ( ‘YYYY-MM-DDTHH:mm:ssZ` )
33 34 35 |
# File 'lib/the_plaid_api/models/cashflow_report_insights_get_response.rb', line 33 def last_generated_time @last_generated_time end |
#request_id ⇒ String
A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.
39 40 41 |
# File 'lib/the_plaid_api/models/cashflow_report_insights_get_response.rb', line 39 def request_id @request_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/the_plaid_api/models/cashflow_report_insights_get_response.rb', line 76 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. item = Item.from_hash(hash['item']) if hash['item'] # Parameter is an array, so we need to iterate through it accounts = nil unless hash['accounts'].nil? accounts = [] hash['accounts'].each do |structure| accounts << (BusinessAccount.from_hash(structure) if structure) end end accounts = nil unless hash.key?('accounts') account_insights = CashflowAccountInsights.from_hash(hash['account_insights']) if hash['account_insights'] last_generated_time = if hash.key?('last_generated_time') (DateTimeHelper.from_rfc3339(hash['last_generated_time']) if hash['last_generated_time']) end request_id = hash.key?('request_id') ? hash['request_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. CashflowReportInsightsGetResponse.new(item: item, accounts: accounts, account_insights: account_insights, last_generated_time: last_generated_time, request_id: request_id, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
42 43 44 45 46 47 48 49 50 |
# File 'lib/the_plaid_api/models/cashflow_report_insights_get_response.rb', line 42 def self.names @_hash = {} if @_hash.nil? @_hash['item'] = 'item' @_hash['accounts'] = 'accounts' @_hash['account_insights'] = 'account_insights' @_hash['last_generated_time'] = 'last_generated_time' @_hash['request_id'] = 'request_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
58 59 60 |
# File 'lib/the_plaid_api/models/cashflow_report_insights_get_response.rb', line 58 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
53 54 55 |
# File 'lib/the_plaid_api/models/cashflow_report_insights_get_response.rb', line 53 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
127 128 129 130 131 132 |
# File 'lib/the_plaid_api/models/cashflow_report_insights_get_response.rb', line 127 def inspect class_name = self.class.name.split('::').last "<#{class_name} item: #{@item.inspect}, accounts: #{@accounts.inspect}, account_insights:"\ " #{@account_insights.inspect}, last_generated_time: #{@last_generated_time.inspect},"\ " request_id: #{@request_id.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_last_generated_time ⇒ Object
114 115 116 |
# File 'lib/the_plaid_api/models/cashflow_report_insights_get_response.rb', line 114 def to_custom_last_generated_time DateTimeHelper.to_rfc3339(last_generated_time) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
119 120 121 122 123 124 |
# File 'lib/the_plaid_api/models/cashflow_report_insights_get_response.rb', line 119 def to_s class_name = self.class.name.split('::').last "<#{class_name} item: #{@item}, accounts: #{@accounts}, account_insights:"\ " #{@account_insights}, last_generated_time: #{@last_generated_time}, request_id:"\ " #{@request_id}, additional_properties: #{@additional_properties}>" end |