Class: ThePlaidApi::AccountFiltersResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::AccountFiltersResponse
- Defined in:
- lib/the_plaid_api/models/account_filters_response.rb
Overview
The ‘account_filters` specified in the original call to `/link/token/create`.
Instance Attribute Summary collapse
-
#credit ⇒ CreditFilter
A filter to apply to ‘credit`-type accounts.
-
#depository ⇒ DepositoryFilter
A filter to apply to ‘depository`-type accounts.
-
#investment ⇒ InvestmentFilter
A filter to apply to ‘investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier).
-
#loan ⇒ LoanFilter
A filter to apply to ‘loan`-type accounts.
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: SKIP, credit: SKIP, loan: SKIP, investment: SKIP, additional_properties: nil) ⇒ AccountFiltersResponse
constructor
A new instance of AccountFiltersResponse.
-
#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: SKIP, credit: SKIP, loan: SKIP, investment: SKIP, additional_properties: nil) ⇒ AccountFiltersResponse
Returns a new instance of AccountFiltersResponse.
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/the_plaid_api/models/account_filters_response.rb', line 55 def initialize(depository: SKIP, credit: SKIP, loan: SKIP, investment: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @depository = depository unless depository == SKIP @credit = credit unless credit == SKIP @loan = loan unless loan == SKIP @investment = investment unless investment == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#credit ⇒ CreditFilter
A filter to apply to ‘credit`-type accounts
19 20 21 |
# File 'lib/the_plaid_api/models/account_filters_response.rb', line 19 def credit @credit end |
#depository ⇒ DepositoryFilter
A filter to apply to ‘depository`-type accounts
15 16 17 |
# File 'lib/the_plaid_api/models/account_filters_response.rb', line 15 def depository @depository end |
#investment ⇒ InvestmentFilter
A filter to apply to ‘investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier).
28 29 30 |
# File 'lib/the_plaid_api/models/account_filters_response.rb', line 28 def investment @investment end |
#loan ⇒ LoanFilter
A filter to apply to ‘loan`-type accounts
23 24 25 |
# File 'lib/the_plaid_api/models/account_filters_response.rb', line 23 def loan @loan end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/the_plaid_api/models/account_filters_response.rb', line 68 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. depository = DepositoryFilter.from_hash(hash['depository']) if hash['depository'] credit = CreditFilter.from_hash(hash['credit']) if hash['credit'] loan = LoanFilter.from_hash(hash['loan']) if hash['loan'] investment = InvestmentFilter.from_hash(hash['investment']) if hash['investment'] # 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. AccountFiltersResponse.new(depository: depository, credit: credit, loan: loan, investment: investment, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
31 32 33 34 35 36 37 38 |
# File 'lib/the_plaid_api/models/account_filters_response.rb', line 31 def self.names @_hash = {} if @_hash.nil? @_hash['depository'] = 'depository' @_hash['credit'] = 'credit' @_hash['loan'] = 'loan' @_hash['investment'] = 'investment' @_hash end |
.nullables ⇒ Object
An array for nullable fields
51 52 53 |
# File 'lib/the_plaid_api/models/account_filters_response.rb', line 51 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
41 42 43 44 45 46 47 48 |
# File 'lib/the_plaid_api/models/account_filters_response.rb', line 41 def self.optionals %w[ depository credit loan investment ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
100 101 102 103 104 105 |
# File 'lib/the_plaid_api/models/account_filters_response.rb', line 100 def inspect class_name = self.class.name.split('::').last "<#{class_name} depository: #{@depository.inspect}, credit: #{@credit.inspect}, loan:"\ " #{@loan.inspect}, investment: #{@investment.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
93 94 95 96 97 |
# File 'lib/the_plaid_api/models/account_filters_response.rb', line 93 def to_s class_name = self.class.name.split('::').last "<#{class_name} depository: #{@depository}, credit: #{@credit}, loan: #{@loan}, investment:"\ " #{@investment}, additional_properties: #{@additional_properties}>" end |