autosde_openapi_client 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -7
  3. data/docs/AbstractCapabilityApi.md +6 -6
  4. data/docs/AccountApi.md +9 -9
  5. data/docs/AddressApi.md +6 -6
  6. data/docs/AuthenticationApi.md +1 -1
  7. data/docs/AutoSDEProjectApi.md +6 -6
  8. data/docs/AutoSDERoleApi.md +6 -6
  9. data/docs/CapabilityTranslationApi.md +6 -6
  10. data/docs/HostApi.md +6 -6
  11. data/docs/HostVolumeConnectionApi.md +6 -6
  12. data/docs/Job.md +29 -0
  13. data/docs/JobApi.md +104 -0
  14. data/docs/JobCreate.md +19 -0
  15. data/docs/NativeCapabilityApi.md +6 -6
  16. data/docs/ProfileApi.md +6 -6
  17. data/docs/ProvisioningStrategyApi.md +6 -6
  18. data/docs/ServiceApi.md +9 -9
  19. data/docs/ServiceResourceAttachmentApi.md +6 -6
  20. data/docs/Snapshot.md +25 -0
  21. data/docs/SnapshotApi.md +204 -0
  22. data/docs/SnapshotCreate.md +23 -0
  23. data/docs/StorageHost.md +29 -0
  24. data/docs/StorageHostApi.md +256 -0
  25. data/docs/StorageHostCreate.md +37 -0
  26. data/docs/StorageHostResponse.md +31 -0
  27. data/docs/StorageHostUpdate.md +21 -0
  28. data/docs/StorageHostVolumeMapping.md +25 -0
  29. data/docs/StorageHostVolumeMappingApi.md +204 -0
  30. data/docs/StorageHostVolumeMappingCreate.md +23 -0
  31. data/docs/StorageResourceApi.md +9 -9
  32. data/docs/StorageSystemApi.md +6 -6
  33. data/docs/SystemTypeApi.md +6 -6
  34. data/docs/Volume.md +2 -0
  35. data/docs/VolumeApi.md +9 -9
  36. data/docs/VolumeCreate.md +2 -0
  37. data/docs/VolumeResponse.md +2 -0
  38. data/docs/VolumeSafeDeleteApi.md +6 -6
  39. data/docs/VolumeUpdate.md +3 -1
  40. data/lib/openapi_client.rb +108 -0
  41. data/lib/{autosde_openapi_client → openapi_client}/api/abstract_capability_api.rb +19 -15
  42. data/lib/{autosde_openapi_client → openapi_client}/api/account_api.rb +25 -20
  43. data/lib/{autosde_openapi_client → openapi_client}/api/address_api.rb +19 -15
  44. data/lib/{autosde_openapi_client → openapi_client}/api/authentication_api.rb +5 -4
  45. data/lib/{autosde_openapi_client → openapi_client}/api/auto_sde_project_api.rb +19 -15
  46. data/lib/{autosde_openapi_client → openapi_client}/api/auto_sde_role_api.rb +19 -15
  47. data/lib/{autosde_openapi_client → openapi_client}/api/capability_translation_api.rb +19 -15
  48. data/lib/{autosde_openapi_client → openapi_client}/api/host_api.rb +19 -15
  49. data/lib/{autosde_openapi_client → openapi_client}/api/host_volume_connection_api.rb +19 -15
  50. data/lib/openapi_client/api/job_api.rb +136 -0
  51. data/lib/{autosde_openapi_client → openapi_client}/api/native_capability_api.rb +19 -15
  52. data/lib/{autosde_openapi_client → openapi_client}/api/profile_api.rb +19 -15
  53. data/lib/{autosde_openapi_client → openapi_client}/api/provisioning_strategy_api.rb +19 -15
  54. data/lib/{autosde_openapi_client → openapi_client}/api/service_api.rb +25 -20
  55. data/lib/{autosde_openapi_client → openapi_client}/api/service_resource_attachment_api.rb +19 -15
  56. data/lib/openapi_client/api/snapshot_api.rb +254 -0
  57. data/lib/openapi_client/api/storage_host_api.rb +321 -0
  58. data/lib/openapi_client/api/storage_host_volume_mapping_api.rb +254 -0
  59. data/lib/{autosde_openapi_client → openapi_client}/api/storage_resource_api.rb +25 -20
  60. data/lib/{autosde_openapi_client → openapi_client}/api/storage_system_api.rb +19 -15
  61. data/lib/{autosde_openapi_client → openapi_client}/api/system_type_api.rb +19 -15
  62. data/lib/{autosde_openapi_client → openapi_client}/api/volume_api.rb +25 -20
  63. data/lib/{autosde_openapi_client → openapi_client}/api/volume_safe_delete_api.rb +19 -15
  64. data/lib/{autosde_openapi_client → openapi_client}/api_client.rb +46 -45
  65. data/lib/{autosde_openapi_client → openapi_client}/api_error.rb +1 -1
  66. data/lib/{autosde_openapi_client → openapi_client}/configuration.rb +34 -7
  67. data/lib/{autosde_openapi_client → openapi_client}/models/abstract_capability.rb +9 -5
  68. data/lib/{autosde_openapi_client → openapi_client}/models/account.rb +9 -5
  69. data/lib/{autosde_openapi_client → openapi_client}/models/account_post_request.rb +9 -5
  70. data/lib/{autosde_openapi_client → openapi_client}/models/account_post_response.rb +9 -5
  71. data/lib/{autosde_openapi_client → openapi_client}/models/address.rb +9 -5
  72. data/lib/{autosde_openapi_client → openapi_client}/models/address_create.rb +9 -5
  73. data/lib/{autosde_openapi_client → openapi_client}/models/auth_response.rb +9 -5
  74. data/lib/{autosde_openapi_client → openapi_client}/models/authentication.rb +9 -5
  75. data/lib/{autosde_openapi_client → openapi_client}/models/auto_sde_project.rb +9 -5
  76. data/lib/{autosde_openapi_client → openapi_client}/models/auto_sde_role.rb +9 -5
  77. data/lib/{autosde_openapi_client → openapi_client}/models/capability_translation.rb +9 -5
  78. data/lib/{autosde_openapi_client → openapi_client}/models/capability_translation_create.rb +9 -5
  79. data/lib/{autosde_openapi_client → openapi_client}/models/host.rb +9 -5
  80. data/lib/{autosde_openapi_client → openapi_client}/models/host_create.rb +9 -5
  81. data/lib/{autosde_openapi_client → openapi_client}/models/host_volume_connection.rb +9 -5
  82. data/lib/{autosde_openapi_client → openapi_client}/models/host_volume_connection_create.rb +9 -5
  83. data/lib/openapi_client/models/job.rb +272 -0
  84. data/lib/openapi_client/models/job_create.rb +222 -0
  85. data/lib/{autosde_openapi_client → openapi_client}/models/native_capability.rb +9 -5
  86. data/lib/{autosde_openapi_client → openapi_client}/models/profile.rb +9 -5
  87. data/lib/{autosde_openapi_client → openapi_client}/models/provisioning_strategy.rb +9 -5
  88. data/lib/{autosde_openapi_client → openapi_client}/models/service.rb +9 -5
  89. data/lib/{autosde_openapi_client → openapi_client}/models/service_abstract_capability_value.rb +9 -5
  90. data/lib/{autosde_openapi_client → openapi_client}/models/service_create.rb +9 -5
  91. data/lib/{autosde_openapi_client → openapi_client}/models/service_resource_attachment.rb +9 -5
  92. data/lib/openapi_client/models/snapshot.rb +290 -0
  93. data/lib/openapi_client/models/snapshot_create.rb +280 -0
  94. data/lib/openapi_client/models/storage_host.rb +309 -0
  95. data/lib/openapi_client/models/storage_host_create.rb +360 -0
  96. data/lib/openapi_client/models/storage_host_response.rb +325 -0
  97. data/lib/openapi_client/models/storage_host_update.rb +293 -0
  98. data/lib/openapi_client/models/storage_host_volume_mapping.rb +291 -0
  99. data/lib/openapi_client/models/storage_host_volume_mapping_create.rb +283 -0
  100. data/lib/{autosde_openapi_client → openapi_client}/models/storage_resource.rb +9 -5
  101. data/lib/{autosde_openapi_client → openapi_client}/models/storage_resource_create.rb +9 -5
  102. data/lib/{autosde_openapi_client → openapi_client}/models/storage_resource_response.rb +9 -5
  103. data/lib/{autosde_openapi_client → openapi_client}/models/storage_system.rb +9 -5
  104. data/lib/{autosde_openapi_client → openapi_client}/models/storage_system_create.rb +9 -5
  105. data/lib/{autosde_openapi_client → openapi_client}/models/system_type.rb +9 -5
  106. data/lib/{autosde_openapi_client → openapi_client}/models/system_type_create.rb +9 -5
  107. data/lib/{autosde_openapi_client → openapi_client}/models/volume.rb +20 -6
  108. data/lib/{autosde_openapi_client → openapi_client}/models/volume_create.rb +20 -6
  109. data/lib/{autosde_openapi_client → openapi_client}/models/volume_response.rb +20 -6
  110. data/lib/{autosde_openapi_client → openapi_client}/models/volume_safe_delete.rb +9 -5
  111. data/lib/{autosde_openapi_client → openapi_client}/models/volume_safe_delete_create.rb +9 -5
  112. data/lib/{autosde_openapi_client → openapi_client}/models/volume_update.rb +22 -6
  113. data/lib/{autosde_openapi_client → openapi_client}/version.rb +2 -2
  114. data/{autosde_openapi_client.gemspec → openapi_client.gemspec} +3 -4
  115. data/spec/api/abstract_capability_api_spec.rb +1 -1
  116. data/spec/api/account_api_spec.rb +1 -1
  117. data/spec/api/address_api_spec.rb +1 -1
  118. data/spec/api/authentication_api_spec.rb +1 -1
  119. data/spec/api/auto_sde_project_api_spec.rb +1 -1
  120. data/spec/api/auto_sde_role_api_spec.rb +1 -1
  121. data/spec/api/capability_translation_api_spec.rb +1 -1
  122. data/spec/api/host_api_spec.rb +1 -1
  123. data/spec/api/host_volume_connection_api_spec.rb +1 -1
  124. data/spec/api/job_api_spec.rb +54 -0
  125. data/spec/api/native_capability_api_spec.rb +1 -1
  126. data/spec/api/profile_api_spec.rb +1 -1
  127. data/spec/api/provisioning_strategy_api_spec.rb +1 -1
  128. data/spec/api/service_api_spec.rb +1 -1
  129. data/spec/api/service_resource_attachment_api_spec.rb +1 -1
  130. data/spec/api/snapshot_api_spec.rb +74 -0
  131. data/spec/api/storage_host_api_spec.rb +74 -0
  132. data/spec/api/storage_host_volume_mapping_api_spec.rb +74 -0
  133. data/spec/api/storage_resource_api_spec.rb +1 -1
  134. data/spec/api/storage_system_api_spec.rb +1 -1
  135. data/spec/api/system_type_api_spec.rb +1 -1
  136. data/spec/api/volume_api_spec.rb +1 -1
  137. data/spec/api/volume_safe_delete_api_spec.rb +1 -1
  138. data/spec/api_client_spec.rb +1 -1
  139. data/spec/configuration_spec.rb +1 -1
  140. data/spec/models/abstract_capability_spec.rb +1 -1
  141. data/spec/models/account_post_request_spec.rb +1 -1
  142. data/spec/models/account_post_response_spec.rb +1 -1
  143. data/spec/models/account_spec.rb +1 -1
  144. data/spec/models/address_create_spec.rb +1 -1
  145. data/spec/models/address_spec.rb +1 -1
  146. data/spec/models/auth_response_spec.rb +1 -1
  147. data/spec/models/authentication_spec.rb +1 -1
  148. data/spec/models/auto_sde_project_spec.rb +1 -1
  149. data/spec/models/auto_sde_role_spec.rb +1 -1
  150. data/spec/models/capability_translation_create_spec.rb +1 -1
  151. data/spec/models/capability_translation_spec.rb +1 -1
  152. data/spec/models/host_create_spec.rb +1 -1
  153. data/spec/models/host_spec.rb +1 -1
  154. data/spec/models/host_volume_connection_create_spec.rb +1 -1
  155. data/spec/models/host_volume_connection_spec.rb +1 -1
  156. data/spec/models/job_create_spec.rb +47 -0
  157. data/spec/models/job_spec.rb +77 -0
  158. data/spec/models/native_capability_spec.rb +1 -1
  159. data/spec/models/profile_spec.rb +1 -1
  160. data/spec/models/provisioning_strategy_spec.rb +1 -1
  161. data/spec/models/service_abstract_capability_value_spec.rb +1 -1
  162. data/spec/models/service_create_spec.rb +1 -1
  163. data/spec/models/service_resource_attachment_spec.rb +1 -1
  164. data/spec/models/service_spec.rb +1 -1
  165. data/spec/models/snapshot_create_spec.rb +63 -0
  166. data/spec/models/snapshot_spec.rb +69 -0
  167. data/spec/models/storage_host_create_spec.rb +109 -0
  168. data/spec/models/storage_host_response_spec.rb +87 -0
  169. data/spec/models/storage_host_spec.rb +81 -0
  170. data/spec/models/storage_host_update_spec.rb +61 -0
  171. data/spec/models/storage_host_volume_mapping_create_spec.rb +63 -0
  172. data/spec/models/storage_host_volume_mapping_spec.rb +69 -0
  173. data/spec/models/storage_resource_create_spec.rb +1 -1
  174. data/spec/models/storage_resource_response_spec.rb +1 -1
  175. data/spec/models/storage_resource_spec.rb +1 -1
  176. data/spec/models/storage_system_create_spec.rb +1 -1
  177. data/spec/models/storage_system_spec.rb +1 -1
  178. data/spec/models/system_type_create_spec.rb +1 -1
  179. data/spec/models/system_type_spec.rb +1 -1
  180. data/spec/models/volume_create_spec.rb +1 -1
  181. data/spec/models/volume_response_spec.rb +1 -1
  182. data/spec/models/volume_safe_delete_create_spec.rb +1 -1
  183. data/spec/models/volume_safe_delete_spec.rb +1 -1
  184. data/spec/models/volume_spec.rb +1 -1
  185. data/spec/models/volume_update_spec.rb +7 -1
  186. data/spec/spec_helper.rb +2 -2
  187. metadata +142 -106
  188. data/lib/autosde_openapi_client.rb +0 -94
  189. data/site_manager_oas.json +0 -3992
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: autosde@il.ibm.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module OpenapiClient
16
17
  # NativeCapability
