Class: Plaid::InstitutionsGetRequestOptions

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/plaid/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.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/plaid/models/institutions_get_request_options.rb', line 78

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)


41
42
43
# File 'lib/plaid/models/institutions_get_request_options.rb', line 41

def 
  @include_auth_metadata
end

#include_optional_metadataTrueClass | FalseClass

When ‘true`, return the institution’s homepage URL, logo and primary brand color. 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)


36
37
38
# File 'lib/plaid/models/institutions_get_request_options.rb', line 36

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)


46
47
48
# File 'lib/plaid/models/institutions_get_request_options.rb', line 46

def 
  @include_payment_initiation_metadata
end

#oauthTrueClass | FalseClass

Limit results to institutions with or without OAuth login flows. This is primarily relevant to institutions with European country codes.

Returns:

  • (TrueClass | FalseClass)


25
26
27
# File 'lib/plaid/models/institutions_get_request_options.rb', line 25

def oauth
  @oauth
end

#productsArray[Products]

Filter the Institutions based on which products they support.

Returns:



14
15
16
# File 'lib/plaid/models/institutions_get_request_options.rb', line 14

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.

Returns:

  • (Array[String])


20
21
22
# File 'lib/plaid/models/institutions_get_request_options.rb', line 20

def routing_numbers
  @routing_numbers
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/plaid/models/institutions_get_request_options.rb', line 102

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.



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/plaid/models/institutions_get_request_options.rb', line 49

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



74
75
76
# File 'lib/plaid/models/institutions_get_request_options.rb', line 74

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

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.



144
145
146
147
148
149
150
151
152
# File 'lib/plaid/models/institutions_get_request_options.rb', line 144

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.



134
135
136
137
138
139
140
141
# File 'lib/plaid/models/institutions_get_request_options.rb', line 134

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