autosde_openapi_client 1.0.0 → 1.0.21

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.
Files changed (223) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +143 -117
  3. data/autosde_openapi_client.gemspec +4 -5
  4. data/docs/AbstractCapability.md +11 -10
  5. data/docs/AbstractCapabilityApi.md +122 -50
  6. data/docs/Account.md +13 -12
  7. data/docs/AccountApi.md +155 -65
  8. data/docs/AccountPostRequest.md +11 -10
  9. data/docs/AccountPostResponse.md +15 -14
  10. data/docs/Address.md +23 -22
  11. data/docs/AddressApi.md +122 -50
  12. data/docs/AddressCreate.md +23 -22
  13. data/docs/AuthResponse.md +9 -8
  14. data/docs/Authentication.md +11 -10
  15. data/docs/AuthenticationApi.md +33 -16
  16. data/docs/AutoSDEProject.md +47 -46
  17. data/docs/AutoSDEProjectApi.md +122 -50
  18. data/docs/AutoSDERole.md +11 -10
  19. data/docs/AutoSDERoleApi.md +122 -50
  20. data/docs/CapabilityTranslation.md +27 -26
  21. data/docs/CapabilityTranslationApi.md +122 -50
  22. data/docs/CapabilityTranslationCreate.md +23 -22
  23. data/docs/Host.md +21 -20
  24. data/docs/HostApi.md +122 -50
  25. data/docs/HostCreate.md +31 -30
  26. data/docs/HostVolumeConnection.md +15 -14
  27. data/docs/HostVolumeConnectionApi.md +122 -50
  28. data/docs/HostVolumeConnectionCreate.md +13 -12
  29. data/docs/Job.md +30 -0
  30. data/docs/JobApi.md +140 -0
  31. data/docs/JobCreate.md +20 -0
  32. data/docs/NativeCapability.md +15 -14
  33. data/docs/NativeCapabilityApi.md +122 -50
  34. data/docs/Profile.md +17 -16
  35. data/docs/ProfileApi.md +122 -50
  36. data/docs/ProvisioningStrategy.md +11 -10
  37. data/docs/ProvisioningStrategyApi.md +122 -50
  38. data/docs/Service.md +27 -26
  39. data/docs/ServiceAbstractCapabilityValue.md +13 -12
  40. data/docs/ServiceApi.md +155 -65
  41. data/docs/ServiceCreate.md +25 -24
  42. data/docs/ServiceResourceAttachment.md +15 -14
  43. data/docs/ServiceResourceAttachmentApi.md +122 -50
  44. data/docs/Snapshot.md +26 -0
  45. data/docs/SnapshotApi.md +276 -0
  46. data/docs/SnapshotCreate.md +24 -0
  47. data/docs/StorageHost.md +30 -0
  48. data/docs/StorageHostApi.md +346 -0
  49. data/docs/StorageHostCreate.md +38 -0
  50. data/docs/StorageHostResponse.md +32 -0
  51. data/docs/StorageHostUpdate.md +22 -0
  52. data/docs/StorageHostVolumeMapping.md +26 -0
  53. data/docs/StorageHostVolumeMappingApi.md +276 -0
  54. data/docs/StorageHostVolumeMappingCreate.md +24 -0
  55. data/docs/StorageHostVolumeMappingResponse.md +26 -0
  56. data/docs/StorageResource.md +25 -24
  57. data/docs/StorageResourceApi.md +155 -65
  58. data/docs/StorageResourceCreate.md +23 -22
  59. data/docs/StorageResourceResponse.md +25 -24
  60. data/docs/StorageSystem.md +21 -20
  61. data/docs/StorageSystemApi.md +122 -50
  62. data/docs/StorageSystemCreate.md +41 -40
  63. data/docs/SystemType.md +17 -16
  64. data/docs/SystemTypeApi.md +122 -50
  65. data/docs/SystemTypeCreate.md +19 -18
  66. data/docs/Volume.md +25 -22
  67. data/docs/VolumeApi.md +155 -65
  68. data/docs/VolumeCreate.md +21 -18
  69. data/docs/VolumeResponse.md +25 -22
  70. data/docs/VolumeSafeDelete.md +13 -12
  71. data/docs/VolumeSafeDeleteApi.md +122 -50
  72. data/docs/VolumeSafeDeleteCreate.md +9 -8
  73. data/docs/VolumeUpdate.md +11 -8
  74. data/lib/autosde_openapi_client.rb +18 -3
  75. data/lib/autosde_openapi_client/api/abstract_capability_api.rb +20 -16
  76. data/lib/autosde_openapi_client/api/account_api.rb +26 -21
  77. data/lib/autosde_openapi_client/api/address_api.rb +20 -16
  78. data/lib/autosde_openapi_client/api/authentication_api.rb +6 -5
  79. data/lib/autosde_openapi_client/api/auto_sde_project_api.rb +20 -16
  80. data/lib/autosde_openapi_client/api/auto_sde_role_api.rb +20 -16
  81. data/lib/autosde_openapi_client/api/capability_translation_api.rb +20 -16
  82. data/lib/autosde_openapi_client/api/host_api.rb +20 -16
  83. data/lib/autosde_openapi_client/api/host_volume_connection_api.rb +20 -16
  84. data/lib/autosde_openapi_client/api/job_api.rb +136 -0
  85. data/lib/autosde_openapi_client/api/native_capability_api.rb +20 -16
  86. data/lib/autosde_openapi_client/api/profile_api.rb +20 -16
  87. data/lib/autosde_openapi_client/api/provisioning_strategy_api.rb +20 -16
  88. data/lib/autosde_openapi_client/api/service_api.rb +26 -21
  89. data/lib/autosde_openapi_client/api/service_resource_attachment_api.rb +20 -16
  90. data/lib/autosde_openapi_client/api/snapshot_api.rb +254 -0
  91. data/lib/autosde_openapi_client/api/storage_host_api.rb +321 -0
  92. data/lib/autosde_openapi_client/api/storage_host_volume_mapping_api.rb +254 -0
  93. data/lib/autosde_openapi_client/api/storage_resource_api.rb +26 -21
  94. data/lib/autosde_openapi_client/api/storage_system_api.rb +20 -16
  95. data/lib/autosde_openapi_client/api/system_type_api.rb +20 -16
  96. data/lib/autosde_openapi_client/api/volume_api.rb +26 -21
  97. data/lib/autosde_openapi_client/api/volume_safe_delete_api.rb +20 -16
  98. data/lib/autosde_openapi_client/api_client.rb +50 -48
  99. data/lib/autosde_openapi_client/api_error.rb +2 -2
  100. data/lib/autosde_openapi_client/configuration.rb +35 -8
  101. data/lib/autosde_openapi_client/models/abstract_capability.rb +22 -10
  102. data/lib/autosde_openapi_client/models/account.rb +22 -10
  103. data/lib/autosde_openapi_client/models/account_post_request.rb +22 -10
  104. data/lib/autosde_openapi_client/models/account_post_response.rb +22 -10
  105. data/lib/autosde_openapi_client/models/address.rb +22 -10
  106. data/lib/autosde_openapi_client/models/address_create.rb +22 -10
  107. data/lib/autosde_openapi_client/models/auth_response.rb +22 -10
  108. data/lib/autosde_openapi_client/models/authentication.rb +22 -10
  109. data/lib/autosde_openapi_client/models/auto_sde_project.rb +22 -10
  110. data/lib/autosde_openapi_client/models/auto_sde_role.rb +22 -10
  111. data/lib/autosde_openapi_client/models/capability_translation.rb +22 -10
  112. data/lib/autosde_openapi_client/models/capability_translation_create.rb +22 -10
  113. data/lib/autosde_openapi_client/models/host.rb +22 -10
  114. data/lib/autosde_openapi_client/models/host_create.rb +22 -10
  115. data/lib/autosde_openapi_client/models/host_volume_connection.rb +22 -10
  116. data/lib/autosde_openapi_client/models/host_volume_connection_create.rb +22 -10
  117. data/lib/autosde_openapi_client/models/job.rb +280 -0
  118. data/lib/autosde_openapi_client/models/job_create.rb +230 -0
  119. data/lib/autosde_openapi_client/models/native_capability.rb +22 -10
  120. data/lib/autosde_openapi_client/models/profile.rb +22 -10
  121. data/lib/autosde_openapi_client/models/provisioning_strategy.rb +22 -10
  122. data/lib/autosde_openapi_client/models/service.rb +22 -10
  123. data/lib/autosde_openapi_client/models/service_abstract_capability_value.rb +22 -10
  124. data/lib/autosde_openapi_client/models/service_create.rb +22 -10
  125. data/lib/autosde_openapi_client/models/service_resource_attachment.rb +22 -10
  126. data/lib/autosde_openapi_client/models/snapshot.rb +298 -0
  127. data/lib/autosde_openapi_client/models/snapshot_create.rb +288 -0
  128. data/lib/autosde_openapi_client/models/storage_host.rb +317 -0
  129. data/lib/autosde_openapi_client/models/storage_host_create.rb +368 -0
  130. data/lib/autosde_openapi_client/models/storage_host_response.rb +333 -0
  131. data/lib/autosde_openapi_client/models/storage_host_update.rb +301 -0
  132. data/lib/autosde_openapi_client/models/storage_host_volume_mapping.rb +299 -0
  133. data/lib/autosde_openapi_client/models/storage_host_volume_mapping_create.rb +291 -0
  134. data/lib/autosde_openapi_client/models/storage_host_volume_mapping_response.rb +301 -0
  135. data/lib/autosde_openapi_client/models/storage_resource.rb +22 -10
  136. data/lib/autosde_openapi_client/models/storage_resource_create.rb +22 -10
  137. data/lib/autosde_openapi_client/models/storage_resource_response.rb +22 -10
  138. data/lib/autosde_openapi_client/models/storage_system.rb +22 -10
  139. data/lib/autosde_openapi_client/models/storage_system_create.rb +22 -10
  140. data/lib/autosde_openapi_client/models/system_type.rb +22 -10
  141. data/lib/autosde_openapi_client/models/system_type_create.rb +22 -10
  142. data/lib/autosde_openapi_client/models/volume.rb +33 -11
  143. data/lib/autosde_openapi_client/models/volume_create.rb +33 -11
  144. data/lib/autosde_openapi_client/models/volume_response.rb +33 -11
  145. data/lib/autosde_openapi_client/models/volume_safe_delete.rb +22 -10
  146. data/lib/autosde_openapi_client/models/volume_safe_delete_create.rb +22 -10
  147. data/lib/autosde_openapi_client/models/volume_update.rb +35 -11
  148. data/lib/autosde_openapi_client/version.rb +4 -4
  149. data/spec/api/abstract_capability_api_spec.rb +2 -2
  150. data/spec/api/account_api_spec.rb +3 -3
  151. data/spec/api/address_api_spec.rb +2 -2
  152. data/spec/api/authentication_api_spec.rb +1 -1
  153. data/spec/api/auto_sde_project_api_spec.rb +2 -2
  154. data/spec/api/auto_sde_role_api_spec.rb +2 -2
  155. data/spec/api/capability_translation_api_spec.rb +2 -2
  156. data/spec/api/host_api_spec.rb +2 -2
  157. data/spec/api/host_volume_connection_api_spec.rb +2 -2
  158. data/spec/api/job_api_spec.rb +54 -0
  159. data/spec/api/native_capability_api_spec.rb +2 -2
  160. data/spec/api/profile_api_spec.rb +2 -2
  161. data/spec/api/provisioning_strategy_api_spec.rb +2 -2
  162. data/spec/api/service_api_spec.rb +3 -3
  163. data/spec/api/service_resource_attachment_api_spec.rb +2 -2
  164. data/spec/api/snapshot_api_spec.rb +74 -0
  165. data/spec/api/storage_host_api_spec.rb +85 -0
  166. data/spec/api/storage_host_volume_mapping_api_spec.rb +74 -0
  167. data/spec/api/storage_resource_api_spec.rb +3 -3
  168. data/spec/api/storage_system_api_spec.rb +2 -2
  169. data/spec/api/system_type_api_spec.rb +2 -2
  170. data/spec/api/volume_api_spec.rb +3 -3
  171. data/spec/api/volume_safe_delete_api_spec.rb +2 -2
  172. data/spec/api_client_spec.rb +30 -30
  173. data/spec/configuration_spec.rb +4 -4
  174. data/spec/models/abstract_capability_spec.rb +4 -11
  175. data/spec/models/account_post_request_spec.rb +4 -11
  176. data/spec/models/account_post_response_spec.rb +4 -11
  177. data/spec/models/account_spec.rb +4 -11
  178. data/spec/models/address_create_spec.rb +6 -13
  179. data/spec/models/address_spec.rb +6 -13
  180. data/spec/models/auth_response_spec.rb +4 -11
  181. data/spec/models/authentication_spec.rb +4 -11
  182. data/spec/models/auto_sde_project_spec.rb +4 -11
  183. data/spec/models/auto_sde_role_spec.rb +4 -11
  184. data/spec/models/capability_translation_create_spec.rb +4 -11
  185. data/spec/models/capability_translation_spec.rb +4 -11
  186. data/spec/models/host_create_spec.rb +7 -14
  187. data/spec/models/host_spec.rb +6 -13
  188. data/spec/models/host_volume_connection_create_spec.rb +5 -12
  189. data/spec/models/host_volume_connection_spec.rb +5 -12
  190. data/spec/models/job_create_spec.rb +40 -0
  191. data/spec/models/job_spec.rb +70 -0
  192. data/spec/models/native_capability_spec.rb +4 -11
  193. data/spec/models/profile_spec.rb +5 -12
  194. data/spec/models/provisioning_strategy_spec.rb +5 -12
  195. data/spec/models/service_abstract_capability_value_spec.rb +4 -11
  196. data/spec/models/service_create_spec.rb +5 -12
  197. data/spec/models/service_resource_attachment_spec.rb +4 -11
  198. data/spec/models/service_spec.rb +5 -12
  199. data/spec/models/snapshot_create_spec.rb +56 -0
  200. data/spec/models/snapshot_spec.rb +62 -0
  201. data/spec/models/storage_host_create_spec.rb +102 -0
  202. data/spec/models/storage_host_response_spec.rb +80 -0
  203. data/spec/models/storage_host_spec.rb +74 -0
  204. data/spec/models/storage_host_update_spec.rb +54 -0
  205. data/spec/models/storage_host_volume_mapping_create_spec.rb +56 -0
  206. data/spec/models/storage_host_volume_mapping_response_spec.rb +62 -0
  207. data/spec/models/storage_host_volume_mapping_spec.rb +62 -0
  208. data/spec/models/storage_resource_create_spec.rb +6 -13
  209. data/spec/models/storage_resource_response_spec.rb +6 -13
  210. data/spec/models/storage_resource_spec.rb +6 -13
  211. data/spec/models/storage_system_create_spec.rb +7 -14
  212. data/spec/models/storage_system_spec.rb +6 -13
  213. data/spec/models/system_type_create_spec.rb +6 -13
  214. data/spec/models/system_type_spec.rb +6 -13
  215. data/spec/models/volume_create_spec.rb +11 -12
  216. data/spec/models/volume_response_spec.rb +11 -12
  217. data/spec/models/volume_safe_delete_create_spec.rb +4 -11
  218. data/spec/models/volume_safe_delete_spec.rb +4 -11
  219. data/spec/models/volume_spec.rb +11 -12
  220. data/spec/models/volume_update_spec.rb +10 -11
  221. data/spec/spec_helper.rb +1 -1
  222. metadata +112 -72
  223. data/site_manager_oas.json +0 -3992
