Class: ThePlaidApi::BeaconBankAccountInsights

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

Overview

Bank Account Insights encapsulate the risk insights for a single Bank Account linked to an Item that is assocaited with a Beacon User.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(account_id:, type:, subtype:, attributes:, additional_properties: nil) ⇒ BeaconBankAccountInsights

Returns a new instance of BeaconBankAccountInsights.



73
74
75
76
77
78
79
80
81
82
83
# File 'lib/the_plaid_api/models/beacon_bank_account_insights.rb', line 73

def initialize(account_id:, type:, subtype:, attributes:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @account_id = 
  @type = type
  @subtype = subtype
  @attributes = attributes
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_idString

The Plaid ‘account_id`

Returns:

  • (String)


15
16
17
# File 'lib/the_plaid_api/models/beacon_bank_account_insights.rb', line 15

def 
  @account_id
end

#attributesBeaconAccountRiskAttributes

The attributes object contains data that can be used to assess account risk. Examples of data include: ‘days_since_first_plaid_connection`: The number of days since the first time the Item was connected to an application via Plaid `plaid_connections_count_7d`: The number of times the Item has been connected to applications via Plaid over the past 7 days `plaid_connections_count_30d`: The number of times the Item has been connected to applications via Plaid over the past 30 days `total_plaid_connections_count`: The number of times the Item has been connected to applications via Plaid For the full list and detailed documentation of core attributes available, or to request that core attributes not be returned, contact Sales or your Plaid account manager



49
50
51
# File 'lib/the_plaid_api/models/beacon_bank_account_insights.rb', line 49

def attributes
  @attributes
end

#subtypeAccountSubtype

See the [Account type schema](plaid.com/docs/api/accounts/#account-type-schema) for a full listing of account types and corresponding subtypes.

Returns:



33
34
35
# File 'lib/the_plaid_api/models/beacon_bank_account_insights.rb', line 33

def subtype
  @subtype
end

#typeAccountType

‘investment:` Investment account. In API versions 2018-05-22 and earlier, this type is called `brokerage` instead. `credit:` Credit card `depository:` Depository account `loan:` Loan account `other:` Non-specified account type See the [Account type schema](plaid.com/docs/api/accounts#account-type-schema) for a full listing of account types and corresponding subtypes.

Returns:



27
28
29
# File 'lib/the_plaid_api/models/beacon_bank_account_insights.rb', line 27

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/the_plaid_api/models/beacon_bank_account_insights.rb', line 86

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('account_id') ? hash['account_id'] : nil
  type = hash.key?('type') ? hash['type'] : nil
  subtype = hash.key?('subtype') ? hash['subtype'] : nil
  attributes = BeaconAccountRiskAttributes.from_hash(hash['attributes']) if hash['attributes']

  # 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.
  BeaconBankAccountInsights.new(account_id: ,
                                type: type,
                                subtype: subtype,
                                attributes: attributes,
                                additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



52
53
54
55
56
57
58
59
# File 'lib/the_plaid_api/models/beacon_bank_account_insights.rb', line 52

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_id'] = 'account_id'
  @_hash['type'] = 'type'
  @_hash['subtype'] = 'subtype'
  @_hash['attributes'] = 'attributes'
  @_hash
end

.nullablesObject

An array for nullable fields



67
68
69
70
71
# File 'lib/the_plaid_api/models/beacon_bank_account_insights.rb', line 67

def self.nullables
  %w[
    subtype
  ]
end

.optionalsObject

An array for optional fields



62
63
64
# File 'lib/the_plaid_api/models/beacon_bank_account_insights.rb', line 62

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



118
119
120
121
122
123
# File 'lib/the_plaid_api/models/beacon_bank_account_insights.rb', line 118

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id.inspect}, type: #{@type.inspect}, subtype:"\
  " #{@subtype.inspect}, attributes: #{@attributes.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



111
112
113
114
115
# File 'lib/the_plaid_api/models/beacon_bank_account_insights.rb', line 111

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id}, type: #{@type}, subtype: #{@subtype},"\
  " attributes: #{@attributes}, additional_properties: #{@additional_properties}>"
end