@@ -135,7 +136,9 @@ module OpenapiClient
135
136
  def build_from_hash(attributes)
136
137
  return nil unless attributes.is_a?(Hash)
137
138
  self.class.openapi_types.each_pair do |key, type|
138
- if type =~ /\AArray<(.*)>/i
139
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
140
+ self.send("#{key}=", nil)
141
+ elsif type =~ /\AArray<(.*)>/i
139
142
  # check to ensure the input is an array given that the attribute
140
143
  # is documented as an array but the input is not
141
144
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -143,7 +146,7 @@ module OpenapiClient
143
146
  end
144
147
  elsif !attributes[self.class.attribute_map[key]].nil?
145
148
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
- end # or else data not found in attributes(hash), not an issue as the data can be optional
149
+ end
147
150
  end
148
151
 
149
152
  self
@@ -155,8 +158,8 @@ module OpenapiClient
155
158
  # @return [Object] Deserialized data
156
159
  def _deserialize(type, value)
157
160
  case type.to_sym
158
- when :DateTime
159
- DateTime.parse(value)
161
+ when :Time
162
+ Time.parse(value)
160
163
  when :Date
161
164
  Date.parse(value)
162
165
  when :String
@@ -235,5 +238,6 @@ module OpenapiClient
235
238
  value
