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,378 @@
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 WebAuthnDevices
18
+ # The first time this webAuthn device was used to authenticate the user
19
+ attr_accessor :created_at
20
+
21
+ # The CredID for this webAuthn device
22
+ attr_accessor :cred_id
23
+
24
+ # The friendly name for the webAuthn device used to authenticate
25
+ attr_accessor :friendly_name
26
+
27
+ # The ID of the webAuthn device used for authentication
28
+ attr_accessor :id
29
+
30
+ # The last time this webAuthn device was used to authenticate the user
31
+ attr_accessor :last_login_at
32
+
33
+ attr_accessor :type
34
+
35
+ # The last time this webAuthn device was updated
36
+ attr_accessor :updated_at
37
+
38
+ # How many times this webAuthn device has been used to authenticate the user
39
+ attr_accessor :usage_count
40
+
41
+ attr_accessor :icons
42
+
43
+ class EnumAttributeValidator
44
+ attr_reader :datatype
45
+ attr_reader :allowable_values
46
+
47
+ def initialize(datatype, allowable_values)
48
+ @allowable_values = allowable_values.map do |value|
49
+ case datatype.to_s
50
+ when /Integer/i
51
+ value.to_i
52
+ when /Float/i
53
+ value.to_f
54
+ else
55
+ value
56
+ end
57
+ end
58
+ end
59
+
60
+ def valid?(value)
61
+ !value || allowable_values.include?(value)
62
+ end
63
+ end
64
+
65
+ # Attribute mapping from ruby-style variable name to JSON key.
66
+ def self.attribute_map
67
+ {
68
+ :'created_at' => :'created_at',
69
+ :'cred_id' => :'cred_id',
70
+ :'friendly_name' => :'friendly_name',
71
+ :'id' => :'id',
72
+ :'last_login_at' => :'last_login_at',
73
+ :'type' => :'type',
74
+ :'updated_at' => :'updated_at',
75
+ :'usage_count' => :'usage_count',
76
+ :'icons' => :'icons'
77
+ }
78
+ end
79
+
80
+ # Returns all the JSON keys this model knows about
81
+ def self.acceptable_attributes
82
+ attribute_map.values
83
+ end
84
+
85
+ # Attribute type mapping.
86
+ def self.openapi_types
87
+ {
88
+ :'created_at' => :'Time',
89
+ :'cred_id' => :'String',
90
+ :'friendly_name' => :'String',
91
+ :'id' => :'String',
92
+ :'last_login_at' => :'Time',
93
+ :'type' => :'WebAuthnType',
94
+ :'updated_at' => :'Time',
95
+ :'usage_count' => :'Integer',
96
+ :'icons' => :'WebAuthnIcons'
97
+ }
98
+ end
99
+
100
+ # List of attributes with nullable: true
101
+ def self.openapi_nullable
102
+ Set.new([
103
+ ])
104
+ end
105
+
106
+ # Initializes the object
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ def initialize(attributes = {})
109
+ if (!attributes.is_a?(Hash))
110
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::WebAuthnDevices` initialize method"
111
+ end
112
+
113
+ # check to see if the attribute exists and convert string to symbol for hash key
114
+ attributes = attributes.each_with_object({}) { |(k, v), h|
115
+ if (!self.class.attribute_map.key?(k.to_sym))
116
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::WebAuthnDevices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
117
+ end
118
+ h[k.to_sym] = v
119
+ }
120
+
121
+ if attributes.key?(:'created_at')
122
+ self.created_at = attributes[:'created_at']
123
+ else
124
+ self.created_at = nil
125
+ end
126
+
127
+ if attributes.key?(:'cred_id')
128
+ self.cred_id = attributes[:'cred_id']
129
+ else
130
+ self.cred_id = nil
131
+ end
132
+
133
+ if attributes.key?(:'friendly_name')
134
+ self.friendly_name = attributes[:'friendly_name']
135
+ else
136
+ self.friendly_name = nil
137
+ end
138
+
139
+ if attributes.key?(:'id')
140
+ self.id = attributes[:'id']
141
+ else
142
+ self.id = nil
143
+ end
144
+
145
+ if attributes.key?(:'last_login_at')
146
+ self.last_login_at = attributes[:'last_login_at']
147
+ else
148
+ self.last_login_at = nil
149
+ end
150
+
151
+ if attributes.key?(:'type')
152
+ self.type = attributes[:'type']
153
+ else
154
+ self.type = nil
155
+ end
156
+
157
+ if attributes.key?(:'updated_at')
158
+ self.updated_at = attributes[:'updated_at']
159
+ else
160
+ self.updated_at = nil
161
+ end
162
+
163
+ if attributes.key?(:'usage_count')
164
+ self.usage_count = attributes[:'usage_count']
165
+ else
166
+ self.usage_count = nil
167
+ end
168
+
169
+ if attributes.key?(:'icons')
170
+ self.icons = attributes[:'icons']
171
+ else
172
+ self.icons = nil
173
+ end
174
+ end
175
+
176
+ # Show invalid properties with the reasons. Usually used together with valid?
177
+ # @return Array for valid properties with the reasons
178
+ def list_invalid_properties
179
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
180
+ invalid_properties = Array.new
181
+ if @created_at.nil?
182
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
183
+ end
184
+
185
+ if @cred_id.nil?
186
+ invalid_properties.push('invalid value for "cred_id", cred_id cannot be nil.')
187
+ end
188
+
189
+ if @friendly_name.nil?
190
+ invalid_properties.push('invalid value for "friendly_name", friendly_name cannot be nil.')
191
+ end
192
+
193
+ if @id.nil?
194
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
195
+ end
196
+
197
+ if @last_login_at.nil?
198
+ invalid_properties.push('invalid value for "last_login_at", last_login_at cannot be nil.')
199
+ end
200
+
201
+ if @type.nil?
202
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
203
+ end
204
+
205
+ if @updated_at.nil?
206
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
207
+ end
208
+
209
+ if @usage_count.nil?
210
+ invalid_properties.push('invalid value for "usage_count", usage_count cannot be nil.')
211
+ end
212
+
213
+ if @icons.nil?
214
+ invalid_properties.push('invalid value for "icons", icons cannot be nil.')
215
+ end
216
+
217
+ invalid_properties
218
+ end
219
+
220
+ # Check to see if the all the properties in the model are valid
221
+ # @return true if the model is valid
222
+ def valid?
223
+ warn '[DEPRECATED] the `valid?` method is obsolete'
224
+ return false if @created_at.nil?
225
+ return false if @cred_id.nil?
226
+ return false if @friendly_name.nil?
227
+ return false if @id.nil?
228
+ return false if @last_login_at.nil?
229
+ return false if @type.nil?
230
+ return false if @updated_at.nil?
231
+ return false if @usage_count.nil?
232
+ return false if @icons.nil?
233
+ true
234
+ end
235
+
236
+ # Checks equality by comparing each attribute.
237
+ # @param [Object] Object to be compared
238
+ def ==(o)
239
+ return true if self.equal?(o)
240
+ self.class == o.class &&
241
+ created_at == o.created_at &&
242
+ cred_id == o.cred_id &&
243
+ friendly_name == o.friendly_name &&
244
+ id == o.id &&
245
+ last_login_at == o.last_login_at &&
246
+ type == o.type &&
247
+ updated_at == o.updated_at &&
248
+ usage_count == o.usage_count &&
249
+ icons == o.icons
250
+ end
251
+
252
+ # @see the `==` method
253
+ # @param [Object] Object to be compared
254
+ def eql?(o)
255
+ self == o
256
+ end
257
+
258
+ # Calculates hash code according to all attributes.
259
+ # @return [Integer] Hash code
260
+ def hash
261
+ [created_at, cred_id, friendly_name, id, last_login_at, type, updated_at, usage_count, icons].hash
262
+ end
263
+
264
+ # Builds the object from hash
265
+ # @param [Hash] attributes Model attributes in the form of hash
266
+ # @return [Object] Returns the model itself
267
+ def self.build_from_hash(attributes)
268
+ return nil unless attributes.is_a?(Hash)
269
+ attributes = attributes.transform_keys(&:to_sym)
270
+ transformed_hash = {}
271
+ openapi_types.each_pair do |key, type|
272
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
273
+ transformed_hash["#{key}"] = nil
274
+ elsif type =~ /\AArray<(.*)>/i
275
+ # check to ensure the input is an array given that the attribute
276
+ # is documented as an array but the input is not
277
+ if attributes[attribute_map[key]].is_a?(Array)
278
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
279
+ end
280
+ elsif !attributes[attribute_map[key]].nil?
281
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
282
+ end
283
+ end
284
+ new(transformed_hash)
285
+ end
286
+
287
+ # Deserializes the data based on type
288
+ # @param string type Data type
289
+ # @param string value Value to be deserialized
290
+ # @return [Object] Deserialized data
291
+ def self._deserialize(type, value)
292
+ case type.to_sym
293
+ when :Time
294
+ Time.parse(value)
295
+ when :Date
296
+ Date.parse(value)
297
+ when :String
298
+ value.to_s
299
+ when :Integer
300
+ value.to_i
301
+ when :Float
302
+ value.to_f
303
+ when :Boolean
304
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
305
+ true
306
+ else
307
+ false
308
+ end
309
+ when :Object
310
+ # generic object (usually a Hash), return directly
311
+ value
312
+ when /\AArray<(?<inner_type>.+)>\z/
313
+ inner_type = Regexp.last_match[:inner_type]
314
+ value.map { |v| _deserialize(inner_type, v) }
315
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
316
+ k_type = Regexp.last_match[:k_type]
317
+ v_type = Regexp.last_match[:v_type]
318
+ {}.tap do |hash|
319
+ value.each do |k, v|
320
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
321
+ end
322
+ end
323
+ else # model
324
+ # models (e.g. Pet) or oneOf
325
+ klass = OpenapiClient.const_get(type)
326
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
327
+ end
328
+ end
329
+
330
+ # Returns the string representation of the object
331
+ # @return [String] String presentation of the object
332
+ def to_s
333
+ to_hash.to_s
334
+ end
335
+
336
+ # to_body is an alias to to_hash (backward compatibility)
337
+ # @return [Hash] Returns the object in the form of hash
338
+ def to_body
339
+ to_hash
340
+ end
341
+
342
+ # Returns the object in the form of hash
343
+ # @return [Hash] Returns the object in the form of hash
344
+ def to_hash
345
+ hash = {}
346
+ self.class.attribute_map.each_pair do |attr, param|
347
+ value = self.send(attr)
348
+ if value.nil?
349
+ is_nullable = self.class.openapi_nullable.include?(attr)
350
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
351
+ end
352
+
353
+ hash[param] = _to_hash(value)
354
+ end
355
+ hash
356
+ end
357
+
358
+ # Outputs non-array value in the form of hash
359
+ # For object, use to_hash. Otherwise, just return the value
360
+ # @param [Object] value Any valid value
361
+ # @return [Hash] Returns the value in the form of hash
362
+ def _to_hash(value)
363
+ if value.is_a?(Array)
364
+ value.compact.map { |v| _to_hash(v) }
365
+ elsif value.is_a?(Hash)
366
+ {}.tap do |hash|
367
+ value.each { |k, v| hash[k] = _to_hash(v) }
368
+ end
369
+ elsif value.respond_to? :to_hash
370
+ value.to_hash
371
+ else
372
+ value
373
+ end
374
+ end
375
+
376
+ end
377
+
378
+ end
@@ -0,0 +1,230 @@
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
+ # Contains the light and dark SVG icons that represent the brand of those devices Values can be null or base64 encoded SVG. Example of SVG output: data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDE5MiAxOTIiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDE5MiAxOTIiIHdpZHRoPSIyNHB4Ij48cmVjdCBmaWxsPSJub25lIiBoZWlnaHQ9IjE5MiIgd2lkdGg9IjE5MiIgeT0iMCIvPjxnPjxwYXRoIGQ9Ik02OS4yOSwxMDZjLTMuNDYsNS45Ny05LjkxLDEwLTE3LjI5LDEwYy0xMS4wMywwLTIwLTguOTctMjAtMjBzOC45Ny0yMCwyMC0yMCBjNy4zOCwwLDEzLjgzLDQuMDMsMTcuMjksMTBoMjUuNTVDOTAuMyw2Ni41NCw3Mi44Miw1Miw1Miw1MkMyNy43NCw1Miw4LDcxLjc0LDgsOTZzMTkuNzQsNDQsNDQsNDRjMjAuODIsMCwzOC4zLTE0LjU0LDQyLjg0LTM0IEg2OS4yOXoiIGZpbGw9IiM0Mjg1RjQiLz48cmVjdCBmaWxsPSIjRkJCQzA0IiBoZWlnaHQ9IjI0IiB3aWR0aD0iNDQiIHg9Ijk0IiB5PSI4NCIvPjxwYXRoIGQ9Ik05NC4zMiw4NEg2OHYwLjA1YzIuNSwzLjM0LDQsNy40Nyw0LDExLjk1cy0xLjUsOC42MS00LDExLjk1VjEwOGgyNi4zMiBjMS4wOC0zLjgyLDEuNjgtNy44NCwxLjY4LTEyUzk1LjQxLDg3LjgyLDk0LjMyLDg0eiIgZmlsbD0iI0VBNDMzNSIvPjxwYXRoIGQ9Ik0xODQsMTA2djI2aC0xNnYtOGMwLTQuNDItMy41OC04LTgtOHMtOCwzLjU4LTgsOHY4aC0xNnYtMjZIMTg0eiIgZmlsbD0iIzM0QTg1MyIvPjxyZWN0IGZpbGw9IiMxODgwMzgiIGhlaWdodD0iMjQiIHdpZHRoPSI0OCIgeD0iMTM2IiB5PSI4NCIvPjwvZz48L3N2Zz4=
18
+ class WebAuthnIcons
19
+ attr_accessor :light
20
+
21
+ attr_accessor :dark
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'light' => :'light',
27
+ :'dark' => :'dark'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'light' => :'String',
40
+ :'dark' => :'String'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ :'light',
48
+ :'dark'
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::WebAuthnIcons` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::WebAuthnIcons`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'light')
68
+ self.light = attributes[:'light']
69
+ else
70
+ self.light = nil
71
+ end
72
+
73
+ if attributes.key?(:'dark')
74
+ self.dark = attributes[:'dark']
75
+ else
76
+ self.dark = nil
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ light == o.light &&
101
+ dark == o.dark
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [light, dark].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+ transformed_hash = {}
123
+ openapi_types.each_pair do |key, type|
124
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = nil
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[attribute_map[key]].is_a?(Array)
130
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
131
+ end
132
+ elsif !attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
134
+ end
135
+ end
136
+ new(transformed_hash)
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def self._deserialize(type, value)
144
+ case type.to_sym
145
+ when :Time
146
+ Time.parse(value)
147
+ when :Date
148
+ Date.parse(value)
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :Boolean
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ # models (e.g. Pet) or oneOf
177
+ klass = OpenapiClient.const_get(type)
178
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+
228
+ end
229
+
230
+ end
@@ -0,0 +1,41 @@
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 WebAuthnType
18
+ PASSKEY = "passkey".freeze
19
+ SECURITY_KEY = "security_key".freeze
20
+ PLATFORM = "platform".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [PASSKEY, SECURITY_KEY, PLATFORM].freeze
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ return value if WebAuthnType.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #WebAuthnType"
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,15 @@
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
+ module OpenapiClient
14
+ VERSION = '1.0.0'
15
+ end