passageidentity 0.7.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/lib/openapi_client/api/users_api.rb +18 -18
  3. data/lib/openapi_client/models/create_magic_link_request.rb +21 -2
  4. data/lib/openapi_client/models/{create_user_request.rb → create_user_args.rb} +3 -3
  5. data/lib/openapi_client/models/magic_link.rb +1 -0
  6. data/lib/openapi_client/models/{theme_type.rb → magic_link_language.rb} +11 -7
  7. data/lib/openapi_client/models/{user_info.rb → passage_user.rb} +3 -3
  8. data/lib/openapi_client/models/{update_user_request.rb → update_user_args.rb} +3 -3
  9. data/lib/openapi_client/models/user_response.rb +1 -1
  10. data/lib/openapi_client.rb +4 -19
  11. data/lib/passageidentity/auth.rb +43 -156
  12. data/lib/passageidentity/client.rb +16 -96
  13. data/lib/passageidentity/user.rb +246 -0
  14. data/lib/passageidentity/version.rb +1 -1
  15. metadata +38 -36
  16. data/lib/models/update_magic_link_auth_method.rb +0 -276
  17. data/lib/models/update_otp_auth_method.rb +0 -276
  18. data/lib/models/update_passkeys_auth_method.rb +0 -216
  19. data/lib/openapi_client/api/apps_api.rb +0 -85
  20. data/lib/openapi_client/models/app_info.rb +0 -886
  21. data/lib/openapi_client/models/app_response.rb +0 -221
  22. data/lib/openapi_client/models/auth_methods.rb +0 -254
  23. data/lib/openapi_client/models/element_customization.rb +0 -457
  24. data/lib/openapi_client/models/font_family.rb +0 -58
  25. data/lib/openapi_client/models/layout_config.rb +0 -285
  26. data/lib/openapi_client/models/layouts.rb +0 -241
  27. data/lib/openapi_client/models/magic_link_auth_method.rb +0 -295
  28. data/lib/openapi_client/models/otp_auth_method.rb +0 -295
  29. data/lib/openapi_client/models/passkeys_auth_method.rb +0 -221
  30. data/lib/openapi_client/models/technologies.rb +0 -46
  31. data/lib/openapi_client/models/ttl_display_unit.rb +0 -42
  32. data/lib/openapi_client/models/user_metadata_field.rb +0 -323
  33. data/lib/openapi_client/models/user_metadata_field_type.rb +0 -44
  34. data/lib/passageidentity/user_api.rb +0 -218