@@ -6,13 +6,14 @@
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
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
- module OpenapiClient
16
+ module AutosdeOpenapiClient
16
17
  # Use to define the storage system type.
17
18
  class SystemType
18
19
  # component_state
@@ -63,6 +64,11 @@ module OpenapiClient
63
64
  }
64
65
  end
65
66
 
67
+ # Returns all the JSON keys this model knows about
68
+ def self.acceptable_attributes
69
+ attribute_map.values
70
+ end
71
+
66
72
  # Attribute type mapping.
67
73
  def self.openapi_types
68
74
  {
@@ -84,13 +90,13 @@ module OpenapiClient
84
90
  # @param [Hash] attributes Model attributes in the form of hash
85
91
  def initialize(attributes = {})
86
92
  if (!attributes.is_a?(Hash))
87
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::SystemType` initialize method"
93
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AutosdeOpenapiClient::SystemType` initialize method"
88
94
  end
89
95
 
90
96
  # check to see if the attribute exists and convert string to symbol for hash key
91
97
  attributes = attributes.each_with_object({}) { |(k, v), h|
92
98
  if (!self.class.attribute_map.key?(k.to_sym))
93
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::SystemType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AutosdeOpenapiClient::SystemType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
94
100
  end
95
101
  h[k.to_sym] = v
96
102
  }
@@ -217,7 +223,9 @@ module OpenapiClient
217
223
  def build_from_hash(attributes)
218
224
  return nil unless attributes.is_a?(Hash)
219
225
  self.class.openapi_types.each_pair do |key, type|
220
- if type =~ /\AArray<(.*)>/i
226
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
227
+ self.send("#{key}=", nil)
228
+ elsif type =~ /\AArray<(.*)>/i
221
229
  # check to ensure the input is an array given that the attribute
222
230
  # is documented as an array but the input is not
223
231
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -225,7 +233,7 @@ module OpenapiClient
225
233
  end
226
234
  elsif !attributes[self.class.attribute_map[key]].nil?
227
235
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
228
- end # or else data not found in attributes(hash), not an issue as the data can be optional
236
+ end
229
237
  end
230
238
 
231
239
  self
@@ -237,8 +245,8 @@ module OpenapiClient
237
245
  # @return [Object] Deserialized data
238
246
  def _deserialize(type, value)
239
247
  case type.to_sym
240
- when :DateTime
241
- DateTime.parse(value)
248
+ when :Time
249
+ Time.parse(value)
242
250
  when :Date
243
251
  Date.parse(value)
244
252
  when :String
@@ -268,7 +276,9 @@ module OpenapiClient
268
276
  end
269
277
  end
270
278
  else # model
271
- OpenapiClient.const_get(type).build_from_hash(value)
279
+ # models (e.g. Pet) or oneOf
280
+ klass = AutosdeOpenapiClient.const_get(type)
281
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
272
282
  end
273
283
  end
274
284
 
@@ -294,7 +304,7 @@ module OpenapiClient
294
304
  is_nullable = self.class.openapi_nullable.include?(attr)
295
305
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
296
306
  end
297
-
307
+
298
308
  hash[param] = _to_hash(value)
299
309
  end
300
310
  hash
@@ -317,5 +327,7 @@ module OpenapiClient
317
327
  value
318
328
  end
319
329
  end
330
+
320
331
  end
332
+
321
333
  end
@@ -6,13 +6,14 @@
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
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
- module OpenapiClient
16
+ module AutosdeOpenapiClient
16
17
  # TODO add description
17
18
  class SystemTypeCreate
18
19
  # component_state
@@ -67,6 +68,11 @@ module OpenapiClient
67
68
  }
