Class: ThePlaidApi::NotificationType

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

Overview

Type of Notification

Constant Summary collapse

NOTIFICATION_TYPE =
[
  # TODO: Write general description for ACCOUNT_TAKEOVER
  ACCOUNT_TAKEOVER = 'ACCOUNT_TAKEOVER'.freeze,

  # TODO: Write general description for ADDRESS_CHANGED
  ADDRESS_CHANGED = 'ADDRESS_CHANGED'.freeze,

  # TODO: Write general description for BALANCE
  BALANCE = 'BALANCE'.freeze,

  # TODO: Write general description for CONSENT_EXPIRED
  CONSENT_EXPIRED = 'CONSENT_EXPIRED'.freeze,

  # TODO: Write general description for CONSENT_GRANTED
  CONSENT_GRANTED = 'CONSENT_GRANTED'.freeze,

  # TODO: Write general description for CONSENT_REVOKED
  CONSENT_REVOKED = 'CONSENT_REVOKED'.freeze,

  # TODO: Write general description for CONSENT_UPDATED
  CONSENT_UPDATED = 'CONSENT_UPDATED'.freeze,

  # TODO: Write general description for CUSTOM
  CUSTOM = 'CUSTOM'.freeze,

  # TODO: Write general description for MFA_TARGET_CHANGED
  MFA_TARGET_CHANGED = 'MFA_TARGET_CHANGED'.freeze,

  # TODO: Write general description for PHONE_CHANGED
  PHONE_CHANGED = 'PHONE_CHANGED'.freeze,

  # TODO: Write general description for PLANNED_OUTAGE
  PLANNED_OUTAGE = 'PLANNED_OUTAGE'.freeze,

  # TODO: Write general description for RISK
  RISK = 'RISK'.freeze,

  # TODO: Write general description for SERVICE
  SERVICE = 'SERVICE'.freeze,

  # TODO: Write general description for SUSPECTED_INCIDENT
  SUSPECTED_INCIDENT = 'SUSPECTED_INCIDENT'.freeze,

  # TODO: Write general description for TAN_ACTIVATED
  TAN_ACTIVATED = 'TAN_ACTIVATED'.freeze,

  # TODO: Write general description for TAN_CREATED
  TAN_CREATED = 'TAN_CREATED'.freeze,

  # TODO: Write general description for TAN_REVOKED
  TAN_REVOKED = 'TAN_REVOKED'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ACCOUNT_TAKEOVER) ⇒ Object



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/the_plaid_api/models/notification_type.rb', line 71

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

  str = value.to_s.strip

  case str.downcase
  when 'account_takeover' then ACCOUNT_TAKEOVER
  when 'address_changed' then ADDRESS_CHANGED
  when 'balance' then BALANCE
  when 'consent_expired' then CONSENT_EXPIRED
  when 'consent_granted' then CONSENT_GRANTED
  when 'consent_revoked' then CONSENT_REVOKED
  when 'consent_updated' then CONSENT_UPDATED
  when 'custom' then CUSTOM
  when 'mfa_target_changed' then MFA_TARGET_CHANGED
  when 'phone_changed' then PHONE_CHANGED
  when 'planned_outage' then PLANNED_OUTAGE
  when 'risk' then RISK
  when 'service' then SERVICE
  when 'suspected_incident' then SUSPECTED_INCIDENT
  when 'tan_activated' then TAN_ACTIVATED
  when 'tan_created' then TAN_CREATED
  when 'tan_revoked' then TAN_REVOKED
  when 'tan_suspended' then TAN_SUSPENDED
  else
    default_value
  end
end

.validate(value) ⇒ Object



65
66
67
68
69
# File 'lib/the_plaid_api/models/notification_type.rb', line 65

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

  NOTIFICATION_TYPE.include?(value)
end