Class: ThePlaidApi::ScopesNullable
- Defined in:
- lib/the_plaid_api/models/scopes_nullable.rb
Overview
The scopes object
Instance Attribute Summary collapse
-
#accounts ⇒ Array[AccountAccess]
The product access being requested.
-
#new_accounts ⇒ TrueClass | FalseClass
Allow access to newly opened accounts as they are opened.
-
#product_access ⇒ ProductAccess
The product access being requested.
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(product_access: SKIP, accounts: SKIP, new_accounts: true, additional_properties: nil) ⇒ ScopesNullable
constructor
A new instance of ScopesNullable.
-
#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(product_access: SKIP, accounts: SKIP, new_accounts: true, additional_properties: nil) ⇒ ScopesNullable
Returns a new instance of ScopesNullable.
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/the_plaid_api/models/scopes_nullable.rb', line 52 def initialize(product_access: SKIP, accounts: SKIP, new_accounts: true, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @product_access = product_access unless product_access == SKIP @accounts = accounts unless accounts == SKIP @new_accounts = new_accounts unless new_accounts == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#accounts ⇒ Array[AccountAccess]
The product access being requested. Used to or disallow product access across all accounts. If unset, defaults to all products allowed.
20 21 22 |
# File 'lib/the_plaid_api/models/scopes_nullable.rb', line 20 def accounts @accounts end |
#new_accounts ⇒ TrueClass | FalseClass
Allow access to newly opened accounts as they are opened. If unset, defaults to ‘true`.
25 26 27 |
# File 'lib/the_plaid_api/models/scopes_nullable.rb', line 25 def new_accounts @new_accounts end |
#product_access ⇒ ProductAccess
The product access being requested. Used to or disallow product access across all accounts. If unset, defaults to all products allowed.
15 16 17 |
# File 'lib/the_plaid_api/models/scopes_nullable.rb', line 15 def product_access @product_access end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/the_plaid_api/models/scopes_nullable.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. product_access = ProductAccess.from_hash(hash['product_access']) if hash['product_access'] # Parameter is an array, so we need to iterate through it accounts = nil unless hash['accounts'].nil? accounts = [] hash['accounts'].each do |structure| accounts << (AccountAccess.from_hash(structure) if structure) end end accounts = SKIP unless hash.key?('accounts') new_accounts = hash['new_accounts'] ||= true # 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. ScopesNullable.new(product_access: product_access, accounts: accounts, new_accounts: new_accounts, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
28 29 30 31 32 33 34 |
# File 'lib/the_plaid_api/models/scopes_nullable.rb', line 28 def self.names @_hash = {} if @_hash.nil? @_hash['product_access'] = 'product_access' @_hash['accounts'] = 'accounts' @_hash['new_accounts'] = 'new_accounts' @_hash end |
.nullables ⇒ Object
An array for nullable fields
46 47 48 49 50 |
# File 'lib/the_plaid_api/models/scopes_nullable.rb', line 46 def self.nullables %w[ new_accounts ] end |
.optionals ⇒ Object
An array for optional fields
37 38 39 40 41 42 43 |
# File 'lib/the_plaid_api/models/scopes_nullable.rb', line 37 def self.optionals %w[ product_access accounts new_accounts ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
103 104 105 106 107 |
# File 'lib/the_plaid_api/models/scopes_nullable.rb', line 103 def inspect class_name = self.class.name.split('::').last "<#{class_name} product_access: #{@product_access.inspect}, accounts: #{@accounts.inspect},"\ " new_accounts: #{@new_accounts.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
96 97 98 99 100 |
# File 'lib/the_plaid_api/models/scopes_nullable.rb', line 96 def to_s class_name = self.class.name.split('::').last "<#{class_name} product_access: #{@product_access}, accounts: #{@accounts}, new_accounts:"\ " #{@new_accounts}, additional_properties: #{@additional_properties}>" end |