68
69
  end
69
70
 
71
+ # Returns all the JSON keys this model knows about
72
+ def self.acceptable_attributes
73
+ attribute_map.values
74
+ end
75
+
70
76
  # Attribute type mapping.
71
77
  def self.openapi_types
72
78
  {
@@ -89,13 +95,13 @@ module OpenapiClient
89
95
  # @param [Hash] attributes Model attributes in the form of hash
90
96
  def initialize(attributes = {})
91
97
  if (!attributes.is_a?(Hash))
92
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::SystemTypeCreate` initialize method"
98
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AutosdeOpenapiClient::SystemTypeCreate` initialize method"
93
99
  end
94
100
 
95
101
  # check to see if the attribute exists and convert string to symbol for hash key
96
102
  attributes = attributes.each_with_object({}) { |(k, v), h|
97
103
  if (!self.class.attribute_map.key?(k.to_sym))
98
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::SystemTypeCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
104
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AutosdeOpenapiClient::SystemTypeCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
99
105
  end
100
106
  h[k.to_sym] = v
101
107
  }
@@ -229,7 +235,9 @@ module OpenapiClient
229
235
  def build_from_hash(attributes)
230
236
  return nil unless attributes.is_a?(Hash)
231
237
  self.class.openapi_types.each_pair do |key, type|
232
- if type =~ /\AArray<(.*)>/i
238
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
239
+ self.send("#{key}=", nil)
240
+ elsif type =~ /\AArray<(.*)>/i
233
241
  # check to ensure the input is an array given that the attribute
234
242
  # is documented as an array but the input is not
235
243
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -237,7 +245,7 @@ module OpenapiClient
237
245
  end
238
246
  elsif !attributes[self.class.attribute_map[key]].nil?
239
247
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
240
- end # or else data not found in attributes(hash), not an issue as the data can be optional
248
+ end
241
249
  end
242
250
 
243
251
  self
@@ -249,8 +257,8 @@ module OpenapiClient
249
257
  # @return [Object] Deserialized data
250
258
  def _deserialize(type, value)
251
259
  case type.to_sym
252
- when :DateTime
253
- DateTime.parse(value)
260
+ when :Time
261
+ Time.parse(value)
254
262
  when :Date
255
263
  Date.parse(value)
256
264
  when :String
@@ -280,7 +288,9 @@ module OpenapiClient
280
288
  end
281
289
  end
282
290
  else # model
283
- OpenapiClient.const_get(type).build_from_hash(value)
291
+ # models (e.g. Pet) or oneOf
292
+ klass = AutosdeOpenapiClient.const_get(type)
293
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
284
294
  end
285
295
  end
286
296
 
@@ -306,7 +316,7 @@ module OpenapiClient
306
316
  is_nullable = self.class.openapi_nullable.include?(attr)
307
317
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
308
318
  end
309
-
319
+
310
320
  hash[param] = _to_hash(value)
311
321
  end
312
322
  hash
@@ -329,5 +339,7 @@ module OpenapiClient
329
339
  value
330
340
  end
331
341
  end
342
+
332
343
  end
344
+
333
345
  end
@@ -6,13 +6,14 @@
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
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
- module OpenapiClient
16
+ module AutosdeOpenapiClient
16
17
  # Define volume properties on a specific storage resource.
17
18
  class Volume
18
19
  # compliant
@@ -33,6 +34,9 @@ module OpenapiClient
33
34
 
34
35
  attr_accessor :storage_resource
35
36
 
37
+ # unmapped_since
38
+ attr_accessor :unmapped_since
39
+
36
40
  # uuid
37
41
  attr_accessor :uuid
38
42
 
@@ -68,10 +72,16 @@ module OpenapiClient
68
72
  :'service' => :'service',
69
73
  :'size' => :'size',
70
74
  :'storage_resource' => :'storage_resource',
75
+ :'unmapped_since' => :'unmapped_since',
71
76
  :'uuid' => :'uuid'
72
77
  }
