smplkit 3.0.64 → 3.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/sso_api.rb +461 -0
  3. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/sso_connection.rb +445 -0
  4. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/sso_connection_request.rb +165 -0
  5. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/sso_connection_resource.rb +225 -0
  6. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/sso_connection_response.rb +165 -0
  7. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/sso_domain.rb +228 -0
  8. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/sso_domain_list_response.rb +193 -0
  9. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/sso_domain_request.rb +165 -0
  10. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/sso_domain_resource.rb +225 -0
  11. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/sso_domain_response.rb +165 -0
  12. data/lib/smplkit/_generated/app/lib/smplkit_app_client.rb +10 -0
  13. data/lib/smplkit/_generated/app/spec/api/sso_api_spec.rb +117 -0
  14. data/lib/smplkit/_generated/app/spec/models/sso_connection_request_spec.rb +36 -0
  15. data/lib/smplkit/_generated/app/spec/models/sso_connection_resource_spec.rb +52 -0
  16. data/lib/smplkit/_generated/app/spec/models/sso_connection_response_spec.rb +36 -0
  17. data/lib/smplkit/_generated/app/spec/models/sso_connection_spec.rb +138 -0
  18. data/lib/smplkit/_generated/app/spec/models/sso_domain_list_response_spec.rb +42 -0
  19. data/lib/smplkit/_generated/app/spec/models/sso_domain_request_spec.rb +36 -0
  20. data/lib/smplkit/_generated/app/spec/models/sso_domain_resource_spec.rb +52 -0
  21. data/lib/smplkit/_generated/app/spec/models/sso_domain_response_spec.rb +36 -0
  22. data/lib/smplkit/_generated/app/spec/models/sso_domain_spec.rb +64 -0
  23. metadata +21 -1