236
239
  end
237
240
  end
241
+
238
242
  end
239
243
  end
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: autosde@il.ibm.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module OpenapiClient
16
17
  # doc-todo: which profile is being defined??
@@ -179,7 +180,9 @@ module OpenapiClient
179
180
  def build_from_hash(attributes)
180
181
  return nil unless attributes.is_a?(Hash)
181
182
  self.class.openapi_types.each_pair do |key, type|
182
- if type =~ /\AArray<(.*)>/i
183
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
184
+ self.send("#{key}=", nil)
185
+ elsif type =~ /\AArray<(.*)>/i
183
186
  # check to ensure the input is an array given that the attribute
184
187
  # is documented as an array but the input is not
185
188
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -187,7 +190,7 @@ module OpenapiClient
187
190
  end
188
191
  elsif !attributes[self.class.attribute_map[key]].nil?
189
192
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
190
- end # or else data not found in attributes(hash), not an issue as the data can be optional
193
+ end
191
194
  end
192
195
 
193
196
  self
@@ -199,8 +202,8 @@ module OpenapiClient
199
202
  # @return [Object] Deserialized data
200
203
  def _deserialize(type, value)
201
204
  case type.to_sym
202
- when :DateTime
203
- DateTime.parse(value)
205
+ when :Time
206
+ Time.parse(value)
204
207
  when :Date