73
78
  end
74
79
 
80
+ # Returns all the JSON keys this model knows about
81
+ def self.acceptable_attributes
82
+ attribute_map.values
83
+ end
84
+
75
85
  # Attribute type mapping.
76
86
  def self.openapi_types
77
87
  {
@@ -82,6 +92,7 @@ module OpenapiClient
82
92
  :'service' => :'Service',
83
93
  :'size' => :'Integer',
84
94
  :'storage_resource' => :'StorageResource',
95
+ :'unmapped_since' => :'Time',
85
96
  :'uuid' => :'String'
86
97
  }
87
98
  end
@@ -96,13 +107,13 @@ module OpenapiClient
96
107
  # @param [Hash] attributes Model attributes in the form of hash
97
108
  def initialize(attributes = {})
98
109
  if (!attributes.is_a?(Hash))
99
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::Volume` initialize method"
110
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AutosdeOpenapiClient::Volume` initialize method"
100
111
  end
101
112
 
102
113
  # check to see if the attribute exists and convert string to symbol for hash key
103
114
  attributes = attributes.each_with_object({}) { |(k, v), h|
104
115
  if (!self.class.attribute_map.key?(k.to_sym))
105
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Volume`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
116
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AutosdeOpenapiClient::Volume`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
106
117
  end
107
118
  h[k.to_sym] = v
108
119
  }
