ibm_cloud_power 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (330) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +255 -0
  4. data/Rakefile +10 -0
  5. data/docs/CloneTaskReference.md +19 -0
  6. data/docs/CloneTaskStatus.md +23 -0
  7. data/docs/ClonedVolume.md +19 -0
  8. data/docs/ClonedVolumeDetail.md +19 -0
  9. data/docs/CloudInstance.md +37 -0
  10. data/docs/CloudInstanceCreate.md +29 -0
  11. data/docs/CloudInstanceReference.md +31 -0
  12. data/docs/CloudInstanceUpdate.md +25 -0
  13. data/docs/CloudInstanceUsageLimits.md +37 -0
  14. data/docs/CreateDataVolume.md +29 -0
  15. data/docs/CreateImage.md +37 -0
  16. data/docs/Error.md +19 -0
  17. data/docs/Event.md +33 -0
  18. data/docs/EventUser.md +21 -0
  19. data/docs/Events.md +17 -0
  20. data/docs/ExportImage.md +23 -0
  21. data/docs/IPAddressRange.md +19 -0
  22. data/docs/Image.md +39 -0
  23. data/docs/ImageReference.md +33 -0
  24. data/docs/ImageSpecifications.md +29 -0
  25. data/docs/ImageVolume.md +23 -0
  26. data/docs/Images.md +17 -0
  27. data/docs/MinMaxDefault.md +21 -0
  28. data/docs/MultiVolumesCreate.md +29 -0
  29. data/docs/Network.md +37 -0
  30. data/docs/NetworkCreate.md +29 -0
  31. data/docs/NetworkIpAddressMetrics.md +23 -0
  32. data/docs/NetworkPort.md +29 -0
  33. data/docs/NetworkPortCreate.md +19 -0
  34. data/docs/NetworkPortPvmInstance.md +19 -0
  35. data/docs/NetworkPortUpdate.md +19 -0
  36. data/docs/NetworkPorts.md +17 -0
  37. data/docs/NetworkReference.md +27 -0
  38. data/docs/NetworkUpdate.md +23 -0
  39. data/docs/Networks.md +17 -0
  40. data/docs/Operations.md +21 -0
  41. data/docs/PCloudEventsApi.md +114 -0
  42. data/docs/PCloudImagesApi.md +342 -0
  43. data/docs/PCloudInstancesApi.md +148 -0
  44. data/docs/PCloudNetworksApi.md +504 -0
  45. data/docs/PCloudPVMInstancesApi.md +809 -0
  46. data/docs/PCloudSAPApi.md +150 -0
  47. data/docs/PCloudSnapshotsApi.md +200 -0
  48. data/docs/PCloudSystemPoolsApi.md +54 -0
  49. data/docs/PCloudTasksApi.md +100 -0
  50. data/docs/PCloudTenantsApi.md +102 -0
  51. data/docs/PCloudTenantsSSHKeysApi.md +248 -0
  52. data/docs/PCloudVolumesApi.md +746 -0
  53. data/docs/PVMInstance.md +77 -0
  54. data/docs/PVMInstanceAction.md +17 -0
  55. data/docs/PVMInstanceAddNetwork.md +19 -0
  56. data/docs/PVMInstanceCapture.md +29 -0
  57. data/docs/PVMInstanceClone.md +31 -0
  58. data/docs/PVMInstanceConsole.md +17 -0
  59. data/docs/PVMInstanceCreate.md +53 -0
  60. data/docs/PVMInstanceFault.md +23 -0
  61. data/docs/PVMInstanceHealth.md +21 -0
  62. data/docs/PVMInstanceMultiCreate.md +21 -0
  63. data/docs/PVMInstanceNetwork.md +33 -0
  64. data/docs/PVMInstanceNetworks.md +17 -0
  65. data/docs/PVMInstanceOperation.md +19 -0
  66. data/docs/PVMInstanceReference.md +71 -0
  67. data/docs/PVMInstanceRemoveNetwork.md +17 -0
  68. data/docs/PVMInstanceUpdate.md +33 -0
  69. data/docs/PVMInstanceUpdateResponse.md +27 -0
  70. data/docs/PVMInstanceVolumeUpdate.md +17 -0
  71. data/docs/PVMInstances.md +17 -0
  72. data/docs/PeeringNetwork.md +21 -0
  73. data/docs/PinPolicy.md +16 -0
  74. data/docs/SAPCreate.md +33 -0
  75. data/docs/SAPProfile.md +25 -0
  76. data/docs/SAPProfileReference.md +19 -0
  77. data/docs/SAPProfiles.md +17 -0
  78. data/docs/SRC.md +19 -0
  79. data/docs/SSHKey.md +21 -0
  80. data/docs/SSHKeys.md +17 -0
  81. data/docs/Snapshot.md +35 -0
  82. data/docs/SnapshotCreate.md +21 -0
  83. data/docs/SnapshotCreateResponse.md +17 -0
  84. data/docs/SnapshotRestore.md +17 -0
  85. data/docs/SnapshotUpdate.md +19 -0
  86. data/docs/Snapshots.md +17 -0
  87. data/docs/SoftwareLicenses.md +25 -0
  88. data/docs/StockImage.md +21 -0
  89. data/docs/System.md +21 -0
  90. data/docs/SystemPool.md +31 -0
  91. data/docs/Task.md +33 -0
  92. data/docs/TaskReference.md +19 -0
  93. data/docs/Tenant.md +29 -0
  94. data/docs/TenantUpdate.md +19 -0
  95. data/docs/UpdateVolume.md +23 -0
  96. data/docs/VirtualCores.md +21 -0
  97. data/docs/Volume.md +41 -0
  98. data/docs/VolumeInfo.md +19 -0
  99. data/docs/VolumeReference.md +43 -0
  100. data/docs/Volumes.md +17 -0
  101. data/docs/VolumesClone.md +31 -0
  102. data/docs/VolumesCloneAsyncRequest.md +19 -0
  103. data/docs/VolumesCloneCancel.md +17 -0
  104. data/docs/VolumesCloneCreate.md +19 -0
  105. data/docs/VolumesCloneDetail.md +33 -0
  106. data/docs/VolumesCloneExecute.md +19 -0
  107. data/docs/VolumesCloneRequest.md +19 -0
  108. data/docs/VolumesCloneResponse.md +17 -0
  109. data/docs/VolumesClones.md +17 -0
  110. data/git_push.sh +58 -0
  111. data/ibm_cloud_power.gemspec +38 -0
  112. data/lib/ibm_cloud_power.rb +144 -0
  113. data/lib/ibm_cloud_power/api/p_cloud_events_api.rb +163 -0
  114. data/lib/ibm_cloud_power/api/p_cloud_images_api.rb +473 -0
  115. data/lib/ibm_cloud_power/api/p_cloud_instances_api.rb +210 -0
  116. data/lib/ibm_cloud_power/api/p_cloud_networks_api.rb +719 -0
  117. data/lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb +1166 -0
  118. data/lib/ibm_cloud_power/api/p_cloud_sap_api.rb +216 -0
  119. data/lib/ibm_cloud_power/api/p_cloud_snapshots_api.rb +288 -0
  120. data/lib/ibm_cloud_power/api/p_cloud_system_pools_api.rb +82 -0
  121. data/lib/ibm_cloud_power/api/p_cloud_tasks_api.rb +142 -0
  122. data/lib/ibm_cloud_power/api/p_cloud_tenants_api.rb +150 -0
  123. data/lib/ibm_cloud_power/api/p_cloud_tenants_ssh_keys_api.rb +356 -0
  124. data/lib/ibm_cloud_power/api/p_cloud_volumes_api.rb +1065 -0
  125. data/lib/ibm_cloud_power/api_client.rb +387 -0
  126. data/lib/ibm_cloud_power/api_error.rb +57 -0
  127. data/lib/ibm_cloud_power/configuration.rb +241 -0
  128. data/lib/ibm_cloud_power/models/clone_task_reference.rb +229 -0
  129. data/lib/ibm_cloud_power/models/clone_task_status.rb +285 -0
  130. data/lib/ibm_cloud_power/models/cloned_volume.rb +219 -0
  131. data/lib/ibm_cloud_power/models/cloned_volume_detail.rb +227 -0
  132. data/lib/ibm_cloud_power/models/cloud_instance.rb +361 -0
  133. data/lib/ibm_cloud_power/models/cloud_instance_create.rb +294 -0
  134. data/lib/ibm_cloud_power/models/cloud_instance_reference.rb +315 -0
  135. data/lib/ibm_cloud_power/models/cloud_instance_update.rb +249 -0
  136. data/lib/ibm_cloud_power/models/cloud_instance_usage_limits.rb +334 -0
  137. data/lib/ibm_cloud_power/models/create_data_volume.rb +313 -0
  138. data/lib/ibm_cloud_power/models/create_image.rb +360 -0
  139. data/lib/ibm_cloud_power/models/error.rb +217 -0
  140. data/lib/ibm_cloud_power/models/event.rb +357 -0
  141. data/lib/ibm_cloud_power/models/event_user.rb +234 -0
  142. data/lib/ibm_cloud_power/models/events.rb +216 -0
  143. data/lib/ibm_cloud_power/models/export_image.rb +249 -0
  144. data/lib/ibm_cloud_power/models/image.rb +351 -0
  145. data/lib/ibm_cloud_power/models/image_reference.rb +333 -0
  146. data/lib/ibm_cloud_power/models/image_specifications.rb +269 -0
  147. data/lib/ibm_cloud_power/models/image_volume.rb +259 -0
  148. data/lib/ibm_cloud_power/models/images.rb +216 -0
  149. data/lib/ibm_cloud_power/models/ip_address_range.rb +229 -0
  150. data/lib/ibm_cloud_power/models/min_max_default.rb +244 -0
  151. data/lib/ibm_cloud_power/models/multi_volumes_create.rb +313 -0
  152. data/lib/ibm_cloud_power/models/network.rb +395 -0
  153. data/lib/ibm_cloud_power/models/network_create.rb +314 -0
  154. data/lib/ibm_cloud_power/models/network_ip_address_metrics.rb +260 -0
  155. data/lib/ibm_cloud_power/models/network_port.rb +293 -0
  156. data/lib/ibm_cloud_power/models/network_port_create.rb +219 -0
  157. data/lib/ibm_cloud_power/models/network_port_pvm_instance.rb +220 -0
  158. data/lib/ibm_cloud_power/models/network_port_update.rb +219 -0
  159. data/lib/ibm_cloud_power/models/network_ports.rb +216 -0
  160. data/lib/ibm_cloud_power/models/network_reference.rb +325 -0
  161. data/lib/ibm_cloud_power/models/network_update.rb +243 -0
  162. data/lib/ibm_cloud_power/models/networks.rb +216 -0
  163. data/lib/ibm_cloud_power/models/operations.rb +287 -0
  164. data/lib/ibm_cloud_power/models/peering_network.rb +241 -0
  165. data/lib/ibm_cloud_power/models/pin_policy.rb +37 -0
  166. data/lib/ibm_cloud_power/models/pvm_instance.rb +612 -0
  167. data/lib/ibm_cloud_power/models/pvm_instance_action.rb +248 -0
  168. data/lib/ibm_cloud_power/models/pvm_instance_add_network.rb +224 -0
  169. data/lib/ibm_cloud_power/models/pvm_instance_capture.rb +317 -0
  170. data/lib/ibm_cloud_power/models/pvm_instance_clone.rb +328 -0
  171. data/lib/ibm_cloud_power/models/pvm_instance_console.rb +214 -0
  172. data/lib/ibm_cloud_power/models/pvm_instance_create.rb +483 -0
  173. data/lib/ibm_cloud_power/models/pvm_instance_fault.rb +240 -0
  174. data/lib/ibm_cloud_power/models/pvm_instance_health.rb +230 -0
  175. data/lib/ibm_cloud_power/models/pvm_instance_multi_create.rb +279 -0
  176. data/lib/ibm_cloud_power/models/pvm_instance_network.rb +290 -0
  177. data/lib/ibm_cloud_power/models/pvm_instance_networks.rb +216 -0
  178. data/lib/ibm_cloud_power/models/pvm_instance_operation.rb +262 -0
  179. data/lib/ibm_cloud_power/models/pvm_instance_reference.rb +566 -0
  180. data/lib/ibm_cloud_power/models/pvm_instance_remove_network.rb +209 -0
  181. data/lib/ibm_cloud_power/models/pvm_instance_update.rb +322 -0
  182. data/lib/ibm_cloud_power/models/pvm_instance_update_response.rb +292 -0
  183. data/lib/ibm_cloud_power/models/pvm_instance_volume_update.rb +214 -0
  184. data/lib/ibm_cloud_power/models/pvm_instances.rb +216 -0
  185. data/lib/ibm_cloud_power/models/sap_create.rb +311 -0
  186. data/lib/ibm_cloud_power/models/sap_profile.rb +310 -0
  187. data/lib/ibm_cloud_power/models/sap_profile_reference.rb +229 -0
  188. data/lib/ibm_cloud_power/models/sap_profiles.rb +216 -0
  189. data/lib/ibm_cloud_power/models/snapshot.rb +321 -0
  190. data/lib/ibm_cloud_power/models/snapshot_create.rb +236 -0
  191. data/lib/ibm_cloud_power/models/snapshot_create_response.rb +214 -0
  192. data/lib/ibm_cloud_power/models/snapshot_restore.rb +211 -0
  193. data/lib/ibm_cloud_power/models/snapshot_update.rb +219 -0
  194. data/lib/ibm_cloud_power/models/snapshots.rb +216 -0
  195. data/lib/ibm_cloud_power/models/software_licenses.rb +257 -0
  196. data/lib/ibm_cloud_power/models/src.rb +219 -0
  197. data/lib/ibm_cloud_power/models/ssh_key.rb +239 -0
  198. data/lib/ibm_cloud_power/models/ssh_keys.rb +216 -0
  199. data/lib/ibm_cloud_power/models/stock_image.rb +230 -0
  200. data/lib/ibm_cloud_power/models/system.rb +239 -0
  201. data/lib/ibm_cloud_power/models/system_pool.rb +277 -0
  202. data/lib/ibm_cloud_power/models/task.rb +334 -0
  203. data/lib/ibm_cloud_power/models/task_reference.rb +229 -0
  204. data/lib/ibm_cloud_power/models/tenant.rb +295 -0
  205. data/lib/ibm_cloud_power/models/tenant_update.rb +221 -0
  206. data/lib/ibm_cloud_power/models/update_volume.rb +239 -0
  207. data/lib/ibm_cloud_power/models/virtual_cores.rb +253 -0
  208. data/lib/ibm_cloud_power/models/volume.rb +356 -0
  209. data/lib/ibm_cloud_power/models/volume_info.rb +219 -0
  210. data/lib/ibm_cloud_power/models/volume_reference.rb +396 -0
  211. data/lib/ibm_cloud_power/models/volumes.rb +216 -0
  212. data/lib/ibm_cloud_power/models/volumes_clone.rb +284 -0
  213. data/lib/ibm_cloud_power/models/volumes_clone_async_request.rb +231 -0
  214. data/lib/ibm_cloud_power/models/volumes_clone_cancel.rb +209 -0
  215. data/lib/ibm_cloud_power/models/volumes_clone_create.rb +231 -0
  216. data/lib/ibm_cloud_power/models/volumes_clone_detail.rb +296 -0
  217. data/lib/ibm_cloud_power/models/volumes_clone_execute.rb +224 -0
  218. data/lib/ibm_cloud_power/models/volumes_clone_request.rb +231 -0
  219. data/lib/ibm_cloud_power/models/volumes_clone_response.rb +211 -0
  220. data/lib/ibm_cloud_power/models/volumes_clones.rb +211 -0
  221. data/lib/ibm_cloud_power/version.rb +15 -0
  222. data/spec/api/p_cloud_events_api_spec.rb +62 -0
  223. data/spec/api/p_cloud_images_api_spec.rb +117 -0
  224. data/spec/api/p_cloud_instances_api_spec.rb +69 -0
  225. data/spec/api/p_cloud_networks_api_spec.rb +161 -0
  226. data/spec/api/p_cloud_pvm_instances_api_spec.rb +240 -0
  227. data/spec/api/p_cloud_sap_api_spec.rb +70 -0
  228. data/spec/api/p_cloud_snapshots_api_spec.rb +83 -0
  229. data/spec/api/p_cloud_system_pools_api_spec.rb +46 -0
  230. data/spec/api/p_cloud_tasks_api_spec.rb +57 -0
  231. data/spec/api/p_cloud_tenants_api_spec.rb +58 -0
  232. data/spec/api/p_cloud_tenants_ssh_keys_api_spec.rb +95 -0
  233. data/spec/api/p_cloud_volumes_api_spec.rb +223 -0
  234. data/spec/api_client_spec.rb +226 -0
  235. data/spec/configuration_spec.rb +42 -0
  236. data/spec/models/clone_task_reference_spec.rb +47 -0
  237. data/spec/models/clone_task_status_spec.rb +63 -0
  238. data/spec/models/cloned_volume_detail_spec.rb +47 -0
  239. data/spec/models/cloned_volume_spec.rb +47 -0
  240. data/spec/models/cloud_instance_create_spec.rb +77 -0
  241. data/spec/models/cloud_instance_reference_spec.rb +83 -0
  242. data/spec/models/cloud_instance_spec.rb +101 -0
  243. data/spec/models/cloud_instance_update_spec.rb +65 -0
  244. data/spec/models/cloud_instance_usage_limits_spec.rb +101 -0
  245. data/spec/models/create_data_volume_spec.rb +81 -0
  246. data/spec/models/create_image_spec.rb +109 -0
  247. data/spec/models/error_spec.rb +47 -0
  248. data/spec/models/event_spec.rb +93 -0
  249. data/spec/models/event_user_spec.rb +53 -0
  250. data/spec/models/events_spec.rb +41 -0
  251. data/spec/models/export_image_spec.rb +59 -0
  252. data/spec/models/image_reference_spec.rb +89 -0
  253. data/spec/models/image_spec.rb +107 -0
  254. data/spec/models/image_specifications_spec.rb +77 -0
  255. data/spec/models/image_volume_spec.rb +59 -0
  256. data/spec/models/images_spec.rb +41 -0
  257. data/spec/models/ip_address_range_spec.rb +47 -0
  258. data/spec/models/min_max_default_spec.rb +53 -0
  259. data/spec/models/multi_volumes_create_spec.rb +81 -0
  260. data/spec/models/network_create_spec.rb +81 -0
  261. data/spec/models/network_ip_address_metrics_spec.rb +59 -0
  262. data/spec/models/network_port_create_spec.rb +47 -0
  263. data/spec/models/network_port_pvm_instance_spec.rb +47 -0
  264. data/spec/models/network_port_spec.rb +77 -0
  265. data/spec/models/network_port_update_spec.rb +47 -0
  266. data/spec/models/network_ports_spec.rb +41 -0
  267. data/spec/models/network_reference_spec.rb +75 -0
  268. data/spec/models/network_spec.rb +105 -0
  269. data/spec/models/network_update_spec.rb +59 -0
  270. data/spec/models/networks_spec.rb +41 -0
  271. data/spec/models/operations_spec.rb +65 -0
  272. data/spec/models/peering_network_spec.rb +53 -0
  273. data/spec/models/pin_policy_spec.rb +35 -0
  274. data/spec/models/pvm_instance_action_spec.rb +45 -0
  275. data/spec/models/pvm_instance_add_network_spec.rb +47 -0
  276. data/spec/models/pvm_instance_capture_spec.rb +81 -0
  277. data/spec/models/pvm_instance_clone_spec.rb +87 -0
  278. data/spec/models/pvm_instance_console_spec.rb +41 -0
  279. data/spec/models/pvm_instance_create_spec.rb +161 -0
  280. data/spec/models/pvm_instance_fault_spec.rb +59 -0
  281. data/spec/models/pvm_instance_health_spec.rb +53 -0
  282. data/spec/models/pvm_instance_multi_create_spec.rb +61 -0
  283. data/spec/models/pvm_instance_network_spec.rb +89 -0
  284. data/spec/models/pvm_instance_networks_spec.rb +41 -0
  285. data/spec/models/pvm_instance_operation_spec.rb +51 -0
  286. data/spec/models/pvm_instance_reference_spec.rb +207 -0
  287. data/spec/models/pvm_instance_remove_network_spec.rb +41 -0
  288. data/spec/models/pvm_instance_spec.rb +225 -0
  289. data/spec/models/pvm_instance_update_response_spec.rb +75 -0
  290. data/spec/models/pvm_instance_update_spec.rb +93 -0
  291. data/spec/models/pvm_instance_volume_update_spec.rb +41 -0
  292. data/spec/models/pvm_instances_spec.rb +41 -0
  293. data/spec/models/sap_create_spec.rb +89 -0
  294. data/spec/models/sap_profile_reference_spec.rb +47 -0
  295. data/spec/models/sap_profile_spec.rb +69 -0
  296. data/spec/models/sap_profiles_spec.rb +41 -0
  297. data/spec/models/snapshot_create_response_spec.rb +41 -0
  298. data/spec/models/snapshot_create_spec.rb +53 -0
  299. data/spec/models/snapshot_restore_spec.rb +41 -0
  300. data/spec/models/snapshot_spec.rb +95 -0
  301. data/spec/models/snapshot_update_spec.rb +47 -0
  302. data/spec/models/snapshots_spec.rb +41 -0
  303. data/spec/models/software_licenses_spec.rb +65 -0
  304. data/spec/models/src_spec.rb +47 -0
  305. data/spec/models/ssh_key_spec.rb +53 -0
  306. data/spec/models/ssh_keys_spec.rb +41 -0
  307. data/spec/models/stock_image_spec.rb +53 -0
  308. data/spec/models/system_pool_spec.rb +83 -0
  309. data/spec/models/system_spec.rb +53 -0
  310. data/spec/models/task_reference_spec.rb +47 -0
  311. data/spec/models/task_spec.rb +89 -0
  312. data/spec/models/tenant_spec.rb +77 -0
  313. data/spec/models/tenant_update_spec.rb +47 -0
  314. data/spec/models/update_volume_spec.rb +59 -0
  315. data/spec/models/virtual_cores_spec.rb +53 -0
  316. data/spec/models/volume_info_spec.rb +47 -0
  317. data/spec/models/volume_reference_spec.rb +119 -0
  318. data/spec/models/volume_spec.rb +113 -0
  319. data/spec/models/volumes_clone_async_request_spec.rb +47 -0
  320. data/spec/models/volumes_clone_cancel_spec.rb +41 -0
  321. data/spec/models/volumes_clone_create_spec.rb +47 -0
  322. data/spec/models/volumes_clone_detail_spec.rb +89 -0
  323. data/spec/models/volumes_clone_execute_spec.rb +47 -0
  324. data/spec/models/volumes_clone_request_spec.rb +47 -0
  325. data/spec/models/volumes_clone_response_spec.rb +47 -0
  326. data/spec/models/volumes_clone_spec.rb +83 -0
  327. data/spec/models/volumes_clones_spec.rb +41 -0
  328. data/spec/models/volumes_spec.rb +41 -0
  329. data/spec/spec_helper.rb +111 -0
  330. metadata +519 -0