205
208
  Date.parse(value)
206
209
  when :String
@@ -279,5 +282,6 @@ module OpenapiClient
279
282
  value
280
283
  end
281
284
  end
285
+
282
286
  end
283
287
  end
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: autosde@il.ibm.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module OpenapiClient
16
17
  # Used for capacity provisioning details.
@@ -153,7 +154,9 @@ module OpenapiClient
153
154
  def build_from_hash(attributes)
154
155
  return nil unless attributes.is_a?(Hash)
155
156
  self.class.openapi_types.each_pair do |key, type|
156
- if type =~ /\AArray<(.*)>/i
157
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
158
+ self.send("#{key}=", nil)
159
+ elsif type =~ /\AArray<(.*)>/i
157
160
  # check to ensure the input is an array given that the attribute
158
161
  # is documented as an array but the input is not
159
162
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -161,7 +164,7 @@ module OpenapiClient
161
164
  end
162
165
  elsif !attributes[self.class.attribute_map[key]].nil?
163
166
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
164
- end # or else data not found in attributes(hash), not an issue as the data can be optional
167
+ end
165
168
  end
166
169
 
167
170
  self
@@ -173,8 +176,8 @@ module OpenapiClient
173
176
  # @return [Object] Deserialized data
174
177
  def _deserialize(type, value)