@@ -137,6 +148,10 @@ module OpenapiClient
137
148
  self.storage_resource = attributes[:'storage_resource']
138
149
  end
139
150
 
151
+ if attributes.key?(:'unmapped_since')
152
+ self.unmapped_since = attributes[:'unmapped_since']
153
+ end
154
+
140
155
  if attributes.key?(:'uuid')
141
156
  self.uuid = attributes[:'uuid']
142
157
  end
@@ -184,6 +199,7 @@ module OpenapiClient
184
199
  service == o.service &&
185
200
  size == o.size &&
186
201
  storage_resource == o.storage_resource &&
202
+ unmapped_since == o.unmapped_since &&
187
203
  uuid == o.uuid
188
204
  end
189
205
 
@@ -196,7 +212,7 @@ module OpenapiClient
196
212
  # Calculates hash code according to all attributes.
197
213
  # @return [Integer] Hash code
198
214
  def hash
199
- [compliant, component_state, historical_service, name, service, size, storage_resource, uuid].hash
215
+ [compliant, component_state, historical_service, name, service, size, storage_resource, unmapped_since, uuid].hash
200
216
  end
201
217
 
202
218
  # Builds the object from hash
@@ -212,7 +228,9 @@ module OpenapiClient
212
228
  def build_from_hash(attributes)
