Class: ThePlaidApi::StandaloneAccountType
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::StandaloneAccountType
- Defined in:
- lib/the_plaid_api/models/standalone_account_type.rb
Overview
The schema below describes the various ‘types` and corresponding `subtypes` that Plaid recognizes and reports for financial institution accounts. For a mapping of supported types and subtypes to Plaid products, see the [Account type / product support matrix](plaid.com/docs/api/accounts/#account-type–product-support-m atrix).
Instance Attribute Summary collapse
-
#credit ⇒ CreditAccount
A credit card type account.
-
#depository ⇒ DepositoryAccount
An account type holding cash, in which funds are deposited.
-
#investment ⇒ InvestmentAccountSubtype1
An investment account.
-
#loan ⇒ LoanAccount
A loan type account.
-
#other ⇒ String
Other or unknown account type.
-
#payroll ⇒ PayrollAccount
A payroll 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(depository:, credit:, loan:, investment:, other:, payroll: SKIP, additional_properties: nil) ⇒ StandaloneAccountType
constructor
A new instance of StandaloneAccountType.
-
#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(depository:, credit:, loan:, investment:, other:, payroll: SKIP, additional_properties: nil) ⇒ StandaloneAccountType
Returns a new instance of StandaloneAccountType.
66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/the_plaid_api/models/standalone_account_type.rb', line 66 def initialize(depository:, credit:, loan:, investment:, other:, payroll: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @depository = depository @credit = credit @loan = loan @investment = investment @payroll = payroll unless payroll == SKIP @other = other @additional_properties = additional_properties end |
Instance Attribute Details
#credit ⇒ CreditAccount
A credit card type account.
23 24 25 |
# File 'lib/the_plaid_api/models/standalone_account_type.rb', line 23 def credit @credit end |
#depository ⇒ DepositoryAccount
An account type holding cash, in which funds are deposited.
19 20 21 |
# File 'lib/the_plaid_api/models/standalone_account_type.rb', line 19 def depository @depository end |
#investment ⇒ InvestmentAccountSubtype1
An investment account. In API versions 2018-05-22 and earlier, this type is called ‘brokerage`.
32 33 34 |
# File 'lib/the_plaid_api/models/standalone_account_type.rb', line 32 def investment @investment end |
#loan ⇒ LoanAccount
A loan type account.
27 28 29 |
# File 'lib/the_plaid_api/models/standalone_account_type.rb', line 27 def loan @loan end |
#other ⇒ String
Other or unknown account type.
40 41 42 |
# File 'lib/the_plaid_api/models/standalone_account_type.rb', line 40 def other @other end |
#payroll ⇒ PayrollAccount
A payroll account.
36 37 38 |
# File 'lib/the_plaid_api/models/standalone_account_type.rb', line 36 def payroll @payroll end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/the_plaid_api/models/standalone_account_type.rb', line 81 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. depository = DepositoryAccount.from_hash(hash['depository']) if hash['depository'] credit = CreditAccount.from_hash(hash['credit']) if hash['credit'] loan = LoanAccount.from_hash(hash['loan']) if hash['loan'] investment = InvestmentAccountSubtype1.from_hash(hash['investment']) if hash['investment'] other = hash.key?('other') ? hash['other'] : nil payroll = PayrollAccount.from_hash(hash['payroll']) if hash['payroll'] # 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. StandaloneAccountType.new(depository: depository, credit: credit, loan: loan, investment: investment, other: other, payroll: payroll, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/the_plaid_api/models/standalone_account_type.rb', line 43 def self.names @_hash = {} if @_hash.nil? @_hash['depository'] = 'depository' @_hash['credit'] = 'credit' @_hash['loan'] = 'loan' @_hash['investment'] = 'investment' @_hash['payroll'] = 'payroll' @_hash['other'] = 'other' @_hash end |
.nullables ⇒ Object
An array for nullable fields
62 63 64 |
# File 'lib/the_plaid_api/models/standalone_account_type.rb', line 62 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
55 56 57 58 59 |
# File 'lib/the_plaid_api/models/standalone_account_type.rb', line 55 def self.optionals %w[ payroll ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
118 119 120 121 122 123 |
# File 'lib/the_plaid_api/models/standalone_account_type.rb', line 118 def inspect class_name = self.class.name.split('::').last "<#{class_name} depository: #{@depository.inspect}, credit: #{@credit.inspect}, loan:"\ " #{@loan.inspect}, investment: #{@investment.inspect}, payroll: #{@payroll.inspect}, other:"\ " #{@other.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
110 111 112 113 114 115 |
# File 'lib/the_plaid_api/models/standalone_account_type.rb', line 110 def to_s class_name = self.class.name.split('::').last "<#{class_name} depository: #{@depository}, credit: #{@credit}, loan: #{@loan}, investment:"\ " #{@investment}, payroll: #{@payroll}, other: #{@other}, additional_properties:"\ " #{@additional_properties}>" end |