Class: OCI::Apigateway::Models::OAuth2ResponseValidationFailurePolicy

Inherits:
ValidationFailurePolicy show all
Defined in:
lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb

Overview

Policy to specify OAuth2 flow configuration.

Constant Summary collapse

RESPONSE_TYPE_ENUM =
[
  RESPONSE_TYPE_CODE = 'CODE'.freeze,
  RESPONSE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Constants inherited from ValidationFailurePolicy

ValidationFailurePolicy::TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from ValidationFailurePolicy

#type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ValidationFailurePolicy

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ OAuth2ResponseValidationFailurePolicy

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 118

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['type'] = 'OAUTH2'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.client_details = attributes[:'clientDetails'] if attributes[:'clientDetails']

  raise 'You cannot provide both :clientDetails and :client_details' if attributes.key?(:'clientDetails') && attributes.key?(:'client_details')

  self.client_details = attributes[:'client_details'] if attributes[:'client_details']

  self.source_uri_details = attributes[:'sourceUriDetails'] if attributes[:'sourceUriDetails']

  raise 'You cannot provide both :sourceUriDetails and :source_uri_details' if attributes.key?(:'sourceUriDetails') && attributes.key?(:'source_uri_details')

  self.source_uri_details = attributes[:'source_uri_details'] if attributes[:'source_uri_details']

  self.scopes = attributes[:'scopes'] if attributes[:'scopes']

  self.max_expiry_duration_in_hours = attributes[:'maxExpiryDurationInHours'] if attributes[:'maxExpiryDurationInHours']
  self.max_expiry_duration_in_hours = 1 if max_expiry_duration_in_hours.nil? && !attributes.key?(:'maxExpiryDurationInHours') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :maxExpiryDurationInHours and :max_expiry_duration_in_hours' if attributes.key?(:'maxExpiryDurationInHours') && attributes.key?(:'max_expiry_duration_in_hours')

  self.max_expiry_duration_in_hours = attributes[:'max_expiry_duration_in_hours'] if attributes[:'max_expiry_duration_in_hours']
  self.max_expiry_duration_in_hours = 1 if max_expiry_duration_in_hours.nil? && !attributes.key?(:'maxExpiryDurationInHours') && !attributes.key?(:'max_expiry_duration_in_hours') # rubocop:disable Style/StringLiterals

  self.use_cookies_for_session = attributes[:'useCookiesForSession'] unless attributes[:'useCookiesForSession'].nil?
  self.use_cookies_for_session = false if use_cookies_for_session.nil? && !attributes.key?(:'useCookiesForSession') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :useCookiesForSession and :use_cookies_for_session' if attributes.key?(:'useCookiesForSession') && attributes.key?(:'use_cookies_for_session')

  self.use_cookies_for_session = attributes[:'use_cookies_for_session'] unless attributes[:'use_cookies_for_session'].nil?
  self.use_cookies_for_session = false if use_cookies_for_session.nil? && !attributes.key?(:'useCookiesForSession') && !attributes.key?(:'use_cookies_for_session') # rubocop:disable Style/StringLiterals

  self.use_cookies_for_intermediate_steps = attributes[:'useCookiesForIntermediateSteps'] unless attributes[:'useCookiesForIntermediateSteps'].nil?
  self.use_cookies_for_intermediate_steps = false if use_cookies_for_intermediate_steps.nil? && !attributes.key?(:'useCookiesForIntermediateSteps') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :useCookiesForIntermediateSteps and :use_cookies_for_intermediate_steps' if attributes.key?(:'useCookiesForIntermediateSteps') && attributes.key?(:'use_cookies_for_intermediate_steps')

  self.use_cookies_for_intermediate_steps = attributes[:'use_cookies_for_intermediate_steps'] unless attributes[:'use_cookies_for_intermediate_steps'].nil?
  self.use_cookies_for_intermediate_steps = false if use_cookies_for_intermediate_steps.nil? && !attributes.key?(:'useCookiesForIntermediateSteps') && !attributes.key?(:'use_cookies_for_intermediate_steps') # rubocop:disable Style/StringLiterals

  self.use_pkce = attributes[:'usePkce'] unless attributes[:'usePkce'].nil?
  self.use_pkce = false if use_pkce.nil? && !attributes.key?(:'usePkce') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :usePkce and :use_pkce' if attributes.key?(:'usePkce') && attributes.key?(:'use_pkce')

  self.use_pkce = attributes[:'use_pkce'] unless attributes[:'use_pkce'].nil?
  self.use_pkce = false if use_pkce.nil? && !attributes.key?(:'usePkce') && !attributes.key?(:'use_pkce') # rubocop:disable Style/StringLiterals

  self.response_type = attributes[:'responseType'] if attributes[:'responseType']

  raise 'You cannot provide both :responseType and :response_type' if attributes.key?(:'responseType') && attributes.key?(:'response_type')

  self.response_type = attributes[:'response_type'] if attributes[:'response_type']

  self.fallback_redirect_path = attributes[:'fallbackRedirectPath'] if attributes[:'fallbackRedirectPath']

  raise 'You cannot provide both :fallbackRedirectPath and :fallback_redirect_path' if attributes.key?(:'fallbackRedirectPath') && attributes.key?(:'fallback_redirect_path')

  self.fallback_redirect_path = attributes[:'fallback_redirect_path'] if attributes[:'fallback_redirect_path']

  self.logout_path = attributes[:'logoutPath'] if attributes[:'logoutPath']

  raise 'You cannot provide both :logoutPath and :logout_path' if attributes.key?(:'logoutPath') && attributes.key?(:'logout_path')

  self.logout_path = attributes[:'logout_path'] if attributes[:'logout_path']
end

Instance Attribute Details

#client_detailsOCI::Apigateway::Models::ClientAppDetails

This attribute is required.



21
22
23
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 21

def client_details
  @client_details
end

#fallback_redirect_pathString

The path to be used as fallback after OAuth2.

Returns:

  • (String)


58
59
60
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 58

def fallback_redirect_path
  @fallback_redirect_path
end

#logout_pathString

The path to be used as logout.

Returns:

  • (String)


62
63
64
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 62

def logout_path
  @logout_path
end

#max_expiry_duration_in_hoursInteger

The duration for which the OAuth2 success token should be cached before it is fetched again.

Returns:

  • (Integer)


35
36
37
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 35

def max_expiry_duration_in_hours
  @max_expiry_duration_in_hours
end

#response_typeString

[Required] Response Type.

Returns:

  • (String)


54
55
56
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 54

def response_type
  @response_type
end

#scopesArray<String>

[Required] List of scopes.

Returns:

  • (Array<String>)


29
30
31
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 29

def scopes
  @scopes
end

#source_uri_detailsOCI::Apigateway::Models::SourceUriDetails

This attribute is required.



25
26
27
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 25

def source_uri_details
  @source_uri_details
end

#use_cookies_for_intermediate_stepsBOOLEAN

Defines whether or not to use cookies for OAuth2 intermediate steps.

Returns:

  • (BOOLEAN)


45
46
47
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 45

def use_cookies_for_intermediate_steps
  @use_cookies_for_intermediate_steps
end

#use_cookies_for_sessionBOOLEAN

Defines whether or not to use cookies for session maintenance.

Returns:

  • (BOOLEAN)


40
41
42
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 40

def use_cookies_for_session
  @use_cookies_for_session
end

#use_pkceBOOLEAN

Defines whether or not to support PKCE.

Returns:

  • (BOOLEAN)


50
51
52
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 50

def use_pkce
  @use_pkce
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 65

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'type',
    'client_details': :'clientDetails',
    'source_uri_details': :'sourceUriDetails',
    'scopes': :'scopes',
    'max_expiry_duration_in_hours': :'maxExpiryDurationInHours',
    'use_cookies_for_session': :'useCookiesForSession',
    'use_cookies_for_intermediate_steps': :'useCookiesForIntermediateSteps',
    'use_pkce': :'usePkce',
    'response_type': :'responseType',
    'fallback_redirect_path': :'fallbackRedirectPath',
    'logout_path': :'logoutPath'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 84

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'String',
    'client_details': :'OCI::Apigateway::Models::ClientAppDetails',
    'source_uri_details': :'OCI::Apigateway::Models::SourceUriDetails',
    'scopes': :'Array<String>',
    'max_expiry_duration_in_hours': :'Integer',
    'use_cookies_for_session': :'BOOLEAN',
    'use_cookies_for_intermediate_steps': :'BOOLEAN',
    'use_pkce': :'BOOLEAN',
    'response_type': :'String',
    'fallback_redirect_path': :'String',
    'logout_path': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 213

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    type == other.type &&
    client_details == other.client_details &&
    source_uri_details == other.source_uri_details &&
    scopes == other.scopes &&
    max_expiry_duration_in_hours == other.max_expiry_duration_in_hours &&
    use_cookies_for_session == other.use_cookies_for_session &&
    use_cookies_for_intermediate_steps == other.use_cookies_for_intermediate_steps &&
    use_pkce == other.use_pkce &&
    response_type == other.response_type &&
    fallback_redirect_path == other.fallback_redirect_path &&
    logout_path == other.logout_path
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 253

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


233
234
235
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 233

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



242
243
244
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 242

def hash
  [type, client_details, source_uri_details, scopes, max_expiry_duration_in_hours, use_cookies_for_session, use_cookies_for_intermediate_steps, use_pkce, response_type, fallback_redirect_path, logout_path].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



286
287
288
289
290
291
292
293
294
295
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 286

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



280
281
282
# File 'lib/oci/apigateway/models/o_auth2_response_validation_failure_policy.rb', line 280

def to_s
  to_hash.to_s
end