213
229
  return nil unless attributes.is_a?(Hash)
214
230
  self.class.openapi_types.each_pair do |key, type|
215
- if type =~ /\AArray<(.*)>/i
231
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
232
+ self.send("#{key}=", nil)
233
+ elsif type =~ /\AArray<(.*)>/i
216
234
  # check to ensure the input is an array given that the attribute
217
235
  # is documented as an array but the input is not
218
236
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -220,7 +238,7 @@ module OpenapiClient
220
238
  end
221
239
  elsif !attributes[self.class.attribute_map[key]].nil?
222
240
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
223
- end # or else data not found in attributes(hash), not an issue as the data can be optional
241
+ end
224
242
  end
225
243
 
226
244
  self
@@ -232,8 +250,8 @@ module OpenapiClient
232
250
  # @return [Object] Deserialized data
233
251
  def _deserialize(type, value)
234
252
  case type.to_sym
235
- when :DateTime
236
- DateTime.parse(value)
253
+ when :Time
254
+ Time.parse(value)
237
255
  when :Date
238
256
  Date.parse(value)
239
257
  when :String
@@ -263,7 +281,9 @@ module OpenapiClient
263
281
  end
264
282
  end
265
283
  else # model
266
- OpenapiClient.const_get(type).build_from_hash(value)
284
+ # models (e.g. Pet) or oneOf
285
+ klass = AutosdeOpenapiClient.const_get(type)
286
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
267
287
  end
