Class: Spatio::DiscoveryDocument

Inherits:
ApiModelBase show all
Defined in:
lib/spatio-sdk/models/discovery_document.rb

Overview

OAuth 2.1 (RFC 8414) + OpenID Connect Discovery 1.0 metadata. Same payload returned from both well-known paths.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ DiscoveryDocument

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/spatio-sdk/models/discovery_document.rb', line 121

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Spatio::DiscoveryDocument` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Spatio::DiscoveryDocument`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'issuer')
    self.issuer = attributes[:'issuer']
  else
    self.issuer = nil
  end

  if attributes.key?(:'authorization_endpoint')
    self.authorization_endpoint = attributes[:'authorization_endpoint']
  else
    self.authorization_endpoint = nil
  end

  if attributes.key?(:'token_endpoint')
    self.token_endpoint = attributes[:'token_endpoint']
  else
    self.token_endpoint = nil
  end

  if attributes.key?(:'registration_endpoint')
    self.registration_endpoint = attributes[:'registration_endpoint']
  end

  if attributes.key?(:'introspection_endpoint')
    self.introspection_endpoint = attributes[:'introspection_endpoint']
  end

  if attributes.key?(:'revocation_endpoint')
    self.revocation_endpoint = attributes[:'revocation_endpoint']
  end

  if attributes.key?(:'userinfo_endpoint')
    self.userinfo_endpoint = attributes[:'userinfo_endpoint']
  end

  if attributes.key?(:'jwks_uri')
    self.jwks_uri = attributes[:'jwks_uri']
  else
    self.jwks_uri = nil
  end

  if attributes.key?(:'response_types_supported')
    if (value = attributes[:'response_types_supported']).is_a?(Array)
      self.response_types_supported = value
    end
  end

  if attributes.key?(:'grant_types_supported')
    if (value = attributes[:'grant_types_supported']).is_a?(Array)
      self.grant_types_supported = value
    end
  end

  if attributes.key?(:'token_endpoint_auth_methods_supported')
    if (value = attributes[:'token_endpoint_auth_methods_supported']).is_a?(Array)
      self.token_endpoint_auth_methods_supported = value
    end
  end

  if attributes.key?(:'code_challenge_methods_supported')
    if (value = attributes[:'code_challenge_methods_supported']).is_a?(Array)
      self.code_challenge_methods_supported = value
    end
  end

  if attributes.key?(:'scopes_supported')
    if (value = attributes[:'scopes_supported']).is_a?(Array)
      self.scopes_supported = value
    end
  else
    self.scopes_supported = nil
  end

  if attributes.key?(:'subject_types_supported')
    if (value = attributes[:'subject_types_supported']).is_a?(Array)
      self.subject_types_supported = value
    end
  end

  if attributes.key?(:'id_token_signing_alg_values_supported')
    if (value = attributes[:'id_token_signing_alg_values_supported']).is_a?(Array)
      self.id_token_signing_alg_values_supported = value
    end
  end

  if attributes.key?(:'prompt_values_supported')
    if (value = attributes[:'prompt_values_supported']).is_a?(Array)
      self.prompt_values_supported = value
    end
  end

  if attributes.key?(:'claims_supported')
    if (value = attributes[:'claims_supported']).is_a?(Array)
      self.claims_supported = value
    end
  end

  if attributes.key?(:'service_documentation')
    self.service_documentation = attributes[:'service_documentation']
  end
end

Instance Attribute Details

#authorization_endpointObject

Returns the value of attribute authorization_endpoint.



21
22
23
# File 'lib/spatio-sdk/models/discovery_document.rb', line 21

def authorization_endpoint
  @authorization_endpoint
end

#claims_supportedObject

Returns the value of attribute claims_supported.



51
52
53
# File 'lib/spatio-sdk/models/discovery_document.rb', line 51

def claims_supported
  @claims_supported
end

#code_challenge_methods_supportedObject

Returns the value of attribute code_challenge_methods_supported.



41
42
43
# File 'lib/spatio-sdk/models/discovery_document.rb', line 41

def code_challenge_methods_supported
  @code_challenge_methods_supported
end

#grant_types_supportedObject

Returns the value of attribute grant_types_supported.



37
38
39
# File 'lib/spatio-sdk/models/discovery_document.rb', line 37

