Class: ThePlaidApi::InstitutionsGetRequestOptions

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/institutions_get_request_options.rb

Overview

An optional object to filter ‘/institutions/get` results.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(products: SKIP, routing_numbers: SKIP, oauth: SKIP, include_optional_metadata: SKIP, include_auth_metadata: false, include_payment_initiation_metadata: false, additional_properties: nil) ⇒ InstitutionsGetRequestOptions

Returns a new instance of InstitutionsGetRequestOptions.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/the_plaid_api/models/institutions_get_request_options.rb', line 94

def initialize(products: SKIP, routing_numbers: SKIP, oauth: SKIP,
               include_optional_metadata: SKIP,
               include_auth_metadata: false,
               include_payment_initiation_metadata: false,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @products = products unless products == SKIP
  @routing_numbers = routing_numbers unless routing_numbers == SKIP
  @oauth = oauth unless oauth == SKIP
  unless  == SKIP
    @include_optional_metadata =
      
  end
  @include_auth_metadata =  unless  == SKIP
  unless  == SKIP
    @include_payment_initiation_metadata =
      
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#include_auth_metadataTrueClass | FalseClass

When ‘true`, returns metadata related to the Auth product indicating which auth methods are supported.

Returns:

  • (TrueClass | FalseClass)


53
54
55
# File 'lib/the_plaid_api/models/institutions_get_request_options.rb', line 53

def 
  @include_auth_metadata
end

#include_optional_metadataTrueClass | FalseClass

When ‘true`, return the institution’s homepage URL, logo and primary brand color. Not all institutions’ logos are available. Note that Plaid does not own any of the logos shared by the API, and that by accessing or using these logos, you agree that you are doing so at your own risk and will, if necessary, obtain all required permissions from the appropriate rights holders and adhere to any applicable usage guidelines. Plaid disclaims all express or implied warranties with respect to the logos.

Returns:

  • (TrueClass | FalseClass)


48
49
50
# File 'lib/the_plaid_api/models/institutions_get_request_options.rb', line 48

def 
  @include_optional_metadata
end

#include_payment_initiation_metadataTrueClass | FalseClass

When ‘true`, returns metadata related to the Payment Initiation product indicating which payment configurations are supported.

Returns:

  • (TrueClass | FalseClass)


58
59
60
# File 'lib/the_plaid_api/models/institutions_get_request_options.rb', line 58

def 
  @include_payment_initiation_metadata
end

#oauthTrueClass | FalseClass

Limit results to institutions with or without OAuth login flows. Note that institutions will have ‘oauth` set to `true` if some Items associated with that institution are required to use OAuth flows; institutions in a state of migration to OAuth will have the `oauth` attribute set to `true`.

Returns:

  • (TrueClass | FalseClass)


37
38
39
# File 'lib/the_plaid_api/models/institutions_get_request_options.rb', line 37

def oauth
  @oauth
end

#productsArray[Products]

Filter the Institutions based on which products they support. Will only return institutions that support all listed products. When filtering based on ‘auth`, an institution must support Instant Auth to match the criterion. To filter for Signal Transaction Scores support, use `balance`. To filter for Transfer support, use `auth`.

Returns:



18
19
20
# File 'lib/the_plaid_api/models/institutions_get_request_options.rb', line 18

def products
  @products
end

#routing_numbersArray[String]

Specify an array of routing numbers to filter institutions. The response will only return institutions that match all of the routing numbers in the array. Routing number records used for this matching are generally comprehensive; however, failure to match a given routing number to an institution does not necessarily mean that the institution is unsupported by Plaid. Invalid routing numbers (numbers that are not 9 digits in length or do not have a valid checksum) will be filtered from the array before the response is processed. If all provided routing numbers are invalid, an ‘INVALID_REQUEST` error with the code of `INVALID_FIELD` will be returned.

Returns:

  • (Array[String])


30
31
32
# File 'lib/the_plaid_api/models/institutions_get_request_options.rb', line 30

def routing_numbers
  @routing_numbers
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/the_plaid_api/models/institutions_get_request_options.rb', line 118

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  products = hash.key?('products') ? hash['products'] : SKIP
  routing_numbers =
    hash.key?('routing_numbers') ? hash['routing_numbers'] : SKIP
  oauth = hash.key?('oauth') ? hash['oauth'] : SKIP
   =
    hash.key?('include_optional_metadata') ? hash['include_optional_metadata'] : SKIP
   = hash['include_auth_metadata'] ||= false
   =
    hash['include_payment_initiation_metadata'] ||= false

  # 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.
  InstitutionsGetRequestOptions.new(products: products,
                                    routing_numbers: routing_numbers,
                                    oauth: oauth,
                                    include_optional_metadata: ,
                                    include_auth_metadata: ,
                                    include_payment_initiation_metadata: ,
                                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



61
62
63
64
65
66
67
68
69
70
71
# File 'lib/the_plaid_api/models/institutions_get_request_options.rb', line 61

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['products'] = 'products'
  @_hash['routing_numbers'] = 'routing_numbers'
  @_hash['oauth'] = 'oauth'
  @_hash['include_optional_metadata'] = 'include_optional_metadata'
  @_hash['include_auth_metadata'] = 'include_auth_metadata'
  @_hash['include_payment_initiation_metadata'] =
    'include_payment_initiation_metadata'
  @_hash
end

.nullablesObject

An array for nullable fields



86
87
88
89
90
91
92
# File 'lib/the_plaid_api/models/institutions_get_request_options.rb', line 86

def self.nullables
  %w[
    products
    routing_numbers
    oauth
  ]
end

.optionalsObject

An array for optional fields



74
75
76
77
78
79
80
81
82
83
# File 'lib/the_plaid_api/models/institutions_get_request_options.rb', line 74

def self.optionals
  %w[
    products
    routing_numbers
    oauth
    include_optional_metadata
    include_auth_metadata
    include_payment_initiation_metadata
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



160
161
162
163
164
165
166
167
168
# File 'lib/the_plaid_api/models/institutions_get_request_options.rb', line 160

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} products: #{@products.inspect}, routing_numbers:"\
  " #{@routing_numbers.inspect}, oauth: #{@oauth.inspect}, include_optional_metadata:"\
  " #{@include_optional_metadata.inspect}, include_auth_metadata:"\
  " #{@include_auth_metadata.inspect}, include_payment_initiation_metadata:"\
  " #{@include_payment_initiation_metadata.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



150
151
152
153
154
155
156
157
# File 'lib/the_plaid_api/models/institutions_get_request_options.rb', line 150

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} products: #{@products}, routing_numbers: #{@routing_numbers}, oauth:"\
  " #{@oauth}, include_optional_metadata: #{@include_optional_metadata},"\
  " include_auth_metadata: #{@include_auth_metadata}, include_payment_initiation_metadata:"\
  " #{@include_payment_initiation_metadata}, additional_properties:"\
  " #{@additional_properties}>"
end