passageidentity 0.3.0 → 0.5.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/docs/generated/AppleUserSocialConnection.md +24 -0
- data/docs/generated/GithubUserSocialConnection.md +24 -0
- data/docs/generated/GoogleUserSocialConnection.md +24 -0
- data/docs/generated/README.md +153 -0
- data/docs/generated/UserInfo.md +3 -1
- data/docs/generated/{UserEventInfo.md → UserRecentEvent.md} +2 -2
- data/docs/generated/UserSocialConnections.md +22 -0
- data/lib/openapi_client/models/apple_user_social_connection.rb +271 -0
- data/lib/openapi_client/models/github_user_social_connection.rb +271 -0
- data/lib/openapi_client/models/google_user_social_connection.rb +271 -0
- data/lib/openapi_client/models/model404_error.rb +2 -2
- data/lib/openapi_client/models/otp_auth_method.rb +3 -3
- data/lib/openapi_client/models/ttl_display_unit.rb +1 -1
- data/lib/openapi_client/models/user_info.rb +18 -2
- data/lib/openapi_client/models/{user_event_info.rb → user_recent_event.rb} +3 -3
- data/lib/openapi_client/models/user_social_connections.rb +232 -0
- data/lib/openapi_client.rb +12 -2
- data/lib/passageidentity/version.rb +1 -1
- metadata +13 -4
@@ -0,0 +1,271 @@
|
|
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 GithubUserSocialConnection
|
18
|
+
# The external ID of the Social Connection.
|
19
|
+
attr_accessor :provider_id
|
20
|
+
|
21
|
+
attr_accessor :created_at
|
22
|
+
|
23
|
+
attr_accessor :last_login_at
|
24
|
+
|
25
|
+
# The email of connected social user.
|
26
|
+
attr_accessor :provider_identifier
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'provider_id' => :'provider_id',
|
32
|
+
:'created_at' => :'created_at',
|
33
|
+
:'last_login_at' => :'last_login_at',
|
34
|
+
:'provider_identifier' => :'provider_identifier'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Returns all the JSON keys this model knows about
|
39
|
+
def self.acceptable_attributes
|
40
|
+
attribute_map.values
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute type mapping.
|
44
|
+
def self.openapi_types
|
45
|
+
{
|
46
|
+
:'provider_id' => :'String',
|
47
|
+
:'created_at' => :'Time',
|
48
|
+
:'last_login_at' => :'Time',
|
49
|
+
:'provider_identifier' => :'String'
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# List of attributes with nullable: true
|
54
|
+
def self.openapi_nullable
|
55
|
+
Set.new([
|
56
|
+
])
|
57
|
+
end
|
58
|
+
|
59
|
+
# Initializes the object
|
60
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
61
|
+
def initialize(attributes = {})
|
62
|
+
if (!attributes.is_a?(Hash))
|
63
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::GithubUserSocialConnection` initialize method"
|
64
|
+
end
|
65
|
+
|
66
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
68
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::GithubUserSocialConnection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
70
|
+
end
|
71
|
+
h[k.to_sym] = v
|
72
|
+
}
|
73
|
+
|
74
|
+
if attributes.key?(:'provider_id')
|
75
|
+
self.provider_id = attributes[:'provider_id']
|
76
|
+
else
|
77
|
+
self.provider_id = nil
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'created_at')
|
81
|
+
self.created_at = attributes[:'created_at']
|
82
|
+
else
|
83
|
+
self.created_at = nil
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.key?(:'last_login_at')
|
87
|
+
self.last_login_at = attributes[:'last_login_at']
|
88
|
+
else
|
89
|
+
self.last_login_at = nil
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'provider_identifier')
|
93
|
+
self.provider_identifier = attributes[:'provider_identifier']
|
94
|
+
else
|
95
|
+
self.provider_identifier = nil
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
100
|
+
# @return Array for valid properties with the reasons
|
101
|
+
def list_invalid_properties
|
102
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
103
|
+
invalid_properties = Array.new
|
104
|
+
if @provider_id.nil?
|
105
|
+
invalid_properties.push('invalid value for "provider_id", provider_id cannot be nil.')
|
106
|
+
end
|
107
|
+
|
108
|
+
if @created_at.nil?
|
109
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
110
|
+
end
|
111
|
+
|
112
|
+
if @last_login_at.nil?
|
113
|
+
invalid_properties.push('invalid value for "last_login_at", last_login_at cannot be nil.')
|
114
|
+
end
|
115
|
+
|
116
|
+
if @provider_identifier.nil?
|
117
|
+
invalid_properties.push('invalid value for "provider_identifier", provider_identifier cannot be nil.')
|
118
|
+
end
|
119
|
+
|
120
|
+
invalid_properties
|
121
|
+
end
|
122
|
+
|
123
|
+
# Check to see if the all the properties in the model are valid
|
124
|
+
# @return true if the model is valid
|
125
|
+
def valid?
|
126
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
127
|
+
return false if @provider_id.nil?
|
128
|
+
return false if @created_at.nil?
|
129
|
+
return false if @last_login_at.nil?
|
130
|
+
return false if @provider_identifier.nil?
|
131
|
+
true
|
132
|
+
end
|
133
|
+
|
134
|
+
# Checks equality by comparing each attribute.
|
135
|
+
# @param [Object] Object to be compared
|
136
|
+
def ==(o)
|
137
|
+
return true if self.equal?(o)
|
138
|
+
self.class == o.class &&
|
139
|
+
provider_id == o.provider_id &&
|
140
|
+
created_at == o.created_at &&
|
141
|
+
last_login_at == o.last_login_at &&
|
142
|
+
provider_identifier == o.provider_identifier
|
143
|
+
end
|
144
|
+
|
145
|
+
# @see the `==` method
|
146
|
+
# @param [Object] Object to be compared
|
147
|
+
def eql?(o)
|
148
|
+
self == o
|
149
|
+
end
|
150
|
+
|
151
|
+
# Calculates hash code according to all attributes.
|
152
|
+
# @return [Integer] Hash code
|
153
|
+
def hash
|
154
|
+
[provider_id, created_at, last_login_at, provider_identifier].hash
|
155
|
+
end
|
156
|
+
|
157
|
+
# Builds the object from hash
|
158
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
159
|
+
# @return [Object] Returns the model itself
|
160
|
+
def self.build_from_hash(attributes)
|
161
|
+
return nil unless attributes.is_a?(Hash)
|
162
|
+
attributes = attributes.transform_keys(&:to_sym)
|
163
|
+
transformed_hash = {}
|
164
|
+
openapi_types.each_pair do |key, type|
|
165
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
166
|
+
transformed_hash["#{key}"] = nil
|
167
|
+
elsif type =~ /\AArray<(.*)>/i
|
168
|
+
# check to ensure the input is an array given that the attribute
|
169
|
+
# is documented as an array but the input is not
|
170
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
171
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
172
|
+
end
|
173
|
+
elsif !attributes[attribute_map[key]].nil?
|
174
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
175
|
+
end
|
176
|
+
end
|
177
|
+
new(transformed_hash)
|
178
|
+
end
|
179
|
+
|
180
|
+
# Deserializes the data based on type
|
181
|
+
# @param string type Data type
|
182
|
+
# @param string value Value to be deserialized
|
183
|
+
# @return [Object] Deserialized data
|
184
|
+
def self._deserialize(type, value)
|
185
|
+
case type.to_sym
|
186
|
+
when :Time
|
187
|
+
Time.parse(value)
|
188
|
+
when :Date
|
189
|
+
Date.parse(value)
|
190
|
+
when :String
|
191
|
+
value.to_s
|
192
|
+
when :Integer
|
193
|
+
value.to_i
|
194
|
+
when :Float
|
195
|
+
value.to_f
|
196
|
+
when :Boolean
|
197
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
198
|
+
true
|
199
|
+
else
|
200
|
+
false
|
201
|
+
end
|
202
|
+
when :Object
|
203
|
+
# generic object (usually a Hash), return directly
|
204
|
+
value
|
205
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
206
|
+
inner_type = Regexp.last_match[:inner_type]
|
207
|
+
value.map { |v| _deserialize(inner_type, v) }
|
208
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
209
|
+
k_type = Regexp.last_match[:k_type]
|
210
|
+
v_type = Regexp.last_match[:v_type]
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each do |k, v|
|
213
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
214
|
+
end
|
215
|
+
end
|
216
|
+
else # model
|
217
|
+
# models (e.g. Pet) or oneOf
|
218
|
+
klass = OpenapiClient.const_get(type)
|
219
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
# Returns the string representation of the object
|
224
|
+
# @return [String] String presentation of the object
|
225
|
+
def to_s
|
226
|
+
to_hash.to_s
|
227
|
+
end
|
228
|
+
|
229
|
+
# to_body is an alias to to_hash (backward compatibility)
|
230
|
+
# @return [Hash] Returns the object in the form of hash
|
231
|
+
def to_body
|
232
|
+
to_hash
|
233
|
+
end
|
234
|
+
|
235
|
+
# Returns the object in the form of hash
|
236
|
+
# @return [Hash] Returns the object in the form of hash
|
237
|
+
def to_hash
|
238
|
+
hash = {}
|
239
|
+
self.class.attribute_map.each_pair do |attr, param|
|
240
|
+
value = self.send(attr)
|
241
|
+
if value.nil?
|
242
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
243
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
244
|
+
end
|
245
|
+
|
246
|
+
hash[param] = _to_hash(value)
|
247
|
+
end
|
248
|
+
hash
|
249
|
+
end
|
250
|
+
|
251
|
+
# Outputs non-array value in the form of hash
|
252
|
+
# For object, use to_hash. Otherwise, just return the value
|
253
|
+
# @param [Object] value Any valid value
|
254
|
+
# @return [Hash] Returns the value in the form of hash
|
255
|
+
def _to_hash(value)
|
256
|
+
if value.is_a?(Array)
|
257
|
+
value.compact.map { |v| _to_hash(v) }
|
258
|
+
elsif value.is_a?(Hash)
|
259
|
+
{}.tap do |hash|
|
260
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
261
|
+
end
|
262
|
+
elsif value.respond_to? :to_hash
|
263
|
+
value.to_hash
|
264
|
+
else
|
265
|
+
value
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
end
|
270
|
+
|
271
|
+
end
|
@@ -0,0 +1,271 @@
|
|
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 GoogleUserSocialConnection
|
18
|
+
# The external ID of the Social Connection.
|
19
|
+
attr_accessor :provider_id
|
20
|
+
|
21
|
+
attr_accessor :created_at
|
22
|
+
|
23
|
+
attr_accessor :last_login_at
|
24
|
+
|
25
|
+
# The email of connected social user.
|
26
|
+
attr_accessor :provider_identifier
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'provider_id' => :'provider_id',
|
32
|
+
:'created_at' => :'created_at',
|
33
|
+
:'last_login_at' => :'last_login_at',
|
34
|
+
:'provider_identifier' => :'provider_identifier'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Returns all the JSON keys this model knows about
|
39
|
+
def self.acceptable_attributes
|
40
|
+
attribute_map.values
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute type mapping.
|
44
|
+
def self.openapi_types
|
45
|
+
{
|
46
|
+
:'provider_id' => :'String',
|
47
|
+
:'created_at' => :'Time',
|
48
|
+
:'last_login_at' => :'Time',
|
49
|
+
:'provider_identifier' => :'String'
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# List of attributes with nullable: true
|
54
|
+
def self.openapi_nullable
|
55
|
+
Set.new([
|
56
|
+
])
|
57
|
+
end
|
58
|
+
|
59
|
+
# Initializes the object
|
60
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
61
|
+
def initialize(attributes = {})
|
62
|
+
if (!attributes.is_a?(Hash))
|
63
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::GoogleUserSocialConnection` initialize method"
|
64
|
+
end
|
65
|
+
|
66
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
68
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::GoogleUserSocialConnection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
70
|
+
end
|
71
|
+
h[k.to_sym] = v
|
72
|
+
}
|
73
|
+
|
74
|
+
if attributes.key?(:'provider_id')
|
75
|
+
self.provider_id = attributes[:'provider_id']
|
76
|
+
else
|
77
|
+
self.provider_id = nil
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'created_at')
|
81
|
+
self.created_at = attributes[:'created_at']
|
82
|
+
else
|
83
|
+
self.created_at = nil
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.key?(:'last_login_at')
|
87
|
+
self.last_login_at = attributes[:'last_login_at']
|
88
|
+
else
|
89
|
+
self.last_login_at = nil
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'provider_identifier')
|
93
|
+
self.provider_identifier = attributes[:'provider_identifier']
|
94
|
+
else
|
95
|
+
self.provider_identifier = nil
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
100
|
+
# @return Array for valid properties with the reasons
|
101
|
+
def list_invalid_properties
|
102
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
103
|
+
invalid_properties = Array.new
|
104
|
+
if @provider_id.nil?
|
105
|
+
invalid_properties.push('invalid value for "provider_id", provider_id cannot be nil.')
|
106
|
+
end
|
107
|
+
|
108
|
+
if @created_at.nil?
|
109
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
110
|
+
end
|
111
|
+
|
112
|
+
if @last_login_at.nil?
|
113
|
+
invalid_properties.push('invalid value for "last_login_at", last_login_at cannot be nil.')
|
114
|
+
end
|
115
|
+
|
116
|
+
if @provider_identifier.nil?
|
117
|
+
invalid_properties.push('invalid value for "provider_identifier", provider_identifier cannot be nil.')
|
118
|
+
end
|
119
|
+
|
120
|
+
invalid_properties
|
121
|
+
end
|
122
|
+
|
123
|
+
# Check to see if the all the properties in the model are valid
|
124
|
+
# @return true if the model is valid
|
125
|
+
def valid?
|
126
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
127
|
+
return false if @provider_id.nil?
|
128
|
+
return false if @created_at.nil?
|
129
|
+
return false if @last_login_at.nil?
|
130
|
+
return false if @provider_identifier.nil?
|
131
|
+
true
|
132
|
+
end
|
133
|
+
|
134
|
+
# Checks equality by comparing each attribute.
|
135
|
+
# @param [Object] Object to be compared
|
136
|
+
def ==(o)
|
137
|
+
return true if self.equal?(o)
|
138
|
+
self.class == o.class &&
|
139
|
+
provider_id == o.provider_id &&
|
140
|
+
created_at == o.created_at &&
|
141
|
+
last_login_at == o.last_login_at &&
|
142
|
+
provider_identifier == o.provider_identifier
|
143
|
+
end
|
144
|
+
|
145
|
+
# @see the `==` method
|
146
|
+
# @param [Object] Object to be compared
|
147
|
+
def eql?(o)
|
148
|
+
self == o
|
149
|
+
end
|
150
|
+
|
151
|
+
# Calculates hash code according to all attributes.
|
152
|
+
# @return [Integer] Hash code
|
153
|
+
def hash
|
154
|
+
[provider_id, created_at, last_login_at, provider_identifier].hash
|
155
|
+
end
|
156
|
+
|
157
|
+
# Builds the object from hash
|
158
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
159
|
+
# @return [Object] Returns the model itself
|
160
|
+
def self.build_from_hash(attributes)
|
161
|
+
return nil unless attributes.is_a?(Hash)
|
162
|
+
attributes = attributes.transform_keys(&:to_sym)
|
163
|
+
transformed_hash = {}
|
164
|
+
openapi_types.each_pair do |key, type|
|
165
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
166
|
+
transformed_hash["#{key}"] = nil
|
167
|
+
elsif type =~ /\AArray<(.*)>/i
|
168
|
+
# check to ensure the input is an array given that the attribute
|
169
|
+
# is documented as an array but the input is not
|
170
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
171
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
172
|
+
end
|
173
|
+
elsif !attributes[attribute_map[key]].nil?
|
174
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
175
|
+
end
|
176
|
+
end
|
177
|
+
new(transformed_hash)
|
178
|
+
end
|
179
|
+
|
180
|
+
# Deserializes the data based on type
|
181
|
+
# @param string type Data type
|
182
|
+
# @param string value Value to be deserialized
|
183
|
+
# @return [Object] Deserialized data
|
184
|
+
def self._deserialize(type, value)
|
185
|
+
case type.to_sym
|
186
|
+
when :Time
|
187
|
+
Time.parse(value)
|
188
|
+
when :Date
|
189
|
+
Date.parse(value)
|
190
|
+
when :String
|
191
|
+
value.to_s
|
192
|
+
when :Integer
|
193
|
+
value.to_i
|
194
|
+
when :Float
|
195
|
+
value.to_f
|
196
|
+
when :Boolean
|
197
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
198
|
+
true
|
199
|
+
else
|
200
|
+
false
|
201
|
+
end
|
202
|
+
when :Object
|
203
|
+
# generic object (usually a Hash), return directly
|
204
|
+
value
|
205
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
206
|
+
inner_type = Regexp.last_match[:inner_type]
|
207
|
+
value.map { |v| _deserialize(inner_type, v) }
|
208
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
209
|
+
k_type = Regexp.last_match[:k_type]
|
210
|
+
v_type = Regexp.last_match[:v_type]
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each do |k, v|
|
213
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
214
|
+
end
|
215
|
+
end
|
216
|
+
else # model
|
217
|
+
# models (e.g. Pet) or oneOf
|
218
|
+
klass = OpenapiClient.const_get(type)
|
219
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
# Returns the string representation of the object
|
224
|
+
# @return [String] String presentation of the object
|
225
|
+
def to_s
|
226
|
+
to_hash.to_s
|
227
|
+
end
|
228
|
+
|
229
|
+
# to_body is an alias to to_hash (backward compatibility)
|
230
|
+
# @return [Hash] Returns the object in the form of hash
|
231
|
+
def to_body
|
232
|
+
to_hash
|
233
|
+
end
|
234
|
+
|
235
|
+
# Returns the object in the form of hash
|
236
|
+
# @return [Hash] Returns the object in the form of hash
|
237
|
+
def to_hash
|
238
|
+
hash = {}
|
239
|
+
self.class.attribute_map.each_pair do |attr, param|
|
240
|
+
value = self.send(attr)
|
241
|
+
if value.nil?
|
242
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
243
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
244
|
+
end
|
245
|
+
|
246
|
+
hash[param] = _to_hash(value)
|
247
|
+
end
|
248
|
+
hash
|
249
|
+
end
|
250
|
+
|
251
|
+
# Outputs non-array value in the form of hash
|
252
|
+
# For object, use to_hash. Otherwise, just return the value
|
253
|
+
# @param [Object] value Any valid value
|
254
|
+
# @return [Hash] Returns the value in the form of hash
|
255
|
+
def _to_hash(value)
|
256
|
+
if value.is_a?(Array)
|
257
|
+
value.compact.map { |v| _to_hash(v) }
|
258
|
+
elsif value.is_a?(Hash)
|
259
|
+
{}.tap do |hash|
|
260
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
261
|
+
end
|
262
|
+
elsif value.respond_to? :to_hash
|
263
|
+
value.to_hash
|
264
|
+
else
|
265
|
+
value
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
end
|
270
|
+
|
271
|
+
end
|
@@ -117,7 +117,7 @@ module OpenapiClient
|
|
117
117
|
def valid?
|
118
118
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
119
119
|
return false if @code.nil?
|
120
|
-
code_validator = EnumAttributeValidator.new('String', ["admin_not_found", "api_key_not_found", "app_not_found", "device_not_found", "domain_not_found", "email_provider_not_found", "email_template_not_found", "event_not_found", "function_not_found", "function_secret_key_not_found", "function_version_not_found", "metadata_field_not_found", "organization_member_not_found", "sms_provider_not_found", "sms_template_not_found", "
|
120
|
+
code_validator = EnumAttributeValidator.new('String', ["admin_not_found", "api_key_not_found", "app_not_found", "device_not_found", "domain_not_found", "email_provider_not_found", "email_template_not_found", "event_not_found", "function_not_found", "function_secret_key_not_found", "function_version_not_found", "metadata_field_not_found", "oauth2_app_not_found", "organization_member_not_found", "sms_provider_not_found", "sms_template_not_found", "social_connection_not_found", "user_not_found"])
|
121
121
|
return false unless code_validator.valid?(@code)
|
122
122
|
return false if @error.nil?
|
123
123
|
true
|
@@ -126,7 +126,7 @@ module OpenapiClient
|
|
126
126
|
# Custom attribute writer method checking allowed values (enum).
|
127
127
|
# @param [Object] code Object to be assigned
|
128
128
|
def code=(code)
|
129
|
-
validator = EnumAttributeValidator.new('String', ["admin_not_found", "api_key_not_found", "app_not_found", "device_not_found", "domain_not_found", "email_provider_not_found", "email_template_not_found", "event_not_found", "function_not_found", "function_secret_key_not_found", "function_version_not_found", "metadata_field_not_found", "organization_member_not_found", "sms_provider_not_found", "sms_template_not_found", "
|
129
|
+
validator = EnumAttributeValidator.new('String', ["admin_not_found", "api_key_not_found", "app_not_found", "device_not_found", "domain_not_found", "email_provider_not_found", "email_template_not_found", "event_not_found", "function_not_found", "function_secret_key_not_found", "function_version_not_found", "metadata_field_not_found", "oauth2_app_not_found", "organization_member_not_found", "sms_provider_not_found", "sms_template_not_found", "social_connection_not_found", "user_not_found"])
|
130
130
|
unless validator.valid?(code)
|
131
131
|
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
132
132
|
end
|
@@ -156,9 +156,9 @@ module OpenapiClient
|
|
156
156
|
fail ArgumentError, 'ttl cannot be nil'
|
157
157
|
end
|
158
158
|
|
159
|
-
|
160
|
-
|
161
|
-
|
159
|
+
if ttl < 60
|
160
|
+
fail ArgumentError, 'invalid value for "ttl", must be greater than or equal to 60.'
|
161
|
+
end
|
162
162
|
|
163
163
|
@ttl = ttl
|
164
164
|
end
|
@@ -35,7 +35,7 @@ module OpenapiClient
|
|
35
35
|
# @param [String] The enum value in the form of the string
|
36
36
|
# @return [String] The enum value
|
37
37
|
def build_from_hash(value)
|
38
|
-
return value if TtlDisplayUnit.all_vars.include?(value)
|
38
|
+
return value if TtlDisplayUnit.all_vars.include?(value)
|
39
39
|
raise "Invalid ENUM value #{value} for class #TtlDisplayUnit"
|
40
40
|
end
|
41
41
|
end
|
@@ -33,6 +33,8 @@ module OpenapiClient
|
|
33
33
|
|
34
34
|
attr_accessor :recent_events
|
35
35
|
|
36
|
+
attr_accessor :social_connections
|
37
|
+
|
36
38
|
attr_accessor :status
|
37
39
|
|
38
40
|
attr_accessor :updated_at
|
@@ -80,6 +82,7 @@ module OpenapiClient
|
|
80
82
|
:'phone' => :'phone',
|
81
83
|
:'phone_verified' => :'phone_verified',
|
82
84
|
:'recent_events' => :'recent_events',
|
85
|
+
:'social_connections' => :'social_connections',
|
83
86
|
:'status' => :'status',
|
84
87
|
:'updated_at' => :'updated_at',
|
85
88
|
:'user_metadata' => :'user_metadata',
|
@@ -105,7 +108,8 @@ module OpenapiClient
|
|
105
108
|
:'login_count' => :'Integer',
|
106
109
|
:'phone' => :'String',
|
107
110
|
:'phone_verified' => :'Boolean',
|
108
|
-
:'recent_events' => :'Array<
|
111
|
+
:'recent_events' => :'Array<UserRecentEvent>',
|
112
|
+
:'social_connections' => :'UserSocialConnections',
|
109
113
|
:'status' => :'UserStatus',
|
110
114
|
:'updated_at' => :'Time',
|
111
115
|
:'user_metadata' => :'Object',
|
@@ -193,6 +197,12 @@ module OpenapiClient
|
|
193
197
|
self.recent_events = nil
|
194
198
|
end
|
195
199
|
|
200
|
+
if attributes.key?(:'social_connections')
|
201
|
+
self.social_connections = attributes[:'social_connections']
|
202
|
+
else
|
203
|
+
self.social_connections = nil
|
204
|
+
end
|
205
|
+
|
196
206
|
if attributes.key?(:'status')
|
197
207
|
self.status = attributes[:'status']
|
198
208
|
else
|
@@ -275,6 +285,10 @@ module OpenapiClient
|
|
275
285
|
invalid_properties.push('invalid value for "recent_events", recent_events cannot be nil.')
|
276
286
|
end
|
277
287
|
|
288
|
+
if @social_connections.nil?
|
289
|
+
invalid_properties.push('invalid value for "social_connections", social_connections cannot be nil.')
|
290
|
+
end
|
291
|
+
|
278
292
|
if @status.nil?
|
279
293
|
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
280
294
|
end
|
@@ -311,6 +325,7 @@ module OpenapiClient
|
|
311
325
|
return false if @phone.nil?
|
312
326
|
return false if @phone_verified.nil?
|
313
327
|
return false if @recent_events.nil?
|
328
|
+
return false if @social_connections.nil?
|
314
329
|
return false if @status.nil?
|
315
330
|
return false if @updated_at.nil?
|
316
331
|
return false if @webauthn.nil?
|
@@ -333,6 +348,7 @@ module OpenapiClient
|
|
333
348
|
phone == o.phone &&
|
334
349
|
phone_verified == o.phone_verified &&
|
335
350
|
recent_events == o.recent_events &&
|
351
|
+
social_connections == o.social_connections &&
|
336
352
|
status == o.status &&
|
337
353
|
updated_at == o.updated_at &&
|
338
354
|
user_metadata == o.user_metadata &&
|
@@ -350,7 +366,7 @@ module OpenapiClient
|
|
350
366
|
# Calculates hash code according to all attributes.
|
351
367
|
# @return [Integer] Hash code
|
352
368
|
def hash
|
353
|
-
[created_at, email, email_verified, id, last_login_at, login_count, phone, phone_verified, recent_events, status, updated_at, user_metadata, webauthn, webauthn_devices, webauthn_types].hash
|
369
|
+
[created_at, email, email_verified, id, last_login_at, login_count, phone, phone_verified, recent_events, social_connections, status, updated_at, user_metadata, webauthn, webauthn_devices, webauthn_types].hash
|
354
370
|
end
|
355
371
|
|
356
372
|
# Builds the object from hash
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module OpenapiClient
|
17
|
-
class
|
17
|
+
class UserRecentEvent
|
18
18
|
attr_accessor :created_at
|
19
19
|
|
20
20
|
attr_accessor :id
|
@@ -62,13 +62,13 @@ module OpenapiClient
|
|
62
62
|
# @param [Hash] attributes Model attributes in the form of hash
|
63
63
|
def initialize(attributes = {})
|
64
64
|
if (!attributes.is_a?(Hash))
|
65
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::UserRecentEvent` initialize method"
|
66
66
|
end
|
67
67
|
|
68
68
|
# check to see if the attribute exists and convert string to symbol for hash key
|
69
69
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
70
70
|
if (!self.class.attribute_map.key?(k.to_sym))
|
71
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::UserRecentEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
72
72
|
end
|
73
73
|
h[k.to_sym] = v
|
74
74
|
}
|