Class: Plaid::AccountIdentity
- Defined in:
- lib/plaid/models/account_identity.rb
Overview
AccountIdentity Model.
Instance Attribute Summary collapse
-
#account_id ⇒ String
Plaid’s unique identifier for the account.
-
#balances ⇒ AccountBalance
A set of fields describing the balance for an account.
-
#mask ⇒ String
The last 2-4 alphanumeric characters of an account’s official account number.
-
#name ⇒ String
The name of the account, either assigned by the user or by the financial institution itself.
-
#official_name ⇒ String
The official name of the account as given by the financial institution.
-
#owners ⇒ Array[Owner]
Data returned by the financial institution about the account owner or owners.
-
#subtype ⇒ AccountSubtype
See the [Account type schema](plaid.com/docs/api/accounts/#account-type-schema) for a full listing of account types and corresponding subtypes.
-
#type ⇒ AccountType
‘investment:` Investment account `credit:` Credit card `depository:` Depository account `loan:` Loan account `brokerage`: An investment account.
-
#verification_status ⇒ VerificationStatus4
The current verification status of an Auth Item initiated through Automated or Manual micro-deposits.
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(account_id:, balances:, mask:, name:, official_name:, type:, subtype:, owners:, verification_status: SKIP, additional_properties: nil) ⇒ AccountIdentity
constructor
A new instance of AccountIdentity.
-
#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(account_id:, balances:, mask:, name:, official_name:, type:, subtype:, owners:, verification_status: SKIP, additional_properties: nil) ⇒ AccountIdentity
Returns a new instance of AccountIdentity.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/plaid/models/account_identity.rb', line 124 def initialize(account_id:, balances:, mask:, name:, official_name:, type:, subtype:, owners:, verification_status: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_id = account_id @balances = balances @mask = mask @name = name @official_name = official_name @type = type @subtype = subtype @verification_status = verification_status unless verification_status == SKIP @owners = owners @additional_properties = additional_properties end |
Instance Attribute Details
#account_id ⇒ String
Plaid’s unique identifier for the account. This value will not change unless Plaid can’t reconcile the account with the data returned by the financial institution. This may occur, for example, when the name of the account changes. If this happens a new ‘account_id` will be assigned to the account. The `account_id` can also change if the `access_token` is deleted and the same credentials that were used to generate that `access_token` are used to generate a new `access_token` on a later date. In that case, the new `account_id` will be different from the old `account_id`. If an account with a specific `account_id` disappears instead of changing, the account is likely closed. Closed accounts are not returned by the Plaid API. Like all Plaid identifiers, the `account_id` is case sensitive.
26 27 28 |
# File 'lib/plaid/models/account_identity.rb', line 26 def account_id @account_id end |
#balances ⇒ AccountBalance
A set of fields describing the balance for an account. Balance information may be cached unless the balance object was returned by ‘/accounts/balance/get`.
32 33 34 |
# File 'lib/plaid/models/account_identity.rb', line 32 def balances @balances end |
#mask ⇒ String
The last 2-4 alphanumeric characters of an account’s official account number. Note that the mask may be non-unique between an Item’s accounts, and it may also not match the mask that the bank displays to the user.
38 39 40 |
# File 'lib/plaid/models/account_identity.rb', line 38 def mask @mask end |
#name ⇒ String
The name of the account, either assigned by the user or by the financial institution itself
43 44 45 |
# File 'lib/plaid/models/account_identity.rb', line 43 def name @name end |
#official_name ⇒ String
The official name of the account as given by the financial institution
47 48 49 |
# File 'lib/plaid/models/account_identity.rb', line 47 def official_name @official_name end |
#owners ⇒ Array[Owner]
Data returned by the financial institution about the account owner or owners. Only returned by Identity or Assets endpoints. Multiple owners on a single account will be represented in the same ‘owner` object, not in multiple owner objects within the array.
92 93 94 |
# File 'lib/plaid/models/account_identity.rb', line 92 def owners @owners end |
#subtype ⇒ AccountSubtype
See the [Account type schema](plaid.com/docs/api/accounts/#account-type-schema) for a full listing of account types and corresponding subtypes.
66 67 68 |
# File 'lib/plaid/models/account_identity.rb', line 66 def subtype @subtype end |
#type ⇒ AccountType
‘investment:` Investment account `credit:` Credit card `depository:` Depository account `loan:` Loan account `brokerage`: An investment account. Used for `/assets/` endpoints only; other endpoints use `investment`. `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.
60 61 62 |
# File 'lib/plaid/models/account_identity.rb', line 60 def type @type end |
#verification_status ⇒ VerificationStatus4
The current verification status of an Auth Item initiated through Automated or Manual micro-deposits. Returned for Auth Items only. ‘pending_automatic_verification`: The Item is pending automatic verification `pending_manual_verification`: The Item is pending manual micro-deposit verification. Items remain in this state until the user successfully verifies the two amounts. `automatically_verified`: The Item has successfully been automatically verified `manually_verified`: The Item has successfully been manually verified `verification_expired`: Plaid was unable to automatically verify the deposit within 7 calendar days and will no longer attempt to validate the Item. Users may retry by submitting their information again through Link. `verification_failed`: The Item failed manual micro-deposit verification because the user exhausted all 3 verification attempts. Users may retry by submitting their information again through Link.
85 86 87 |
# File 'lib/plaid/models/account_identity.rb', line 85 def verification_status @verification_status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/plaid/models/account_identity.rb', line 143 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_id = hash.key?('account_id') ? hash['account_id'] : nil balances = AccountBalance.from_hash(hash['balances']) if hash['balances'] mask = hash.key?('mask') ? hash['mask'] : nil name = hash.key?('name') ? hash['name'] : nil official_name = hash.key?('official_name') ? hash['official_name'] : nil type = hash.key?('type') ? hash['type'] : nil subtype = hash.key?('subtype') ? hash['subtype'] : nil # Parameter is an array, so we need to iterate through it owners = nil unless hash['owners'].nil? owners = [] hash['owners'].each do |structure| owners << (Owner.from_hash(structure) if structure) end end owners = nil unless hash.key?('owners') verification_status = hash.key?('verification_status') ? hash['verification_status'] : SKIP # 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. AccountIdentity.new(account_id: account_id, balances: balances, mask: mask, name: name, official_name: official_name, type: type, subtype: subtype, owners: owners, verification_status: verification_status, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/plaid/models/account_identity.rb', line 95 def self.names @_hash = {} if @_hash.nil? @_hash['account_id'] = 'account_id' @_hash['balances'] = 'balances' @_hash['mask'] = 'mask' @_hash['name'] = 'name' @_hash['official_name'] = 'official_name' @_hash['type'] = 'type' @_hash['subtype'] = 'subtype' @_hash['verification_status'] = 'verification_status' @_hash['owners'] = 'owners' @_hash end |
.nullables ⇒ Object
An array for nullable fields
117 118 119 120 121 122 |
# File 'lib/plaid/models/account_identity.rb', line 117 def self.nullables %w[ mask official_name ] end |
.optionals ⇒ Object
An array for optional fields
110 111 112 113 114 |
# File 'lib/plaid/models/account_identity.rb', line 110 def self.optionals %w[ verification_status ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
197 198 199 200 201 202 203 204 |
# File 'lib/plaid/models/account_identity.rb', line 197 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id.inspect}, balances: #{@balances.inspect}, mask:"\ " #{@mask.inspect}, name: #{@name.inspect}, official_name: #{@official_name.inspect}, type:"\ " #{@type.inspect}, subtype: #{@subtype.inspect}, verification_status:"\ " #{@verification_status.inspect}, owners: #{@owners.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
188 189 190 191 192 193 194 |
# File 'lib/plaid/models/account_identity.rb', line 188 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id}, balances: #{@balances}, mask: #{@mask}, name:"\ " #{@name}, official_name: #{@official_name}, type: #{@type}, subtype: #{@subtype},"\ " verification_status: #{@verification_status}, owners: #{@owners}, additional_properties:"\ " #{@additional_properties}>" end |