Class: ThePlaidApi::StatementsAccount
- Defined in:
- lib/the_plaid_api/models/statements_account.rb
Overview
Account associated with the Item.
Instance Attribute Summary collapse
-
#account_id ⇒ String
Plaid’s unique identifier for the account.
-
#account_mask ⇒ String
The last 2-4 alphanumeric characters of an account’s official account number.
-
#account_name ⇒ String
The name of the account, either assigned by the user or by the financial institution itself.
-
#account_official_name ⇒ String
The official name of the account as given by the financial institution.
-
#account_subtype ⇒ String
The subtype of the account.
-
#account_type ⇒ String
The type of account.
-
#statements ⇒ Array[StatementsStatement]
The list of statements’ metadata associated with this account.
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:, account_mask:, account_name:, account_official_name:, account_subtype:, account_type:, statements:, additional_properties: nil) ⇒ StatementsAccount
constructor
A new instance of StatementsAccount.
-
#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:, account_mask:, account_name:, account_official_name:, account_subtype:, account_type:, statements:, additional_properties: nil) ⇒ StatementsAccount
Returns a new instance of StatementsAccount.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/the_plaid_api/models/statements_account.rb', line 69 def initialize(account_id:, account_mask:, account_name:, account_official_name:, account_subtype:, account_type:, statements:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_id = account_id @account_mask = account_mask @account_name = account_name @account_official_name = account_official_name @account_subtype = account_subtype @account_type = account_type @statements = statements @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/statements_account.rb', line 14 def account_id @account_id end |
#account_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.
20 21 22 |
# File 'lib/the_plaid_api/models/statements_account.rb', line 20 def account_mask @account_mask end |
#account_name ⇒ String
The name of the account, either assigned by the user or by the financial institution itself.
25 26 27 |
# File 'lib/the_plaid_api/models/statements_account.rb', line 25 def account_name @account_name end |
#account_official_name ⇒ String
The official name of the account as given by the financial institution.
29 30 31 |
# File 'lib/the_plaid_api/models/statements_account.rb', line 29 def account_official_name @account_official_name end |
#account_subtype ⇒ String
The subtype of the account. For a full list of valid types and subtypes, see the [Account schema](plaid.com/docs/api/accounts#account-type-schema).
35 36 37 |
# File 'lib/the_plaid_api/models/statements_account.rb', line 35 def account_subtype @account_subtype end |
#account_type ⇒ String
The type of account. For a full list of valid types and subtypes, see the [Account schema](plaid.com/docs/api/accounts#account-type-schema).
40 41 42 |
# File 'lib/the_plaid_api/models/statements_account.rb', line 40 def account_type @account_type end |
#statements ⇒ Array[StatementsStatement]
The list of statements’ metadata associated with this account.
44 45 46 |
# File 'lib/the_plaid_api/models/statements_account.rb', line 44 def statements @statements 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 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/the_plaid_api/models/statements_account.rb', line 86 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_id = hash.key?('account_id') ? hash['account_id'] : nil account_mask = hash.key?('account_mask') ? hash['account_mask'] : nil account_name = hash.key?('account_name') ? hash['account_name'] : nil account_official_name = hash.key?('account_official_name') ? hash['account_official_name'] : nil account_subtype = hash.key?('account_subtype') ? hash['account_subtype'] : nil account_type = hash.key?('account_type') ? hash['account_type'] : nil # Parameter is an array, so we need to iterate through it statements = nil unless hash['statements'].nil? statements = [] hash['statements'].each do |structure| statements << (StatementsStatement.from_hash(structure) if structure) end end statements = nil unless hash.key?('statements') # 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. StatementsAccount.new(account_id: account_id, account_mask: account_mask, account_name: account_name, account_official_name: account_official_name, account_subtype: account_subtype, account_type: account_type, statements: statements, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/the_plaid_api/models/statements_account.rb', line 47 def self.names @_hash = {} if @_hash.nil? @_hash['account_id'] = 'account_id' @_hash['account_mask'] = 'account_mask' @_hash['account_name'] = 'account_name' @_hash['account_official_name'] = 'account_official_name' @_hash['account_subtype'] = 'account_subtype' @_hash['account_type'] = 'account_type' @_hash['statements'] = 'statements' @_hash end |
.nullables ⇒ Object
An array for nullable fields
65 66 67 |
# File 'lib/the_plaid_api/models/statements_account.rb', line 65 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
60 61 62 |
# File 'lib/the_plaid_api/models/statements_account.rb', line 60 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
137 138 139 140 141 142 143 144 |
# File 'lib/the_plaid_api/models/statements_account.rb', line 137 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id.inspect}, account_mask: #{@account_mask.inspect},"\ " account_name: #{@account_name.inspect}, account_official_name:"\ " #{@account_official_name.inspect}, account_subtype: #{@account_subtype.inspect},"\ " account_type: #{@account_type.inspect}, statements: #{@statements.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
128 129 130 131 132 133 134 |
# File 'lib/the_plaid_api/models/statements_account.rb', line 128 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id}, account_mask: #{@account_mask}, account_name:"\ " #{@account_name}, account_official_name: #{@account_official_name}, account_subtype:"\ " #{@account_subtype}, account_type: #{@account_type}, statements: #{@statements},"\ " additional_properties: #{@additional_properties}>" end |