Class: Spatio::ClientRegistrationResponse

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

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 = {}) ⇒ ClientRegistrationResponse

Initializes the object

Parameters:

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

    Model attributes in the form of hash



93
94
95
96
97
98
99
100
101
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
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
# File 'lib/spatio-sdk/models/client_registration_response.rb', line 93

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Spatio::ClientRegistrationResponse` 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::ClientRegistrationResponse`. 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?(:'client_id')
    self.client_id = attributes[:'client_id']
  else
    self.client_id = nil
  end

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#client_idObject

Returns the value of attribute client_id.



18
19
20
# File 'lib/spatio-sdk/models/client_registration_response.rb', line 18

def client_id
  @client_id
end

#client_id_issued_atObject

Returns the value of attribute client_id_issued_at.



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

def client_id_issued_at
  @client_id_issued_at
end

#client_nameObject

Returns the value of attribute client_name.



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

def client_name
  @client_name
end

#client_secretObject

Only returned when token_endpoint_auth_method is client_secret_*.



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

def client_secret
  @client_secret
end

#grant_typesObject

Returns the value of attribute grant_types.



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

def grant_types
  @grant_types
end

#redirect_urisObject

Returns the value of attribute redirect_uris.



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

def redirect_uris
  @redirect_uris
end

#registration_access_tokenObject

Returns the value of attribute registration_access_token.



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

def registration_access_token
  @registration_access_token
end

#registration_client_uriObject

Returns the value of attribute registration_client_uri.



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

def registration_client_uri
  @registration_client_uri
end

#response_typesObject

Returns the value of attribute response_types.



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

def response_types
  @response_types
end

#scopeObject

Returns the value of attribute scope.



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

def scope
  @scope
end

#token_endpoint_auth_methodObject

Returns the value of attribute token_endpoint_auth_method.



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

def token_endpoint_auth_method
  @token_endpoint_auth_method
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



59
60
61
# File 'lib/spatio-sdk/models/client_registration_response.rb', line 59

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



64
65
66
# File 'lib/spatio-sdk/models/client_registration_response.rb', line 64

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/spatio-sdk/models/client_registration_response.rb', line 42

def self.attribute_map
  {
    :'client_id' => :'client_id',
    :'client_secret' => :'client_secret',
    :'client_name' => :'client_name',
    :'redirect_uris' => :'redirect_uris',
    :'grant_types' => :'grant_types',
    :'response_types' => :'response_types',
    :'scope' => :'scope',
    :'token_endpoint_auth_method' => :'token_endpoint_auth_method',
    :'registration_access_token' => :'registration_access_token',
    :'registration_client_uri' => :'registration_client_uri',
    :'client_id_issued_at' => :'client_id_issued_at'
  }
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



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/spatio-sdk/models/client_registration_response.rb', line 291

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



86
87
88
89
# File 'lib/spatio-sdk/models/client_registration_response.rb', line 86

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

.openapi_typesObject

Attribute type mapping.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/spatio-sdk/models/client_registration_response.rb', line 69

def self.openapi_types
  {
    :'client_id' => :'String',
    :'client_secret' => :'String',
    :'client_name' => :'String',
    :'redirect_uris' => :'Array<String>',
    :'grant_types' => :'Array<String>',
    :'response_types' => :'Array<String>',
    :'scope' => :'String',
    :'token_endpoint_auth_method' => :'String',
    :'registration_access_token' => :'String',
    :'registration_client_uri' => :'String',
    :'client_id_issued_at' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/spatio-sdk/models/client_registration_response.rb', line 260

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      client_id == o.client_id &&
      client_secret == o.client_secret &&
      client_name == o.client_name &&
      redirect_uris == o.redirect_uris &&
      grant_types == o.grant_types &&
      response_types == o.response_types &&
      scope == o.scope &&
      token_endpoint_auth_method == o.token_endpoint_auth_method &&
      registration_access_token == o.registration_access_token &&
      registration_client_uri == o.registration_client_uri &&
      client_id_issued_at == o.client_id_issued_at
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


278
279
280
# File 'lib/spatio-sdk/models/client_registration_response.rb', line 278

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



284
285
286
# File 'lib/spatio-sdk/models/client_registration_response.rb', line 284

def hash
  [client_id, client_secret, client_name, redirect_uris, grant_types, response_types, scope, token_endpoint_auth_method, registration_access_token, registration_client_uri, client_id_issued_at].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
# File 'lib/spatio-sdk/models/client_registration_response.rb', line 170

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

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

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

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

  if @client_id_issued_at.nil?
    invalid_properties.push('invalid value for "client_id_issued_at", client_id_issued_at 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



313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/spatio-sdk/models/client_registration_response.rb', line 313

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



198
199
200
201
202
203
204
205
206
# File 'lib/spatio-sdk/models/client_registration_response.rb', line 198

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @client_id.nil?
  return false if @client_name.nil?
  return false if @redirect_uris.nil?
  return false if @registration_access_token.nil?
  return false if @client_id_issued_at.nil?
  true
end