@@ -0,0 +1,445 @@
1
+ =begin
2
+ #smplkit API
3
+
4
+ #API for the smplkit platform.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SmplkitGeneratedClient::App
17
+ # An account's Single Sign-On connection to a customer-controlled identity provider. Configuring a connection lets the account federate authentication to its own SAML or OIDC IdP; with `enforced` enabled, password and social sign-in are disabled for users on the account's verified domains. Each account has at most one SSO connection. The Service Provider metadata fields (`sp_entity_id`, `acs_url`, `slo_url`) are computed on every read from the connection identifier and never stored.
18
+ class SSOConnection < ApiModelBase
19
+ # Federation protocol. `oidc` for OpenID Connect; `saml` for SAML 2.0. Determines which set of IdP fields below are required.
20
+ attr_accessor :protocol
21
+
22
+ # OIDC issuer URL — the base from which `.well-known/openid-configuration` is discovered. Required when `protocol` is `oidc`; ignored when `protocol` is `saml`.
23
+ attr_accessor :oidc_issuer
24
+
25
+ # OIDC client identifier issued by the IdP for smplkit. Required when `protocol` is `oidc`; ignored otherwise.
26
+ attr_accessor :oidc_client_id
27
+
28
+ # OIDC client secret. Write-only — supplied on PUT, never returned by the API. Stored envelope-encrypted at rest. Required on first creation of an OIDC connection; on subsequent PUTs, omit to retain the existing value.
29
+ attr_accessor :oidc_client_secret
30
+
31
+ # SAML IdP EntityID (typically a URI). Required when `protocol` is `saml`; ignored otherwise.
32
+ attr_accessor :saml_idp_entity_id
33
+
34
+ # SAML IdP single sign-on URL (HTTP-Redirect or HTTP-POST endpoint). Required when `protocol` is `saml`.
35
+ attr_accessor :saml_idp_sso_url
36
+
37
+ # SAML IdP single logout URL. Optional — when present, smplkit will issue LogoutRequests on user sign-out.
38
+ attr_accessor :saml_idp_slo_url
39
+
40
+ # SAML IdP X.509 signing certificate (PEM-encoded). Required when `protocol` is `saml`.
41
+ attr_accessor :saml_idp_x509_cert
42
+
43
+ # Role granted to a user provisioned just-in-time on their first SSO login when no group mapping applies. `OWNER` values are downgraded to `ADMIN` for JIT — owner promotion remains an explicit account action.
44
+ attr_accessor :default_role
45
+
46
+ # Mapping of IdP group claim values to smplkit roles. The first key matching the user's group claims (in declaration order) decides the JIT role; if none match, `default_role` applies. Example: `{\"smplkit-admins\": \"ADMIN\"}`.
47
+ attr_accessor :group_role_mappings
48
+
49
+ # When `true`, password and social sign-in are rejected for users whose email domain matches one of the account's verified domains. The account owner is exempt (break-glass).
50
+ attr_accessor :enforced
51
+
52
+ # Service Provider EntityID to register with the IdP. Computed from the connection — paste this value into the IdP's smplkit configuration.
53
+ attr_accessor :sp_entity_id
54
+
55
+ # Assertion Consumer Service URL (SAML) or redirect URI (OIDC) to register with the IdP. Computed.
56
+ attr_accessor :acs_url
57
+
58
+ # Single Logout URL to register with the IdP. Computed; smplkit accepts logout requests here for the SAML case.
59
+ attr_accessor :slo_url
60
+
61
+ # When the connection was created.
62
+ attr_accessor :created_at
63
+
64
+ # When the connection was last modified.
65
+ attr_accessor :updated_at
66
+
67
+ class EnumAttributeValidator
68
+ attr_reader :datatype
69
+ attr_reader :allowable_values
70
+
71
+ def initialize(datatype, allowable_values)
72
+ @allowable_values = allowable_values.map do |value|
73
+ case datatype.to_s
74
+ when /Integer/i
75
+ value.to_i
76
+ when /Float/i
77
+ value.to_f
78
+ else
79
+ value
80
+ end
81
+ end
82
+ end
83
+
84
+ def valid?(value)
85
+ !value || allowable_values.include?(value)
86
+ end
87
+ end
88
+
89
+ # Attribute mapping from ruby-style variable name to JSON key.
90
+ def self.attribute_map
91
+ {
92
+ :'protocol' => :'protocol',
93
+ :'oidc_issuer' => :'oidc_issuer',
94
+ :'oidc_client_id' => :'oidc_client_id',
95
+ :'oidc_client_secret' => :'oidc_client_secret',
96
+ :'saml_idp_entity_id' => :'saml_idp_entity_id',
97
+ :'saml_idp_sso_url' => :'saml_idp_sso_url',
98
+ :'saml_idp_slo_url' => :'saml_idp_slo_url',
99
+ :'saml_idp_x509_cert' => :'saml_idp_x509_cert',
100
+ :'default_role' => :'default_role',
101
+ :'group_role_mappings' => :'group_role_mappings',
102
+ :'enforced' => :'enforced',
103
+ :'sp_entity_id' => :'sp_entity_id',
104
+ :'acs_url' => :'acs_url',
105
+ :'slo_url' => :'slo_url',
106
+ :'created_at' => :'created_at',
107
+ :'updated_at' => :'updated_at'
108
+ }
109
+ end
110
+
111
+ # Returns attribute mapping this model knows about
112
+ def self.acceptable_attribute_map
113
+ attribute_map
114
+ end
115
+
116
+ # Returns all the JSON keys this model knows about
117
+ def self.acceptable_attributes
118
+ acceptable_attribute_map.values
119
+ end
120
+
121
+ # Attribute type mapping.
122
+ def self.openapi_types
123
+ {
124
+ :'protocol' => :'String',
125
+ :'oidc_issuer' => :'String',
126
+ :'oidc_client_id' => :'String',
127
+ :'oidc_client_secret' => :'String',
128
+ :'saml_idp_entity_id' => :'String',
129
+ :'saml_idp_sso_url' => :'String',
130
+ :'saml_idp_slo_url' => :'String',
131
+ :'saml_idp_x509_cert' => :'String',
132
+ :'default_role' => :'String',
133
+ :'group_role_mappings' => :'Hash<String, String>',
134
+ :'enforced' => :'Boolean',
135
+ :'sp_entity_id' => :'String',
136
+ :'acs_url' => :'String',
137
+ :'slo_url' => :'String',
138
+ :'created_at' => :'Time',
139
+ :'updated_at' => :'Time'
140
+ }
141
+ end
142
+
143
+ # List of attributes with nullable: true
144
+ def self.openapi_nullable
145
+ Set.new([
146
+ :'oidc_issuer',
147
+ :'oidc_client_id',
148
+ :'oidc_client_secret',
149
+ :'saml_idp_entity_id',
150
+ :'saml_idp_sso_url',
151
+ :'saml_idp_slo_url',
152
+ :'saml_idp_x509_cert',
153
+ :'sp_entity_id',
154
+ :'acs_url',
155
+ :'slo_url',
156
+ :'created_at',
157
+ :'updated_at'
158
+ ])
159
+ end
160
+
161
+ # Initializes the object
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ def initialize(attributes = {})
164
+ if (!attributes.is_a?(Hash))
165
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::SSOConnection` initialize method"
166
+ end
167
+
168
+ # check to see if the attribute exists and convert string to symbol for hash key
169
+ acceptable_attribute_map = self.class.acceptable_attribute_map
170
+ attributes = attributes.each_with_object({}) { |(k, v), h|
171
+ if (!acceptable_attribute_map.key?(k.to_sym))
172
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::SSOConnection`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
173
+ end
174
+ h[k.to_sym] = v
175
+ }
176
+
177
+ if attributes.key?(:'protocol')
178
+ self.protocol = attributes[:'protocol']
179
+ else
180
+ self.protocol = nil
181
+ end
182
+
183
+ if attributes.key?(:'oidc_issuer')
184
+ self.oidc_issuer = attributes[:'oidc_issuer']
185
+ end
186
+
187
+ if attributes.key?(:'oidc_client_id')
188
+ self.oidc_client_id = attributes[:'oidc_client_id']
189
+ end
190
+
191
+ if attributes.key?(:'oidc_client_secret')
192
+ self.oidc_client_secret = attributes[:'oidc_client_secret']
193
+ end
194
+
195
+ if attributes.key?(:'saml_idp_entity_id')
196
+ self.saml_idp_entity_id = attributes[:'saml_idp_entity_id']
197
+ end
198
+
199
+ if attributes.key?(:'saml_idp_sso_url')
200
+ self.saml_idp_sso_url = attributes[:'saml_idp_sso_url']
201
+ end
202
+
203
+ if attributes.key?(:'saml_idp_slo_url')
204
+ self.saml_idp_slo_url = attributes[:'saml_idp_slo_url']
205
+ end
206
+
207
+ if attributes.key?(:'saml_idp_x509_cert')
208
+ self.saml_idp_x509_cert = attributes[:'saml_idp_x509_cert']
209
+ end
210
+
211
+ if attributes.key?(:'default_role')
212
+ self.default_role = attributes[:'default_role']
213
+ else
214
+ self.default_role = 'MEMBER'
215
+ end
216
+
217
+ if attributes.key?(:'group_role_mappings')
218
+ if (value = attributes[:'group_role_mappings']).is_a?(Hash)
219
+ self.group_role_mappings = value
220
+ end
221
+ end
222
+
223
+ if attributes.key?(:'enforced')
224
+ self.enforced = attributes[:'enforced']
225
+ else
226
+ self.enforced = false
227
+ end
228
+
229
+ if attributes.key?(:'sp_entity_id')
230
+ self.sp_entity_id = attributes[:'sp_entity_id']
231
+ end
232
+
233
+ if attributes.key?(:'acs_url')
234
+ self.acs_url = attributes[:'acs_url']
235
+ end
236
+
237
+ if attributes.key?(:'slo_url')
238
+ self.slo_url = attributes[:'slo_url']
239
+ end
240
+
241
+ if attributes.key?(:'created_at')
242
+ self.created_at = attributes[:'created_at']
243
+ end
244
+
245
+ if attributes.key?(:'updated_at')
246
+ self.updated_at = attributes[:'updated_at']
247
+ end
248
+ end
249
+
250
+ # Show invalid properties with the reasons. Usually used together with valid?
251
+ # @return Array for valid properties with the reasons
252
+ def list_invalid_properties
253
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
254
+ invalid_properties = Array.new
255
+ if @protocol.nil?
256
+ invalid_properties.push('invalid value for "protocol", protocol cannot be nil.')
257
+ end
258
+
259
+ if !@oidc_issuer.nil? && @oidc_issuer.to_s.length > 2048
260
+ invalid_properties.push('invalid value for "oidc_issuer", the character length must be smaller than or equal to 2048.')
261
+ end
262
+
263
+ if !@oidc_client_id.nil? && @oidc_client_id.to_s.length > 512
264
+ invalid_properties.push('invalid value for "oidc_client_id", the character length must be smaller than or equal to 512.')
265
+ end
266
+
267
+ if !@saml_idp_entity_id.nil? && @saml_idp_entity_id.to_s.length > 2048
268
+ invalid_properties.push('invalid value for "saml_idp_entity_id", the character length must be smaller than or equal to 2048.')
269
+ end
270
+
271
+ if !@saml_idp_sso_url.nil? && @saml_idp_sso_url.to_s.length > 2048
272
+ invalid_properties.push('invalid value for "saml_idp_sso_url", the character length must be smaller than or equal to 2048.')
273
+ end
274
+
275
+ if !@saml_idp_slo_url.nil? && @saml_idp_slo_url.to_s.length > 2048
276
+ invalid_properties.push('invalid value for "saml_idp_slo_url", the character length must be smaller than or equal to 2048.')
277
+ end
278
+
279
+ invalid_properties
280
+ end
281
+
282
+ # Check to see if the all the properties in the model are valid
283
+ # @return true if the model is valid
284
+ def valid?
285
+ warn '[DEPRECATED] the `valid?` method is obsolete'
286
+ return false if @protocol.nil?
287
+ protocol_validator = EnumAttributeValidator.new('String', ["saml", "oidc"])
288
+ return false unless protocol_validator.valid?(@protocol)
289
+ return false if !@oidc_issuer.nil? && @oidc_issuer.to_s.length > 2048
290
+ return false if !@oidc_client_id.nil? && @oidc_client_id.to_s.length > 512
291
+ return false if !@saml_idp_entity_id.nil? && @saml_idp_entity_id.to_s.length > 2048
292
+ return false if !@saml_idp_sso_url.nil? && @saml_idp_sso_url.to_s.length > 2048
293
+ return false if !@saml_idp_slo_url.nil? && @saml_idp_slo_url.to_s.length > 2048
294
+ default_role_validator = EnumAttributeValidator.new('String', ["OWNER", "ADMIN", "MEMBER", "VIEWER"])
295
+ return false unless default_role_validator.valid?(@default_role)
296
+ true
297
+ end
298
+
299
+ # Custom attribute writer method checking allowed values (enum).
300
+ # @param [Object] protocol Object to be assigned
301
+ def protocol=(protocol)
302
+ validator = EnumAttributeValidator.new('String', ["saml", "oidc"])
303
+ unless validator.valid?(protocol)
304
+ fail ArgumentError, "invalid value for \"protocol\", must be one of #{validator.allowable_values}."
305
+ end
306
+ @protocol = protocol
307
+ end
308
+
309
+ # Custom attribute writer method with validation
310
+ # @param [Object] oidc_issuer Value to be assigned
311
+ def oidc_issuer=(oidc_issuer)
312
+ if !oidc_issuer.nil? && oidc_issuer.to_s.length > 2048
313
+ fail ArgumentError, 'invalid value for "oidc_issuer", the character length must be smaller than or equal to 2048.'
314
+ end
315
+
316
+ @oidc_issuer = oidc_issuer
317
+ end
318
+
319
+ # Custom attribute writer method with validation
320
+ # @param [Object] oidc_client_id Value to be assigned
321
+ def oidc_client_id=(oidc_client_id)
322
+ if !oidc_client_id.nil? && oidc_client_id.to_s.length > 512
323
+ fail ArgumentError, 'invalid value for "oidc_client_id", the character length must be smaller than or equal to 512.'
324
+ end
325
+
326
+ @oidc_client_id = oidc_client_id
327
+ end
328
+
329
+ # Custom attribute writer method with validation
330
+ # @param [Object] saml_idp_entity_id Value to be assigned
331
+ def saml_idp_entity_id=(saml_idp_entity_id)
332
+ if !saml_idp_entity_id.nil? && saml_idp_entity_id.to_s.length > 2048
333
+ fail ArgumentError, 'invalid value for "saml_idp_entity_id", the character length must be smaller than or equal to 2048.'
334
+ end
335
+
336
+ @saml_idp_entity_id = saml_idp_entity_id
337
+ end
338
+
339
+ # Custom attribute writer method with validation
340
+ # @param [Object] saml_idp_sso_url Value to be assigned
341
+ def saml_idp_sso_url=(saml_idp_sso_url)
342
+ if !saml_idp_sso_url.nil? && saml_idp_sso_url.to_s.length > 2048
343
+ fail ArgumentError, 'invalid value for "saml_idp_sso_url", the character length must be smaller than or equal to 2048.'
344
+ end
345
+
346
+ @saml_idp_sso_url = saml_idp_sso_url
347
+ end
348
+
349
+ # Custom attribute writer method with validation
350
+ # @param [Object] saml_idp_slo_url Value to be assigned
351
+ def saml_idp_slo_url=(saml_idp_slo_url)
352
+ if !saml_idp_slo_url.nil? && saml_idp_slo_url.to_s.length > 2048
353
+ fail ArgumentError, 'invalid value for "saml_idp_slo_url", the character length must be smaller than or equal to 2048.'
354
+ end
355
+
356
+ @saml_idp_slo_url = saml_idp_slo_url
357
+ end
358
+
359
+ # Custom attribute writer method checking allowed values (enum).
360
+ # @param [Object] default_role Object to be assigned
361
+ def default_role=(default_role)
362
+ validator = EnumAttributeValidator.new('String', ["OWNER", "ADMIN", "MEMBER", "VIEWER"])
363
+ unless validator.valid?(default_role)
364
+ fail ArgumentError, "invalid value for \"default_role\", must be one of #{validator.allowable_values}."
365
+ end
366
+ @default_role = default_role
367
+ end
368
+
369
+ # Checks equality by comparing each attribute.
370
+ # @param [Object] Object to be compared
371
+ def ==(o)
372
+ return true if self.equal?(o)
373
+ self.class == o.class &&
374
+ protocol == o.protocol &&
375
+ oidc_issuer == o.oidc_issuer &&
376
+ oidc_client_id == o.oidc_client_id &&
377
+ oidc_client_secret == o.oidc_client_secret &&
378
+ saml_idp_entity_id == o.saml_idp_entity_id &&
379
+ saml_idp_sso_url == o.saml_idp_sso_url &&
380
+ saml_idp_slo_url == o.saml_idp_slo_url &&
381
+ saml_idp_x509_cert == o.saml_idp_x509_cert &&
382
+ default_role == o.default_role &&
383
+ group_role_mappings == o.group_role_mappings &&
384
+ enforced == o.enforced &&
385
+ sp_entity_id == o.sp_entity_id &&
386
+ acs_url == o.acs_url &&
387
+ slo_url == o.slo_url &&
388
+ created_at == o.created_at &&
389
+ updated_at == o.updated_at
390
+ end
391
+
392
+ # @see the `==` method
393
+ # @param [Object] Object to be compared
394
+ def eql?(o)
395
+ self == o
396
+ end
397
+
398
+ # Calculates hash code according to all attributes.
399
+ # @return [Integer] Hash code
400
+ def hash
401
+ [protocol, oidc_issuer, oidc_client_id, oidc_client_secret, saml_idp_entity_id, saml_idp_sso_url, saml_idp_slo_url, saml_idp_x509_cert, default_role, group_role_mappings, enforced, sp_entity_id, acs_url, slo_url, created_at, updated_at].hash
402
+ end
403
+
404
+ # Builds the object from hash
405
+ # @param [Hash] attributes Model attributes in the form of hash
406
+ # @return [Object] Returns the model itself
407
+ def self.build_from_hash(attributes)
408
+ return nil unless attributes.is_a?(Hash)
409
+ attributes = attributes.transform_keys(&:to_sym)
410
+ transformed_hash = {}
411
+ openapi_types.each_pair do |key, type|
412
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
413
+ transformed_hash["#{key}"] = nil
414
+ elsif type =~ /\AArray<(.*)>/i
415
+ # check to ensure the input is an array given that the attribute
416
+ # is documented as an array but the input is not
417
+ if attributes[attribute_map[key]].is_a?(Array)
418
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
419
+ end
420
+ elsif !attributes[attribute_map[key]].nil?
421
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
422
+ end
423
+ end
424
+ new(transformed_hash)
425
+ end
426
+
427
+ # Returns the object in the form of hash
428
+ # @return [Hash] Returns the object in the form of hash
429
+ def to_hash
430
+ hash = {}
431
+ self.class.attribute_map.each_pair do |attr, param|
432
+ value = self.send(attr)
433
+ if value.nil?
434
+ is_nullable = self.class.openapi_nullable.include?(attr)
435
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
436
+ end
437
+
438
+ hash[param] = _to_hash(value)
439
+ end
440
+ hash
441
+ end
442
+
443
+ end
444
+
445
+ end
@@ -0,0 +1,165 @@
1
+ =begin
2
+ #smplkit API
3
+
4
+ #API for the smplkit platform.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SmplkitGeneratedClient::App
17
+ # JSON:API request envelope for creating or replacing the SSO connection.
18
+ class SSOConnectionRequest < ApiModelBase
19
+ attr_accessor :data
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'data' => :'data'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'data' => :'SSOConnectionResource'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::SSOConnectionRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::SSOConnectionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'data')
68
+ self.data = attributes[:'data']
69
+ else
70
+ self.data = nil
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
+ invalid_properties = Array.new
79
+ if @data.nil?
80
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ warn '[DEPRECATED] the `valid?` method is obsolete'
90
+ return false if @data.nil?
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method with validation
95
+ # @param [Object] data Value to be assigned
96
+ def data=(data)
97
+ if data.nil?
98
+ fail ArgumentError, 'data cannot be nil'
99
+ end
100
+
101
+ @data = data
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ data == o.data
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [data].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end