175
178
  case type.to_sym
176
- when :DateTime
177
- DateTime.parse(value)
179
+ when :Time
180
+ Time.parse(value)
178
181
  when :Date
179
182
  Date.parse(value)
180
183
  when :String
@@ -253,5 +256,6 @@ module OpenapiClient
253
256
  value
254
257
  end
255
258
  end
259
+
256
260
  end
257
261
  end
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: autosde@il.ibm.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module OpenapiClient
16
17
  # Service
@@ -235,7 +236,9 @@ module OpenapiClient
235
236
  def build_from_hash(attributes)
236
237
  return nil unless attributes.is_a?(Hash)
237
238
  self.class.openapi_types.each_pair do |key, type|
238
- if type =~ /\AArray<(.*)>/i
239
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
240
+ self.send("#{key}=", nil)
241
+ elsif type =~ /\AArray<(.*)>/i
239
242
  # check to ensure the input is an array given that the attribute
240
243
  # is documented as an array but the input is not
241
244
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -243,7 +246,7 @@ module OpenapiClient
243
246
  end
244
247
  elsif !attributes[self.class.attribute_map[key]].nil?
245
248
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
246
- end # or else data not found in attributes(hash), not an issue as the data can be optional
249
+ end
247
250
  end
248
251
 
249
252
  self
