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,285 @@
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 UserEventInfo
18
+ attr_accessor :created_at
19
+
20
+ attr_accessor :id
21
+
22
+ attr_accessor :ip_addr
23
+
24
+ attr_accessor :type
25
+
26
+ attr_accessor :user_agent
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'created_at' => :'created_at',
32
+ :'id' => :'id',
33
+ :'ip_addr' => :'ip_addr',
34
+ :'type' => :'type',
35
+ :'user_agent' => :'user_agent'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'created_at' => :'Time',
48
+ :'id' => :'String',
49
+ :'ip_addr' => :'String',
50
+ :'type' => :'String',
51
+ :'user_agent' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::UserEventInfo` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::UserEventInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'created_at')
77
+ self.created_at = attributes[:'created_at']
78
+ else
79
+ self.created_at = nil
80
+ end
81
+
82
+ if attributes.key?(:'id')
83
+ self.id = attributes[:'id']
84
+ else
85
+ self.id = nil
86
+ end
87
+
88
+ if attributes.key?(:'ip_addr')
89
+ self.ip_addr = attributes[:'ip_addr']
90
+ else
91
+ self.ip_addr = nil
92
+ end
93
+
94
+ if attributes.key?(:'type')
95
+ self.type = attributes[:'type']
96
+ else
97
+ self.type = nil
98
+ end
99
+
100
+ if attributes.key?(:'user_agent')
101
+ self.user_agent = attributes[:'user_agent']
102
+ else
103
+ self.user_agent = nil
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ if @created_at.nil?
113
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
114
+ end
115
+
116
+ if @id.nil?
117
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
118
+ end
119
+
120
+ if @ip_addr.nil?
121
+ invalid_properties.push('invalid value for "ip_addr", ip_addr cannot be nil.')
122
+ end
123
+
124
+ if @type.nil?
125
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
126
+ end
127
+
128
+ if @user_agent.nil?
129
+ invalid_properties.push('invalid value for "user_agent", user_agent cannot be nil.')
130
+ end
131
+
132
+ invalid_properties
133
+ end
134
+
135
+ # Check to see if the all the properties in the model are valid
136
+ # @return true if the model is valid
137
+ def valid?
138
+ warn '[DEPRECATED] the `valid?` method is obsolete'
139
+ return false if @created_at.nil?
140
+ return false if @id.nil?
141
+ return false if @ip_addr.nil?
142
+ return false if @type.nil?
143
+ return false if @user_agent.nil?
144
+ true
145
+ end
146
+
147
+ # Checks equality by comparing each attribute.
148
+ # @param [Object] Object to be compared
149
+ def ==(o)
150
+ return true if self.equal?(o)
151
+ self.class == o.class &&
152
+ created_at == o.created_at &&
153
+ id == o.id &&
154
+ ip_addr == o.ip_addr &&
155
+ type == o.type &&
156
+ user_agent == o.user_agent
157
+ end
158
+
159
+ # @see the `==` method
160
+ # @param [Object] Object to be compared
161
+ def eql?(o)
162
+ self == o
163
+ end
164
+
165
+ # Calculates hash code according to all attributes.
166
+ # @return [Integer] Hash code
167
+ def hash
168
+ [created_at, id, ip_addr, type, user_agent].hash
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def self.build_from_hash(attributes)
175
+ return nil unless attributes.is_a?(Hash)
176
+ attributes = attributes.transform_keys(&:to_sym)
177
+ transformed_hash = {}
178
+ openapi_types.each_pair do |key, type|
179
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
180
+ transformed_hash["#{key}"] = nil
181
+ elsif type =~ /\AArray<(.*)>/i
182
+ # check to ensure the input is an array given that the attribute
183
+ # is documented as an array but the input is not
184
+ if attributes[attribute_map[key]].is_a?(Array)
185
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
186
+ end
187
+ elsif !attributes[attribute_map[key]].nil?
188
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
189
+ end
190
+ end
191
+ new(transformed_hash)
192
+ end
193
+
194
+ # Deserializes the data based on type
195
+ # @param string type Data type
196
+ # @param string value Value to be deserialized
197
+ # @return [Object] Deserialized data
198
+ def self._deserialize(type, value)
199
+ case type.to_sym
200
+ when :Time
201
+ Time.parse(value)
202
+ when :Date
203
+ Date.parse(value)
204
+ when :String
205
+ value.to_s
206
+ when :Integer
207
+ value.to_i
208
+ when :Float
209
+ value.to_f
210
+ when :Boolean
211
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
+ true
213
+ else
214
+ false
215
+ end
216
+ when :Object
217
+ # generic object (usually a Hash), return directly
218
+ value
219
+ when /\AArray<(?<inner_type>.+)>\z/
220
+ inner_type = Regexp.last_match[:inner_type]
221
+ value.map { |v| _deserialize(inner_type, v) }
222
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
+ k_type = Regexp.last_match[:k_type]
224
+ v_type = Regexp.last_match[:v_type]
225
+ {}.tap do |hash|
226
+ value.each do |k, v|
227
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
+ end
229
+ end
230
+ else # model
231
+ # models (e.g. Pet) or oneOf
232
+ klass = OpenapiClient.const_get(type)
233
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
234
+ end
235
+ end
236
+
237
+ # Returns the string representation of the object
238
+ # @return [String] String presentation of the object
239
+ def to_s
240
+ to_hash.to_s
241
+ end
242
+
243
+ # to_body is an alias to to_hash (backward compatibility)
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_body
246
+ to_hash
247
+ end
248
+
249
+ # Returns the object in the form of hash
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_hash
252
+ hash = {}
253
+ self.class.attribute_map.each_pair do |attr, param|
254
+ value = self.send(attr)
255
+ if value.nil?
256
+ is_nullable = self.class.openapi_nullable.include?(attr)
257
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
258
+ end
259
+
260
+ hash[param] = _to_hash(value)
261
+ end
262
+ hash
263
+ end
264
+
265
+ # Outputs non-array value in the form of hash
266
+ # For object, use to_hash. Otherwise, just return the value
267
+ # @param [Object] value Any valid value
268
+ # @return [Hash] Returns the value in the form of hash
269
+ def _to_hash(value)
270
+ if value.is_a?(Array)
271
+ value.compact.map { |v| _to_hash(v) }
272
+ elsif value.is_a?(Hash)
273
+ {}.tap do |hash|
274
+ value.each { |k, v| hash[k] = _to_hash(v) }
275
+ end
276
+ elsif value.respond_to? :to_hash
277
+ value.to_hash
278
+ else
279
+ value
280
+ end
281
+ end
282
+
283
+ end
284
+
285
+ end