passageidentity 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +18 -61
  4. data/docs/custom/AuthApi.md +141 -0
  5. data/docs/custom/ClientApi.md +107 -0
  6. data/docs/custom/UserApi.md +419 -0
  7. data/docs/generated/AppInfo.md +94 -0
  8. data/docs/generated/AppResponse.md +18 -0
  9. data/docs/generated/AppsApi.md +77 -0
  10. data/docs/generated/AuthMethods.md +22 -0
  11. data/docs/generated/CreateMagicLinkRequest.md +36 -0
  12. data/docs/generated/CreateUserRequest.md +22 -0
  13. data/docs/generated/ElementCustomization.md +56 -0
  14. data/docs/generated/FontFamily.md +15 -0
  15. data/docs/generated/LayoutConfig.md +26 -0
  16. data/docs/generated/Layouts.md +20 -0
  17. data/docs/generated/ListDevicesResponse.md +18 -0
  18. data/docs/generated/MagicLink.md +36 -0
  19. data/docs/generated/MagicLinkAuthMethod.md +22 -0
  20. data/docs/generated/MagicLinkChannel.md +15 -0
  21. data/docs/generated/MagicLinkResponse.md +18 -0
  22. data/docs/generated/MagicLinkType.md +15 -0
  23. data/docs/generated/MagicLinksApi.md +79 -0
  24. data/docs/generated/Model400Error.md +20 -0
  25. data/docs/generated/Model401Error.md +20 -0
  26. data/docs/generated/Model404Error.md +20 -0
  27. data/docs/generated/Model500Error.md +20 -0
  28. data/docs/generated/OtpAuthMethod.md +22 -0
  29. data/docs/generated/PasskeysAuthMethod.md +18 -0
  30. data/docs/generated/Technologies.md +15 -0
  31. data/docs/generated/TokensApi.md +78 -0
  32. data/docs/generated/TtlDisplayUnit.md +15 -0
  33. data/docs/generated/UpdateMagicLinkAuthMethod.md +22 -0
  34. data/docs/generated/UpdateOtpAuthMethod.md +22 -0
  35. data/docs/generated/UpdatePasskeysAuthMethod.md +18 -0
  36. data/docs/generated/UpdateUserRequest.md +22 -0
  37. data/docs/generated/UserDevicesApi.md +152 -0
  38. data/docs/generated/UserEventInfo.md +26 -0
  39. data/docs/generated/UserInfo.md +46 -0
  40. data/docs/generated/UserMetadataField.md +28 -0
  41. data/docs/generated/UserMetadataFieldType.md +15 -0
  42. data/docs/generated/UserResponse.md +18 -0
  43. data/docs/generated/UserStatus.md +15 -0
  44. data/docs/generated/UsersApi.md +440 -0
  45. data/docs/generated/WebAuthnDevices.md +34 -0
  46. data/docs/generated/WebAuthnIcons.md +20 -0
  47. data/docs/generated/WebAuthnType.md +15 -0
  48. data/generate.sh +31 -0
  49. data/lib/openapi_client/api/apps_api.rb +85 -0
  50. data/lib/openapi_client/api/magic_links_api.rb +96 -0
  51. data/lib/openapi_client/api/tokens_api.rb +91 -0
  52. data/lib/openapi_client/api/user_devices_api.rb +166 -0
  53. data/lib/openapi_client/api/users_api.rb +452 -0
  54. data/lib/openapi_client/api_client.rb +431 -0
  55. data/lib/openapi_client/api_error.rb +58 -0
  56. data/lib/openapi_client/configuration.rb +383 -0
  57. data/lib/openapi_client/models/app_info.rb +853 -0
  58. data/lib/openapi_client/models/app_response.rb +221 -0
  59. data/lib/openapi_client/models/auth_methods.rb +254 -0
  60. data/lib/openapi_client/models/create_magic_link_request.rb +374 -0
  61. data/lib/openapi_client/models/create_user_request.rb +234 -0
  62. data/lib/openapi_client/models/element_customization.rb +457 -0
  63. data/lib/openapi_client/models/font_family.rb +58 -0
  64. data/lib/openapi_client/models/layout_config.rb +285 -0
  65. data/lib/openapi_client/models/layouts.rb +241 -0
  66. data/lib/openapi_client/models/list_devices_response.rb +223 -0
  67. data/lib/openapi_client/models/magic_link.rb +387 -0
  68. data/lib/openapi_client/models/magic_link_auth_method.rb +302 -0
  69. data/lib/openapi_client/models/magic_link_channel.rb +40 -0
  70. data/lib/openapi_client/models/magic_link_response.rb +221 -0
  71. data/lib/openapi_client/models/magic_link_type.rb +40 -0
  72. data/lib/openapi_client/models/model400_error.rb +271 -0
  73. data/lib/openapi_client/models/model401_error.rb +271 -0
  74. data/lib/openapi_client/models/model404_error.rb +271 -0
  75. data/lib/openapi_client/models/model500_error.rb +271 -0
  76. data/lib/openapi_client/models/otp_auth_method.rb +302 -0
  77. data/lib/openapi_client/models/passkeys_auth_method.rb +228 -0
  78. data/lib/openapi_client/models/technologies.rb +46 -0
  79. data/lib/openapi_client/models/ttl_display_unit.rb +42 -0
  80. data/lib/openapi_client/models/update_magic_link_auth_method.rb +276 -0
  81. data/lib/openapi_client/models/update_otp_auth_method.rb +276 -0
  82. data/lib/openapi_client/models/update_passkeys_auth_method.rb +216 -0
  83. data/lib/openapi_client/models/update_user_request.rb +232 -0
  84. data/lib/openapi_client/models/user_event_info.rb +285 -0
  85. data/lib/openapi_client/models/user_info.rb +470 -0
  86. data/lib/openapi_client/models/user_metadata_field.rb +323 -0
  87. data/lib/openapi_client/models/user_metadata_field_type.rb +44 -0
  88. data/lib/openapi_client/models/user_response.rb +221 -0
  89. data/lib/openapi_client/models/user_status.rb +41 -0
  90. data/lib/openapi_client/models/web_authn_devices.rb +378 -0
  91. data/lib/openapi_client/models/web_authn_icons.rb +230 -0
  92. data/lib/openapi_client/models/web_authn_type.rb +41 -0
  93. data/lib/openapi_client/version.rb +15 -0
  94. data/lib/openapi_client.rb +74 -0
  95. data/lib/passageidentity/auth.rb +32 -5
  96. data/lib/passageidentity/client.rb +17 -121
  97. data/lib/passageidentity/user_api.rb +29 -131
  98. data/lib/passageidentity/version.rb +5 -0
  99. data/openapitools.json +7 -0
  100. data/passageidentity.gemspec +3 -1
  101. data/tests/auth_test.rb +6 -1
  102. data/tests/magic_link_test.rb +5 -4
  103. data/tests/user_api_test.rb +2 -2
  104. metadata +96 -2