268
288
  end
269
289
 
@@ -289,7 +309,7 @@ module OpenapiClient
289
309
  is_nullable = self.class.openapi_nullable.include?(attr)
290
310
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
291
311
  end
292
-
312
+
293
313
  hash[param] = _to_hash(value)
294
314
  end
295
315
  hash
@@ -312,5 +332,7 @@ module OpenapiClient
312
332
  value
313
333
  end
314
334
  end
335
+
315
336
  end
337
+
316
338
  end
@@ -6,13 +6,14 @@
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
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
- module OpenapiClient
16
+ module AutosdeOpenapiClient
16
17
  # TODO add description
17
18
  class VolumeCreate
18
19
  # compliant
@@ -30,6 +31,9 @@ module OpenapiClient
30
31
  # size
31
32
  attr_accessor :size
32
33
 
34
+ # unmapped_since
35
+ attr_accessor :unmapped_since
36
+
33
37
  # uuid
34
38
  attr_accessor :uuid
35
39
 
@@ -63,10 +67,16 @@ module OpenapiClient
63
67
  :'name' => :'name',
64
68
  :'service' => :'service',
65
69
  :'size' => :'size',
70
+ :'unmapped_since' => :'unmapped_since',
66
71
  :'uuid' => :'uuid'
67
72
  }
68
73
  end
69
74
 
75
+ # Returns all the JSON keys this model knows about
76
+ def self.acceptable_attributes
77
+ attribute_map.values
78
+ end
79
+
70
80
  # Attribute type mapping.
71
81
  def self.openapi_types
