authress-sdk 2.0.36.0 → 2.0.39.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/authress-sdk/api/access_records_api.rb +6 -6
- data/lib/authress-sdk/api/accounts_api.rb +9 -9
- data/lib/authress-sdk/api/metadata_api.rb +6 -6
- data/lib/authress-sdk/api/resource_permissions_api.rb +9 -9
- data/lib/authress-sdk/api/roles_api.rb +9 -9
- data/lib/authress-sdk/api/service_clients_api.rb +15 -15
- data/lib/authress-sdk/api/user_permissions_api.rb +9 -9
- data/lib/authress-sdk/api/users_api.rb +134 -0
- data/lib/authress-sdk/models/{permission_response.rb → permission_collection.rb} +3 -3
- data/lib/authress-sdk/models/{v1resourcesresource_uri_permissions.rb → user_identity.rb} +40 -38
- data/lib/authress-sdk/models/{inline_response_200_6.rb → user_identity_collection.rb} +5 -5
- metadata +6 -28
- data/lib/authress-sdk/models/inline_response_200.rb +0 -240
- data/lib/authress-sdk/models/inline_response_200_1.rb +0 -229
- data/lib/authress-sdk/models/inline_response_200_10.rb +0 -248
- data/lib/authress-sdk/models/inline_response_200_11.rb +0 -204
- data/lib/authress-sdk/models/inline_response_200_12.rb +0 -206
- data/lib/authress-sdk/models/inline_response_200_13.rb +0 -222
- data/lib/authress-sdk/models/inline_response_200_14.rb +0 -239
- data/lib/authress-sdk/models/inline_response_200_15.rb +0 -235
- data/lib/authress-sdk/models/inline_response_200_2.rb +0 -231
- data/lib/authress-sdk/models/inline_response_200_3.rb +0 -253
- data/lib/authress-sdk/models/inline_response_200_4.rb +0 -221
- data/lib/authress-sdk/models/inline_response_200_5.rb +0 -206
- data/lib/authress-sdk/models/inline_response_200_7.rb +0 -222
- data/lib/authress-sdk/models/inline_response_200_9.rb +0 -261
- data/lib/authress-sdk/models/v1clients_options.rb +0 -211
- data/lib/authress-sdk/models/v1records_account.rb +0 -204
- data/lib/authress-sdk/models/v1records_links.rb +0 -204
- data/lib/authress-sdk/models/v1records_links_self.rb +0 -216
- data/lib/authress-sdk/models/v1records_users.rb +0 -205
- data/lib/authress-sdk/models/v1roles_permissions.rb +0 -251
- data/lib/authress-sdk/models/v1usersuser_idresourcesresource_urimetadata_account.rb +0 -199
- data/lib/authress-sdk/models/v1usersuser_idtokens_resources.rb +0 -205
- data/lib/authress-sdk/models/v1usersuser_idtokens_statements.rb +0 -222
@@ -1,235 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
|
3
|
-
=end
|
4
|
-
|
5
|
-
require 'date'
|
6
|
-
|
7
|
-
module AuthressSdk
|
8
|
-
# A client configuration.
|
9
|
-
class InlineResponse20015
|
10
|
-
# The unique id of the client.
|
11
|
-
attr_accessor :key_id
|
12
|
-
|
13
|
-
# The unique id of the client.
|
14
|
-
attr_accessor :client_id
|
15
|
-
|
16
|
-
attr_accessor :generation_date
|
17
|
-
|
18
|
-
# An encoded access key which contains identifying information for client access token creation. For direct use with the Authress SDKs, not meant to be decoded. Must be saved on created, as it will never be returned from the API ever again. Authress only saved the corresponding public key to verify private access keys.
|
19
|
-
attr_accessor :access_key
|
20
|
-
|
21
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
-
def self.attribute_map
|
23
|
-
{
|
24
|
-
:'key_id' => :'keyId',
|
25
|
-
:'client_id' => :'clientId',
|
26
|
-
:'generation_date' => :'generationDate',
|
27
|
-
:'access_key' => :'accessKey'
|
28
|
-
}
|
29
|
-
end
|
30
|
-
|
31
|
-
# Attribute type mapping.
|
32
|
-
def self.openapi_types
|
33
|
-
{
|
34
|
-
:'key_id' => :'Object',
|
35
|
-
:'client_id' => :'Object',
|
36
|
-
:'generation_date' => :'Object',
|
37
|
-
:'access_key' => :'Object'
|
38
|
-
}
|
39
|
-
end
|
40
|
-
|
41
|
-
# List of attributes with nullable: true
|
42
|
-
def self.openapi_nullable
|
43
|
-
Set.new([
|
44
|
-
])
|
45
|
-
end
|
46
|
-
|
47
|
-
# Initializes the object
|
48
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
49
|
-
def initialize(attributes = {})
|
50
|
-
if (!attributes.is_a?(Hash))
|
51
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `AuthressSdk::InlineResponse20015` initialize method"
|
52
|
-
end
|
53
|
-
|
54
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
55
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
56
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
57
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `AuthressSdk::InlineResponse20015`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
58
|
-
end
|
59
|
-
h[k.to_sym] = v
|
60
|
-
}
|
61
|
-
|
62
|
-
if attributes.key?(:'key_id')
|
63
|
-
self.key_id = attributes[:'key_id']
|
64
|
-
end
|
65
|
-
|
66
|
-
if attributes.key?(:'client_id')
|
67
|
-
self.client_id = attributes[:'client_id']
|
68
|
-
end
|
69
|
-
|
70
|
-
if attributes.key?(:'generation_date')
|
71
|
-
self.generation_date = attributes[:'generation_date']
|
72
|
-
end
|
73
|
-
|
74
|
-
if attributes.key?(:'access_key')
|
75
|
-
self.access_key = attributes[:'access_key']
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
80
|
-
# @return Array for valid properties with the reasons
|
81
|
-
def list_invalid_properties
|
82
|
-
invalid_properties = Array.new
|
83
|
-
if @client_id.nil?
|
84
|
-
invalid_properties.push('invalid value for "client_id", client_id cannot be nil.')
|
85
|
-
end
|
86
|
-
|
87
|
-
invalid_properties
|
88
|
-
end
|
89
|
-
|
90
|
-
# Check to see if the all the properties in the model are valid
|
91
|
-
# @return true if the model is valid
|
92
|
-
def valid?
|
93
|
-
return false if @client_id.nil?
|
94
|
-
true
|
95
|
-
end
|
96
|
-
|
97
|
-
# Checks equality by comparing each attribute.
|
98
|
-
# @param [Object] Object to be compared
|
99
|
-
def ==(o)
|
100
|
-
return true if self.equal?(o)
|
101
|
-
self.class == o.class &&
|
102
|
-
key_id == o.key_id &&
|
103
|
-
client_id == o.client_id &&
|
104
|
-
generation_date == o.generation_date &&
|
105
|
-
access_key == o.access_key
|
106
|
-
end
|
107
|
-
|
108
|
-
# @see the `==` method
|
109
|
-
# @param [Object] Object to be compared
|
110
|
-
def eql?(o)
|
111
|
-
self == o
|
112
|
-
end
|
113
|
-
|
114
|
-
# Calculates hash code according to all attributes.
|
115
|
-
# @return [Integer] Hash code
|
116
|
-
def hash
|
117
|
-
[key_id, client_id, generation_date, access_key].hash
|
118
|
-
end
|
119
|
-
|
120
|
-
# Builds the object from hash
|
121
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
122
|
-
# @return [Object] Returns the model itself
|
123
|
-
def self.build_from_hash(attributes)
|
124
|
-
new.build_from_hash(attributes)
|
125
|
-
end
|
126
|
-
|
127
|
-
# Builds the object from hash
|
128
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
-
# @return [Object] Returns the model itself
|
130
|
-
def build_from_hash(attributes)
|
131
|
-
return nil unless attributes.is_a?(Hash)
|
132
|
-
self.class.openapi_types.each_pair do |key, type|
|
133
|
-
if type =~ /\AArray<(.*)>/i
|
134
|
-
# check to ensure the input is an array given that the attribute
|
135
|
-
# is documented as an array but the input is not
|
136
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
137
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
138
|
-
end
|
139
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
140
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
141
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
142
|
-
self.send("#{key}=", nil)
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
self
|
147
|
-
end
|
148
|
-
|
149
|
-
# Deserializes the data based on type
|
150
|
-
# @param string type Data type
|
151
|
-
# @param string value Value to be deserialized
|
152
|
-
# @return [Object] Deserialized data
|
153
|
-
def _deserialize(type, value)
|
154
|
-
case type.to_sym
|
155
|
-
when :DateTime
|
156
|
-
DateTime.parse(value)
|
157
|
-
when :Date
|
158
|
-
Date.parse(value)
|
159
|
-
when :String
|
160
|
-
value.to_s
|
161
|
-
when :Integer
|
162
|
-
value.to_i
|
163
|
-
when :Float
|
164
|
-
value.to_f
|
165
|
-
when :Boolean
|
166
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
167
|
-
true
|
168
|
-
else
|
169
|
-
false
|
170
|
-
end
|
171
|
-
when :Object
|
172
|
-
# generic object (usually a Hash), return directly
|
173
|
-
value
|
174
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
175
|
-
inner_type = Regexp.last_match[:inner_type]
|
176
|
-
value.map { |v| _deserialize(inner_type, v) }
|
177
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
178
|
-
k_type = Regexp.last_match[:k_type]
|
179
|
-
v_type = Regexp.last_match[:v_type]
|
180
|
-
{}.tap do |hash|
|
181
|
-
value.each do |k, v|
|
182
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
183
|
-
end
|
184
|
-
end
|
185
|
-
else # model
|
186
|
-
AuthressSdk.const_get(type).build_from_hash(value)
|
187
|
-
end
|
188
|
-
end
|
189
|
-
|
190
|
-
# Returns the string representation of the object
|
191
|
-
# @return [String] String presentation of the object
|
192
|
-
def to_s
|
193
|
-
to_hash.to_s
|
194
|
-
end
|
195
|
-
|
196
|
-
# to_body is an alias to to_hash (backward compatibility)
|
197
|
-
# @return [Hash] Returns the object in the form of hash
|
198
|
-
def to_body
|
199
|
-
to_hash
|
200
|
-
end
|
201
|
-
|
202
|
-
# Returns the object in the form of hash
|
203
|
-
# @return [Hash] Returns the object in the form of hash
|
204
|
-
def to_hash
|
205
|
-
hash = {}
|
206
|
-
self.class.attribute_map.each_pair do |attr, param|
|
207
|
-
value = self.send(attr)
|
208
|
-
if value.nil?
|
209
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
210
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
211
|
-
end
|
212
|
-
|
213
|
-
hash[param] = _to_hash(value)
|
214
|
-
end
|
215
|
-
hash
|
216
|
-
end
|
217
|
-
|
218
|
-
# Outputs non-array value in the form of hash
|
219
|
-
# For object, use to_hash. Otherwise, just return the value
|
220
|
-
# @param [Object] value Any valid value
|
221
|
-
# @return [Hash] Returns the value in the form of hash
|
222
|
-
def _to_hash(value)
|
223
|
-
if value.is_a?(Array)
|
224
|
-
value.compact.map { |v| _to_hash(v) }
|
225
|
-
elsif value.is_a?(Hash)
|
226
|
-
{}.tap do |hash|
|
227
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
228
|
-
end
|
229
|
-
elsif value.respond_to? :to_hash
|
230
|
-
value.to_hash
|
231
|
-
else
|
232
|
-
value
|
233
|
-
end
|
234
|
-
end end
|
235
|
-
end
|
@@ -1,231 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
|
3
|
-
=end
|
4
|
-
|
5
|
-
require 'date'
|
6
|
-
|
7
|
-
module AuthressSdk
|
8
|
-
# A collect of permissions that the user has to a resource.
|
9
|
-
class InlineResponse2002
|
10
|
-
attr_accessor :account
|
11
|
-
|
12
|
-
attr_accessor :user_id
|
13
|
-
|
14
|
-
# A list of the permissions
|
15
|
-
attr_accessor :permissions
|
16
|
-
|
17
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
18
|
-
def self.attribute_map
|
19
|
-
{
|
20
|
-
:'account' => :'account',
|
21
|
-
:'user_id' => :'userId',
|
22
|
-
:'permissions' => :'permissions'
|
23
|
-
}
|
24
|
-
end
|
25
|
-
|
26
|
-
# Attribute type mapping.
|
27
|
-
def self.openapi_types
|
28
|
-
{
|
29
|
-
:'account' => :'Object',
|
30
|
-
:'user_id' => :'Object',
|
31
|
-
:'permissions' => :'Object'
|
32
|
-
}
|
33
|
-
end
|
34
|
-
|
35
|
-
# List of attributes with nullable: true
|
36
|
-
def self.openapi_nullable
|
37
|
-
Set.new([
|
38
|
-
])
|
39
|
-
end
|
40
|
-
|
41
|
-
# Initializes the object
|
42
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
43
|
-
def initialize(attributes = {})
|
44
|
-
if (!attributes.is_a?(Hash))
|
45
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `AuthressSdk::InlineResponse2002` initialize method"
|
46
|
-
end
|
47
|
-
|
48
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
49
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
50
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
51
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `AuthressSdk::InlineResponse2002`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
52
|
-
end
|
53
|
-
h[k.to_sym] = v
|
54
|
-
}
|
55
|
-
|
56
|
-
if attributes.key?(:'account')
|
57
|
-
self.account = attributes[:'account']
|
58
|
-
end
|
59
|
-
|
60
|
-
if attributes.key?(:'user_id')
|
61
|
-
self.user_id = attributes[:'user_id']
|
62
|
-
end
|
63
|
-
|
64
|
-
if attributes.key?(:'permissions')
|
65
|
-
if (value = attributes[:'permissions']).is_a?(Array)
|
66
|
-
self.permissions = value
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
72
|
-
# @return Array for valid properties with the reasons
|
73
|
-
def list_invalid_properties
|
74
|
-
invalid_properties = Array.new
|
75
|
-
if @user_id.nil?
|
76
|
-
invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
|
77
|
-
end
|
78
|
-
|
79
|
-
if @permissions.nil?
|
80
|
-
invalid_properties.push('invalid value for "permissions", permissions cannot be nil.')
|
81
|
-
end
|
82
|
-
|
83
|
-
invalid_properties
|
84
|
-
end
|
85
|
-
|
86
|
-
# Check to see if the all the properties in the model are valid
|
87
|
-
# @return true if the model is valid
|
88
|
-
def valid?
|
89
|
-
return false if @user_id.nil?
|
90
|
-
return false if @permissions.nil?
|
91
|
-
true
|
92
|
-
end
|
93
|
-
|
94
|
-
# Checks equality by comparing each attribute.
|
95
|
-
# @param [Object] Object to be compared
|
96
|
-
def ==(o)
|
97
|
-
return true if self.equal?(o)
|
98
|
-
self.class == o.class &&
|
99
|
-
account == o.account &&
|
100
|
-
user_id == o.user_id &&
|
101
|
-
permissions == o.permissions
|
102
|
-
end
|
103
|
-
|
104
|
-
# @see the `==` method
|
105
|
-
# @param [Object] Object to be compared
|
106
|
-
def eql?(o)
|
107
|
-
self == o
|
108
|
-
end
|
109
|
-
|
110
|
-
# Calculates hash code according to all attributes.
|
111
|
-
# @return [Integer] Hash code
|
112
|
-
def hash
|
113
|
-
[account, user_id, permissions].hash
|
114
|
-
end
|
115
|
-
|
116
|
-
# Builds the object from hash
|
117
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
118
|
-
# @return [Object] Returns the model itself
|
119
|
-
def self.build_from_hash(attributes)
|
120
|
-
new.build_from_hash(attributes)
|
121
|
-
end
|
122
|
-
|
123
|
-
# Builds the object from hash
|
124
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
125
|
-
# @return [Object] Returns the model itself
|
126
|
-
def build_from_hash(attributes)
|
127
|
-
return nil unless attributes.is_a?(Hash)
|
128
|
-
self.class.openapi_types.each_pair do |key, type|
|
129
|
-
if type =~ /\AArray<(.*)>/i
|
130
|
-
# check to ensure the input is an array given that the attribute
|
131
|
-
# is documented as an array but the input is not
|
132
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
133
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
134
|
-
end
|
135
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
136
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
137
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
138
|
-
self.send("#{key}=", nil)
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
self
|
143
|
-
end
|
144
|
-
|
145
|
-
# Deserializes the data based on type
|
146
|
-
# @param string type Data type
|
147
|
-
# @param string value Value to be deserialized
|
148
|
-
# @return [Object] Deserialized data
|
149
|
-
def _deserialize(type, value)
|
150
|
-
case type.to_sym
|
151
|
-
when :DateTime
|
152
|
-
DateTime.parse(value)
|
153
|
-
when :Date
|
154
|
-
Date.parse(value)
|
155
|
-
when :String
|
156
|
-
value.to_s
|
157
|
-
when :Integer
|
158
|
-
value.to_i
|
159
|
-
when :Float
|
160
|
-
value.to_f
|
161
|
-
when :Boolean
|
162
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
163
|
-
true
|
164
|
-
else
|
165
|
-
false
|
166
|
-
end
|
167
|
-
when :Object
|
168
|
-
# generic object (usually a Hash), return directly
|
169
|
-
value
|
170
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
171
|
-
inner_type = Regexp.last_match[:inner_type]
|
172
|
-
value.map { |v| _deserialize(inner_type, v) }
|
173
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
174
|
-
k_type = Regexp.last_match[:k_type]
|
175
|
-
v_type = Regexp.last_match[:v_type]
|
176
|
-
{}.tap do |hash|
|
177
|
-
value.each do |k, v|
|
178
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
179
|
-
end
|
180
|
-
end
|
181
|
-
else # model
|
182
|
-
AuthressSdk.const_get(type).build_from_hash(value)
|
183
|
-
end
|
184
|
-
end
|
185
|
-
|
186
|
-
# Returns the string representation of the object
|
187
|
-
# @return [String] String presentation of the object
|
188
|
-
def to_s
|
189
|
-
to_hash.to_s
|
190
|
-
end
|
191
|
-
|
192
|
-
# to_body is an alias to to_hash (backward compatibility)
|
193
|
-
# @return [Hash] Returns the object in the form of hash
|
194
|
-
def to_body
|
195
|
-
to_hash
|
196
|
-
end
|
197
|
-
|
198
|
-
# Returns the object in the form of hash
|
199
|
-
# @return [Hash] Returns the object in the form of hash
|
200
|
-
def to_hash
|
201
|
-
hash = {}
|
202
|
-
self.class.attribute_map.each_pair do |attr, param|
|
203
|
-
value = self.send(attr)
|
204
|
-
if value.nil?
|
205
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
206
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
207
|
-
end
|
208
|
-
|
209
|
-
hash[param] = _to_hash(value)
|
210
|
-
end
|
211
|
-
hash
|
212
|
-
end
|
213
|
-
|
214
|
-
# Outputs non-array value in the form of hash
|
215
|
-
# For object, use to_hash. Otherwise, just return the value
|
216
|
-
# @param [Object] value Any valid value
|
217
|
-
# @return [Hash] Returns the value in the form of hash
|
218
|
-
def _to_hash(value)
|
219
|
-
if value.is_a?(Array)
|
220
|
-
value.compact.map { |v| _to_hash(v) }
|
221
|
-
elsif value.is_a?(Hash)
|
222
|
-
{}.tap do |hash|
|
223
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
224
|
-
end
|
225
|
-
elsif value.respond_to? :to_hash
|
226
|
-
value.to_hash
|
227
|
-
else
|
228
|
-
value
|
229
|
-
end
|
230
|
-
end end
|
231
|
-
end
|
@@ -1,253 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
|
3
|
-
=end
|
4
|
-
|
5
|
-
require 'date'
|
6
|
-
|
7
|
-
module AuthressSdk
|
8
|
-
# A JWT token with represents the user.
|
9
|
-
class InlineResponse2003
|
10
|
-
attr_accessor :account
|
11
|
-
|
12
|
-
attr_accessor :user_id
|
13
|
-
|
14
|
-
# The unique identifier for the token
|
15
|
-
attr_accessor :token_id
|
16
|
-
|
17
|
-
# The access token
|
18
|
-
attr_accessor :token
|
19
|
-
|
20
|
-
attr_accessor :links
|
21
|
-
|
22
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
-
def self.attribute_map
|
24
|
-
{
|
25
|
-
:'account' => :'account',
|
26
|
-
:'user_id' => :'userId',
|
27
|
-
:'token_id' => :'tokenId',
|
28
|
-
:'token' => :'token',
|
29
|
-
:'links' => :'links'
|
30
|
-
}
|
31
|
-
end
|
32
|
-
|
33
|
-
# Attribute type mapping.
|
34
|
-
def self.openapi_types
|
35
|
-
{
|
36
|
-
:'account' => :'Object',
|
37
|
-
:'user_id' => :'Object',
|
38
|
-
:'token_id' => :'Object',
|
39
|
-
:'token' => :'Object',
|
40
|
-
:'links' => :'Object'
|
41
|
-
}
|
42
|
-
end
|
43
|
-
|
44
|
-
# List of attributes with nullable: true
|
45
|
-
def self.openapi_nullable
|
46
|
-
Set.new([
|
47
|
-
])
|
48
|
-
end
|
49
|
-
|
50
|
-
# Initializes the object
|
51
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
-
def initialize(attributes = {})
|
53
|
-
if (!attributes.is_a?(Hash))
|
54
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `AuthressSdk::InlineResponse2003` initialize method"
|
55
|
-
end
|
56
|
-
|
57
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
58
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
59
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
60
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `AuthressSdk::InlineResponse2003`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
|
-
end
|
62
|
-
h[k.to_sym] = v
|
63
|
-
}
|
64
|
-
|
65
|
-
if attributes.key?(:'account')
|
66
|
-
self.account = attributes[:'account']
|
67
|
-
end
|
68
|
-
|
69
|
-
if attributes.key?(:'user_id')
|
70
|
-
self.user_id = attributes[:'user_id']
|
71
|
-
end
|
72
|
-
|
73
|
-
if attributes.key?(:'token_id')
|
74
|
-
self.token_id = attributes[:'token_id']
|
75
|
-
end
|
76
|
-
|
77
|
-
if attributes.key?(:'token')
|
78
|
-
self.token = attributes[:'token']
|
79
|
-
end
|
80
|
-
|
81
|
-
if attributes.key?(:'links')
|
82
|
-
self.links = attributes[:'links']
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
87
|
-
# @return Array for valid properties with the reasons
|
88
|
-
def list_invalid_properties
|
89
|
-
invalid_properties = Array.new
|
90
|
-
if @user_id.nil?
|
91
|
-
invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
|
92
|
-
end
|
93
|
-
|
94
|
-
if @token_id.nil?
|
95
|
-
invalid_properties.push('invalid value for "token_id", token_id cannot be nil.')
|
96
|
-
end
|
97
|
-
|
98
|
-
if @token.nil?
|
99
|
-
invalid_properties.push('invalid value for "token", token cannot be nil.')
|
100
|
-
end
|
101
|
-
|
102
|
-
invalid_properties
|
103
|
-
end
|
104
|
-
|
105
|
-
# Check to see if the all the properties in the model are valid
|
106
|
-
# @return true if the model is valid
|
107
|
-
def valid?
|
108
|
-
return false if @user_id.nil?
|
109
|
-
return false if @token_id.nil?
|
110
|
-
return false if @token.nil?
|
111
|
-
true
|
112
|
-
end
|
113
|
-
|
114
|
-
# Checks equality by comparing each attribute.
|
115
|
-
# @param [Object] Object to be compared
|
116
|
-
def ==(o)
|
117
|
-
return true if self.equal?(o)
|
118
|
-
self.class == o.class &&
|
119
|
-
account == o.account &&
|
120
|
-
user_id == o.user_id &&
|
121
|
-
token_id == o.token_id &&
|
122
|
-
token == o.token &&
|
123
|
-
links == o.links
|
124
|
-
end
|
125
|
-
|
126
|
-
# @see the `==` method
|
127
|
-
# @param [Object] Object to be compared
|
128
|
-
def eql?(o)
|
129
|
-
self == o
|
130
|
-
end
|
131
|
-
|
132
|
-
# Calculates hash code according to all attributes.
|
133
|
-
# @return [Integer] Hash code
|
134
|
-
def hash
|
135
|
-
[account, user_id, token_id, token, links].hash
|
136
|
-
end
|
137
|
-
|
138
|
-
# Builds the object from hash
|
139
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
140
|
-
# @return [Object] Returns the model itself
|
141
|
-
def self.build_from_hash(attributes)
|
142
|
-
new.build_from_hash(attributes)
|
143
|
-
end
|
144
|
-
|
145
|
-
# Builds the object from hash
|
146
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
147
|
-
# @return [Object] Returns the model itself
|
148
|
-
def build_from_hash(attributes)
|
149
|
-
return nil unless attributes.is_a?(Hash)
|
150
|
-
self.class.openapi_types.each_pair do |key, type|
|
151
|
-
if type =~ /\AArray<(.*)>/i
|
152
|
-
# check to ensure the input is an array given that the attribute
|
153
|
-
# is documented as an array but the input is not
|
154
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
155
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
156
|
-
end
|
157
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
158
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
159
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
160
|
-
self.send("#{key}=", nil)
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
self
|
165
|
-
end
|
166
|
-
|
167
|
-
# Deserializes the data based on type
|
168
|
-
# @param string type Data type
|
169
|
-
# @param string value Value to be deserialized
|
170
|
-
# @return [Object] Deserialized data
|
171
|
-
def _deserialize(type, value)
|
172
|
-
case type.to_sym
|
173
|
-
when :DateTime
|
174
|
-
DateTime.parse(value)
|
175
|
-
when :Date
|
176
|
-
Date.parse(value)
|
177
|
-
when :String
|
178
|
-
value.to_s
|
179
|
-
when :Integer
|
180
|
-
value.to_i
|
181
|
-
when :Float
|
182
|
-
value.to_f
|
183
|
-
when :Boolean
|
184
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
185
|
-
true
|
186
|
-
else
|
187
|
-
false
|
188
|
-
end
|
189
|
-
when :Object
|
190
|
-
# generic object (usually a Hash), return directly
|
191
|
-
value
|
192
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
193
|
-
inner_type = Regexp.last_match[:inner_type]
|
194
|
-
value.map { |v| _deserialize(inner_type, v) }
|
195
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
196
|
-
k_type = Regexp.last_match[:k_type]
|
197
|
-
v_type = Regexp.last_match[:v_type]
|
198
|
-
{}.tap do |hash|
|
199
|
-
value.each do |k, v|
|
200
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
201
|
-
end
|
202
|
-
end
|
203
|
-
else # model
|
204
|
-
AuthressSdk.const_get(type).build_from_hash(value)
|
205
|
-
end
|
206
|
-
end
|
207
|
-
|
208
|
-
# Returns the string representation of the object
|
209
|
-
# @return [String] String presentation of the object
|
210
|
-
def to_s
|
211
|
-
to_hash.to_s
|
212
|
-
end
|
213
|
-
|
214
|
-
# to_body is an alias to to_hash (backward compatibility)
|
215
|
-
# @return [Hash] Returns the object in the form of hash
|
216
|
-
def to_body
|
217
|
-
to_hash
|
218
|
-
end
|
219
|
-
|
220
|
-
# Returns the object in the form of hash
|
221
|
-
# @return [Hash] Returns the object in the form of hash
|
222
|
-
def to_hash
|
223
|
-
hash = {}
|
224
|
-
self.class.attribute_map.each_pair do |attr, param|
|
225
|
-
value = self.send(attr)
|
226
|
-
if value.nil?
|
227
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
228
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
229
|
-
end
|
230
|
-
|
231
|
-
hash[param] = _to_hash(value)
|
232
|
-
end
|
233
|
-
hash
|
234
|
-
end
|
235
|
-
|
236
|
-
# Outputs non-array value in the form of hash
|
237
|
-
# For object, use to_hash. Otherwise, just return the value
|
238
|
-
# @param [Object] value Any valid value
|
239
|
-
# @return [Hash] Returns the value in the form of hash
|
240
|
-
def _to_hash(value)
|
241
|
-
if value.is_a?(Array)
|
242
|
-
value.compact.map { |v| _to_hash(v) }
|
243
|
-
elsif value.is_a?(Hash)
|
244
|
-
{}.tap do |hash|
|
245
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
246
|
-
end
|
247
|
-
elsif value.respond_to? :to_hash
|
248
|
-
value.to_hash
|
249
|
-
else
|
250
|
-
value
|
251
|
-
end
|
252
|
-
end end
|
253
|
-
end
|