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,457 @@
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 ElementCustomization
18
+ # Container background color in hex. Default is `#ffffff` in light mode & `#383838` in dark mode.
19
+ attr_accessor :passage_container_background_color
20
+
21
+ # Maximum width of container (px)
22
+ attr_accessor :passage_container_max_width
23
+
24
+ # Input box background color in hex. Default is `#ffffff` in light mode & `#4b4b4b` in dark mode.
25
+ attr_accessor :passage_input_box_background_color
26
+
27
+ # Input box border radius (px)
28
+ attr_accessor :passage_input_box_border_radius
29
+
30
+ attr_accessor :passage_header_font_family
31
+
32
+ attr_accessor :passage_body_font_family
33
+
34
+ # Header text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode.
35
+ attr_accessor :passage_header_text_color
36
+
37
+ # Body text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode.
38
+ attr_accessor :passage_body_text_color
39
+
40
+ # Primary button background colour (hex)
41
+ attr_accessor :passage_primary_button_background_color
42
+
43
+ # Primary button font colour (hex)
44
+ attr_accessor :passage_primary_button_text_color
45
+
46
+ # Primary button background on hover (hex)
47
+ attr_accessor :passage_primary_button_hover_color
48
+
49
+ # Primary button border radius (px)
50
+ attr_accessor :passage_primary_button_border_radius
51
+
52
+ # Primary button border color
53
+ attr_accessor :passage_primary_button_border_color
54
+
55
+ # Primary button border width (px)
56
+ attr_accessor :passage_primary_button_border_width
57
+
58
+ # Secondary button background colour (hex)
59
+ attr_accessor :passage_secondary_button_background_color
60
+
61
+ # Secondary button font colour (hex)
62
+ attr_accessor :passage_secondary_button_text_color
63
+
64
+ # Secondary button background on hover (hex)
65
+ attr_accessor :passage_secondary_button_hover_color
66
+
67
+ # Secondary button border radius (px)
68
+ attr_accessor :passage_secondary_button_border_radius
69
+
70
+ # Secondary button border color
71
+ attr_accessor :passage_secondary_button_border_color
72
+
73
+ # Secondary button border width (px)
74
+ attr_accessor :passage_secondary_button_border_width
75
+
76
+ class EnumAttributeValidator
77
+ attr_reader :datatype
78
+ attr_reader :allowable_values
79
+
80
+ def initialize(datatype, allowable_values)
81
+ @allowable_values = allowable_values.map do |value|
82
+ case datatype.to_s
83
+ when /Integer/i
84
+ value.to_i
85
+ when /Float/i
86
+ value.to_f
87
+ else
88
+ value
89
+ end
90
+ end
91
+ end
92
+
93
+ def valid?(value)
94
+ !value || allowable_values.include?(value)
95
+ end
96
+ end
97
+
98
+ # Attribute mapping from ruby-style variable name to JSON key.
99
+ def self.attribute_map
100
+ {
101
+ :'passage_container_background_color' => :'passage_container_background_color',
102
+ :'passage_container_max_width' => :'passage_container_max_width',
103
+ :'passage_input_box_background_color' => :'passage_input_box_background_color',
104
+ :'passage_input_box_border_radius' => :'passage_input_box_border_radius',
105
+ :'passage_header_font_family' => :'passage_header_font_family',
106
+ :'passage_body_font_family' => :'passage_body_font_family',
107
+ :'passage_header_text_color' => :'passage_header_text_color',
108
+ :'passage_body_text_color' => :'passage_body_text_color',
109
+ :'passage_primary_button_background_color' => :'passage_primary_button_background_color',
110
+ :'passage_primary_button_text_color' => :'passage_primary_button_text_color',
111
+ :'passage_primary_button_hover_color' => :'passage_primary_button_hover_color',
112
+ :'passage_primary_button_border_radius' => :'passage_primary_button_border_radius',
113
+ :'passage_primary_button_border_color' => :'passage_primary_button_border_color',
114
+ :'passage_primary_button_border_width' => :'passage_primary_button_border_width',
115
+ :'passage_secondary_button_background_color' => :'passage_secondary_button_background_color',
116
+ :'passage_secondary_button_text_color' => :'passage_secondary_button_text_color',
117
+ :'passage_secondary_button_hover_color' => :'passage_secondary_button_hover_color',
118
+ :'passage_secondary_button_border_radius' => :'passage_secondary_button_border_radius',
119
+ :'passage_secondary_button_border_color' => :'passage_secondary_button_border_color',
120
+ :'passage_secondary_button_border_width' => :'passage_secondary_button_border_width'
121
+ }
122
+ end
123
+
124
+ # Returns all the JSON keys this model knows about
125
+ def self.acceptable_attributes
126
+ attribute_map.values
127
+ end
128
+
129
+ # Attribute type mapping.
130
+ def self.openapi_types
131
+ {
132
+ :'passage_container_background_color' => :'String',
133
+ :'passage_container_max_width' => :'Integer',
134
+ :'passage_input_box_background_color' => :'String',
135
+ :'passage_input_box_border_radius' => :'Integer',
136
+ :'passage_header_font_family' => :'FontFamily',
137
+ :'passage_body_font_family' => :'FontFamily',
138
+ :'passage_header_text_color' => :'String',
139
+ :'passage_body_text_color' => :'String',
140
+ :'passage_primary_button_background_color' => :'String',
141
+ :'passage_primary_button_text_color' => :'String',
142
+ :'passage_primary_button_hover_color' => :'String',
143
+ :'passage_primary_button_border_radius' => :'Integer',
144
+ :'passage_primary_button_border_color' => :'String',
145
+ :'passage_primary_button_border_width' => :'Integer',
146
+ :'passage_secondary_button_background_color' => :'String',
147
+ :'passage_secondary_button_text_color' => :'String',
148
+ :'passage_secondary_button_hover_color' => :'String',
149
+ :'passage_secondary_button_border_radius' => :'Integer',
150
+ :'passage_secondary_button_border_color' => :'String',
151
+ :'passage_secondary_button_border_width' => :'Integer'
152
+ }
153
+ end
154
+
155
+ # List of attributes with nullable: true
156
+ def self.openapi_nullable
157
+ Set.new([
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 `OpenapiClient::ElementCustomization` initialize method"
166
+ end
167
+
168
+ # check to see if the attribute exists and convert string to symbol for hash key
169
+ attributes = attributes.each_with_object({}) { |(k, v), h|
170
+ if (!self.class.attribute_map.key?(k.to_sym))
171
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::ElementCustomization`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
172
+ end
173
+ h[k.to_sym] = v
174
+ }
175
+
176
+ if attributes.key?(:'passage_container_background_color')
177
+ self.passage_container_background_color = attributes[:'passage_container_background_color']
178
+ end
179
+
180
+ if attributes.key?(:'passage_container_max_width')
181
+ self.passage_container_max_width = attributes[:'passage_container_max_width']
182
+ else
183
+ self.passage_container_max_width = 300
184
+ end
185
+
186
+ if attributes.key?(:'passage_input_box_background_color')
187
+ self.passage_input_box_background_color = attributes[:'passage_input_box_background_color']
188
+ end
189
+
190
+ if attributes.key?(:'passage_input_box_border_radius')
191
+ self.passage_input_box_border_radius = attributes[:'passage_input_box_border_radius']
192
+ else
193
+ self.passage_input_box_border_radius = 5
194
+ end
195
+
196
+ if attributes.key?(:'passage_header_font_family')
197
+ self.passage_header_font_family = attributes[:'passage_header_font_family']
198
+ else
199
+ self.passage_header_font_family = 'Helvetica'
200
+ end
201
+
202
+ if attributes.key?(:'passage_body_font_family')
203
+ self.passage_body_font_family = attributes[:'passage_body_font_family']
204
+ else
205
+ self.passage_body_font_family = 'Helvetica'
206
+ end
207
+
208
+ if attributes.key?(:'passage_header_text_color')
209
+ self.passage_header_text_color = attributes[:'passage_header_text_color']
210
+ end
211
+
212
+ if attributes.key?(:'passage_body_text_color')
213
+ self.passage_body_text_color = attributes[:'passage_body_text_color']
214
+ end
215
+
216
+ if attributes.key?(:'passage_primary_button_background_color')
217
+ self.passage_primary_button_background_color = attributes[:'passage_primary_button_background_color']
218
+ else
219
+ self.passage_primary_button_background_color = '#121212'
220
+ end
221
+
222
+ if attributes.key?(:'passage_primary_button_text_color')
223
+ self.passage_primary_button_text_color = attributes[:'passage_primary_button_text_color']
224
+ else
225
+ self.passage_primary_button_text_color = '#f3f3f3'
226
+ end
227
+
228
+ if attributes.key?(:'passage_primary_button_hover_color')
229
+ self.passage_primary_button_hover_color = attributes[:'passage_primary_button_hover_color']
230
+ else
231
+ self.passage_primary_button_hover_color = '#4d4d4d'
232
+ end
233
+
234
+ if attributes.key?(:'passage_primary_button_border_radius')
235
+ self.passage_primary_button_border_radius = attributes[:'passage_primary_button_border_radius']
236
+ else
237
+ self.passage_primary_button_border_radius = 5
238
+ end
239
+
240
+ if attributes.key?(:'passage_primary_button_border_color')
241
+ self.passage_primary_button_border_color = attributes[:'passage_primary_button_border_color']
242
+ else
243
+ self.passage_primary_button_border_color = '#121212'
244
+ end
245
+
246
+ if attributes.key?(:'passage_primary_button_border_width')
247
+ self.passage_primary_button_border_width = attributes[:'passage_primary_button_border_width']
248
+ else
249
+ self.passage_primary_button_border_width = 0
250
+ end
251
+
252
+ if attributes.key?(:'passage_secondary_button_background_color')
253
+ self.passage_secondary_button_background_color = attributes[:'passage_secondary_button_background_color']
254
+ else
255
+ self.passage_secondary_button_background_color = '#ffffff'
256
+ end
257
+
258
+ if attributes.key?(:'passage_secondary_button_text_color')
259
+ self.passage_secondary_button_text_color = attributes[:'passage_secondary_button_text_color']
260
+ else
261
+ self.passage_secondary_button_text_color = '#222222'
262
+ end
263
+
264
+ if attributes.key?(:'passage_secondary_button_hover_color')
265
+ self.passage_secondary_button_hover_color = attributes[:'passage_secondary_button_hover_color']
266
+ else
267
+ self.passage_secondary_button_hover_color = '#d7d7d7'
268
+ end
269
+
270
+ if attributes.key?(:'passage_secondary_button_border_radius')
271
+ self.passage_secondary_button_border_radius = attributes[:'passage_secondary_button_border_radius']
272
+ else
273
+ self.passage_secondary_button_border_radius = 5
274
+ end
275
+
276
+ if attributes.key?(:'passage_secondary_button_border_color')
277
+ self.passage_secondary_button_border_color = attributes[:'passage_secondary_button_border_color']
278
+ else
279
+ self.passage_secondary_button_border_color = '#d7d7d7'
280
+ end
281
+
282
+ if attributes.key?(:'passage_secondary_button_border_width')
283
+ self.passage_secondary_button_border_width = attributes[:'passage_secondary_button_border_width']
284
+ else
285
+ self.passage_secondary_button_border_width = 1
286
+ end
287
+ end
288
+
289
+ # Show invalid properties with the reasons. Usually used together with valid?
290
+ # @return Array for valid properties with the reasons
291
+ def list_invalid_properties
292
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
293
+ invalid_properties = Array.new
294
+ invalid_properties
295
+ end
296
+
297
+ # Check to see if the all the properties in the model are valid
298
+ # @return true if the model is valid
299
+ def valid?
300
+ warn '[DEPRECATED] the `valid?` method is obsolete'
301
+ true
302
+ end
303
+
304
+ # Checks equality by comparing each attribute.
305
+ # @param [Object] Object to be compared
306
+ def ==(o)
307
+ return true if self.equal?(o)
308
+ self.class == o.class &&
309
+ passage_container_background_color == o.passage_container_background_color &&
310
+ passage_container_max_width == o.passage_container_max_width &&
311
+ passage_input_box_background_color == o.passage_input_box_background_color &&
312
+ passage_input_box_border_radius == o.passage_input_box_border_radius &&
313
+ passage_header_font_family == o.passage_header_font_family &&
314
+ passage_body_font_family == o.passage_body_font_family &&
315
+ passage_header_text_color == o.passage_header_text_color &&
316
+ passage_body_text_color == o.passage_body_text_color &&
317
+ passage_primary_button_background_color == o.passage_primary_button_background_color &&
318
+ passage_primary_button_text_color == o.passage_primary_button_text_color &&
319
+ passage_primary_button_hover_color == o.passage_primary_button_hover_color &&
320
+ passage_primary_button_border_radius == o.passage_primary_button_border_radius &&
321
+ passage_primary_button_border_color == o.passage_primary_button_border_color &&
322
+ passage_primary_button_border_width == o.passage_primary_button_border_width &&
323
+ passage_secondary_button_background_color == o.passage_secondary_button_background_color &&
324
+ passage_secondary_button_text_color == o.passage_secondary_button_text_color &&
325
+ passage_secondary_button_hover_color == o.passage_secondary_button_hover_color &&
326
+ passage_secondary_button_border_radius == o.passage_secondary_button_border_radius &&
327
+ passage_secondary_button_border_color == o.passage_secondary_button_border_color &&
328
+ passage_secondary_button_border_width == o.passage_secondary_button_border_width
329
+ end
330
+
331
+ # @see the `==` method
332
+ # @param [Object] Object to be compared
333
+ def eql?(o)
334
+ self == o
335
+ end
336
+
337
+ # Calculates hash code according to all attributes.
338
+ # @return [Integer] Hash code
339
+ def hash
340
+ [passage_container_background_color, passage_container_max_width, passage_input_box_background_color, passage_input_box_border_radius, passage_header_font_family, passage_body_font_family, passage_header_text_color, passage_body_text_color, passage_primary_button_background_color, passage_primary_button_text_color, passage_primary_button_hover_color, passage_primary_button_border_radius, passage_primary_button_border_color, passage_primary_button_border_width, passage_secondary_button_background_color, passage_secondary_button_text_color, passage_secondary_button_hover_color, passage_secondary_button_border_radius, passage_secondary_button_border_color, passage_secondary_button_border_width].hash
341
+ end
342
+
343
+ # Builds the object from hash
344
+ # @param [Hash] attributes Model attributes in the form of hash
345
+ # @return [Object] Returns the model itself
346
+ def self.build_from_hash(attributes)
347
+ return nil unless attributes.is_a?(Hash)
348
+ attributes = attributes.transform_keys(&:to_sym)
349
+ transformed_hash = {}
350
+ openapi_types.each_pair do |key, type|
351
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
352
+ transformed_hash["#{key}"] = nil
353
+ elsif type =~ /\AArray<(.*)>/i
354
+ # check to ensure the input is an array given that the attribute
355
+ # is documented as an array but the input is not
356
+ if attributes[attribute_map[key]].is_a?(Array)
357
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
358
+ end
359
+ elsif !attributes[attribute_map[key]].nil?
360
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
361
+ end
362
+ end
363
+ new(transformed_hash)
364
+ end
365
+
366
+ # Deserializes the data based on type
367
+ # @param string type Data type
368
+ # @param string value Value to be deserialized
369
+ # @return [Object] Deserialized data
370
+ def self._deserialize(type, value)
371
+ case type.to_sym
372
+ when :Time
373
+ Time.parse(value)
374
+ when :Date
375
+ Date.parse(value)
376
+ when :String
377
+ value.to_s
378
+ when :Integer
379
+ value.to_i
380
+ when :Float
381
+ value.to_f
382
+ when :Boolean
383
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
384
+ true
385
+ else
386
+ false
387
+ end
388
+ when :Object
389
+ # generic object (usually a Hash), return directly
390
+ value
391
+ when /\AArray<(?<inner_type>.+)>\z/
392
+ inner_type = Regexp.last_match[:inner_type]
393
+ value.map { |v| _deserialize(inner_type, v) }
394
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
395
+ k_type = Regexp.last_match[:k_type]
396
+ v_type = Regexp.last_match[:v_type]
397
+ {}.tap do |hash|
398
+ value.each do |k, v|
399
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
400
+ end
401
+ end
402
+ else # model
403
+ # models (e.g. Pet) or oneOf
404
+ klass = OpenapiClient.const_get(type)
405
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
406
+ end
407
+ end
408
+
409
+ # Returns the string representation of the object
410
+ # @return [String] String presentation of the object
411
+ def to_s
412
+ to_hash.to_s
413
+ end
414
+
415
+ # to_body is an alias to to_hash (backward compatibility)
416
+ # @return [Hash] Returns the object in the form of hash
417
+ def to_body
418
+ to_hash
419
+ end
420
+
421
+ # Returns the object in the form of hash
422
+ # @return [Hash] Returns the object in the form of hash
423
+ def to_hash
424
+ hash = {}
425
+ self.class.attribute_map.each_pair do |attr, param|
426
+ value = self.send(attr)
427
+ if value.nil?
428
+ is_nullable = self.class.openapi_nullable.include?(attr)
429
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
430
+ end
431
+
432
+ hash[param] = _to_hash(value)
433
+ end
434
+ hash
435
+ end
436
+
437
+ # Outputs non-array value in the form of hash
438
+ # For object, use to_hash. Otherwise, just return the value
439
+ # @param [Object] value Any valid value
440
+ # @return [Hash] Returns the value in the form of hash
441
+ def _to_hash(value)
442
+ if value.is_a?(Array)
443
+ value.compact.map { |v| _to_hash(v) }
444
+ elsif value.is_a?(Hash)
445
+ {}.tap do |hash|
446
+ value.each { |k, v| hash[k] = _to_hash(v) }
447
+ end
448
+ elsif value.respond_to? :to_hash
449
+ value.to_hash
450
+ else
451
+ value
452
+ end
453
+ end
454
+
455
+ end
456
+
457
+ end
@@ -0,0 +1,58 @@
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 FontFamily
18
+ HELVETICA = "Helvetica".freeze
19
+ ARIAL = "Arial".freeze
20
+ ARIAL_BLACK = "Arial Black".freeze
21
+ VERDANA = "Verdana".freeze
22
+ TAHOMA = "Tahoma".freeze
23
+ TREBUCHET_MS = "Trebuchet MS".freeze
24
+ IMPACT = "Impact".freeze
25
+ GILL_SANS = "Gill Sans".freeze
26
+ TIMES_NEW_ROMAN = "Times New Roman".freeze
27
+ GEORGIA = "Georgia".freeze
28
+ PALATINO = "Palatino".freeze
29
+ BASKERVILLE = "Baskerville".freeze
30
+ ANDAL_MONO = "Andalé Mono".freeze
31
+ COURIER = "Courier".freeze
32
+ LUCIDA = "Lucida".freeze
33
+ MONACO = "Monaco".freeze
34
+ BRADLEY_HAND = "Bradley Hand".freeze
35
+ BRUSH_SCRIPT_MT = "Brush Script MT".freeze
36
+ LUMINARI = "Luminari".freeze
37
+ COMIC_SANS_MS = "Comic Sans MS".freeze
38
+
39
+ def self.all_vars
40
+ @all_vars ||= [HELVETICA, ARIAL, ARIAL_BLACK, VERDANA, TAHOMA, TREBUCHET_MS, IMPACT, GILL_SANS, TIMES_NEW_ROMAN, GEORGIA, PALATINO, BASKERVILLE, ANDAL_MONO, COURIER, LUCIDA, MONACO, BRADLEY_HAND, BRUSH_SCRIPT_MT, LUMINARI, COMIC_SANS_MS].freeze
41
+ end
42
+
43
+ # Builds the enum from string
44
+ # @param [String] The enum value in the form of the string
45
+ # @return [String] The enum value
46
+ def self.build_from_hash(value)
47
+ new.build_from_hash(value)
48
+ end
49
+
50
+ # Builds the enum from string
51
+ # @param [String] The enum value in the form of the string
52
+ # @return [String] The enum value
53
+ def build_from_hash(value)
54
+ return value if FontFamily.all_vars.include?(value)
55
+ raise "Invalid ENUM value #{value} for class #FontFamily"
56
+ end
57
+ end
58
+ end