@@ -0,0 +1,853 @@
1
+ =begin
2
+ #Passage Management API
3
+
4
+ #Passage's management API to manage your Passage apps and users.
5
+
6
+ The version of the OpenAPI document: 1
7
+ Contact: support@passage.id
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.1.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OpenapiClient
17
+ class AppInfo
18
+ attr_accessor :additional_auth_origins
19
+
20
+ # The valid URLs where users can be redirected after authentication.
21
+ attr_accessor :allowed_callback_urls
22
+
23
+ attr_accessor :allowed_identifier
24
+
25
+ # The valid URLs where users can be redirected after logging out.
26
+ attr_accessor :allowed_logout_urls
27
+
28
+ # A route within your application that redirects to the Authorization URL endpoint.
29
+ attr_accessor :application_login_uri
30
+
31
+ # Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods.
32
+ attr_accessor :auth_fallback_method
33
+
34
+ # Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods.
35
+ attr_accessor :auth_fallback_method_ttl
36
+
37
+ attr_accessor :auth_methods
38
+
39
+ attr_accessor :auth_origin
40
+
41
+ attr_accessor :created_at
42
+
43
+ attr_accessor :default_language
44
+
45
+ attr_accessor :id
46
+
47
+ attr_accessor :layouts
48
+
49
+ attr_accessor :login_url
50
+
51
+ attr_accessor :light_logo_url
52
+
53
+ attr_accessor :dark_logo_url
54
+
55
+ attr_accessor :name
56
+
57
+ # whether or not the app's login page hosted by passage
58
+ attr_accessor :hosted
59
+
60
+ # the subdomain of the app's hosted login page
61
+ attr_accessor :hosted_subdomain
62
+
63
+ attr_accessor :id_token_lifetime
64
+
65
+ attr_accessor :passage_branding
66
+
67
+ attr_accessor :profile_management
68
+
69
+ attr_accessor :public_signup
70
+
71
+ attr_accessor :redirect_url
72
+
73
+ attr_accessor :refresh_absolute_lifetime
74
+
75
+ attr_accessor :refresh_enabled
76
+
77
+ attr_accessor :refresh_inactivity_lifetime
78
+
79
+ attr_accessor :require_email_verification
80
+
81
+ attr_accessor :require_identifier_verification
82
+
83
+ attr_accessor :required_identifier
84
+
85
+ attr_accessor :role
86
+
87
+ attr_accessor :rsa_public_key
88
+
89
+ # can only be retrieved by an app admin
90
+ attr_accessor :secret
91
+
92
+ attr_accessor :session_timeout_length
93
+
94
+ attr_accessor :type
95
+
96
+ attr_accessor :user_metadata_schema
97
+
98
+ attr_accessor :technologies
99
+
100
+ attr_accessor :element_customization
101
+
102
+ attr_accessor :element_customization_dark
103
+
104
+ class EnumAttributeValidator
105
+ attr_reader :datatype
106
+ attr_reader :allowable_values
107
+
108
+ def initialize(datatype, allowable_values)
109
+ @allowable_values = allowable_values.map do |value|
110
+ case datatype.to_s
111
+ when /Integer/i
112
+ value.to_i
113
+ when /Float/i
114
+ value.to_f
115
+ else
116
+ value
117
+ end
118
+ end
119
+ end
120
+
121
+ def valid?(value)
122
+ !value || allowable_values.include?(value)
123
+ end
124
+ end
125
+
126
+ # Attribute mapping from ruby-style variable name to JSON key.
127
+ def self.attribute_map
128
+ {
129
+ :'additional_auth_origins' => :'additional_auth_origins',
130
+ :'allowed_callback_urls' => :'allowed_callback_urls',
131
+ :'allowed_identifier' => :'allowed_identifier',
132
+ :'allowed_logout_urls' => :'allowed_logout_urls',
133
+ :'application_login_uri' => :'application_login_uri',
134
+ :'auth_fallback_method' => :'auth_fallback_method',
135
+ :'auth_fallback_method_ttl' => :'auth_fallback_method_ttl',
136
+ :'auth_methods' => :'auth_methods',
137
+ :'auth_origin' => :'auth_origin',
138
+ :'created_at' => :'created_at',
139
+ :'default_language' => :'default_language',
140
+ :'id' => :'id',
141
+ :'layouts' => :'layouts',
142
+ :'login_url' => :'login_url',
143
+ :'light_logo_url' => :'light_logo_url',
144
+ :'dark_logo_url' => :'dark_logo_url',
145
+ :'name' => :'name',
146
+ :'hosted' => :'hosted',
147
+ :'hosted_subdomain' => :'hosted_subdomain',
148
+ :'id_token_lifetime' => :'id_token_lifetime',
149
+ :'passage_branding' => :'passage_branding',
150
+ :'profile_management' => :'profile_management',
151
+ :'public_signup' => :'public_signup',
152
+ :'redirect_url' => :'redirect_url',
153
+ :'refresh_absolute_lifetime' => :'refresh_absolute_lifetime',
154
+ :'refresh_enabled' => :'refresh_enabled',
155
+ :'refresh_inactivity_lifetime' => :'refresh_inactivity_lifetime',
156
+ :'require_email_verification' => :'require_email_verification',
157
+ :'require_identifier_verification' => :'require_identifier_verification',
158
+ :'required_identifier' => :'required_identifier',
159
+ :'role' => :'role',
160
+ :'rsa_public_key' => :'rsa_public_key',
161
+ :'secret' => :'secret',
162
+ :'session_timeout_length' => :'session_timeout_length',
163
+ :'type' => :'type',
164
+ :'user_metadata_schema' => :'user_metadata_schema',
165
+ :'technologies' => :'technologies',
166
+ :'element_customization' => :'element_customization',
167
+ :'element_customization_dark' => :'element_customization_dark'
168
+ }
169
+ end
170
+
171
+ # Returns all the JSON keys this model knows about
172
+ def self.acceptable_attributes
173
+ attribute_map.values
174
+ end
175
+
176
+ # Attribute type mapping.
177
+ def self.openapi_types
178
+ {
179
+ :'additional_auth_origins' => :'Array<String>',
180
+ :'allowed_callback_urls' => :'Array<String>',
181
+ :'allowed_identifier' => :'String',
182
+ :'allowed_logout_urls' => :'Array<String>',
183
+ :'application_login_uri' => :'String',
184
+ :'auth_fallback_method' => :'String',
185
+ :'auth_fallback_method_ttl' => :'Integer',
186
+ :'auth_methods' => :'AuthMethods',
187
+ :'auth_origin' => :'String',
188
+ :'created_at' => :'Time',
189
+ :'default_language' => :'String',
190
+ :'id' => :'String',
191
+ :'layouts' => :'Layouts',
192
+ :'login_url' => :'String',
193
+ :'light_logo_url' => :'String',
194
+ :'dark_logo_url' => :'String',
195
+ :'name' => :'String',
196
+ :'hosted' => :'Boolean',
197
+ :'hosted_subdomain' => :'String',
198
+ :'id_token_lifetime' => :'Integer',
199
+ :'passage_branding' => :'Boolean',
200
+ :'profile_management' => :'Boolean',
201
+ :'public_signup' => :'Boolean',
202
+ :'redirect_url' => :'String',
203
+ :'refresh_absolute_lifetime' => :'Integer',
204
+ :'refresh_enabled' => :'Boolean',
205
+ :'refresh_inactivity_lifetime' => :'Integer',
206
+ :'require_email_verification' => :'Boolean',
207
+ :'require_identifier_verification' => :'Boolean',
208
+ :'required_identifier' => :'String',
209
+ :'role' => :'String',
210
+ :'rsa_public_key' => :'String',
211
+ :'secret' => :'String',
212
+ :'session_timeout_length' => :'Integer',
213
+ :'type' => :'String',
214
+ :'user_metadata_schema' => :'Array<UserMetadataField>',
215
+ :'technologies' => :'Array<Technologies>',
216
+ :'element_customization' => :'ElementCustomization',
217
+ :'element_customization_dark' => :'ElementCustomization'
218
+ }
219
+ end
220
+
221
+ # List of attributes with nullable: true
222
+ def self.openapi_nullable
223
+ Set.new([
224
+ ])
225
+ end
226
+
227
+ # Initializes the object
228
+ # @param [Hash] attributes Model attributes in the form of hash
229
+ def initialize(attributes = {})
230
+ if (!attributes.is_a?(Hash))
231
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::AppInfo` initialize method"
232
+ end
233
+
234
+ # check to see if the attribute exists and convert string to symbol for hash key
235
+ attributes = attributes.each_with_object({}) { |(k, v), h|
236
+ if (!self.class.attribute_map.key?(k.to_sym))
237
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::AppInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
238
+ end
239
+ h[k.to_sym] = v
240
+ }
241
+
242
+ if attributes.key?(:'additional_auth_origins')
243
+ if (value = attributes[:'additional_auth_origins']).is_a?(Array)
244
+ self.additional_auth_origins = value
245
+ end
246
+ else
247
+ self.additional_auth_origins = nil
248
+ end
249
+
250
+ if attributes.key?(:'allowed_callback_urls')
251
+ if (value = attributes[:'allowed_callback_urls']).is_a?(Array)
252
+ self.allowed_callback_urls = value
253
+ end
254
+ else
255
+ self.allowed_callback_urls = nil
256
+ end
257
+
258
+ if attributes.key?(:'allowed_identifier')
259
+ self.allowed_identifier = attributes[:'allowed_identifier']
260
+ else
261
+ self.allowed_identifier = nil
262
+ end
263
+
264
+ if attributes.key?(:'allowed_logout_urls')
265
+ if (value = attributes[:'allowed_logout_urls']).is_a?(Array)
266
+ self.allowed_logout_urls = value
267
+ end
268
+ else
269
+ self.allowed_logout_urls = nil
270
+ end
271
+
272
+ if attributes.key?(:'application_login_uri')
273
+ self.application_login_uri = attributes[:'application_login_uri']
274
+ else
275
+ self.application_login_uri = nil
276
+ end
277
+
278
+ if attributes.key?(:'auth_fallback_method')
279
+ self.auth_fallback_method = attributes[:'auth_fallback_method']
280
+ else
281
+ self.auth_fallback_method = nil
282
+ end
283
+
284
+ if attributes.key?(:'auth_fallback_method_ttl')
285
+ self.auth_fallback_method_ttl = attributes[:'auth_fallback_method_ttl']
286
+ else
287
+ self.auth_fallback_method_ttl = nil
288
+ end
289
+
290
+ if attributes.key?(:'auth_methods')
291
+ self.auth_methods = attributes[:'auth_methods']
292
+ else
293
+ self.auth_methods = nil
294
+ end
295
+
296
+ if attributes.key?(:'auth_origin')
297
+ self.auth_origin = attributes[:'auth_origin']
298
+ else
299
+ self.auth_origin = nil
300
+ end
301
+
302
+ if attributes.key?(:'created_at')
303
+ self.created_at = attributes[:'created_at']
304
+ else
305
+ self.created_at = nil
306
+ end
307
+
308
+ if attributes.key?(:'default_language')
309
+ self.default_language = attributes[:'default_language']
310
+ else
311
+ self.default_language = nil
312
+ end
313
+
314
+ if attributes.key?(:'id')
315
+ self.id = attributes[:'id']
316
+ else
317
+ self.id = nil
318
+ end
319
+
320
+ if attributes.key?(:'layouts')
321
+ self.layouts = attributes[:'layouts']
322
+ else
323
+ self.layouts = nil
324
+ end
325
+
326
+ if attributes.key?(:'login_url')
327
+ self.login_url = attributes[:'login_url']
328
+ else
329
+ self.login_url = nil
330
+ end
331
+
332
+ if attributes.key?(:'light_logo_url')
333
+ self.light_logo_url = attributes[:'light_logo_url']
334
+ end
335
+
336
+ if attributes.key?(:'dark_logo_url')
337
+ self.dark_logo_url = attributes[:'dark_logo_url']
338
+ end
339
+
340
+ if attributes.key?(:'name')
341
+ self.name = attributes[:'name']
342
+ else
343
+ self.name = nil
344
+ end
345
+
346
+ if attributes.key?(:'hosted')
347
+ self.hosted = attributes[:'hosted']
348
+ else
349
+ self.hosted = nil
350
+ end
351
+
352
+ if attributes.key?(:'hosted_subdomain')
353
+ self.hosted_subdomain = attributes[:'hosted_subdomain']
354
+ else
355
+ self.hosted_subdomain = nil
356
+ end
357
+
358
+ if attributes.key?(:'id_token_lifetime')
359
+ self.id_token_lifetime = attributes[:'id_token_lifetime']
360
+ end
361
+
362
+ if attributes.key?(:'passage_branding')
363
+ self.passage_branding = attributes[:'passage_branding']
364
+ else
365
+ self.passage_branding = nil
366
+ end
367
+
368
+ if attributes.key?(:'profile_management')
369
+ self.profile_management = attributes[:'profile_management']
370
+ else
371
+ self.profile_management = nil
372
+ end
373
+
374
+ if attributes.key?(:'public_signup')
375
+ self.public_signup = attributes[:'public_signup']
376
+ else
377
+ self.public_signup = nil
378
+ end
379
+
380
+ if attributes.key?(:'redirect_url')
381
+ self.redirect_url = attributes[:'redirect_url']
382
+ else
383
+ self.redirect_url = nil
384
+ end
385
+
386
+ if attributes.key?(:'refresh_absolute_lifetime')
387
+ self.refresh_absolute_lifetime = attributes[:'refresh_absolute_lifetime']
388
+ else
389
+ self.refresh_absolute_lifetime = nil
390
+ end
391
+
392
+ if attributes.key?(:'refresh_enabled')
393
+ self.refresh_enabled = attributes[:'refresh_enabled']
394
+ else
395
+ self.refresh_enabled = nil
396
+ end
397
+
398
+ if attributes.key?(:'refresh_inactivity_lifetime')
399
+ self.refresh_inactivity_lifetime = attributes[:'refresh_inactivity_lifetime']
400
+ else
401
+ self.refresh_inactivity_lifetime = nil
402
+ end
403
+
404
+ if attributes.key?(:'require_email_verification')
405
+ self.require_email_verification = attributes[:'require_email_verification']
406
+ else
407
+ self.require_email_verification = nil
408
+ end
409
+
410
+ if attributes.key?(:'require_identifier_verification')
411
+ self.require_identifier_verification = attributes[:'require_identifier_verification']
412
+ else
413
+ self.require_identifier_verification = nil
414
+ end
415
+
416
+ if attributes.key?(:'required_identifier')
417
+ self.required_identifier = attributes[:'required_identifier']
418
+ else
419
+ self.required_identifier = nil
420
+ end
421
+
422
+ if attributes.key?(:'role')
423
+ self.role = attributes[:'role']
424
+ else
425
+ self.role = nil
426
+ end
427
+
428
+ if attributes.key?(:'rsa_public_key')
429
+ self.rsa_public_key = attributes[:'rsa_public_key']
430
+ else
431
+ self.rsa_public_key = nil
432
+ end
433
+
434
+ if attributes.key?(:'secret')
435
+ self.secret = attributes[:'secret']
436
+ end
437
+
438
+ if attributes.key?(:'session_timeout_length')
439
+ self.session_timeout_length = attributes[:'session_timeout_length']
440
+ else
441
+ self.session_timeout_length = nil
442
+ end
443
+
444
+ if attributes.key?(:'type')
445
+ self.type = attributes[:'type']
446
+ else
447
+ self.type = nil
448
+ end
449
+
450
+ if attributes.key?(:'user_metadata_schema')
451
+ if (value = attributes[:'user_metadata_schema']).is_a?(Array)
452
+ self.user_metadata_schema = value
453
+ end
454
+ else
455
+ self.user_metadata_schema = nil
456
+ end
457
+
458
+ if attributes.key?(:'technologies')
459
+ if (value = attributes[:'technologies']).is_a?(Array)
460
+ self.technologies = value
461
+ end
462
+ else
463
+ self.technologies = nil
464
+ end
465
+
466
+ if attributes.key?(:'element_customization')
467
+ self.element_customization = attributes[:'element_customization']
468
+ else
469
+ self.element_customization = nil
470
+ end
471
+
472
+ if attributes.key?(:'element_customization_dark')
473
+ self.element_customization_dark = attributes[:'element_customization_dark']
474
+ else
475
+ self.element_customization_dark = nil
476
+ end
477
+ end
478
+
479
+ # Show invalid properties with the reasons. Usually used together with valid?
480
+ # @return Array for valid properties with the reasons
481
+ def list_invalid_properties
482
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
483
+ invalid_properties = Array.new
484
+ if @additional_auth_origins.nil?
485
+ invalid_properties.push('invalid value for "additional_auth_origins", additional_auth_origins cannot be nil.')
486
+ end
487
+
488
+ if @allowed_callback_urls.nil?
489
+ invalid_properties.push('invalid value for "allowed_callback_urls", allowed_callback_urls cannot be nil.')
490
+ end
491
+
492
+ if @allowed_identifier.nil?
493
+ invalid_properties.push('invalid value for "allowed_identifier", allowed_identifier cannot be nil.')
494
+ end
495
+
496
+ if @allowed_logout_urls.nil?
497
+ invalid_properties.push('invalid value for "allowed_logout_urls", allowed_logout_urls cannot be nil.')
498
+ end
499
+
500
+ if @application_login_uri.nil?
501
+ invalid_properties.push('invalid value for "application_login_uri", application_login_uri cannot be nil.')
502
+ end
503
+
504
+ if @auth_fallback_method.nil?
505
+ invalid_properties.push('invalid value for "auth_fallback_method", auth_fallback_method cannot be nil.')
506
+ end
507
+
508
+ if @auth_fallback_method_ttl.nil?
509
+ invalid_properties.push('invalid value for "auth_fallback_method_ttl", auth_fallback_method_ttl cannot be nil.')
510
+ end
511
+
512
+ if @auth_methods.nil?
513
+ invalid_properties.push('invalid value for "auth_methods", auth_methods cannot be nil.')
514
+ end
515
+
516
+ if @auth_origin.nil?
517
+ invalid_properties.push('invalid value for "auth_origin", auth_origin cannot be nil.')
518
+ end
519
+
520
+ if @created_at.nil?
521
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
522
+ end
523
+
524
+ if @default_language.nil?
525
+ invalid_properties.push('invalid value for "default_language", default_language cannot be nil.')
526
+ end
527
+
528
+ if @id.nil?
529
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
530
+ end
531
+
532
+ if @layouts.nil?
533
+ invalid_properties.push('invalid value for "layouts", layouts cannot be nil.')
534
+ end
535
+
536
+ if @login_url.nil?
537
+ invalid_properties.push('invalid value for "login_url", login_url cannot be nil.')
538
+ end
539
+
540
+ if @name.nil?
541
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
542
+ end
543
+
544
+ if @hosted.nil?
545
+ invalid_properties.push('invalid value for "hosted", hosted cannot be nil.')
546
+ end
547
+
548
+ if @hosted_subdomain.nil?
549
+ invalid_properties.push('invalid value for "hosted_subdomain", hosted_subdomain cannot be nil.')
550
+ end
551
+
552
+ if @passage_branding.nil?
553
+ invalid_properties.push('invalid value for "passage_branding", passage_branding cannot be nil.')
554
+ end
555
+
556
+ if @profile_management.nil?
557
+ invalid_properties.push('invalid value for "profile_management", profile_management cannot be nil.')
558
+ end
559
+
560
+ if @public_signup.nil?
561
+ invalid_properties.push('invalid value for "public_signup", public_signup cannot be nil.')
562
+ end
563
+
564
+ if @redirect_url.nil?
565
+ invalid_properties.push('invalid value for "redirect_url", redirect_url cannot be nil.')
566
+ end
567
+
568
+ if @refresh_absolute_lifetime.nil?
569
+ invalid_properties.push('invalid value for "refresh_absolute_lifetime", refresh_absolute_lifetime cannot be nil.')
570
+ end
571
+
572
+ if @refresh_enabled.nil?
573
+ invalid_properties.push('invalid value for "refresh_enabled", refresh_enabled cannot be nil.')
574
+ end
575
+
576
+ if @refresh_inactivity_lifetime.nil?
577
+ invalid_properties.push('invalid value for "refresh_inactivity_lifetime", refresh_inactivity_lifetime cannot be nil.')
578
+ end
579
+
580
+ if @require_email_verification.nil?
581
+ invalid_properties.push('invalid value for "require_email_verification", require_email_verification cannot be nil.')
582
+ end
583
+
584
+ if @require_identifier_verification.nil?
585
+ invalid_properties.push('invalid value for "require_identifier_verification", require_identifier_verification cannot be nil.')
586
+ end
587
+
588
+ if @required_identifier.nil?
589
+ invalid_properties.push('invalid value for "required_identifier", required_identifier cannot be nil.')
590
+ end
591
+
592
+ if @role.nil?
593
+ invalid_properties.push('invalid value for "role", role cannot be nil.')
594
+ end
595
+
596
+ if @rsa_public_key.nil?
597
+ invalid_properties.push('invalid value for "rsa_public_key", rsa_public_key cannot be nil.')
598
+ end
599
+
600
+ if @session_timeout_length.nil?
601
+ invalid_properties.push('invalid value for "session_timeout_length", session_timeout_length cannot be nil.')
602
+ end
603
+
604
+ if @type.nil?
605
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
606
+ end
607
+
608
+ if @user_metadata_schema.nil?
609
+ invalid_properties.push('invalid value for "user_metadata_schema", user_metadata_schema cannot be nil.')
610
+ end
611
+
612
+ if @technologies.nil?
613
+ invalid_properties.push('invalid value for "technologies", technologies cannot be nil.')
614
+ end
615
+
616
+ if @element_customization.nil?
617
+ invalid_properties.push('invalid value for "element_customization", element_customization cannot be nil.')
618
+ end
619
+
620
+ if @element_customization_dark.nil?
621
+ invalid_properties.push('invalid value for "element_customization_dark", element_customization_dark cannot be nil.')
622
+ end
623
+
624
+ invalid_properties
625
+ end
626
+
627
+ # Check to see if the all the properties in the model are valid
628
+ # @return true if the model is valid
629
+ def valid?
630
+ warn '[DEPRECATED] the `valid?` method is obsolete'
631
+ return false if @additional_auth_origins.nil?
632
+ return false if @allowed_callback_urls.nil?
633
+ return false if @allowed_identifier.nil?
634
+ return false if @allowed_logout_urls.nil?
635
+ return false if @application_login_uri.nil?
636
+ return false if @auth_fallback_method.nil?
637
+ return false if @auth_fallback_method_ttl.nil?
638
+ return false if @auth_methods.nil?
639
+ return false if @auth_origin.nil?
640
+ return false if @created_at.nil?
641
+ return false if @default_language.nil?
642
+ return false if @id.nil?
643
+ return false if @layouts.nil?
644
+ return false if @login_url.nil?
645
+ return false if @name.nil?
646
+ return false if @hosted.nil?
647
+ return false if @hosted_subdomain.nil?
648
+ return false if @passage_branding.nil?
649
+ return false if @profile_management.nil?
650
+ return false if @public_signup.nil?
651
+ return false if @redirect_url.nil?
652
+ return false if @refresh_absolute_lifetime.nil?
653
+ return false if @refresh_enabled.nil?
654
+ return false if @refresh_inactivity_lifetime.nil?
655
+ return false if @require_email_verification.nil?
656
+ return false if @require_identifier_verification.nil?
657
+ return false if @required_identifier.nil?
658
+ return false if @role.nil?
659
+ return false if @rsa_public_key.nil?
660
+ return false if @session_timeout_length.nil?
661
+ return false if @type.nil?
662
+ type_validator = EnumAttributeValidator.new('String', ["complete", "flex"])
663
+ return false unless type_validator.valid?(@type)
664
+ return false if @user_metadata_schema.nil?
665
+ return false if @technologies.nil?
666
+ return false if @element_customization.nil?
667
+ return false if @element_customization_dark.nil?
668
+ true
669
+ end
670
+
671
+ # Custom attribute writer method checking allowed values (enum).
672
+ # @param [Object] type Object to be assigned
673
+ def type=(type)
674
+ validator = EnumAttributeValidator.new('String', ["complete", "flex"])
675
+ unless validator.valid?(type)
676
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
677
+ end
678
+ @type = type
679
+ end
680
+
681
+ # Checks equality by comparing each attribute.
682
+ # @param [Object] Object to be compared
683
+ def ==(o)
684
+ return true if self.equal?(o)
685
+ self.class == o.class &&
686
+ additional_auth_origins == o.additional_auth_origins &&
687
+ allowed_callback_urls == o.allowed_callback_urls &&
688
+ allowed_identifier == o.allowed_identifier &&
689
+ allowed_logout_urls == o.allowed_logout_urls &&
690
+ application_login_uri == o.application_login_uri &&
691
+ auth_fallback_method == o.auth_fallback_method &&
692
+ auth_fallback_method_ttl == o.auth_fallback_method_ttl &&
693
+ auth_methods == o.auth_methods &&
694
+ auth_origin == o.auth_origin &&
695
+ created_at == o.created_at &&
696
+ default_language == o.default_language &&
697
+ id == o.id &&
698
+ layouts == o.layouts &&
699
+ login_url == o.login_url &&
700
+ light_logo_url == o.light_logo_url &&
701
+ dark_logo_url == o.dark_logo_url &&
702
+ name == o.name &&
703
+ hosted == o.hosted &&
704
+ hosted_subdomain == o.hosted_subdomain &&
705
+ id_token_lifetime == o.id_token_lifetime &&
706
+ passage_branding == o.passage_branding &&
707
+ profile_management == o.profile_management &&
708
+ public_signup == o.public_signup &&
709
+ redirect_url == o.redirect_url &&
710
+ refresh_absolute_lifetime == o.refresh_absolute_lifetime &&
711
+ refresh_enabled == o.refresh_enabled &&
712
+ refresh_inactivity_lifetime == o.refresh_inactivity_lifetime &&
713
+ require_email_verification == o.require_email_verification &&
714
+ require_identifier_verification == o.require_identifier_verification &&
715
+ required_identifier == o.required_identifier &&
716
+ role == o.role &&
717
+ rsa_public_key == o.rsa_public_key &&
718
+ secret == o.secret &&
719
+ session_timeout_length == o.session_timeout_length &&
720
+ type == o.type &&
721
+ user_metadata_schema == o.user_metadata_schema &&
722
+ technologies == o.technologies &&
723
+ element_customization == o.element_customization &&
724
+ element_customization_dark == o.element_customization_dark
725
+ end
726
+
727
+ # @see the `==` method
728
+ # @param [Object] Object to be compared
729
+ def eql?(o)
730
+ self == o
731
+ end
732
+
733
+ # Calculates hash code according to all attributes.
734
+ # @return [Integer] Hash code
735
+ def hash
736
+ [additional_auth_origins, allowed_callback_urls, allowed_identifier, allowed_logout_urls, application_login_uri, auth_fallback_method, auth_fallback_method_ttl, auth_methods, auth_origin, created_at, default_language, id, layouts, login_url, light_logo_url, dark_logo_url, name, hosted, hosted_subdomain, id_token_lifetime, passage_branding, profile_management, public_signup, redirect_url, refresh_absolute_lifetime, refresh_enabled, refresh_inactivity_lifetime, require_email_verification, require_identifier_verification, required_identifier, role, rsa_public_key, secret, session_timeout_length, type, user_metadata_schema, technologies, element_customization, element_customization_dark].hash
737
+ end
738
+
739
+ # Builds the object from hash
740
+ # @param [Hash] attributes Model attributes in the form of hash
741
+ # @return [Object] Returns the model itself
742
+ def self.build_from_hash(attributes)
743
+ return nil unless attributes.is_a?(Hash)
744
+ attributes = attributes.transform_keys(&:to_sym)
745
+ transformed_hash = {}
746
+ openapi_types.each_pair do |key, type|
747
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
748
+ transformed_hash["#{key}"] = nil
749
+ elsif type =~ /\AArray<(.*)>/i
750
+ # check to ensure the input is an array given that the attribute
751
+ # is documented as an array but the input is not
752
+ if attributes[attribute_map[key]].is_a?(Array)
753
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
754
+ end
755
+ elsif !attributes[attribute_map[key]].nil?
756
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
757
+ end
758
+ end
759
+ new(transformed_hash)
760
+ end
761
+
762
+ # Deserializes the data based on type
763
+ # @param string type Data type
764
+ # @param string value Value to be deserialized
765
+ # @return [Object] Deserialized data
766
+ def self._deserialize(type, value)
767
+ case type.to_sym
768
+ when :Time
769
+ Time.parse(value)
770
+ when :Date
771
+ Date.parse(value)
772
+ when :String
773
+ value.to_s
774
+ when :Integer
775
+ value.to_i
776
+ when :Float
777
+ value.to_f
778
+ when :Boolean
779
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
780
+ true
781
+ else
782
+ false
783
+ end
784
+ when :Object
785
+ # generic object (usually a Hash), return directly
786
+ value
787
+ when /\AArray<(?<inner_type>.+)>\z/
788
+ inner_type = Regexp.last_match[:inner_type]
789
+ value.map { |v| _deserialize(inner_type, v) }
790
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
791
+ k_type = Regexp.last_match[:k_type]
792
+ v_type = Regexp.last_match[:v_type]
793
+ {}.tap do |hash|
794
+ value.each do |k, v|
795
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
796
+ end
797
+ end
798
+ else # model
799
+ # models (e.g. Pet) or oneOf
800
+ klass = OpenapiClient.const_get(type)
801
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
802
+ end
803
+ end
804
+
805
+ # Returns the string representation of the object
806
+ # @return [String] String presentation of the object
807
+ def to_s
808
+ to_hash.to_s
809
+ end
810
+
811
+ # to_body is an alias to to_hash (backward compatibility)
812
+ # @return [Hash] Returns the object in the form of hash
813
+ def to_body
814
+ to_hash
815
+ end
816
+
817
+ # Returns the object in the form of hash
818
+ # @return [Hash] Returns the object in the form of hash
819
+ def to_hash
820
+ hash = {}
821
+ self.class.attribute_map.each_pair do |attr, param|
822
+ value = self.send(attr)
823
+ if value.nil?
824
+ is_nullable = self.class.openapi_nullable.include?(attr)
825
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
826
+ end
827
+
828
+ hash[param] = _to_hash(value)
829
+ end
830
+ hash
831
+ end
832
+
833
+ # Outputs non-array value in the form of hash
834
+ # For object, use to_hash. Otherwise, just return the value
835
+ # @param [Object] value Any valid value
836
+ # @return [Hash] Returns the value in the form of hash
837
+ def _to_hash(value)
838
+ if value.is_a?(Array)
839
+ value.compact.map { |v| _to_hash(v) }
840
+ elsif value.is_a?(Hash)
841
+ {}.tap do |hash|
842
+ value.each { |k, v| hash[k] = _to_hash(v) }
843
+ end
844
+ elsif value.respond_to? :to_hash
845
+ value.to_hash
846
+ else
847
+ value
848
+ end
849
+ end
850
+
851
+ end
852
+
853
+ end