@@ -0,0 +1,241 @@
1
+ =begin
2
+ #Power Cloud API
3
+
4
+ #IBM Power Cloud API for Power Hardware / Infrastructure
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: kylej@us.ibm.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-beta2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module IbmCloudPower
16
+ class PeeringNetwork
17
+ # Name of project to be peered
18
+ attr_accessor :project_name
19
+
20
+ # Network in CIDR notation (192.168.0.0/24)
21
+ attr_accessor :cidr
22
+
23
+ # DNS Servers
24
+ attr_accessor :dns_servers
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'project_name' => :'projectName',
30
+ :'cidr' => :'cidr',
31
+ :'dns_servers' => :'dnsServers'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'project_name' => :'String',
39
+ :'cidr' => :'String',
40
+ :'dns_servers' => :'Array<String>'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IbmCloudPower::PeeringNetwork` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IbmCloudPower::PeeringNetwork`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'project_name')
66
+ self.project_name = attributes[:'project_name']
67
+ end
68
+
69
+ if attributes.key?(:'cidr')
70
+ self.cidr = attributes[:'cidr']
71
+ end
72
+
73
+ if attributes.key?(:'dns_servers')
74
+ if (value = attributes[:'dns_servers']).is_a?(Array)
75
+ self.dns_servers = value
76
+ end
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ invalid_properties = Array.new
84
+ if @project_name.nil?
85
+ invalid_properties.push('invalid value for "project_name", project_name cannot be nil.')
86
+ end
87
+
88
+ if @cidr.nil?
89
+ invalid_properties.push('invalid value for "cidr", cidr cannot be nil.')
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ return false if @project_name.nil?
99
+ return false if @cidr.nil?
100
+ true
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ project_name == o.project_name &&
109
+ cidr == o.cidr &&
110
+ dns_servers == o.dns_servers
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [project_name, cidr, dns_servers].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ new.build_from_hash(attributes)
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ self.class.openapi_types.each_pair do |key, type|
138
+ if type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
147
+ self.send("#{key}=", nil)
148
+ end
149
+ end
150
+
151
+ self
152
+ end
153
+
154
+ # Deserializes the data based on type
155
+ # @param string type Data type
156
+ # @param string value Value to be deserialized
157
+ # @return [Object] Deserialized data
158
+ def _deserialize(type, value)
159
+ case type.to_sym
160
+ when :DateTime
161
+ DateTime.parse(value)
162
+ when :Date
163
+ Date.parse(value)
164
+ when :String
165
+ value.to_s
166
+ when :Integer
167
+ value.to_i
168
+ when :Float
169
+ value.to_f
170
+ when :Boolean
171
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
172
+ true
173
+ else
174
+ false
175
+ end
176
+ when :Object
177
+ # generic object (usually a Hash), return directly
178
+ value
179
+ when /\AArray<(?<inner_type>.+)>\z/
180
+ inner_type = Regexp.last_match[:inner_type]
181
+ value.map { |v| _deserialize(inner_type, v) }
182
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
183
+ k_type = Regexp.last_match[:k_type]
184
+ v_type = Regexp.last_match[:v_type]
185
+ {}.tap do |hash|
186
+ value.each do |k, v|
187
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
188
+ end
189
+ end
190
+ else # model
191
+ IbmCloudPower.const_get(type).build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ # Outputs non-array value in the form of hash
224
+ # For object, use to_hash. Otherwise, just return the value
225
+ # @param [Object] value Any valid value
226
+ # @return [Hash] Returns the value in the form of hash
227
+ def _to_hash(value)
228
+ if value.is_a?(Array)
229
+ value.compact.map { |v| _to_hash(v) }
230
+ elsif value.is_a?(Hash)
231
+ {}.tap do |hash|
232
+ value.each { |k, v| hash[k] = _to_hash(v) }
233
+ end
234
+ elsif value.respond_to? :to_hash
235
+ value.to_hash
236
+ else
237
+ value
238
+ end
239
+ end
240
+ end
241
+ end
@@ -0,0 +1,37 @@
1
+ =begin
2
+ #Power Cloud API
3
+
4
+ #IBM Power Cloud API for Power Hardware / Infrastructure
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: kylej@us.ibm.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-beta2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module IbmCloudPower
16
+ class PinPolicy
17
+ NONE = "none".freeze
18
+ SOFT = "soft".freeze
19
+ HARD = "hard".freeze
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def self.build_from_hash(value)
25
+ new.build_from_hash(value)
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ constantValues = PinPolicy.constants.select { |c| PinPolicy::const_get(c) == value }
33
+ raise "Invalid ENUM value #{value} for class #PinPolicy" if constantValues.empty?
34
+ value
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,612 @@
1
+ =begin
2
+ #Power Cloud API
3
+
4
+ #IBM Power Cloud API for Power Hardware / Infrastructure
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: kylej@us.ibm.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-beta2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module IbmCloudPower
16
+ class PVMInstance
17
+ # PCloud PVM Instance ID
18
+ attr_accessor :pvm_instance_id
19
+
20
+ # Name of the server
21
+ attr_accessor :server_name
22
+
23
+ # The ImageID used by the server
24
+ attr_accessor :image_id
25
+
26
+ # Number of processors allocated
27
+ attr_accessor :processors
28
+
29
+ # Minimum number of processors that can be allocated (for resize)
30
+ attr_accessor :minproc
31
+
32
+ # Maximum number of processors that can be allocated (for resize)
33
+ attr_accessor :maxproc
34
+
35
+ # Processor type (dedicated, shared, capped)
36
+ attr_accessor :proc_type
37
+
38
+ # Amount of memory allocated (in GB)
39
+ attr_accessor :memory
40
+
41
+ # Minimum amount of memory that can be allocated (in GB, for resize)
42
+ attr_accessor :minmem
43
+
44
+ # Maximum amount of memory that can be allocated (in GB, for resize)
45
+ attr_accessor :maxmem
46
+
47
+ # Size of allocated disk (in GB)
48
+ attr_accessor :disk_size
49
+
50
+ # (deprecated - replaced by networks) List of Network IDs
51
+ attr_accessor :network_i_ds
52
+
53
+ # List of volume IDs
54
+ attr_accessor :volume_i_ds
55
+
56
+ # (deprecated - replaced by networks) The list of addresses and their network information
57
+ attr_accessor :addresses
58
+
59
+ # The pvm instance networks information
60
+ attr_accessor :networks
61
+
62
+ # The status of the instance
63
+ attr_accessor :status
64
+
65
+ # The progress of an operation
66
+ attr_accessor :progress
67
+
68
+ attr_accessor :fault
69
+
70
+ # Date/Time of PVM creation
71
+ attr_accessor :creation_date
72
+
73
+ # Date/Time of PVM last update
74
+ attr_accessor :updated_date
75
+
76
+ # System type used to host the instance
77
+ attr_accessor :sys_type
78
+
79
+ attr_accessor :health
80
+
81
+ # whether the instance can be migrated
82
+ attr_accessor :migratable
83
+
84
+ # Storage type where server is deployed
85
+ attr_accessor :storage_type
86
+
87
+ attr_accessor :software_licenses
88
+
89
+ # The pvm instance SRC lists
90
+ attr_accessor :srcs
91
+
92
+ # VM pinning policy to use [none, soft, hard]
93
+ attr_accessor :pin_policy
94
+
95
+ # Type of the OS [aix, ibmi, redhat, sles]
96
+ attr_accessor :os_type
97
+
98
+ # OS system information (usually version and build)
99
+ attr_accessor :operating_system
100
+
101
+ attr_accessor :sap_profile
102
+
103
+ attr_accessor :virtual_cores
104
+
105
+ class EnumAttributeValidator
106
+ attr_reader :datatype
107
+ attr_reader :allowable_values
108
+
109
+ def initialize(datatype, allowable_values)
110
+ @allowable_values = allowable_values.map do |value|
111
+ case datatype.to_s
112
+ when /Integer/i
113
+ value.to_i
114
+ when /Float/i
115
+ value.to_f
116
+ else
117
+ value
118
+ end
119
+ end
120
+ end
121
+
122
+ def valid?(value)
123
+ !value || allowable_values.include?(value)
124
+ end
125
+ end
126
+
127
+ # Attribute mapping from ruby-style variable name to JSON key.
128
+ def self.attribute_map
129
+ {
130
+ :'pvm_instance_id' => :'pvmInstanceID',
131
+ :'server_name' => :'serverName',
132
+ :'image_id' => :'imageID',
133
+ :'processors' => :'processors',
134
+ :'minproc' => :'minproc',
135
+ :'maxproc' => :'maxproc',
136
+ :'proc_type' => :'procType',
137
+ :'memory' => :'memory',
138
+ :'minmem' => :'minmem',
139
+ :'maxmem' => :'maxmem',
140
+ :'disk_size' => :'diskSize',
141
+ :'network_i_ds' => :'networkIDs',
142
+ :'volume_i_ds' => :'volumeIDs',
143
+ :'addresses' => :'addresses',
144
+ :'networks' => :'networks',
145
+ :'status' => :'status',
146
+ :'progress' => :'progress',
147
+ :'fault' => :'fault',
148
+ :'creation_date' => :'creationDate',
149
+ :'updated_date' => :'updatedDate',
150
+ :'sys_type' => :'sysType',
151
+ :'health' => :'health',
152
+ :'migratable' => :'migratable',
153
+ :'storage_type' => :'storageType',
154
+ :'software_licenses' => :'softwareLicenses',
155
+ :'srcs' => :'srcs',
156
+ :'pin_policy' => :'pinPolicy',
157
+ :'os_type' => :'osType',
158
+ :'operating_system' => :'operatingSystem',
159
+ :'sap_profile' => :'sapProfile',
160
+ :'virtual_cores' => :'virtualCores'
161
+ }
162
+ end
163
+
164
+ # Attribute type mapping.
165
+ def self.openapi_types
166
+ {
167
+ :'pvm_instance_id' => :'String',
168
+ :'server_name' => :'String',
169
+ :'image_id' => :'String',
170
+ :'processors' => :'Float',
171
+ :'minproc' => :'Float',
172
+ :'maxproc' => :'Float',
173
+ :'proc_type' => :'String',
174
+ :'memory' => :'Float',
175
+ :'minmem' => :'Float',
176
+ :'maxmem' => :'Float',
177
+ :'disk_size' => :'Float',
178
+ :'network_i_ds' => :'Array<String>',
179
+ :'volume_i_ds' => :'Array<String>',
180
+ :'addresses' => :'Array<PVMInstanceNetwork>',
181
+ :'networks' => :'Array<PVMInstanceNetwork>',
182
+ :'status' => :'String',
183
+ :'progress' => :'Float',
184
+ :'fault' => :'PVMInstanceFault',
185
+ :'creation_date' => :'DateTime',
186
+ :'updated_date' => :'DateTime',
187
+ :'sys_type' => :'String',
188
+ :'health' => :'PVMInstanceHealth',
189
+ :'migratable' => :'Boolean',
190
+ :'storage_type' => :'String',
191
+ :'software_licenses' => :'SoftwareLicenses',
192
+ :'srcs' => :'Array<Array<SRC>>',
193
+ :'pin_policy' => :'String',
194
+ :'os_type' => :'String',
195
+ :'operating_system' => :'String',
196
+ :'sap_profile' => :'SAPProfileReference',
197
+ :'virtual_cores' => :'VirtualCores'
198
+ }
199
+ end
200
+
201
+ # List of attributes with nullable: true
202
+ def self.openapi_nullable
203
+ Set.new([
204
+ ])
205
+ end
206
+
207
+ # Initializes the object
208
+ # @param [Hash] attributes Model attributes in the form of hash
209
+ def initialize(attributes = {})
210
+ if (!attributes.is_a?(Hash))
211
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IbmCloudPower::PVMInstance` initialize method"
212
+ end
213
+
214
+ # check to see if the attribute exists and convert string to symbol for hash key
215
+ attributes = attributes.each_with_object({}) { |(k, v), h|
216
+ if (!self.class.attribute_map.key?(k.to_sym))
217
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IbmCloudPower::PVMInstance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
218
+ end
219
+ h[k.to_sym] = v
220
+ }
221
+
222
+ if attributes.key?(:'pvm_instance_id')
223
+ self.pvm_instance_id = attributes[:'pvm_instance_id']
224
+ end
225
+
226
+ if attributes.key?(:'server_name')
227
+ self.server_name = attributes[:'server_name']
228
+ end
229
+
230
+ if attributes.key?(:'image_id')
231
+ self.image_id = attributes[:'image_id']
232
+ end
233
+
234
+ if attributes.key?(:'processors')
235
+ self.processors = attributes[:'processors']
236
+ end
237
+
238
+ if attributes.key?(:'minproc')
239
+ self.minproc = attributes[:'minproc']
240
+ end
241
+
242
+ if attributes.key?(:'maxproc')
243
+ self.maxproc = attributes[:'maxproc']
244
+ end
245
+
246
+ if attributes.key?(:'proc_type')
247
+ self.proc_type = attributes[:'proc_type']
248
+ else
249
+ self.proc_type = 'dedicated'
250
+ end
251
+
252
+ if attributes.key?(:'memory')
253
+ self.memory = attributes[:'memory']
254
+ end
255
+
256
+ if attributes.key?(:'minmem')
257
+ self.minmem = attributes[:'minmem']
258
+ end
259
+
260
+ if attributes.key?(:'maxmem')
261
+ self.maxmem = attributes[:'maxmem']
262
+ end
263
+
264
+ if attributes.key?(:'disk_size')
265
+ self.disk_size = attributes[:'disk_size']
266
+ end
267
+
268
+ if attributes.key?(:'network_i_ds')
269
+ if (value = attributes[:'network_i_ds']).is_a?(Array)
270
+ self.network_i_ds = value
271
+ end
272
+ end
273
+
274
+ if attributes.key?(:'volume_i_ds')
275
+ if (value = attributes[:'volume_i_ds']).is_a?(Array)
276
+ self.volume_i_ds = value
277
+ end
278
+ end
279
+
280
+ if attributes.key?(:'addresses')
281
+ if (value = attributes[:'addresses']).is_a?(Array)
282
+ self.addresses = value
283
+ end
284
+ end
285
+
286
+ if attributes.key?(:'networks')
287
+ if (value = attributes[:'networks']).is_a?(Array)
288
+ self.networks = value
289
+ end
290
+ end
291
+
292
+ if attributes.key?(:'status')
293
+ self.status = attributes[:'status']
294
+ end
295
+
296
+ if attributes.key?(:'progress')
297
+ self.progress = attributes[:'progress']
298
+ end
299
+
300
+ if attributes.key?(:'fault')
301
+ self.fault = attributes[:'fault']
302
+ end
303
+
304
+ if attributes.key?(:'creation_date')
305
+ self.creation_date = attributes[:'creation_date']
306
+ end
307
+
308
+ if attributes.key?(:'updated_date')
309
+ self.updated_date = attributes[:'updated_date']
310
+ end
311
+
312
+ if attributes.key?(:'sys_type')
313
+ self.sys_type = attributes[:'sys_type']
314
+ end
315
+
316
+ if attributes.key?(:'health')
317
+ self.health = attributes[:'health']
318
+ end
319
+
320
+ if attributes.key?(:'migratable')
321
+ self.migratable = attributes[:'migratable']
322
+ else
323
+ self.migratable = true
324
+ end
325
+
326
+ if attributes.key?(:'storage_type')
327
+ self.storage_type = attributes[:'storage_type']
328
+ end
329
+
330
+ if attributes.key?(:'software_licenses')
331
+ self.software_licenses = attributes[:'software_licenses']
332
+ end
333
+
334
+ if attributes.key?(:'srcs')
335
+ if (value = attributes[:'srcs']).is_a?(Array)
336
+ self.srcs = value
337
+ end
338
+ end
339
+
340
+ if attributes.key?(:'pin_policy')
341
+ self.pin_policy = attributes[:'pin_policy']
342
+ end
343
+
344
+ if attributes.key?(:'os_type')
345
+ self.os_type = attributes[:'os_type']
346
+ end
347
+
348
+ if attributes.key?(:'operating_system')
349
+ self.operating_system = attributes[:'operating_system']
350
+ end
351
+
352
+ if attributes.key?(:'sap_profile')
353
+ self.sap_profile = attributes[:'sap_profile']
354
+ end
355
+
356
+ if attributes.key?(:'virtual_cores')
357
+ self.virtual_cores = attributes[:'virtual_cores']
358
+ end
359
+ end
360
+
361
+ # Show invalid properties with the reasons. Usually used together with valid?
362
+ # @return Array for valid properties with the reasons
363
+ def list_invalid_properties
364
+ invalid_properties = Array.new
365
+ if @pvm_instance_id.nil?
366
+ invalid_properties.push('invalid value for "pvm_instance_id", pvm_instance_id cannot be nil.')
367
+ end
368
+
369
+ if @server_name.nil?
370
+ invalid_properties.push('invalid value for "server_name", server_name cannot be nil.')
371
+ end
372
+
373
+ if @image_id.nil?
374
+ invalid_properties.push('invalid value for "image_id", image_id cannot be nil.')
375
+ end
376
+
377
+ if @processors.nil?
378
+ invalid_properties.push('invalid value for "processors", processors cannot be nil.')
379
+ end
380
+
381
+ if @proc_type.nil?
382
+ invalid_properties.push('invalid value for "proc_type", proc_type cannot be nil.')
383
+ end
384
+
385
+ if @memory.nil?
386
+ invalid_properties.push('invalid value for "memory", memory cannot be nil.')
387
+ end
388
+
389
+ if @disk_size.nil?
390
+ invalid_properties.push('invalid value for "disk_size", disk_size cannot be nil.')
391
+ end
392
+
393
+ if @network_i_ds.nil?
394
+ invalid_properties.push('invalid value for "network_i_ds", network_i_ds cannot be nil.')
395
+ end
396
+
397
+ if @volume_i_ds.nil?
398
+ invalid_properties.push('invalid value for "volume_i_ds", volume_i_ds cannot be nil.')
399
+ end
400
+
401
+ if @status.nil?
402
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
403
+ end
404
+
405
+ if @storage_type.nil?
406
+ invalid_properties.push('invalid value for "storage_type", storage_type cannot be nil.')
407
+ end
408
+
409
+ if @os_type.nil?
410
+ invalid_properties.push('invalid value for "os_type", os_type cannot be nil.')
411
+ end
412
+
413
+ invalid_properties
414
+ end
415
+
416
+ # Check to see if the all the properties in the model are valid
417
+ # @return true if the model is valid
418
+ def valid?
419
+ return false if @pvm_instance_id.nil?
420
+ return false if @server_name.nil?
421
+ return false if @image_id.nil?
422
+ return false if @processors.nil?
423
+ return false if @proc_type.nil?
424
+ proc_type_validator = EnumAttributeValidator.new('String', ["dedicated", "shared", "capped"])
425
+ return false unless proc_type_validator.valid?(@proc_type)
426
+ return false if @memory.nil?
427
+ return false if @disk_size.nil?
428
+ return false if @network_i_ds.nil?
429
+ return false if @volume_i_ds.nil?
430
+ return false if @status.nil?
431
+ return false if @storage_type.nil?
432
+ return false if @os_type.nil?
433
+ true
434
+ end
435
+
436
+ # Custom attribute writer method checking allowed values (enum).
437
+ # @param [Object] proc_type Object to be assigned
438
+ def proc_type=(proc_type)
439
+ validator = EnumAttributeValidator.new('String', ["dedicated", "shared", "capped"])
440
+ unless validator.valid?(proc_type)
441
+ fail ArgumentError, "invalid value for \"proc_type\", must be one of #{validator.allowable_values}."
442
+ end
443
+ @proc_type = proc_type
444
+ end
445
+
446
+ # Checks equality by comparing each attribute.
447
+ # @param [Object] Object to be compared
448
+ def ==(o)
449
+ return true if self.equal?(o)
450
+ self.class == o.class &&
451
+ pvm_instance_id == o.pvm_instance_id &&
452
+ server_name == o.server_name &&
453
+ image_id == o.image_id &&
454
+ processors == o.processors &&
455
+ minproc == o.minproc &&
456
+ maxproc == o.maxproc &&
457
+ proc_type == o.proc_type &&
458
+ memory == o.memory &&
459
+ minmem == o.minmem &&
460
+ maxmem == o.maxmem &&
461
+ disk_size == o.disk_size &&
462
+ network_i_ds == o.network_i_ds &&
463
+ volume_i_ds == o.volume_i_ds &&
464
+ addresses == o.addresses &&
465
+ networks == o.networks &&
466
+ status == o.status &&
467
+ progress == o.progress &&
468
+ fault == o.fault &&
469
+ creation_date == o.creation_date &&
470
+ updated_date == o.updated_date &&
471
+ sys_type == o.sys_type &&
472
+ health == o.health &&
473
+ migratable == o.migratable &&
474
+ storage_type == o.storage_type &&
475
+ software_licenses == o.software_licenses &&
476
+ srcs == o.srcs &&
477
+ pin_policy == o.pin_policy &&
478
+ os_type == o.os_type &&
479
+ operating_system == o.operating_system &&
480
+ sap_profile == o.sap_profile &&
481
+ virtual_cores == o.virtual_cores
482
+ end
483
+
484
+ # @see the `==` method
485
+ # @param [Object] Object to be compared
486
+ def eql?(o)
487
+ self == o
488
+ end
489
+
490
+ # Calculates hash code according to all attributes.
491
+ # @return [Integer] Hash code
492
+ def hash
493
+ [pvm_instance_id, server_name, image_id, processors, minproc, maxproc, proc_type, memory, minmem, maxmem, disk_size, network_i_ds, volume_i_ds, addresses, networks, status, progress, fault, creation_date, updated_date, sys_type, health, migratable, storage_type, software_licenses, srcs, pin_policy, os_type, operating_system, sap_profile, virtual_cores].hash
494
+ end
495
+
496
+ # Builds the object from hash
497
+ # @param [Hash] attributes Model attributes in the form of hash
498
+ # @return [Object] Returns the model itself
499
+ def self.build_from_hash(attributes)
500
+ new.build_from_hash(attributes)
501
+ end
502
+
503
+ # Builds the object from hash
504
+ # @param [Hash] attributes Model attributes in the form of hash
505
+ # @return [Object] Returns the model itself
506
+ def build_from_hash(attributes)
507
+ return nil unless attributes.is_a?(Hash)
508
+ self.class.openapi_types.each_pair do |key, type|
509
+ if type =~ /\AArray<(.*)>/i
510
+ # check to ensure the input is an array given that the attribute
511
+ # is documented as an array but the input is not
512
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
513
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
514
+ end
515
+ elsif !attributes[self.class.attribute_map[key]].nil?
516
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
517
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
518
+ self.send("#{key}=", nil)
519
+ end
520
+ end
521
+
522
+ self
523
+ end
524
+
525
+ # Deserializes the data based on type
526
+ # @param string type Data type
527
+ # @param string value Value to be deserialized
528
+ # @return [Object] Deserialized data
529
+ def _deserialize(type, value)
530
+ case type.to_sym
531
+ when :DateTime
532
+ DateTime.parse(value)
533
+ when :Date
534
+ Date.parse(value)
535
+ when :String
536
+ value.to_s
537
+ when :Integer
538
+ value.to_i
539
+ when :Float
540
+ value.to_f
541
+ when :Boolean
542
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
543
+ true
544
+ else
545
+ false
546
+ end
547
+ when :Object
548
+ # generic object (usually a Hash), return directly
549
+ value
550
+ when /\AArray<(?<inner_type>.+)>\z/
551
+ inner_type = Regexp.last_match[:inner_type]
552
+ value.map { |v| _deserialize(inner_type, v) }
553
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
554
+ k_type = Regexp.last_match[:k_type]
555
+ v_type = Regexp.last_match[:v_type]
556
+ {}.tap do |hash|
557
+ value.each do |k, v|
558
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
559
+ end
560
+ end
561
+ else # model
562
+ IbmCloudPower.const_get(type).build_from_hash(value)
563
+ end
564
+ end
565
+
566
+ # Returns the string representation of the object
567
+ # @return [String] String presentation of the object
568
+ def to_s
569
+ to_hash.to_s
570
+ end
571
+
572
+ # to_body is an alias to to_hash (backward compatibility)
573
+ # @return [Hash] Returns the object in the form of hash
574
+ def to_body
575
+ to_hash
576
+ end
577
+
578
+ # Returns the object in the form of hash
579
+ # @return [Hash] Returns the object in the form of hash
580
+ def to_hash
581
+ hash = {}
582
+ self.class.attribute_map.each_pair do |attr, param|
583
+ value = self.send(attr)
584
+ if value.nil?
585
+ is_nullable = self.class.openapi_nullable.include?(attr)
586
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
587
+ end
588
+
589
+ hash[param] = _to_hash(value)
590
+ end
591
+ hash
592
+ end
593
+
594
+ # Outputs non-array value in the form of hash
595
+ # For object, use to_hash. Otherwise, just return the value
596
+ # @param [Object] value Any valid value
597
+ # @return [Hash] Returns the value in the form of hash
598
+ def _to_hash(value)
599
+ if value.is_a?(Array)
600
+ value.compact.map { |v| _to_hash(v) }
601
+ elsif value.is_a?(Hash)
602
+ {}.tap do |hash|
603
+ value.each { |k, v| hash[k] = _to_hash(v) }
604
+ end
605
+ elsif value.respond_to? :to_hash
606
+ value.to_hash
607
+ else
608
+ value
609
+ end
610
+ end
611
+ end
612
+ end