Class: Spatio::ClientRegistrationRequest

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

Defined Under Namespace

Classes: EnumAttributeValidator

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
167
168
169
170
171
172
173
174
175
176
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 111

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

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

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

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

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

Instance Attribute Details

#client_nameObject

Returns the value of attribute client_name.



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

def client_name
  @client_name
end

#client_uriObject

Returns the value of attribute client_uri.



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

def client_uri
  @client_uri
end

#grant_typesObject

Returns the value of attribute grant_types.



22
23
24
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 22

def grant_types
  @grant_types
end

#logo_uriObject

Returns the value of attribute logo_uri.



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

def logo_uri
  @logo_uri
end

#policy_uriObject

Returns the value of attribute policy_uri.



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

def policy_uri
  @policy_uri
end

#redirect_urisObject

Returns the value of attribute redirect_uris.



20
21
22
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 20

def redirect_uris
  @redirect_uris
end

#response_typesObject

Returns the value of attribute response_types.



24
25
26
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 24

def response_types
  @response_types
end

#scopeObject

Space-separated scope list. Defaults to ‘read:*`.



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

def scope
  @scope
end

#token_endpoint_auth_methodObject

Returns the value of attribute token_endpoint_auth_method.



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

def token_endpoint_auth_method
  @token_endpoint_auth_method
end

#tos_uriObject

Returns the value of attribute tos_uri.



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

def tos_uri
  @tos_uri
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



78
79
80
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 78

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



83
84
85
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 83

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 62

def self.attribute_map
  {
    :'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',
    :'client_uri' => :'client_uri',
    :'logo_uri' => :'logo_uri',
    :'policy_uri' => :'policy_uri',
    :'tos_uri' => :'tos_uri'
  }
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



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 276

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



104
105
106
107
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 104

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

.openapi_typesObject

Attribute type mapping.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 88

def self.openapi_types
  {
    :'client_name' => :'String',
    :'redirect_uris' => :'Array<String>',
    :'grant_types' => :'Array<String>',
    :'response_types' => :'Array<String>',
    :'scope' => :'String',
    :'token_endpoint_auth_method' => :'String',
    :'client_uri' => :'String',
    :'logo_uri' => :'String',
    :'policy_uri' => :'String',
    :'tos_uri' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 246

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      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 &&
      client_uri == o.client_uri &&
      logo_uri == o.logo_uri &&
      policy_uri == o.policy_uri &&
      tos_uri == o.tos_uri
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


263
264
265
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 263

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



269
270
271
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 269

def hash
  [client_name, redirect_uris, grant_types, response_types, scope, token_endpoint_auth_method, client_uri, logo_uri, policy_uri, tos_uri].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 180

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  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 @redirect_uris.length > 10
    invalid_properties.push('invalid value for "redirect_uris", number of items must be less than or equal to 10.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 298

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



200
201
202
203
204
205
206
207
208
# File 'lib/spatio-sdk/models/client_registration_request.rb', line 200

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @client_name.nil?
  return false if @redirect_uris.nil?
  return false if @redirect_uris.length > 10
  token_endpoint_auth_method_validator = EnumAttributeValidator.new('String', ["none", "client_secret_basic", "client_secret_post"])
  return false unless token_endpoint_auth_method_validator.valid?(@token_endpoint_auth_method)
  true
end