Class: ThePlaidApi::CreditBankIncomeAccount
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::CreditBankIncomeAccount
- Defined in:
- lib/the_plaid_api/models/credit_bank_income_account.rb
Overview
The Item’s bank accounts that have the selected data.
Instance Attribute Summary collapse
-
#account_id ⇒ String
Plaid’s unique identifier for the account.
-
#mask ⇒ String
The last 2-4 alphanumeric characters of an account’s official account number.
-
#name ⇒ String
The name of the bank account.
-
#official_name ⇒ String
The official name of the bank account.
-
#owners ⇒ Array[Owner]
Data returned by the financial institution about the account owner or owners.
-
#subtype ⇒ DepositoryAccountSubtype
Valid account subtypes for depository accounts.
-
#type ⇒ String
readonly
The account type.
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:, mask:, name:, official_name:, subtype:, owners:, additional_properties: nil) ⇒ CreditBankIncomeAccount
constructor
A new instance of CreditBankIncomeAccount.
-
#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:, mask:, name:, official_name:, subtype:, owners:, additional_properties: nil) ⇒ CreditBankIncomeAccount
Returns a new instance of CreditBankIncomeAccount.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/the_plaid_api/models/credit_bank_income_account.rb', line 74 def initialize(account_id:, mask:, name:, official_name:, subtype:, owners:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_id = account_id @mask = mask @name = name @official_name = official_name @subtype = subtype @type = 'depository' @owners = owners @additional_properties = additional_properties end |
Instance Attribute Details
#account_id ⇒ String
Plaid’s unique identifier for the account.
14 15 16 |
# File 'lib/the_plaid_api/models/credit_bank_income_account.rb', line 14 def account_id @account_id 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.
21 22 23 |
# File 'lib/the_plaid_api/models/credit_bank_income_account.rb', line 21 def mask @mask end |
#name ⇒ String
The name of the bank account.
25 26 27 |
# File 'lib/the_plaid_api/models/credit_bank_income_account.rb', line 25 def name @name end |
#official_name ⇒ String
The official name of the bank account.
29 30 31 |
# File 'lib/the_plaid_api/models/credit_bank_income_account.rb', line 29 def official_name @official_name end |
#owners ⇒ Array[Owner]
Data returned by the financial institution about the account owner or owners. Identity information is optional, so field may return an empty array.
46 47 48 |
# File 'lib/the_plaid_api/models/credit_bank_income_account.rb', line 46 def owners @owners end |
#subtype ⇒ DepositoryAccountSubtype
Valid account subtypes for depository accounts. For a list containing descriptions of each subtype, see [Account schemas](plaid.com/docs/api/accounts/#StandaloneAccountType-deposi tory).
36 37 38 |
# File 'lib/the_plaid_api/models/credit_bank_income_account.rb', line 36 def subtype @subtype end |
#type ⇒ String (readonly)
The account type. This will always be ‘depository`.
40 41 42 |
# File 'lib/the_plaid_api/models/credit_bank_income_account.rb', line 40 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/the_plaid_api/models/credit_bank_income_account.rb', line 90 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_id = hash.key?('account_id') ? hash['account_id'] : nil mask = hash.key?('mask') ? hash['mask'] : nil name = hash.key?('name') ? hash['name'] : nil official_name = hash.key?('official_name') ? hash['official_name'] : 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') # 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. CreditBankIncomeAccount.new(account_id: account_id, mask: mask, name: name, official_name: official_name, subtype: subtype, owners: owners, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/the_plaid_api/models/credit_bank_income_account.rb', line 49 def self.names @_hash = {} if @_hash.nil? @_hash['account_id'] = 'account_id' @_hash['mask'] = 'mask' @_hash['name'] = 'name' @_hash['official_name'] = 'official_name' @_hash['subtype'] = 'subtype' @_hash['type'] = 'type' @_hash['owners'] = 'owners' @_hash end |
.nullables ⇒ Object
An array for nullable fields
67 68 69 70 71 72 |
# File 'lib/the_plaid_api/models/credit_bank_income_account.rb', line 67 def self.nullables %w[ mask official_name ] end |
.optionals ⇒ Object
An array for optional fields
62 63 64 |
# File 'lib/the_plaid_api/models/credit_bank_income_account.rb', line 62 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
136 137 138 139 140 141 142 |
# File 'lib/the_plaid_api/models/credit_bank_income_account.rb', line 136 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id.inspect}, mask: #{@mask.inspect}, name:"\ " #{@name.inspect}, official_name: #{@official_name.inspect}, subtype: #{@subtype.inspect},"\ " type: #{@type.inspect}, owners: #{@owners.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
128 129 130 131 132 133 |
# File 'lib/the_plaid_api/models/credit_bank_income_account.rb', line 128 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id}, mask: #{@mask}, name: #{@name}, official_name:"\ " #{@official_name}, subtype: #{@subtype}, type: #{@type}, owners: #{@owners},"\ " additional_properties: #{@additional_properties}>" end |