@@ -255,8 +258,8 @@ module OpenapiClient
255
258
  # @return [Object] Deserialized data
256
259
  def _deserialize(type, value)
257
260
  case type.to_sym
258
- when :DateTime
259
- DateTime.parse(value)
261
+ when :Time
262
+ Time.parse(value)
260
263
  when :Date
261
264
  Date.parse(value)
262
265
  when :String
@@ -335,5 +338,6 @@ module OpenapiClient
335
338
  value
336
339
  end
337
340
  end
341
+
338
342
  end
339
343
  end
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: autosde@il.ibm.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module OpenapiClient
16
17
  # ServiceAbstractCapabilityValue
@@ -123,7 +124,9 @@ module OpenapiClient
123
124
  def build_from_hash(attributes)
124
125
  return nil unless attributes.is_a?(Hash)
125
126
  self.class.openapi_types.each_pair do |key, type|
126
- if type =~ /\AArray<(.*)>/i
127
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
128
+ self.send("#{key}=", nil)
129
+ elsif type =~ /\AArray<(.*)>/i
127
130
  # check to ensure the input is an array given that the attribute
128
131
  # is documented as an array but the input is not
129
132
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -131,7 +134,7 @@ module OpenapiClient
131
134
  end
132
135
  elsif !attributes[self.class.attribute_map[key]].nil?
133
136
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
134
- end # or else data not found in attributes(hash), not an issue as the data can be optional
137
+ end
135
138
  end
136
139
 
137
140
  self
@@ -143,8 +146,8 @@ module OpenapiClient
143
146
  # @return [Object] Deserialized data
144
147
  def _deserialize(type, value)
145
148
  case type.to_sym
146
- when :DateTime
147
- DateTime.parse(value)
149
+ when :Time
150
+ Time.parse(value)
148
151
  when :Date
149
152
  Date.parse(value)
150
153
  when :String
@@ -223,5 +226,6 @@ module OpenapiClient
223
226
  value
224
227
  end
225
228
  end
229
+
226
230
  end
227
231
  end
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: autosde@il.ibm.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module OpenapiClient
16
17
  # TODO add description
@@ -223,7 +224,9 @@ module OpenapiClient
223
224
  def build_from_hash(attributes)
224
225
  return nil unless attributes.is_a?(Hash)
225
226
  self.class.openapi_types.each_pair do |key, type|
226
- if type =~ /\AArray<(.*)>/i
227
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
228
+ self.send("#{key}=", nil)
229
+ elsif type =~ /\AArray<(.*)>/i
227
230
  # check to ensure the input is an array given that the attribute
228
231
  # is documented as an array but the input is not
229
232
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -231,7 +234,7 @@ module OpenapiClient
231
234
  end
232
235
  elsif !attributes[self.class.attribute_map[key]].nil?
233
236
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
234
- end # or else data not found in attributes(hash), not an issue as the data can be optional
237
+ end
235
238
  end
236
239
 
237
240
  self
@@ -243,8 +246,8 @@ module OpenapiClient
243
246
  # @return [Object] Deserialized data
244
247
  def _deserialize(type, value)
245
248
  case type.to_sym
246
- when :DateTime
247
- DateTime.parse(value)
249
+ when :Time
250
+ Time.parse(value)
248
251
  when :Date
249
252
  Date.parse(value)
250
253
  when :String
@@ -323,5 +326,6 @@ module OpenapiClient
323
326
  value
324
327
  end
325
328
  end
329
+
326
330
  end
327
331
  end
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: autosde@il.ibm.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module OpenapiClient
16
17
  # ServiceResourceAttachment
