autosde_openapi_client 1.1.9 → 1.1.10

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.
@@ -0,0 +1,395 @@
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 AutosdeOpenapiClient
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 `AutosdeOpenapiClient::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 `AutosdeOpenapiClient::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 = AutosdeOpenapiClient.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
@@ -14,15 +14,39 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module AutosdeOpenapiClient
17
- # UserChangePassword
18
- class UserChangePassword
19
- # new_password
20
- attr_accessor :new_password
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
21
39
 
22
40
  # Attribute mapping from ruby-style variable name to JSON key.
23
41
  def self.attribute_map
24
42
  {
25
- :'new_password' => :'new_password'
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'
26
50
  }
27
51
  end
28
52
 
@@ -34,7 +58,13 @@ module AutosdeOpenapiClient
34
58
  # Attribute type mapping.
35
59
  def self.openapi_types
36
60
  {
37
- :'new_password' => :'String'
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'
38
68
  }
39
69
  end
40
70
 
@@ -48,19 +78,43 @@ module AutosdeOpenapiClient
48
78
  # @param [Hash] attributes Model attributes in the form of hash
49
79
  def initialize(attributes = {})
50
80
  if (!attributes.is_a?(Hash))
51
- fail ArgumentError, "The input argument (attributes) must be a hash in `AutosdeOpenapiClient::UserChangePassword` initialize method"
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AutosdeOpenapiClient::UserUpdate` initialize method"
52
82
  end
53
83
 
54
84
  # check to see if the attribute exists and convert string to symbol for hash key
55
85
  attributes = attributes.each_with_object({}) { |(k, v), h|
56
86
  if (!self.class.attribute_map.key?(k.to_sym))
57
- fail ArgumentError, "`#{k}` is not a valid attribute in `AutosdeOpenapiClient::UserChangePassword`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AutosdeOpenapiClient::UserUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
88
  end
59
89
  h[k.to_sym] = v
60
90
  }
61
91
 
62
- if attributes.key?(:'new_password')
63
- self.new_password = attributes[:'new_password']
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']
64
118
  end
65
119
  end
66
120
 
@@ -82,7 +136,13 @@ module AutosdeOpenapiClient
82
136
  def ==(o)
83
137
  return true if self.equal?(o)
84
138
  self.class == o.class &&
85
- new_password == o.new_password
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
86
146
  end
87
147
 
88
148
  # @see the `==` method
@@ -94,7 +154,7 @@ module AutosdeOpenapiClient
94
154
  # Calculates hash code according to all attributes.
95
155
  # @return [Integer] Hash code
96
156
  def hash
97
- [new_password].hash
157
+ [email, first_name, is_active, is_staff, last_name, password, username].hash
98
158
  end
99
159
 
100
160
  # Builds the object from hash
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Site Manager API
5
5
 
6
- The version of the OpenAPI document: 1.1.9
6
+ The version of the OpenAPI document: 1.1.10
7
7
  Contact: autosde@il.ibm.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.0.0
@@ -11,5 +11,5 @@ OpenAPI Generator version: 5.0.0
11
11
  =end
12
12
 
13
13
  module AutosdeOpenapiClient
14
- VERSION = '1.1.9'
14
+ VERSION = '1.1.10'
15
15
  end
@@ -67,7 +67,9 @@ require 'autosde_openapi_client/models/storage_system_create'
67
67
  require 'autosde_openapi_client/models/storage_system_update'
68
68
  require 'autosde_openapi_client/models/system_type'
69
69
  require 'autosde_openapi_client/models/system_type_create'
70
- require 'autosde_openapi_client/models/user_change_password'
70
+ require 'autosde_openapi_client/models/user'
71
+ require 'autosde_openapi_client/models/user_create'
72
+ require 'autosde_openapi_client/models/user_update'
71
73
  require 'autosde_openapi_client/models/volume'
72
74
  require 'autosde_openapi_client/models/volume_create'
73
75
  require 'autosde_openapi_client/models/volume_response'
@@ -101,7 +103,7 @@ require 'autosde_openapi_client/api/storage_host_wwpn_candidates_api'
101
103
  require 'autosde_openapi_client/api/storage_resource_api'
102
104
  require 'autosde_openapi_client/api/storage_system_api'
103
105
  require 'autosde_openapi_client/api/system_type_api'
104
- require 'autosde_openapi_client/api/user_change_password_api'
106
+ require 'autosde_openapi_client/api/user_api'
105
107
  require 'autosde_openapi_client/api/volume_api'
106
108
  require 'autosde_openapi_client/api/volume_safe_delete_api'
107
109
 
@@ -0,0 +1,85 @@
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 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for AutosdeOpenapiClient::UserApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'UserApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = AutosdeOpenapiClient::UserApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of UserApi' do
30
+ it 'should create an instance of UserApi' do
31
+ expect(@api_instance).to be_instance_of(AutosdeOpenapiClient::UserApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for autosde_users_get
36
+ # @param [Hash] opts the optional parameters
37
+ # @return [Array<UserCreate>]
38
+ describe 'autosde_users_get test' do
39
+ it 'should work' do
40
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
41
+ end
42
+ end
43
+
44
+ # unit tests for autosde_users_pk_delete
45
+ # @param pk
46
+ # @param [Hash] opts the optional parameters
47
+ # @return [Array<User>]
48
+ describe 'autosde_users_pk_delete test' do
49
+ it 'should work' do
50
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
51
+ end
52
+ end
53
+
54
+ # unit tests for autosde_users_pk_get
55
+ # @param pk
56
+ # @param [Hash] opts the optional parameters
57
+ # @return [Array<UserCreate>]
58
+ describe 'autosde_users_pk_get test' do
59
+ it 'should work' do
60
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
61
+ end
62
+ end
63
+
64
+ # unit tests for autosde_users_pk_put
65
+ # @param pk
66
+ # @param user_update
67
+ # @param [Hash] opts the optional parameters
68
+ # @return [UserCreate]
69
+ describe 'autosde_users_pk_put test' do
70
+ it 'should work' do
71
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
72
+ end
73
+ end
74
+
75
+ # unit tests for autosde_users_post
76
+ # @param user_create
77
+ # @param [Hash] opts the optional parameters
78
+ # @return [UserCreate]
79
+ describe 'autosde_users_post test' do
80
+ it 'should work' do
81
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
82
+ end
83
+ end
84
+
85
+ end