Class: ThePlaidApi::PendingDisconnectWebhookReason

Inherits:
Object
  • Object
show all
Defined in:
lib/the_plaid_api/models/pending_disconnect_webhook_reason.rb

Overview

Reason why the item is about to be disconnected. ‘INSTITUTION_MIGRATION`: The institution is moving to API or to a different integration. For example, this can occur when an institution moves from a non-OAuth integration to an OAuth integration. `INSTITUTION_TOKEN_EXPIRATION`: The consent on an Item associated with a US or CA institution is about to expire.

Constant Summary collapse

PENDING_DISCONNECT_WEBHOOK_REASON =
[
  # TODO: Write general description for INSTITUTION_MIGRATION
  INSTITUTION_MIGRATION = 'INSTITUTION_MIGRATION'.freeze,

  # TODO: Write general description for INSTITUTION_TOKEN_EXPIRATION
  INSTITUTION_TOKEN_EXPIRATION = 'INSTITUTION_TOKEN_EXPIRATION'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = INSTITUTION_MIGRATION) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/the_plaid_api/models/pending_disconnect_webhook_reason.rb', line 27

def self.from_value(value, default_value = INSTITUTION_MIGRATION)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'institution_migration' then INSTITUTION_MIGRATION
  when 'institution_token_expiration' then INSTITUTION_TOKEN_EXPIRATION
  else
    default_value
  end
end

.validate(value) ⇒ Object



21
22
23
24
25
# File 'lib/the_plaid_api/models/pending_disconnect_webhook_reason.rb', line 21

def self.validate(value)
  return false if value.nil?

  PENDING_DISCONNECT_WEBHOOK_REASON.include?(value)
end