def grant_types_supported
  @grant_types_supported
end

#id_token_signing_alg_values_supportedObject

Returns the value of attribute id_token_signing_alg_values_supported.



47
48
49
# File 'lib/spatio-sdk/models/discovery_document.rb', line 47

def id_token_signing_alg_values_supported
  @id_token_signing_alg_values_supported
end

#introspection_endpointObject

Returns the value of attribute introspection_endpoint.



27
28
29
# File 'lib/spatio-sdk/models/discovery_document.rb', line 27

def introspection_endpoint
  @introspection_endpoint
end

#issuerObject

Returns the value of attribute issuer.



19
20
21
# File 'lib/spatio-sdk/models/discovery_document.rb', line 19

def issuer
  @issuer
end

#jwks_uriObject

Returns the value of attribute jwks_uri.



33
34
35
# File 'lib/spatio-sdk/models/discovery_document.rb', line 33

def jwks_uri
  @jwks_uri
end

#prompt_values_supportedObject

Returns the value of attribute prompt_values_supported.



49
50
51
# File 'lib/spatio-sdk/models/discovery_document.rb', line 49

def prompt_values_supported
  @prompt_values_supported
end

#registration_endpointObject

Returns the value of attribute registration_endpoint.



25
26
27
# File 'lib/spatio-sdk/models/discovery_document.rb', line 25

def registration_endpoint
  @registration_endpoint
end

#response_types_supportedObject

Returns the value of attribute response_types_supported.



35
36
37
# File 'lib/spatio-sdk/models/discovery_document.rb', line 35

def response_types_supported
  @response_types_supported
end

#revocation_endpointObject

Returns the value of attribute revocation_endpoint.



29
30
31
# File 'lib/spatio-sdk/models/discovery_document.rb', line 29

def revocation_endpoint
  @revocation_endpoint
end

#scopes_supportedObject

Returns the value of attribute scopes_supported.



43
44
45
# File 'lib/spatio-sdk/models/discovery_document.rb', line 43

def scopes_supported
  @scopes_supported
end

#service_documentationObject

Returns the value of attribute service_documentation.



53
54
55
# File 'lib/spatio-sdk/models/discovery_document.rb', line 53

def service_documentation
  @service_documentation
end

#subject_types_supportedObject

Returns the value of attribute subject_types_supported.



45
46
47
# File 'lib/spatio-sdk/models/discovery_document.rb', line 45

def subject_types_supported
  @subject_types_supported
end

#token_endpointObject

Returns the value of attribute token_endpoint.



23
24
25
# File 'lib/spatio-sdk/models/discovery_document.rb', line 23

def token_endpoint
  @token_endpoint
end

#token_endpoint_auth_methods_supportedObject

Returns the value of attribute token_endpoint_auth_methods_supported.



39
40
41
# File 'lib/spatio-sdk/models/discovery_document.rb', line 39

def token_endpoint_auth_methods_supported
  @token_endpoint_auth_methods_supported
end

#userinfo_endpointObject

Returns the value of attribute userinfo_endpoint.



31
32
33
# File 'lib/spatio-sdk/models/discovery_document.rb', line 31

def userinfo_endpoint
  @userinfo_endpoint
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



80
81
82
# File 'lib/spatio-sdk/models/discovery_document.rb', line 80

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



85
86
87
# File 'lib/spatio-sdk/models/discovery_document.rb', line 85

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/spatio-sdk/models/discovery_document.rb', line 56

def self.attribute_map
  {
    :'issuer' => :'issuer',
    :'authorization_endpoint' => :'authorization_endpoint',
    :'token_endpoint' => :'token_endpoint',
    :'registration_endpoint' => :'registration_endpoint',
    :'introspection_endpoint' => :'introspection_endpoint',
    :'revocation_endpoint' => :'revocation_endpoint',
    :'userinfo_endpoint' => :'userinfo_endpoint',
    :'jwks_uri' => :'jwks_uri',
    :'response_types_supported' => :'response_types_supported',
    :'grant_types_supported' => :'grant_types_supported',
    :'token_endpoint_auth_methods_supported' => :'token_endpoint_auth_methods_supported',
    :'code_challenge_methods_supported' => :'code_challenge_methods_supported',
    :'scopes_supported' => :'scopes_supported',
    :'subject_types_supported' => :'subject_types_supported',
    :'id_token_signing_alg_values_supported' => :'id_token_signing_alg_values_supported',
    :'prompt_values_supported' => :'prompt_values_supported',
    :'claims_supported' => :'claims_supported',
    :'service_documentation' => :'service_documentation'
  }
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



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/spatio-sdk/models/discovery_document.rb', line 366

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



