passageidentity 0.5.0 → 0.6.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -2
- data/Gemfile +1 -1
- data/README.md +39 -21
- data/docs/generated/Link.md +18 -0
- data/docs/generated/ListPaginatedUsersItem.md +38 -0
- data/docs/generated/ListPaginatedUsersResponse.md +28 -0
- data/docs/generated/Model403Error.md +20 -0
- data/docs/generated/Nonce.md +18 -0
- data/docs/generated/PaginatedLinks.md +26 -0
- data/docs/generated/README.md +8 -3
- data/docs/generated/UserEventStatus.md +15 -0
- data/docs/generated/UserRecentEvent.md +4 -0
- data/docs/generated/UsersApi.md +94 -0
- data/lib/openapi_client/api/users_api.rb +96 -0
- data/lib/openapi_client/models/link.rb +221 -0
- data/lib/openapi_client/models/list_paginated_users_item.rb +399 -0
- data/lib/openapi_client/models/list_paginated_users_response.rb +305 -0
- data/lib/openapi_client/models/magic_link_auth_method.rb +0 -7
- data/lib/openapi_client/models/model401_error.rb +2 -2
- data/lib/openapi_client/models/model403_error.rb +271 -0
- data/lib/openapi_client/models/nonce.rb +222 -0
- data/lib/openapi_client/models/otp_auth_method.rb +0 -7
- data/lib/openapi_client/models/paginated_links.rb +285 -0
- data/lib/openapi_client/models/passkeys_auth_method.rb +0 -7
- data/lib/openapi_client/models/user_event_status.rb +40 -0
- data/lib/openapi_client/models/user_recent_event.rb +51 -1
- data/lib/openapi_client.rb +10 -3
- data/lib/passageidentity/user_api.rb +40 -0
- data/lib/passageidentity/version.rb +1 -1
- data/tests/user_api_test.rb +41 -0
- metadata +20 -9
- data/docs/generated/UpdateMagicLinkAuthMethod.md +0 -22
- data/docs/generated/UpdateOtpAuthMethod.md +0 -22
- data/docs/generated/UpdatePasskeysAuthMethod.md +0 -18
- /data/.github/workflows/{on_pr.yml → on-pull-request.yml} +0 -0
- /data/lib/{openapi_client/models → models}/update_magic_link_auth_method.rb +0 -0
- /data/lib/{openapi_client/models → models}/update_otp_auth_method.rb +0 -0
- /data/lib/{openapi_client/models → models}/update_passkeys_auth_method.rb +0 -0
@@ -0,0 +1,222 @@
|
|
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
|
+
# the nonce to exchange for an authentication token
|
18
|
+
class Nonce
|
19
|
+
attr_accessor :nonce
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'nonce' => :'nonce'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Returns all the JSON keys this model knows about
|
29
|
+
def self.acceptable_attributes
|
30
|
+
attribute_map.values
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.openapi_types
|
35
|
+
{
|
36
|
+
:'nonce' => :'String'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# List of attributes with nullable: true
|
41
|
+
def self.openapi_nullable
|
42
|
+
Set.new([
|
43
|
+
])
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
if (!attributes.is_a?(Hash))
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::Nonce` initialize method"
|
51
|
+
end
|
52
|
+
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Nonce`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
h[k.to_sym] = v
|
59
|
+
}
|
60
|
+
|
61
|
+
if attributes.key?(:'nonce')
|
62
|
+
self.nonce = attributes[:'nonce']
|
63
|
+
else
|
64
|
+
self.nonce = nil
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
69
|
+
# @return Array for valid properties with the reasons
|
70
|
+
def list_invalid_properties
|
71
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
72
|
+
invalid_properties = Array.new
|
73
|
+
if @nonce.nil?
|
74
|
+
invalid_properties.push('invalid value for "nonce", nonce cannot be nil.')
|
75
|
+
end
|
76
|
+
|
77
|
+
invalid_properties
|
78
|
+
end
|
79
|
+
|
80
|
+
# Check to see if the all the properties in the model are valid
|
81
|
+
# @return true if the model is valid
|
82
|
+
def valid?
|
83
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
84
|
+
return false if @nonce.nil?
|
85
|
+
true
|
86
|
+
end
|
87
|
+
|
88
|
+
# Checks equality by comparing each attribute.
|
89
|
+
# @param [Object] Object to be compared
|
90
|
+
def ==(o)
|
91
|
+
return true if self.equal?(o)
|
92
|
+
self.class == o.class &&
|
93
|
+
nonce == o.nonce
|
94
|
+
end
|
95
|
+
|
96
|
+
# @see the `==` method
|
97
|
+
# @param [Object] Object to be compared
|
98
|
+
def eql?(o)
|
99
|
+
self == o
|
100
|
+
end
|
101
|
+
|
102
|
+
# Calculates hash code according to all attributes.
|
103
|
+
# @return [Integer] Hash code
|
104
|
+
def hash
|
105
|
+
[nonce].hash
|
106
|
+
end
|
107
|
+
|
108
|
+
# Builds the object from hash
|
109
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
110
|
+
# @return [Object] Returns the model itself
|
111
|
+
def self.build_from_hash(attributes)
|
112
|
+
return nil unless attributes.is_a?(Hash)
|
113
|
+
attributes = attributes.transform_keys(&:to_sym)
|
114
|
+
transformed_hash = {}
|
115
|
+
openapi_types.each_pair do |key, type|
|
116
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
117
|
+
transformed_hash["#{key}"] = nil
|
118
|
+
elsif type =~ /\AArray<(.*)>/i
|
119
|
+
# check to ensure the input is an array given that the attribute
|
120
|
+
# is documented as an array but the input is not
|
121
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
122
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
123
|
+
end
|
124
|
+
elsif !attributes[attribute_map[key]].nil?
|
125
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
126
|
+
end
|
127
|
+
end
|
128
|
+
new(transformed_hash)
|
129
|
+
end
|
130
|
+
|
131
|
+
# Deserializes the data based on type
|
132
|
+
# @param string type Data type
|
133
|
+
# @param string value Value to be deserialized
|
134
|
+
# @return [Object] Deserialized data
|
135
|
+
def self._deserialize(type, value)
|
136
|
+
case type.to_sym
|
137
|
+
when :Time
|
138
|
+
Time.parse(value)
|
139
|
+
when :Date
|
140
|
+
Date.parse(value)
|
141
|
+
when :String
|
142
|
+
value.to_s
|
143
|
+
when :Integer
|
144
|
+
value.to_i
|
145
|
+
when :Float
|
146
|
+
value.to_f
|
147
|
+
when :Boolean
|
148
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
149
|
+
true
|
150
|
+
else
|
151
|
+
false
|
152
|
+
end
|
153
|
+
when :Object
|
154
|
+
# generic object (usually a Hash), return directly
|
155
|
+
value
|
156
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
157
|
+
inner_type = Regexp.last_match[:inner_type]
|
158
|
+
value.map { |v| _deserialize(inner_type, v) }
|
159
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
160
|
+
k_type = Regexp.last_match[:k_type]
|
161
|
+
v_type = Regexp.last_match[:v_type]
|
162
|
+
{}.tap do |hash|
|
163
|
+
value.each do |k, v|
|
164
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
else # model
|
168
|
+
# models (e.g. Pet) or oneOf
|
169
|
+
klass = OpenapiClient.const_get(type)
|
170
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
# Returns the string representation of the object
|
175
|
+
# @return [String] String presentation of the object
|
176
|
+
def to_s
|
177
|
+
to_hash.to_s
|
178
|
+
end
|
179
|
+
|
180
|
+
# to_body is an alias to to_hash (backward compatibility)
|
181
|
+
# @return [Hash] Returns the object in the form of hash
|
182
|
+
def to_body
|
183
|
+
to_hash
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the object in the form of hash
|
187
|
+
# @return [Hash] Returns the object in the form of hash
|
188
|
+
def to_hash
|
189
|
+
hash = {}
|
190
|
+
self.class.attribute_map.each_pair do |attr, param|
|
191
|
+
value = self.send(attr)
|
192
|
+
if value.nil?
|
193
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
194
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
195
|
+
end
|
196
|
+
|
197
|
+
hash[param] = _to_hash(value)
|
198
|
+
end
|
199
|
+
hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Outputs non-array value in the form of hash
|
203
|
+
# For object, use to_hash. Otherwise, just return the value
|
204
|
+
# @param [Object] value Any valid value
|
205
|
+
# @return [Hash] Returns the value in the form of hash
|
206
|
+
def _to_hash(value)
|
207
|
+
if value.is_a?(Array)
|
208
|
+
value.compact.map { |v| _to_hash(v) }
|
209
|
+
elsif value.is_a?(Hash)
|
210
|
+
{}.tap do |hash|
|
211
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
212
|
+
end
|
213
|
+
elsif value.respond_to? :to_hash
|
214
|
+
value.to_hash
|
215
|
+
else
|
216
|
+
value
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
end
|
221
|
+
|
222
|
+
end
|
@@ -73,13 +73,6 @@ module OpenapiClient
|
|
73
73
|
])
|
74
74
|
end
|
75
75
|
|
76
|
-
# List of class defined in allOf (OpenAPI v3)
|
77
|
-
def self.openapi_all_of
|
78
|
-
[
|
79
|
-
:'UpdateOtpAuthMethod'
|
80
|
-
]
|
81
|
-
end
|
82
|
-
|
83
76
|
# Initializes the object
|
84
77
|
# @param [Hash] attributes Model attributes in the form of hash
|
85
78
|
def initialize(attributes = {})
|
@@ -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 PaginatedLinks
|
18
|
+
attr_accessor :first
|
19
|
+
|
20
|
+
attr_accessor :last
|
21
|
+
|
22
|
+
attr_accessor :_next
|
23
|
+
|
24
|
+
attr_accessor :previous
|
25
|
+
|
26
|
+
attr_accessor :_self
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'first' => :'first',
|
32
|
+
:'last' => :'last',
|
33
|
+
:'_next' => :'next',
|
34
|
+
:'previous' => :'previous',
|
35
|
+
:'_self' => :'self'
|
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
|
+
:'first' => :'Link',
|
48
|
+
:'last' => :'Link',
|
49
|
+
:'_next' => :'Link',
|
50
|
+
:'previous' => :'Link',
|
51
|
+
:'_self' => :'Link'
|
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::PaginatedLinks` 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::PaginatedLinks`. 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?(:'first')
|
77
|
+
self.first = attributes[:'first']
|
78
|
+
else
|
79
|
+
self.first = nil
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes.key?(:'last')
|
83
|
+
self.last = attributes[:'last']
|
84
|
+
else
|
85
|
+
self.last = nil
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:'_next')
|
89
|
+
self._next = attributes[:'_next']
|
90
|
+
else
|
91
|
+
self._next = nil
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.key?(:'previous')
|
95
|
+
self.previous = attributes[:'previous']
|
96
|
+
else
|
97
|
+
self.previous = nil
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'_self')
|
101
|
+
self._self = attributes[:'_self']
|
102
|
+
else
|
103
|
+
self._self = 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 @first.nil?
|
113
|
+
invalid_properties.push('invalid value for "first", first cannot be nil.')
|
114
|
+
end
|
115
|
+
|
116
|
+
if @last.nil?
|
117
|
+
invalid_properties.push('invalid value for "last", last cannot be nil.')
|
118
|
+
end
|
119
|
+
|
120
|
+
if @_next.nil?
|
121
|
+
invalid_properties.push('invalid value for "_next", _next cannot be nil.')
|
122
|
+
end
|
123
|
+
|
124
|
+
if @previous.nil?
|
125
|
+
invalid_properties.push('invalid value for "previous", previous cannot be nil.')
|
126
|
+
end
|
127
|
+
|
128
|
+
if @_self.nil?
|
129
|
+
invalid_properties.push('invalid value for "_self", _self 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 @first.nil?
|
140
|
+
return false if @last.nil?
|
141
|
+
return false if @_next.nil?
|
142
|
+
return false if @previous.nil?
|
143
|
+
return false if @_self.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
|
+
first == o.first &&
|
153
|
+
last == o.last &&
|
154
|
+
_next == o._next &&
|
155
|
+
previous == o.previous &&
|
156
|
+
_self == o._self
|
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
|
+
[first, last, _next, previous, _self].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
|
@@ -42,13 +42,6 @@ module OpenapiClient
|
|
42
42
|
])
|
43
43
|
end
|
44
44
|
|
45
|
-
# List of class defined in allOf (OpenAPI v3)
|
46
|
-
def self.openapi_all_of
|
47
|
-
[
|
48
|
-
:'UpdatePasskeysAuthMethod'
|
49
|
-
]
|
50
|
-
end
|
51
|
-
|
52
45
|
# Initializes the object
|
53
46
|
# @param [Hash] attributes Model attributes in the form of hash
|
54
47
|
def initialize(attributes = {})
|
@@ -0,0 +1,40 @@
|
|
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 UserEventStatus
|
18
|
+
COMPLETE = "complete".freeze
|
19
|
+
INCOMPLETE = "incomplete".freeze
|
20
|
+
|
21
|
+
def self.all_vars
|
22
|
+
@all_vars ||= [COMPLETE, INCOMPLETE].freeze
|
23
|
+
end
|
24
|
+
|
25
|
+
# Builds the enum from string
|
26
|
+
# @param [String] The enum value in the form of the string
|
27
|
+
# @return [String] The enum value
|
28
|
+
def self.build_from_hash(value)
|
29
|
+
new.build_from_hash(value)
|
30
|
+
end
|
31
|
+
|
32
|
+
# Builds the enum from string
|
33
|
+
# @param [String] The enum value in the form of the string
|
34
|
+
# @return [String] The enum value
|
35
|
+
def build_from_hash(value)
|
36
|
+
return value if UserEventStatus.all_vars.include?(value)
|
37
|
+
raise "Invalid ENUM value #{value} for class #UserEventStatus"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -17,20 +17,48 @@ module OpenapiClient
|
|
17
17
|
class UserRecentEvent
|
18
18
|
attr_accessor :created_at
|
19
19
|
|
20
|
+
attr_accessor :completed_at
|
21
|
+
|
20
22
|
attr_accessor :id
|
21
23
|
|
22
24
|
attr_accessor :ip_addr
|
23
25
|
|
26
|
+
attr_accessor :status
|
27
|
+
|
24
28
|
attr_accessor :type
|
25
29
|
|
26
30
|
attr_accessor :user_agent
|
27
31
|
|
32
|
+
class EnumAttributeValidator
|
33
|
+
attr_reader :datatype
|
34
|
+
attr_reader :allowable_values
|
35
|
+
|
36
|
+
def initialize(datatype, allowable_values)
|
37
|
+
@allowable_values = allowable_values.map do |value|
|
38
|
+
case datatype.to_s
|
39
|
+
when /Integer/i
|
40
|
+
value.to_i
|
41
|
+
when /Float/i
|
42
|
+
value.to_f
|
43
|
+
else
|
44
|
+
value
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def valid?(value)
|
50
|
+
!value || allowable_values.include?(value)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
28
54
|
# Attribute mapping from ruby-style variable name to JSON key.
|
29
55
|
def self.attribute_map
|
30
56
|
{
|
31
57
|
:'created_at' => :'created_at',
|
58
|
+
:'completed_at' => :'completed_at',
|
32
59
|
:'id' => :'id',
|
33
60
|
:'ip_addr' => :'ip_addr',
|
61
|
+
:'status' => :'status',
|
34
62
|
:'type' => :'type',
|
35
63
|
:'user_agent' => :'user_agent'
|
36
64
|
}
|
@@ -45,8 +73,10 @@ module OpenapiClient
|
|
45
73
|
def self.openapi_types
|
46
74
|
{
|
47
75
|
:'created_at' => :'Time',
|
76
|
+
:'completed_at' => :'Time',
|
48
77
|
:'id' => :'String',
|
49
78
|
:'ip_addr' => :'String',
|
79
|
+
:'status' => :'UserEventStatus',
|
50
80
|
:'type' => :'String',
|
51
81
|
:'user_agent' => :'String'
|
52
82
|
}
|
@@ -55,6 +85,7 @@ module OpenapiClient
|
|
55
85
|
# List of attributes with nullable: true
|
56
86
|
def self.openapi_nullable
|
57
87
|
Set.new([
|
88
|
+
:'completed_at',
|
58
89
|
])
|
59
90
|
end
|
60
91
|
|
@@ -79,6 +110,12 @@ module OpenapiClient
|
|
79
110
|
self.created_at = nil
|
80
111
|
end
|
81
112
|
|
113
|
+
if attributes.key?(:'completed_at')
|
114
|
+
self.completed_at = attributes[:'completed_at']
|
115
|
+
else
|
116
|
+
self.completed_at = nil
|
117
|
+
end
|
118
|
+
|
82
119
|
if attributes.key?(:'id')
|
83
120
|
self.id = attributes[:'id']
|
84
121
|
else
|
@@ -91,6 +128,12 @@ module OpenapiClient
|
|
91
128
|
self.ip_addr = nil
|
92
129
|
end
|
93
130
|
|
131
|
+
if attributes.key?(:'status')
|
132
|
+
self.status = attributes[:'status']
|
133
|
+
else
|
134
|
+
self.status = nil
|
135
|
+
end
|
136
|
+
|
94
137
|
if attributes.key?(:'type')
|
95
138
|
self.type = attributes[:'type']
|
96
139
|
else
|
@@ -121,6 +164,10 @@ module OpenapiClient
|
|
121
164
|
invalid_properties.push('invalid value for "ip_addr", ip_addr cannot be nil.')
|
122
165
|
end
|
123
166
|
|
167
|
+
if @status.nil?
|
168
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
169
|
+
end
|
170
|
+
|
124
171
|
if @type.nil?
|
125
172
|
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
126
173
|
end
|
@@ -139,6 +186,7 @@ module OpenapiClient
|
|
139
186
|
return false if @created_at.nil?
|
140
187
|
return false if @id.nil?
|
141
188
|
return false if @ip_addr.nil?
|
189
|
+
return false if @status.nil?
|
142
190
|
return false if @type.nil?
|
143
191
|
return false if @user_agent.nil?
|
144
192
|
true
|
@@ -150,8 +198,10 @@ module OpenapiClient
|
|
150
198
|
return true if self.equal?(o)
|
151
199
|
self.class == o.class &&
|
152
200
|
created_at == o.created_at &&
|
201
|
+
completed_at == o.completed_at &&
|
153
202
|
id == o.id &&
|
154
203
|
ip_addr == o.ip_addr &&
|
204
|
+
status == o.status &&
|
155
205
|
type == o.type &&
|
156
206
|
user_agent == o.user_agent
|
157
207
|
end
|
@@ -165,7 +215,7 @@ module OpenapiClient
|
|
165
215
|
# Calculates hash code according to all attributes.
|
166
216
|
# @return [Integer] Hash code
|
167
217
|
def hash
|
168
|
-
[created_at, id, ip_addr, type, user_agent].hash
|
218
|
+
[created_at, completed_at, id, ip_addr, status, type, user_agent].hash
|
169
219
|
end
|
170
220
|
|
171
221
|
# Builds the object from hash
|