eilam_test 1.1.10 → 1.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -15
- data/docs/SystemType.md +1 -1
- data/docs/SystemTypeCreate.md +1 -1
- data/lib/eilam_test/models/system_type.rb +3 -3
- data/lib/eilam_test/models/system_type_create.rb +3 -3
- data/lib/eilam_test/version.rb +2 -2
- data/lib/eilam_test.rb +0 -8
- data/spec/models/system_type_create_spec.rb +1 -1
- data/spec/models/system_type_spec.rb +1 -1
- metadata +62 -94
- data/docs/Event.md +0 -32
- data/docs/EventApi.md +0 -276
- data/docs/User.md +0 -38
- data/docs/UserApi.md +0 -346
- data/docs/UserCreate.md +0 -38
- data/docs/UserUpdate.md +0 -30
- data/docs/ValidateSystem.md +0 -26
- data/docs/ValidateSystemApi.md +0 -75
- data/lib/eilam_test/api/event_api.rb +0 -254
- data/lib/eilam_test/api/user_api.rb +0 -321
- data/lib/eilam_test/api/validate_system_api.rb +0 -83
- data/lib/eilam_test/models/event.rb +0 -289
- data/lib/eilam_test/models/user.rb +0 -395
- data/lib/eilam_test/models/user_create.rb +0 -395
- data/lib/eilam_test/models/user_update.rb +0 -280
- data/lib/eilam_test/models/validate_system.rb +0 -260
- data/spec/api/event_api_spec.rb +0 -74
- data/spec/api/user_api_spec.rb +0 -85
- data/spec/api/validate_system_api_spec.rb +0 -45
- data/spec/models/event_spec.rb +0 -76
- data/spec/models/user_create_spec.rb +0 -94
- data/spec/models/user_spec.rb +0 -94
- data/spec/models/user_update_spec.rb +0 -70
- data/spec/models/validate_system_spec.rb +0 -58
@@ -1,395 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Site Manager API
|
3
|
-
|
4
|
-
#Site Manager API
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.0.0
|
7
|
-
Contact: autosde@il.ibm.com
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.0.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
require 'time'
|
15
|
-
|
16
|
-
module EilamTest
|
17
|
-
# TODO add description
|
18
|
-
class UserCreate
|
19
|
-
# date_joined
|
20
|
-
attr_accessor :date_joined
|
21
|
-
|
22
|
-
# email
|
23
|
-
attr_accessor :email
|
24
|
-
|
25
|
-
# first_name
|
26
|
-
attr_accessor :first_name
|
27
|
-
|
28
|
-
# is_active
|
29
|
-
attr_accessor :is_active
|
30
|
-
|
31
|
-
# is_staff
|
32
|
-
attr_accessor :is_staff
|
33
|
-
|
34
|
-
# is_superuser
|
35
|
-
attr_accessor :is_superuser
|
36
|
-
|
37
|
-
# last_login
|
38
|
-
attr_accessor :last_login
|
39
|
-
|
40
|
-
# last_name
|
41
|
-
attr_accessor :last_name
|
42
|
-
|
43
|
-
# password
|
44
|
-
attr_accessor :password
|
45
|
-
|
46
|
-
# username
|
47
|
-
attr_accessor :username
|
48
|
-
|
49
|
-
# uuid
|
50
|
-
attr_accessor :uuid
|
51
|
-
|
52
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
53
|
-
def self.attribute_map
|
54
|
-
{
|
55
|
-
:'date_joined' => :'date_joined',
|
56
|
-
:'email' => :'email',
|
57
|
-
:'first_name' => :'first_name',
|
58
|
-
:'is_active' => :'is_active',
|
59
|
-
:'is_staff' => :'is_staff',
|
60
|
-
:'is_superuser' => :'is_superuser',
|
61
|
-
:'last_login' => :'last_login',
|
62
|
-
:'last_name' => :'last_name',
|
63
|
-
:'password' => :'password',
|
64
|
-
:'username' => :'username',
|
65
|
-
:'uuid' => :'uuid'
|
66
|
-
}
|
67
|
-
end
|
68
|
-
|
69
|
-
# Returns all the JSON keys this model knows about
|
70
|
-
def self.acceptable_attributes
|
71
|
-
attribute_map.values
|
72
|
-
end
|
73
|
-
|
74
|
-
# Attribute type mapping.
|
75
|
-
def self.openapi_types
|
76
|
-
{
|
77
|
-
:'date_joined' => :'Time',
|
78
|
-
:'email' => :'String',
|
79
|
-
:'first_name' => :'String',
|
80
|
-
:'is_active' => :'Boolean',
|
81
|
-
:'is_staff' => :'Boolean',
|
82
|
-
:'is_superuser' => :'Boolean',
|
83
|
-
:'last_login' => :'Time',
|
84
|
-
:'last_name' => :'String',
|
85
|
-
:'password' => :'String',
|
86
|
-
:'username' => :'String',
|
87
|
-
:'uuid' => :'String'
|
88
|
-
}
|
89
|
-
end
|
90
|
-
|
91
|
-
# List of attributes with nullable: true
|
92
|
-
def self.openapi_nullable
|
93
|
-
Set.new([
|
94
|
-
])
|
95
|
-
end
|
96
|
-
|
97
|
-
# Initializes the object
|
98
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
99
|
-
def initialize(attributes = {})
|
100
|
-
if (!attributes.is_a?(Hash))
|
101
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `EilamTest::UserCreate` initialize method"
|
102
|
-
end
|
103
|
-
|
104
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
105
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
106
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
107
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `EilamTest::UserCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
108
|
-
end
|
109
|
-
h[k.to_sym] = v
|
110
|
-
}
|
111
|
-
|
112
|
-
if attributes.key?(:'date_joined')
|
113
|
-
self.date_joined = attributes[:'date_joined']
|
114
|
-
end
|
115
|
-
|
116
|
-
if attributes.key?(:'email')
|
117
|
-
self.email = attributes[:'email']
|
118
|
-
end
|
119
|
-
|
120
|
-
if attributes.key?(:'first_name')
|
121
|
-
self.first_name = attributes[:'first_name']
|
122
|
-
end
|
123
|
-
|
124
|
-
if attributes.key?(:'is_active')
|
125
|
-
self.is_active = attributes[:'is_active']
|
126
|
-
end
|
127
|
-
|
128
|
-
if attributes.key?(:'is_staff')
|
129
|
-
self.is_staff = attributes[:'is_staff']
|
130
|
-
end
|
131
|
-
|
132
|
-
if attributes.key?(:'is_superuser')
|
133
|
-
self.is_superuser = attributes[:'is_superuser']
|
134
|
-
end
|
135
|
-
|
136
|
-
if attributes.key?(:'last_login')
|
137
|
-
self.last_login = attributes[:'last_login']
|
138
|
-
end
|
139
|
-
|
140
|
-
if attributes.key?(:'last_name')
|
141
|
-
self.last_name = attributes[:'last_name']
|
142
|
-
end
|
143
|
-
|
144
|
-
if attributes.key?(:'password')
|
145
|
-
self.password = attributes[:'password']
|
146
|
-
end
|
147
|
-
|
148
|
-
if attributes.key?(:'username')
|
149
|
-
self.username = attributes[:'username']
|
150
|
-
end
|
151
|
-
|
152
|
-
if attributes.key?(:'uuid')
|
153
|
-
self.uuid = attributes[:'uuid']
|
154
|
-
end
|
155
|
-
end
|
156
|
-
|
157
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
158
|
-
# @return Array for valid properties with the reasons
|
159
|
-
def list_invalid_properties
|
160
|
-
invalid_properties = Array.new
|
161
|
-
if !@email.nil? && @email.to_s.length > 254
|
162
|
-
invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 254.')
|
163
|
-
end
|
164
|
-
|
165
|
-
if !@first_name.nil? && @first_name.to_s.length > 150
|
166
|
-
invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 150.')
|
167
|
-
end
|
168
|
-
|
169
|
-
if !@last_name.nil? && @last_name.to_s.length > 150
|
170
|
-
invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 150.')
|
171
|
-
end
|
172
|
-
|
173
|
-
if !@password.nil? && @password.to_s.length > 128
|
174
|
-
invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 128.')
|
175
|
-
end
|
176
|
-
|
177
|
-
if !@username.nil? && @username.to_s.length > 150
|
178
|
-
invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 150.')
|
179
|
-
end
|
180
|
-
|
181
|
-
invalid_properties
|
182
|
-
end
|
183
|
-
|
184
|
-
# Check to see if the all the properties in the model are valid
|
185
|
-
# @return true if the model is valid
|
186
|
-
def valid?
|
187
|
-
return false if !@email.nil? && @email.to_s.length > 254
|
188
|
-
return false if !@first_name.nil? && @first_name.to_s.length > 150
|
189
|
-
return false if !@last_name.nil? && @last_name.to_s.length > 150
|
190
|
-
return false if !@password.nil? && @password.to_s.length > 128
|
191
|
-
return false if !@username.nil? && @username.to_s.length > 150
|
192
|
-
true
|
193
|
-
end
|
194
|
-
|
195
|
-
# Custom attribute writer method with validation
|
196
|
-
# @param [Object] email Value to be assigned
|
197
|
-
def email=(email)
|
198
|
-
if !email.nil? && email.to_s.length > 254
|
199
|
-
fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 254.'
|
200
|
-
end
|
201
|
-
|
202
|
-
@email = email
|
203
|
-
end
|
204
|
-
|
205
|
-
# Custom attribute writer method with validation
|
206
|
-
# @param [Object] first_name Value to be assigned
|
207
|
-
def first_name=(first_name)
|
208
|
-
if !first_name.nil? && first_name.to_s.length > 150
|
209
|
-
fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 150.'
|
210
|
-
end
|
211
|
-
|
212
|
-
@first_name = first_name
|
213
|
-
end
|
214
|
-
|
215
|
-
# Custom attribute writer method with validation
|
216
|
-
# @param [Object] last_name Value to be assigned
|
217
|
-
def last_name=(last_name)
|
218
|
-
if !last_name.nil? && last_name.to_s.length > 150
|
219
|
-
fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 150.'
|
220
|
-
end
|
221
|
-
|
222
|
-
@last_name = last_name
|
223
|
-
end
|
224
|
-
|
225
|
-
# Custom attribute writer method with validation
|
226
|
-
# @param [Object] password Value to be assigned
|
227
|
-
def password=(password)
|
228
|
-
if !password.nil? && password.to_s.length > 128
|
229
|
-
fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 128.'
|
230
|
-
end
|
231
|
-
|
232
|
-
@password = password
|
233
|
-
end
|
234
|
-
|
235
|
-
# Custom attribute writer method with validation
|
236
|
-
# @param [Object] username Value to be assigned
|
237
|
-
def username=(username)
|
238
|
-
if !username.nil? && username.to_s.length > 150
|
239
|
-
fail ArgumentError, 'invalid value for "username", the character length must be smaller than or equal to 150.'
|
240
|
-
end
|
241
|
-
|
242
|
-
@username = username
|
243
|
-
end
|
244
|
-
|
245
|
-
# Checks equality by comparing each attribute.
|
246
|
-
# @param [Object] Object to be compared
|
247
|
-
def ==(o)
|
248
|
-
return true if self.equal?(o)
|
249
|
-
self.class == o.class &&
|
250
|
-
date_joined == o.date_joined &&
|
251
|
-
email == o.email &&
|
252
|
-
first_name == o.first_name &&
|
253
|
-
is_active == o.is_active &&
|
254
|
-
is_staff == o.is_staff &&
|
255
|
-
is_superuser == o.is_superuser &&
|
256
|
-
last_login == o.last_login &&
|
257
|
-
last_name == o.last_name &&
|
258
|
-
password == o.password &&
|
259
|
-
username == o.username &&
|
260
|
-
uuid == o.uuid
|
261
|
-
end
|
262
|
-
|
263
|
-
# @see the `==` method
|
264
|
-
# @param [Object] Object to be compared
|
265
|
-
def eql?(o)
|
266
|
-
self == o
|
267
|
-
end
|
268
|
-
|
269
|
-
# Calculates hash code according to all attributes.
|
270
|
-
# @return [Integer] Hash code
|
271
|
-
def hash
|
272
|
-
[date_joined, email, first_name, is_active, is_staff, is_superuser, last_login, last_name, password, username, uuid].hash
|
273
|
-
end
|
274
|
-
|
275
|
-
# Builds the object from hash
|
276
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
277
|
-
# @return [Object] Returns the model itself
|
278
|
-
def self.build_from_hash(attributes)
|
279
|
-
new.build_from_hash(attributes)
|
280
|
-
end
|
281
|
-
|
282
|
-
# Builds the object from hash
|
283
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
284
|
-
# @return [Object] Returns the model itself
|
285
|
-
def build_from_hash(attributes)
|
286
|
-
return nil unless attributes.is_a?(Hash)
|
287
|
-
self.class.openapi_types.each_pair do |key, type|
|
288
|
-
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
289
|
-
self.send("#{key}=", nil)
|
290
|
-
elsif type =~ /\AArray<(.*)>/i
|
291
|
-
# check to ensure the input is an array given that the attribute
|
292
|
-
# is documented as an array but the input is not
|
293
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
294
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
295
|
-
end
|
296
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
297
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
298
|
-
end
|
299
|
-
end
|
300
|
-
|
301
|
-
self
|
302
|
-
end
|
303
|
-
|
304
|
-
# Deserializes the data based on type
|
305
|
-
# @param string type Data type
|
306
|
-
# @param string value Value to be deserialized
|
307
|
-
# @return [Object] Deserialized data
|
308
|
-
def _deserialize(type, value)
|
309
|
-
case type.to_sym
|
310
|
-
when :Time
|
311
|
-
Time.parse(value)
|
312
|
-
when :Date
|
313
|
-
Date.parse(value)
|
314
|
-
when :String
|
315
|
-
value.to_s
|
316
|
-
when :Integer
|
317
|
-
value.to_i
|
318
|
-
when :Float
|
319
|
-
value.to_f
|
320
|
-
when :Boolean
|
321
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
322
|
-
true
|
323
|
-
else
|
324
|
-
false
|
325
|
-
end
|
326
|
-
when :Object
|
327
|
-
# generic object (usually a Hash), return directly
|
328
|
-
value
|
329
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
330
|
-
inner_type = Regexp.last_match[:inner_type]
|
331
|
-
value.map { |v| _deserialize(inner_type, v) }
|
332
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
333
|
-
k_type = Regexp.last_match[:k_type]
|
334
|
-
v_type = Regexp.last_match[:v_type]
|
335
|
-
{}.tap do |hash|
|
336
|
-
value.each do |k, v|
|
337
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
338
|
-
end
|
339
|
-
end
|
340
|
-
else # model
|
341
|
-
# models (e.g. Pet) or oneOf
|
342
|
-
klass = EilamTest.const_get(type)
|
343
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
344
|
-
end
|
345
|
-
end
|
346
|
-
|
347
|
-
# Returns the string representation of the object
|
348
|
-
# @return [String] String presentation of the object
|
349
|
-
def to_s
|
350
|
-
to_hash.to_s
|
351
|
-
end
|
352
|
-
|
353
|
-
# to_body is an alias to to_hash (backward compatibility)
|
354
|
-
# @return [Hash] Returns the object in the form of hash
|
355
|
-
def to_body
|
356
|
-
to_hash
|
357
|
-
end
|
358
|
-
|
359
|
-
# Returns the object in the form of hash
|
360
|
-
# @return [Hash] Returns the object in the form of hash
|
361
|
-
def to_hash
|
362
|
-
hash = {}
|
363
|
-
self.class.attribute_map.each_pair do |attr, param|
|
364
|
-
value = self.send(attr)
|
365
|
-
if value.nil?
|
366
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
367
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
368
|
-
end
|
369
|
-
|
370
|
-
hash[param] = _to_hash(value)
|
371
|
-
end
|
372
|
-
hash
|
373
|
-
end
|
374
|
-
|
375
|
-
# Outputs non-array value in the form of hash
|
376
|
-
# For object, use to_hash. Otherwise, just return the value
|
377
|
-
# @param [Object] value Any valid value
|
378
|
-
# @return [Hash] Returns the value in the form of hash
|
379
|
-
def _to_hash(value)
|
380
|
-
if value.is_a?(Array)
|
381
|
-
value.compact.map { |v| _to_hash(v) }
|
382
|
-
elsif value.is_a?(Hash)
|
383
|
-
{}.tap do |hash|
|
384
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
385
|
-
end
|
386
|
-
elsif value.respond_to? :to_hash
|
387
|
-
value.to_hash
|
388
|
-
else
|
389
|
-
value
|
390
|
-
end
|
391
|
-
end
|
392
|
-
|
393
|
-
end
|
394
|
-
|
395
|
-
end
|
@@ -1,280 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Site Manager API
|
3
|
-
|
4
|
-
#Site Manager API
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.0.0
|
7
|
-
Contact: autosde@il.ibm.com
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.0.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
require 'time'
|
15
|
-
|
16
|
-
module EilamTest
|
17
|
-
# TODO add description
|
18
|
-
class UserUpdate
|
19
|
-
# email
|
20
|
-
attr_accessor :email
|
21
|
-
|
22
|
-
# first_name
|
23
|
-
attr_accessor :first_name
|
24
|
-
|
25
|
-
# is_active
|
26
|
-
attr_accessor :is_active
|
27
|
-
|
28
|
-
# is_staff
|
29
|
-
attr_accessor :is_staff
|
30
|
-
|
31
|
-
# last_name
|
32
|
-
attr_accessor :last_name
|
33
|
-
|
34
|
-
# password
|
35
|
-
attr_accessor :password
|
36
|
-
|
37
|
-
# username
|
38
|
-
attr_accessor :username
|
39
|
-
|
40
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
41
|
-
def self.attribute_map
|
42
|
-
{
|
43
|
-
:'email' => :'email',
|
44
|
-
:'first_name' => :'first_name',
|
45
|
-
:'is_active' => :'is_active',
|
46
|
-
:'is_staff' => :'is_staff',
|
47
|
-
:'last_name' => :'last_name',
|
48
|
-
:'password' => :'password',
|
49
|
-
:'username' => :'username'
|
50
|
-
}
|
51
|
-
end
|
52
|
-
|
53
|
-
# Returns all the JSON keys this model knows about
|
54
|
-
def self.acceptable_attributes
|
55
|
-
attribute_map.values
|
56
|
-
end
|
57
|
-
|
58
|
-
# Attribute type mapping.
|
59
|
-
def self.openapi_types
|
60
|
-
{
|
61
|
-
:'email' => :'String',
|
62
|
-
:'first_name' => :'String',
|
63
|
-
:'is_active' => :'Boolean',
|
64
|
-
:'is_staff' => :'Boolean',
|
65
|
-
:'last_name' => :'String',
|
66
|
-
:'password' => :'String',
|
67
|
-
:'username' => :'String'
|
68
|
-
}
|
69
|
-
end
|
70
|
-
|
71
|
-
# List of attributes with nullable: true
|
72
|
-
def self.openapi_nullable
|
73
|
-
Set.new([
|
74
|
-
])
|
75
|
-
end
|
76
|
-
|
77
|
-
# Initializes the object
|
78
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
79
|
-
def initialize(attributes = {})
|
80
|
-
if (!attributes.is_a?(Hash))
|
81
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `EilamTest::UserUpdate` initialize method"
|
82
|
-
end
|
83
|
-
|
84
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
85
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
86
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
87
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `EilamTest::UserUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
88
|
-
end
|
89
|
-
h[k.to_sym] = v
|
90
|
-
}
|
91
|
-
|
92
|
-
if attributes.key?(:'email')
|
93
|
-
self.email = attributes[:'email']
|
94
|
-
end
|
95
|
-
|
96
|
-
if attributes.key?(:'first_name')
|
97
|
-
self.first_name = attributes[:'first_name']
|
98
|
-
end
|
99
|
-
|
100
|
-
if attributes.key?(:'is_active')
|
101
|
-
self.is_active = attributes[:'is_active']
|
102
|
-
end
|
103
|
-
|
104
|
-
if attributes.key?(:'is_staff')
|
105
|
-
self.is_staff = attributes[:'is_staff']
|
106
|
-
end
|
107
|
-
|
108
|
-
if attributes.key?(:'last_name')
|
109
|
-
self.last_name = attributes[:'last_name']
|
110
|
-
end
|
111
|
-
|
112
|
-
if attributes.key?(:'password')
|
113
|
-
self.password = attributes[:'password']
|
114
|
-
end
|
115
|
-
|
116
|
-
if attributes.key?(:'username')
|
117
|
-
self.username = attributes[:'username']
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
122
|
-
# @return Array for valid properties with the reasons
|
123
|
-
def list_invalid_properties
|
124
|
-
invalid_properties = Array.new
|
125
|
-
invalid_properties
|
126
|
-
end
|
127
|
-
|
128
|
-
# Check to see if the all the properties in the model are valid
|
129
|
-
# @return true if the model is valid
|
130
|
-
def valid?
|
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
|
-
email == o.email &&
|
140
|
-
first_name == o.first_name &&
|
141
|
-
is_active == o.is_active &&
|
142
|
-
is_staff == o.is_staff &&
|
143
|
-
last_name == o.last_name &&
|
144
|
-
password == o.password &&
|
145
|
-
username == o.username
|
146
|
-
end
|
147
|
-
|
148
|
-
# @see the `==` method
|
149
|
-
# @param [Object] Object to be compared
|
150
|
-
def eql?(o)
|
151
|
-
self == o
|
152
|
-
end
|
153
|
-
|
154
|
-
# Calculates hash code according to all attributes.
|
155
|
-
# @return [Integer] Hash code
|
156
|
-
def hash
|
157
|
-
[email, first_name, is_active, is_staff, last_name, password, username].hash
|
158
|
-
end
|
159
|
-
|
160
|
-
# Builds the object from hash
|
161
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
162
|
-
# @return [Object] Returns the model itself
|
163
|
-
def self.build_from_hash(attributes)
|
164
|
-
new.build_from_hash(attributes)
|
165
|
-
end
|
166
|
-
|
167
|
-
# Builds the object from hash
|
168
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
169
|
-
# @return [Object] Returns the model itself
|
170
|
-
def build_from_hash(attributes)
|
171
|
-
return nil unless attributes.is_a?(Hash)
|
172
|
-
self.class.openapi_types.each_pair do |key, type|
|
173
|
-
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
174
|
-
self.send("#{key}=", nil)
|
175
|
-
elsif type =~ /\AArray<(.*)>/i
|
176
|
-
# check to ensure the input is an array given that the attribute
|
177
|
-
# is documented as an array but the input is not
|
178
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
179
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
180
|
-
end
|
181
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
182
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
183
|
-
end
|
184
|
-
end
|
185
|
-
|
186
|
-
self
|
187
|
-
end
|
188
|
-
|
189
|
-
# Deserializes the data based on type
|
190
|
-
# @param string type Data type
|
191
|
-
# @param string value Value to be deserialized
|
192
|
-
# @return [Object] Deserialized data
|
193
|
-
def _deserialize(type, value)
|
194
|
-
case type.to_sym
|
195
|
-
when :Time
|
196
|
-
Time.parse(value)
|
197
|
-
when :Date
|
198
|
-
Date.parse(value)
|
199
|
-
when :String
|
200
|
-
value.to_s
|
201
|
-
when :Integer
|
202
|
-
value.to_i
|
203
|
-
when :Float
|
204
|
-
value.to_f
|
205
|
-
when :Boolean
|
206
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
207
|
-
true
|
208
|
-
else
|
209
|
-
false
|
210
|
-
end
|
211
|
-
when :Object
|
212
|
-
# generic object (usually a Hash), return directly
|
213
|
-
value
|
214
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
215
|
-
inner_type = Regexp.last_match[:inner_type]
|
216
|
-
value.map { |v| _deserialize(inner_type, v) }
|
217
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
218
|
-
k_type = Regexp.last_match[:k_type]
|
219
|
-
v_type = Regexp.last_match[:v_type]
|
220
|
-
{}.tap do |hash|
|
221
|
-
value.each do |k, v|
|
222
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
223
|
-
end
|
224
|
-
end
|
225
|
-
else # model
|
226
|
-
# models (e.g. Pet) or oneOf
|
227
|
-
klass = EilamTest.const_get(type)
|
228
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
229
|
-
end
|
230
|
-
end
|
231
|
-
|
232
|
-
# Returns the string representation of the object
|
233
|
-
# @return [String] String presentation of the object
|
234
|
-
def to_s
|
235
|
-
to_hash.to_s
|
236
|
-
end
|
237
|
-
|
238
|
-
# to_body is an alias to to_hash (backward compatibility)
|
239
|
-
# @return [Hash] Returns the object in the form of hash
|
240
|
-
def to_body
|
241
|
-
to_hash
|
242
|
-
end
|
243
|
-
|
244
|
-
# Returns the object in the form of hash
|
245
|
-
# @return [Hash] Returns the object in the form of hash
|
246
|
-
def to_hash
|
247
|
-
hash = {}
|
248
|
-
self.class.attribute_map.each_pair do |attr, param|
|
249
|
-
value = self.send(attr)
|
250
|
-
if value.nil?
|
251
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
252
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
253
|
-
end
|
254
|
-
|
255
|
-
hash[param] = _to_hash(value)
|
256
|
-
end
|
257
|
-
hash
|
258
|
-
end
|
259
|
-
|
260
|
-
# Outputs non-array value in the form of hash
|
261
|
-
# For object, use to_hash. Otherwise, just return the value
|
262
|
-
# @param [Object] value Any valid value
|
263
|
-
# @return [Hash] Returns the value in the form of hash
|
264
|
-
def _to_hash(value)
|
265
|
-
if value.is_a?(Array)
|
266
|
-
value.compact.map { |v| _to_hash(v) }
|
267
|
-
elsif value.is_a?(Hash)
|
268
|
-
{}.tap do |hash|
|
269
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
270
|
-
end
|
271
|
-
elsif value.respond_to? :to_hash
|
272
|
-
value.to_hash
|
273
|
-
else
|
274
|
-
value
|
275
|
-
end
|
276
|
-
end
|
277
|
-
|
278
|
-
end
|
279
|
-
|
280
|
-
end
|