Class: ThePlaidApi::CashFlowUpdatesInsightsV2Webhook
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::CashFlowUpdatesInsightsV2Webhook
- Defined in:
- lib/the_plaid_api/models/cash_flow_updates_insights_v2_webhook.rb
Overview
For each item on an enabled user, this webhook will fire up to four times a day with status information. This webhook will not fire immediately upon enrollment in Cash Flow Updates. The payload may contain an ‘insights` array with insights that have been detected, if any (e.g. `LOW_BALANCE_DETECTED`, `LARGE_DEPOSIT_DETECTED`). Upon receiving the webhook, call `/cra/monitoring_insights/get` to retrieve the updated insights.
Instance Attribute Summary collapse
-
#environment ⇒ WebhookEnvironmentValues
The Plaid environment the webhook was sent from.
-
#insights ⇒ Array[CashFlowInsight]
Array containing the insights detected within the generated report, if any.
-
#status ⇒ MonitoringInsightsStatus
Enum for the status of the insights.
-
#user_id ⇒ String
The ‘user_id` associated with the user whose data is being requested.
-
#webhook_code ⇒ String
‘CASH_FLOW_INSIGHTS_UPDATED`.
-
#webhook_type ⇒ String
‘CASH_FLOW_UPDATES`.
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(webhook_type:, webhook_code:, status:, user_id:, insights:, environment:, additional_properties: nil) ⇒ CashFlowUpdatesInsightsV2Webhook
constructor
A new instance of CashFlowUpdatesInsightsV2Webhook.
-
#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(webhook_type:, webhook_code:, status:, user_id:, insights:, environment:, additional_properties: nil) ⇒ CashFlowUpdatesInsightsV2Webhook
Returns a new instance of CashFlowUpdatesInsightsV2Webhook.
69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/the_plaid_api/models/cash_flow_updates_insights_v2_webhook.rb', line 69 def initialize(webhook_type:, webhook_code:, status:, user_id:, insights:, environment:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @webhook_type = webhook_type @webhook_code = webhook_code @status = status @user_id = user_id @insights = insights @environment = environment @additional_properties = additional_properties end |
Instance Attribute Details
#environment ⇒ WebhookEnvironmentValues
The Plaid environment the webhook was sent from
45 46 47 |
# File 'lib/the_plaid_api/models/cash_flow_updates_insights_v2_webhook.rb', line 45 def environment @environment end |
#insights ⇒ Array[CashFlowInsight]
Array containing the insights detected within the generated report, if any. Possible values include:
`LARGE_DEPOSIT_DETECTED`: signaling a deposit over $5,000
`LOW_BALANCE_DETECTED`: signaling a balance below $100
`NEW_LOAN_PAYMENT_DETECTED`: signaling a new loan payment
`NSF_OVERDRAFT_DETECTED`: signaling an NSF overdraft
41 42 43 |
# File 'lib/the_plaid_api/models/cash_flow_updates_insights_v2_webhook.rb', line 41 def insights @insights end |
#status ⇒ MonitoringInsightsStatus
Enum for the status of the insights
27 28 29 |
# File 'lib/the_plaid_api/models/cash_flow_updates_insights_v2_webhook.rb', line 27 def status @status end |
#user_id ⇒ String
The ‘user_id` associated with the user whose data is being requested. This is received by calling `user/create`.
32 33 34 |
# File 'lib/the_plaid_api/models/cash_flow_updates_insights_v2_webhook.rb', line 32 def user_id @user_id end |
#webhook_code ⇒ String
‘CASH_FLOW_INSIGHTS_UPDATED`
23 24 25 |
# File 'lib/the_plaid_api/models/cash_flow_updates_insights_v2_webhook.rb', line 23 def webhook_code @webhook_code end |
#webhook_type ⇒ String
‘CASH_FLOW_UPDATES`
19 20 21 |
# File 'lib/the_plaid_api/models/cash_flow_updates_insights_v2_webhook.rb', line 19 def webhook_type @webhook_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/the_plaid_api/models/cash_flow_updates_insights_v2_webhook.rb', line 84 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. webhook_type = hash.key?('webhook_type') ? hash['webhook_type'] : nil webhook_code = hash.key?('webhook_code') ? hash['webhook_code'] : nil status = hash.key?('status') ? hash['status'] : nil user_id = hash.key?('user_id') ? hash['user_id'] : nil insights = hash.key?('insights') ? hash['insights'] : nil environment = hash.key?('environment') ? hash['environment'] : 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. CashFlowUpdatesInsightsV2Webhook.new(webhook_type: webhook_type, webhook_code: webhook_code, status: status, user_id: user_id, insights: insights, environment: environment, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/the_plaid_api/models/cash_flow_updates_insights_v2_webhook.rb', line 48 def self.names @_hash = {} if @_hash.nil? @_hash['webhook_type'] = 'webhook_type' @_hash['webhook_code'] = 'webhook_code' @_hash['status'] = 'status' @_hash['user_id'] = 'user_id' @_hash['insights'] = 'insights' @_hash['environment'] = 'environment' @_hash end |
.nullables ⇒ Object
An array for nullable fields
65 66 67 |
# File 'lib/the_plaid_api/models/cash_flow_updates_insights_v2_webhook.rb', line 65 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
60 61 62 |
# File 'lib/the_plaid_api/models/cash_flow_updates_insights_v2_webhook.rb', line 60 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
121 122 123 124 125 126 127 |
# File 'lib/the_plaid_api/models/cash_flow_updates_insights_v2_webhook.rb', line 121 def inspect class_name = self.class.name.split('::').last "<#{class_name} webhook_type: #{@webhook_type.inspect}, webhook_code:"\ " #{@webhook_code.inspect}, status: #{@status.inspect}, user_id: #{@user_id.inspect},"\ " insights: #{@insights.inspect}, environment: #{@environment.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
113 114 115 116 117 118 |
# File 'lib/the_plaid_api/models/cash_flow_updates_insights_v2_webhook.rb', line 113 def to_s class_name = self.class.name.split('::').last "<#{class_name} webhook_type: #{@webhook_type}, webhook_code: #{@webhook_code}, status:"\ " #{@status}, user_id: #{@user_id}, insights: #{@insights}, environment: #{@environment},"\ " additional_properties: #{@additional_properties}>" end |