@@ -1,221 +0,0 @@
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
- Generator version: 7.11.0-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module OpenapiClient
17
- class PasskeysAuthMethod
18
- attr_accessor :enabled
19
-
20
- # Attribute mapping from ruby-style variable name to JSON key.
21
- def self.attribute_map
22
- {
23
- :'enabled' => :'enabled'
24
- }
25
- end
26
-
27
- # Returns all the JSON keys this model knows about
28
- def self.acceptable_attributes
29
- attribute_map.values
30
- end
31
-
32
- # Attribute type mapping.
33
- def self.openapi_types
34
- {
35
- :'enabled' => :'Boolean'
36
- }
37
- end
38
-
39
- # List of attributes with nullable: true
40
- def self.openapi_nullable
41
- Set.new([
42
- ])
43
- end
44
-
45
- # Initializes the object
46
- # @param [Hash] attributes Model attributes in the form of hash
47
- def initialize(attributes = {})
48
- if (!attributes.is_a?(Hash))
49
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::PasskeysAuthMethod` initialize method"
50
- end
51
-
52
- # check to see if the attribute exists and convert string to symbol for hash key
53
- attributes = attributes.each_with_object({}) { |(k, v), h|
54
- if (!self.class.attribute_map.key?(k.to_sym))
55
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::PasskeysAuthMethod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
- end
57
- h[k.to_sym] = v
58
- }
59
-
60
- if attributes.key?(:'enabled')
61
- self.enabled = attributes[:'enabled']
62
- else
63
- self.enabled = true
64
- end
65
- end
66
-
67
- # Show invalid properties with the reasons. Usually used together with valid?
68
- # @return Array for valid properties with the reasons
69
- def list_invalid_properties
70
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
71
- invalid_properties = Array.new
72
- if @enabled.nil?
73
- invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
74
- end
75
-
76
- invalid_properties
77
- end
78
-
79
- # Check to see if the all the properties in the model are valid
80
- # @return true if the model is valid
81
- def valid?
82
- warn '[DEPRECATED] the `valid?` method is obsolete'
83
- return false if @enabled.nil?
84
- true
85
- end
86
-
87
- # Checks equality by comparing each attribute.
88
- # @param [Object] Object to be compared
89
- def ==(o)
90
- return true if self.equal?(o)
91
- self.class == o.class &&
92
- enabled == o.enabled
93
- end
94
-
95
- # @see the `==` method
96
- # @param [Object] Object to be compared
97
- def eql?(o)
98
- self == o
99
- end
100
-
101
- # Calculates hash code according to all attributes.
102
- # @return [Integer] Hash code
103
- def hash
104
- [enabled].hash
105
- end
106
-
107
- # Builds the object from hash
108
- # @param [Hash] attributes Model attributes in the form of hash
109
- # @return [Object] Returns the model itself
110
- def self.build_from_hash(attributes)
111
- return nil unless attributes.is_a?(Hash)
112
- attributes = attributes.transform_keys(&:to_sym)
113
- transformed_hash = {}
114
- openapi_types.each_pair do |key, type|
115
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
- transformed_hash["#{key}"] = nil
117
- elsif type =~ /\AArray<(.*)>/i
118
- # check to ensure the input is an array given that the attribute
119
- # is documented as an array but the input is not
120
- if attributes[attribute_map[key]].is_a?(Array)
121
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
122
- end
123
- elsif !attributes[attribute_map[key]].nil?
124
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
125
- end
126
- end
127
- new(transformed_hash)
128
- end
129
-
130
- # Deserializes the data based on type
131
- # @param string type Data type
132
- # @param string value Value to be deserialized
133
- # @return [Object] Deserialized data
134
- def self._deserialize(type, value)
135
- case type.to_sym
136
- when :Time
137
- Time.parse(value)
138
- when :Date
139
- Date.parse(value)
140
- when :String
141
- value.to_s
142
- when :Integer
143
- value.to_i
144
- when :Float
145
- value.to_f
146
- when :Boolean
147
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
- true
149
- else
150
- false
151
- end
152
- when :Object
153
- # generic object (usually a Hash), return directly
154
- value
155
- when /\AArray<(?<inner_type>.+)>\z/
156
- inner_type = Regexp.last_match[:inner_type]
157
- value.map { |v| _deserialize(inner_type, v) }
158
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
- k_type = Regexp.last_match[:k_type]
160
- v_type = Regexp.last_match[:v_type]
161
- {}.tap do |hash|
162
- value.each do |k, v|
163
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
- end
165
- end
166
- else # model
167
- # models (e.g. Pet) or oneOf
168
- klass = OpenapiClient.const_get(type)
169
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
- end
171
- end
172
-
173
- # Returns the string representation of the object
174
- # @return [String] String presentation of the object
175
- def to_s
176
- to_hash.to_s
177
- end
178
-
179
- # to_body is an alias to to_hash (backward compatibility)
180
- # @return [Hash] Returns the object in the form of hash
181
- def to_body
182
- to_hash
183
- end
184
-
185
- # Returns the object in the form of hash
186
- # @return [Hash] Returns the object in the form of hash
187
- def to_hash
188
- hash = {}
189
- self.class.attribute_map.each_pair do |attr, param|
190
- value = self.send(attr)
191
- if value.nil?
192
- is_nullable = self.class.openapi_nullable.include?(attr)
193
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
- end
195
-
196
- hash[param] = _to_hash(value)
197
- end
198
- hash
199
- end
200
-
201
- # Outputs non-array value in the form of hash
202
- # For object, use to_hash. Otherwise, just return the value
203
- # @param [Object] value Any valid value
204
- # @return [Hash] Returns the value in the form of hash
205
- def _to_hash(value)
206
- if value.is_a?(Array)
207
- value.compact.map { |v| _to_hash(v) }
208
- elsif value.is_a?(Hash)
209
- {}.tap do |hash|
210
- value.each { |k, v| hash[k] = _to_hash(v) }
211
- end
212
- elsif value.respond_to? :to_hash
213
- value.to_hash
214
- else
215
- value
216
- end
217
- end
218
-
219
- end
220
-
221
- end
@@ -1,46 +0,0 @@
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
- Generator version: 7.11.0-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module OpenapiClient
17
- class Technologies
18
- REACT = "react".freeze
19
- GO = "go".freeze
20
- VUE = "vue".freeze
21
- ANGULAR = "angular".freeze
22
- PYTHON = "python".freeze
23
- JAVASCRIPT = "javascript".freeze
24
- IOS = "ios".freeze
25
- ANDROID = "android".freeze
26
-
27
- def self.all_vars
28
- @all_vars ||= [REACT, GO, VUE, ANGULAR, PYTHON, JAVASCRIPT, IOS, ANDROID].freeze
29
- end
30
-
31
- # Builds the enum from string
32
- # @param [String] The enum value in the form of the string
33
- # @return [String] The enum value
34
- def self.build_from_hash(value)
35
- new.build_from_hash(value)
36
- end
37
-
38
- # Builds the enum from string
39
- # @param [String] The enum value in the form of the string
40
- # @return [String] The enum value
41
- def build_from_hash(value)
42
- return value if Technologies.all_vars.include?(value)
43
- raise "Invalid ENUM value #{value} for class #Technologies"
44
- end
45
- end
46
- end
@@ -1,42 +0,0 @@
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
- Generator version: 7.11.0-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module OpenapiClient
17
- class TtlDisplayUnit
18
- S = "s".freeze
19
- M = "m".freeze
20
- H = "h".freeze
21
- D = "d".freeze
22
-
23
- def self.all_vars
24
- @all_vars ||= [S, M, H, D].freeze
25
- end
26
-
27
- # Builds the enum from string
28
- # @param [String] The enum value in the form of the string
29
- # @return [String] The enum value
30
- def self.build_from_hash(value)
31
- new.build_from_hash(value)
32
- end
33
-
34
- # Builds the enum from string
35
- # @param [String] The enum value in the form of the string
36
- # @return [String] The enum value
37
- def build_from_hash(value)
38
- return value if TtlDisplayUnit.all_vars.include?(value)
39
- raise "Invalid ENUM value #{value} for class #TtlDisplayUnit"
40
- end
41
- end
42
- end
@@ -1,323 +0,0 @@
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
- Generator version: 7.11.0-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module OpenapiClient
17
- class UserMetadataField
18
- attr_accessor :field_name
19
-
20
- attr_accessor :friendly_name
21
-
22
- attr_accessor :id
23
-
24
- attr_accessor :profile
25
-
26
- attr_accessor :registration
27
-
28
- attr_accessor :type
29
-
30
- class EnumAttributeValidator
31
- attr_reader :datatype
32
- attr_reader :allowable_values
33
-
34
- def initialize(datatype, allowable_values)
35
- @allowable_values = allowable_values.map do |value|
36
- case datatype.to_s
37
- when /Integer/i
38
- value.to_i
39
- when /Float/i
40
- value.to_f
41
- else
42
- value
43
- end
44
- end
45
- end
46
-
47
- def valid?(value)
48
- !value || allowable_values.include?(value)
49
- end
50
- end
51
-
52
- # Attribute mapping from ruby-style variable name to JSON key.
53
- def self.attribute_map
54
- {
55
- :'field_name' => :'field_name',
56
- :'friendly_name' => :'friendly_name',
57
- :'id' => :'id',
58
- :'profile' => :'profile',
59
- :'registration' => :'registration',
60
- :'type' => :'type'
61
- }
62
- end
63
-
64
- # Returns all the JSON keys this model knows about
65
- def self.acceptable_attributes
66
- attribute_map.values
67
- end
68
-
69
- # Attribute type mapping.
70
- def self.openapi_types
71
- {
72
- :'field_name' => :'String',
73
- :'friendly_name' => :'String',
74
- :'id' => :'String',
75
- :'profile' => :'Boolean',
76
- :'registration' => :'Boolean',
77
- :'type' => :'UserMetadataFieldType'
78
- }
79
- end
80
-
81
- # List of attributes with nullable: true
82
- def self.openapi_nullable
83
- Set.new([
84
- ])
85
- end
86
-
87
- # Initializes the object
88
- # @param [Hash] attributes Model attributes in the form of hash
89
- def initialize(attributes = {})
90
- if (!attributes.is_a?(Hash))
91
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::UserMetadataField` initialize method"
92
- end
93
-
94
- # check to see if the attribute exists and convert string to symbol for hash key
95
- attributes = attributes.each_with_object({}) { |(k, v), h|
96
- if (!self.class.attribute_map.key?(k.to_sym))
97
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::UserMetadataField`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
98
- end
99
- h[k.to_sym] = v
100
- }
101
-
102
- if attributes.key?(:'field_name')
103
- self.field_name = attributes[:'field_name']
104
- else
105
- self.field_name = nil
106
- end
107
-
108
- if attributes.key?(:'friendly_name')
109
- self.friendly_name = attributes[:'friendly_name']
110
- else
111
- self.friendly_name = nil
112
- end
113
-
114
- if attributes.key?(:'id')
115
- self.id = attributes[:'id']
116
- else
117
- self.id = nil
118
- end
119
-
120
- if attributes.key?(:'profile')
121
- self.profile = attributes[:'profile']
122
- else
123
- self.profile = nil
124
- end
125
-
126
- if attributes.key?(:'registration')
127
- self.registration = attributes[:'registration']
128
- else
129
- self.registration = nil
130
- end
131
-
132
- if attributes.key?(:'type')
133
- self.type = attributes[:'type']
134
- else
135
- self.type = nil
136
- end
137
- end
138
-
139
- # Show invalid properties with the reasons. Usually used together with valid?
140
- # @return Array for valid properties with the reasons
141
- def list_invalid_properties
142
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
143
- invalid_properties = Array.new
144
- if @field_name.nil?
145
- invalid_properties.push('invalid value for "field_name", field_name cannot be nil.')
146
- end
147
-
148
- if @friendly_name.nil?
149
- invalid_properties.push('invalid value for "friendly_name", friendly_name cannot be nil.')
150
- end
151
-
152
- if @id.nil?
153
- invalid_properties.push('invalid value for "id", id cannot be nil.')
154
- end
155
-
156
- if @profile.nil?
157
- invalid_properties.push('invalid value for "profile", profile cannot be nil.')
158
- end
159
-
160
- if @registration.nil?
161
- invalid_properties.push('invalid value for "registration", registration cannot be nil.')
162
- end
163
-
164
- if @type.nil?
165
- invalid_properties.push('invalid value for "type", type cannot be nil.')
166
- end
167
-
168
- invalid_properties
169
- end
170
-
171
- # Check to see if the all the properties in the model are valid
172
- # @return true if the model is valid
173
- def valid?
174
- warn '[DEPRECATED] the `valid?` method is obsolete'
175
- return false if @field_name.nil?
176
- return false if @friendly_name.nil?
177
- return false if @id.nil?
178
- return false if @profile.nil?
179
- return false if @registration.nil?
180
- return false if @type.nil?
181
- true
182
- end
183
-
184
- # Checks equality by comparing each attribute.
185
- # @param [Object] Object to be compared
186
- def ==(o)
187
- return true if self.equal?(o)
188
- self.class == o.class &&
189
- field_name == o.field_name &&
190
- friendly_name == o.friendly_name &&
191
- id == o.id &&
192
- profile == o.profile &&
193
- registration == o.registration &&
194
- type == o.type
195
- end
196
-
197
- # @see the `==` method
198
- # @param [Object] Object to be compared
199
- def eql?(o)
200
- self == o
201
- end
202
-
203
- # Calculates hash code according to all attributes.
204
- # @return [Integer] Hash code
205
- def hash
206
- [field_name, friendly_name, id, profile, registration, type].hash
207
- end
208
-
209
- # Builds the object from hash
210
- # @param [Hash] attributes Model attributes in the form of hash
211
- # @return [Object] Returns the model itself
212
- def self.build_from_hash(attributes)
213
- return nil unless attributes.is_a?(Hash)
214
- attributes = attributes.transform_keys(&:to_sym)
215
- transformed_hash = {}
216
- openapi_types.each_pair do |key, type|
217
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
218
- transformed_hash["#{key}"] = nil
219
- elsif type =~ /\AArray<(.*)>/i
220
- # check to ensure the input is an array given that the attribute
221
- # is documented as an array but the input is not
222
- if attributes[attribute_map[key]].is_a?(Array)
223
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
224
- end
225
- elsif !attributes[attribute_map[key]].nil?
226
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
227
- end
228
- end
229
- new(transformed_hash)
230
- end
231
-
232
- # Deserializes the data based on type
233
- # @param string type Data type
234
- # @param string value Value to be deserialized
235
- # @return [Object] Deserialized data
236
- def self._deserialize(type, value)
237
- case type.to_sym
238
- when :Time
239
- Time.parse(value)
240
- when :Date
241
- Date.parse(value)
242
- when :String
243
- value.to_s
244
- when :Integer
245
- value.to_i
246
- when :Float
247
- value.to_f
248
- when :Boolean
249
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
250
- true
251
- else
252
- false
253
- end
254
- when :Object
255
- # generic object (usually a Hash), return directly
256
- value
257
- when /\AArray<(?<inner_type>.+)>\z/
258
- inner_type = Regexp.last_match[:inner_type]
259
- value.map { |v| _deserialize(inner_type, v) }
260
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
261
- k_type = Regexp.last_match[:k_type]
262
- v_type = Regexp.last_match[:v_type]
263
- {}.tap do |hash|
264
- value.each do |k, v|
265
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
266
- end
267
- end
268
- else # model
269
- # models (e.g. Pet) or oneOf
270
- klass = OpenapiClient.const_get(type)
271
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
272
- end
273
- end
274
-
275
- # Returns the string representation of the object
276
- # @return [String] String presentation of the object
277
- def to_s
278
- to_hash.to_s
279
- end
280
-
281
- # to_body is an alias to to_hash (backward compatibility)
282
- # @return [Hash] Returns the object in the form of hash
283
- def to_body
284
- to_hash
285
- end
286
-
287
- # Returns the object in the form of hash
288
- # @return [Hash] Returns the object in the form of hash
289
- def to_hash
290
- hash = {}
291
- self.class.attribute_map.each_pair do |attr, param|
292
- value = self.send(attr)
293
- if value.nil?
294
- is_nullable = self.class.openapi_nullable.include?(attr)
295
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
296
- end
297
-
298
- hash[param] = _to_hash(value)
299
- end
300
- hash
301
- end
302
-
303
- # Outputs non-array value in the form of hash
304
- # For object, use to_hash. Otherwise, just return the value
305
- # @param [Object] value Any valid value
306
- # @return [Hash] Returns the value in the form of hash
307
- def _to_hash(value)
308
- if value.is_a?(Array)
309
- value.compact.map { |v| _to_hash(v) }
310
- elsif value.is_a?(Hash)
311
- {}.tap do |hash|
312
- value.each { |k, v| hash[k] = _to_hash(v) }
313
- end
314
- elsif value.respond_to? :to_hash
315
- value.to_hash
316
- else
317
- value
318
- end
319
- end
320
-
321
- end
322
-
323
- end
@@ -1,44 +0,0 @@
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
- Generator version: 7.11.0-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module OpenapiClient
17
- class UserMetadataFieldType
18
- STRING = "string".freeze
19
- BOOLEAN = "boolean".freeze
20
- INTEGER = "integer".freeze
21
- DATE = "date".freeze
22
- PHONE = "phone".freeze
23
- EMAIL = "email".freeze
24
-
25
- def self.all_vars
26
- @all_vars ||= [STRING, BOOLEAN, INTEGER, DATE, PHONE, EMAIL].freeze
27
- end
28
-
29
- # Builds the enum from string
30
- # @param [String] The enum value in the form of the string
31
- # @return [String] The enum value
32
- def self.build_from_hash(value)
33
- new.build_from_hash(value)
34
- end
35
-
36
- # Builds the enum from string
37
- # @param [String] The enum value in the form of the string
38
- # @return [String] The enum value
39
- def build_from_hash(value)
40
- return value if UserMetadataFieldType.all_vars.include?(value)
41
- raise "Invalid ENUM value #{value} for class #UserMetadataFieldType"
42
- end
43
- end
44
- end