114
115
116
117
# File 'lib/spatio-sdk/models/discovery_document.rb', line 114

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/spatio-sdk/models/discovery_document.rb', line 90

def self.openapi_types
  {
    :'issuer' => :'String',
    :'authorization_endpoint' => :'String',
    :'token_endpoint' => :'String',
    :'registration_endpoint' => :'String',
    :'introspection_endpoint' => :'String',
    :'revocation_endpoint' => :'String',
    :'userinfo_endpoint' => :'String',
    :'jwks_uri' => :'String',
    :'response_types_supported' => :'Array<String>',
    :'grant_types_supported' => :'Array<String>',
    :'token_endpoint_auth_methods_supported' => :'Array<String>',
    :'code_challenge_methods_supported' => :'Array<String>',
    :'scopes_supported' => :'Array<String>',
    :'subject_types_supported' => :'Array<String>',
    :'id_token_signing_alg_values_supported' => :'Array<String>',
    :'prompt_values_supported' => :'Array<String>',
    :'claims_supported' => :'Array<String>',
    :'service_documentation' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/spatio-sdk/models/discovery_document.rb', line 328

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      issuer == o.issuer &&
      authorization_endpoint == o.authorization_endpoint &&
      token_endpoint == o.token_endpoint &&
      registration_endpoint == o.registration_endpoint &&
      introspection_endpoint == o.introspection_endpoint &&
      revocation_endpoint == o.revocation_endpoint &&
      userinfo_endpoint == o.userinfo_endpoint &&
      jwks_uri == o.jwks_uri &&
      response_types_supported == o.response_types_supported &&
      grant_types_supported == o.grant_types_supported &&
      token_endpoint_auth_methods_supported == o.token_endpoint_auth_methods_supported &&
      code_challenge_methods_supported == o.code_challenge_methods_supported &&
      scopes_supported == o.scopes_supported &&
      subject_types_supported == o.subject_types_supported &&
      id_token_signing_alg_values_supported == o.id_token_signing_alg_values_supported &&
      prompt_values_supported == o.prompt_values_supported &&
      claims_supported == o.claims_supported &&
      service_documentation == o.service_documentation
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


353
354
355
# File 'lib/spatio-sdk/models/discovery_document.rb', line 353

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



359
360
361
# File 'lib/spatio-sdk/models/discovery_document.rb', line 359

def hash
  [issuer, authorization_endpoint, token_endpoint, registration_endpoint, introspection_endpoint, revocation_endpoint, userinfo_endpoint, jwks_uri, response_types_supported, grant_types_supported, token_endpoint_auth_methods_supported, code_challenge_methods_supported, scopes_supported, subject_types_supported, id_token_signing_alg_values_supported, prompt_values_supported, claims_supported, service_documentation].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/spatio-sdk/models/discovery_document.rb', line 238

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @issuer.nil?
    invalid_properties.push('invalid value for "issuer", issuer cannot be nil.')
  end

  if @authorization_endpoint.nil?
    invalid_properties.push('invalid value for "authorization_endpoint", authorization_endpoint cannot be nil.')
  end

  if @token_endpoint.nil?
    invalid_properties.push('invalid value for "token_endpoint", token_endpoint cannot be nil.')
  end

  if @jwks_uri.nil?
    invalid_properties.push('invalid value for "jwks_uri", jwks_uri cannot be nil.')
  end

  if @scopes_supported.nil?
    invalid_properties.push('invalid value for "scopes_supported", scopes_supported cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



388
389
390
391
392
393
394
395
396
397
398
399
400
# File 'lib/spatio-sdk/models/discovery_document.rb', line 388

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

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

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



266
267
268
269
270
271
272
273
274
# File 'lib/spatio-sdk/models/discovery_document.rb', line 266

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @issuer.nil?
  return false if @authorization_endpoint.nil?
  return false if @token_endpoint.nil?
  return false if @jwks_uri.nil?
  return false if @scopes_supported.nil?
  true
end