@@ -134,7 +135,9 @@ module OpenapiClient
134
135
  def build_from_hash(attributes)
135
136
  return nil unless attributes.is_a?(Hash)
136
137
  self.class.openapi_types.each_pair do |key, type|
137
- if type =~ /\AArray<(.*)>/i
138
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
139
+ self.send("#{key}=", nil)
140
+ elsif type =~ /\AArray<(.*)>/i
138
141
  # check to ensure the input is an array given that the attribute
139
142
  # is documented as an array but the input is not
140
143
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -142,7 +145,7 @@ module OpenapiClient
142
145
  end
143
146
  elsif !attributes[self.class.attribute_map[key]].nil?
144
147
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
145
- end # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ end
146
149
  end
147
150
 
148
151
  self
@@ -154,8 +157,8 @@ module OpenapiClient
154
157
  # @return [Object] Deserialized data
155
158
  def _deserialize(type, value)
156
159
  case type.to_sym
157
- when :DateTime
158
- DateTime.parse(value)
160
+ when :Time
161
+ Time.parse(value)
159
162
  when :Date
160
163
  Date.parse(value)
161
164
  when :String
@@ -234,5 +237,6 @@ module OpenapiClient
234
237
  value
235
238
  end
236
239
  end
240
+
237
241
  end
238
242
  end