72
82
  {
@@ -75,6 +85,7 @@ module OpenapiClient
75
85
  :'name' => :'String',
76
86
  :'service' => :'String',
77
87
  :'size' => :'Integer',
88
+ :'unmapped_since' => :'Time',
78
89
  :'uuid' => :'String'
79
90
  }
80
91
  end
@@ -89,13 +100,13 @@ module OpenapiClient
89
100
  # @param [Hash] attributes Model attributes in the form of hash
90
101
  def initialize(attributes = {})
91
102
  if (!attributes.is_a?(Hash))
92
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::VolumeCreate` initialize method"
103
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AutosdeOpenapiClient::VolumeCreate` initialize method"
93
104
  end
94
105
 
95
106
  # check to see if the attribute exists and convert string to symbol for hash key
96
107
  attributes = attributes.each_with_object({}) { |(k, v), h|
97
108
  if (!self.class.attribute_map.key?(k.to_sym))
98
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::VolumeCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
109
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AutosdeOpenapiClient::VolumeCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
99
110
  end
100
111
  h[k.to_sym] = v
101
112
  }
@@ -122,6 +133,10 @@ module OpenapiClient
122
133
  self.size = attributes[:'size']
123
134
  end
124
135
 
136
+ if attributes.key?(:'unmapped_since')
137
+ self.unmapped_since = attributes[:'unmapped_since']
138
+ end
139
+
125
140
  if attributes.key?(:'uuid')
126
141
  self.uuid = attributes[:'uuid']
127
142
  end
@@ -167,6 +182,7 @@ module OpenapiClient
167
182
  name == o.name &&
168
183
  service == o.service &&
169
184
  size == o.size &&
185
+ unmapped_since == o.unmapped_since &&
170
186
  uuid == o.uuid
171
187
  end
172
188
 
@@ -179,7 +195,7 @@ module OpenapiClient
179
195
  # Calculates hash code according to all attributes.
180
196
  # @return [Integer] Hash code
181
197
  def hash
182
- [compliant, component_state, name, service, size, uuid].hash
198
+ [compliant, component_state, name, service, size, unmapped_since, uuid].hash
183
199
  end
184
200
 
185
201
  # Builds the object from hash
@@ -195,7 +211,9 @@ module OpenapiClient
195
211
  def build_from_hash(attributes)
196
212
  return nil unless attributes.is_a?(Hash)
197
213
  self.class.openapi_types.each_pair do |key, type|
198
- if type =~ /\AArray<(.*)>/i
214
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
215
+ self.send("#{key}=", nil)
216
+ elsif type =~ /\AArray<(.*)>/i
199
217
  # check to ensure the input is an array given that the attribute
200
218
  # is documented as an array but the input is not
201
219
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -203,7 +221,7 @@ module OpenapiClient
203
221
  end
204
222
  elsif !attributes[self.class.attribute_map[key]].nil?
205
223
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
206
- end # or else data not found in attributes(hash), not an issue as the data can be optional
224
+ end
207
225
  end
208
226
 
209
227
  self
@@ -215,8 +233,8 @@ module OpenapiClient
215
233
  # @return [Object] Deserialized data
216
234
  def _deserialize(type, value)
217
235
  case type.to_sym
218
- when :DateTime
219
- DateTime.parse(value)
236
+ when :Time
237
+ Time.parse(value)
220
238
  when :Date
221
239
  Date.parse(value)
222
240
  when :String
@@ -246,7 +264,9 @@ module OpenapiClient
246
264
  end
247
265
  end
248
266
  else # model
249
- OpenapiClient.const_get(type).build_from_hash(value)
267
+ # models (e.g. Pet) or oneOf
268
+ klass = AutosdeOpenapiClient.const_get(type)
269
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
250
270
  end
251
271
  end
252
272
 
@@ -272,7 +292,7 @@ module OpenapiClient
272
292
  is_nullable = self.class.openapi_nullable.include?(attr)
273
293
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
274
294
  end
275
-
295
+
276
296
  hash[param] = _to_hash(value)
277
297
  end
278
298
  hash
@@ -295,5 +315,7 @@ module OpenapiClient
295
315
  value
296
316
  end
297
317
  end
318
+
298
319
  end
320
+
299
321
  end