@@ -0,0 +1,290 @@
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-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OpenapiClient
17
+ # Define volume snapshot.
18
+ class Snapshot
19
+ # component_state
20
+ attr_accessor :component_state
21
+
22
+ # description
23
+ attr_accessor :description
24
+
25
+ # name
26
+ attr_accessor :name
27
+
28
+ # uuid
29
+ attr_accessor :uuid
30
+
31
+ attr_accessor :volume
32
+
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'component_state' => :'component_state',
59
+ :'description' => :'description',
60
+ :'name' => :'name',
61
+ :'uuid' => :'uuid',
62
+ :'volume' => :'volume'
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'component_state' => :'String',
70
+ :'description' => :'String',
71
+ :'name' => :'String',
72
+ :'uuid' => :'String',
73
+ :'volume' => :'Volume'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::Snapshot` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!self.class.attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Snapshot`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'component_state')
99
+ self.component_state = attributes[:'component_state']
100
+ end
101
+
102
+ if attributes.key?(:'description')
103
+ self.description = attributes[:'description']
104
+ end
105
+
106
+ if attributes.key?(:'name')
107
+ self.name = attributes[:'name']
108
+ end
109
+
110
+ if attributes.key?(:'uuid')
111
+ self.uuid = attributes[:'uuid']
112
+ end
113
+
114
+ if attributes.key?(:'volume')
115
+ self.volume = attributes[:'volume']
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ invalid_properties = Array.new
123
+ if !@component_state.nil? && @component_state.to_s.length > 32
124
+ invalid_properties.push('invalid value for "component_state", the character length must be smaller than or equal to 32.')
125
+ end
126
+
127
+ invalid_properties
128
+ end
129
+
130
+ # Check to see if the all the properties in the model are valid
131
+ # @return true if the model is valid
132
+ def valid?
133
+ component_state_validator = EnumAttributeValidator.new('String', ["PENDING_CREATION", "CREATED", "DELETED", "PENDING_DELETION", "MODIFICATION", "PENDING_MODIFICATION"])
134
+ return false unless component_state_validator.valid?(@component_state)
135
+ return false if !@component_state.nil? && @component_state.to_s.length > 32
136
+ true
137
+ end
138
+
139
+ # Custom attribute writer method checking allowed values (enum).
140
+ # @param [Object] component_state Object to be assigned
141
+ def component_state=(component_state)
142
+ validator = EnumAttributeValidator.new('String', ["PENDING_CREATION", "CREATED", "DELETED", "PENDING_DELETION", "MODIFICATION", "PENDING_MODIFICATION"])
143
+ unless validator.valid?(component_state)
144
+ fail ArgumentError, "invalid value for \"component_state\", must be one of #{validator.allowable_values}."
145
+ end
146
+ @component_state = component_state
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ component_state == o.component_state &&
155
+ description == o.description &&
156
+ name == o.name &&
157
+ uuid == o.uuid &&
158
+ volume == o.volume
159
+ end
160
+
161
+ # @see the `==` method
162
+ # @param [Object] Object to be compared
163
+ def eql?(o)
164
+ self == o
165
+ end
166
+
167
+ # Calculates hash code according to all attributes.
168
+ # @return [Integer] Hash code
169
+ def hash
170
+ [component_state, description, name, uuid, volume].hash
171
+ end
172
+
173
+ # Builds the object from hash
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ # @return [Object] Returns the model itself
176
+ def self.build_from_hash(attributes)
177
+ new.build_from_hash(attributes)
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def build_from_hash(attributes)
184
+ return nil unless attributes.is_a?(Hash)
185
+ self.class.openapi_types.each_pair do |key, type|
186
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
187
+ self.send("#{key}=", nil)
188
+ elsif type =~ /\AArray<(.*)>/i
189
+ # check to ensure the input is an array given that the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
192
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
193
+ end
194
+ elsif !attributes[self.class.attribute_map[key]].nil?
195
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
196
+ end
197
+ end
198
+
199
+ self
200
+ end
201
+
202
+ # Deserializes the data based on type
203
+ # @param string type Data type
204
+ # @param string value Value to be deserialized
205
+ # @return [Object] Deserialized data
206
+ def _deserialize(type, value)
207
+ case type.to_sym
208
+ when :Time
209
+ Time.parse(value)
210
+ when :Date
211
+ Date.parse(value)
212
+ when :String
213
+ value.to_s
214
+ when :Integer
215
+ value.to_i
216
+ when :Float
217
+ value.to_f
218
+ when :Boolean
219
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
220
+ true
221
+ else
222
+ false
223
+ end
224
+ when :Object
225
+ # generic object (usually a Hash), return directly
226
+ value
227
+ when /\AArray<(?<inner_type>.+)>\z/
228
+ inner_type = Regexp.last_match[:inner_type]
229
+ value.map { |v| _deserialize(inner_type, v) }
230
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
231
+ k_type = Regexp.last_match[:k_type]
232
+ v_type = Regexp.last_match[:v_type]
233
+ {}.tap do |hash|
234
+ value.each do |k, v|
235
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
236
+ end
237
+ end
238
+ else # model
239
+ OpenapiClient.const_get(type).build_from_hash(value)
240
+ end
241
+ end
242
+
243
+ # Returns the string representation of the object
244
+ # @return [String] String presentation of the object
245
+ def to_s
246
+ to_hash.to_s
247
+ end
248
+
249
+ # to_body is an alias to to_hash (backward compatibility)
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_body
252
+ to_hash
253
+ end
254
+
255
+ # Returns the object in the form of hash
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_hash
258
+ hash = {}
259
+ self.class.attribute_map.each_pair do |attr, param|
260
+ value = self.send(attr)
261
+ if value.nil?
262
+ is_nullable = self.class.openapi_nullable.include?(attr)
263
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
264
+ end
265
+
266
+ hash[param] = _to_hash(value)
267
+ end
268
+ hash
269
+ end
270
+
271
+ # Outputs non-array value in the form of hash
272
+ # For object, use to_hash. Otherwise, just return the value
273
+ # @param [Object] value Any valid value
274
+ # @return [Hash] Returns the value in the form of hash
275
+ def _to_hash(value)
276
+ if value.is_a?(Array)
277
+ value.compact.map { |v| _to_hash(v) }
278
+ elsif value.is_a?(Hash)
279
+ {}.tap do |hash|
280
+ value.each { |k, v| hash[k] = _to_hash(v) }
281
+ end
282
+ elsif value.respond_to? :to_hash
283
+ value.to_hash
284
+ else
285
+ value
286
+ end
287
+ end
288
+
289
+ end
290
+ end