ionoscloud 5.0.0 → 5.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (463) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +68 -0
  3. data/LICENSE +190 -0
  4. data/README.md +14 -4
  5. data/docs/README.md +111 -0
  6. data/docs/api/BackupUnitApi.md +595 -0
  7. data/docs/api/ContractApi.md +89 -0
  8. data/docs/api/DataCenterApi.md +517 -0
  9. data/docs/api/DefaultApi.md +89 -0
  10. data/docs/api/IPBlocksApi.md +517 -0
  11. data/docs/api/ImageApi.md +429 -0
  12. data/docs/api/KubernetesApi.md +1513 -0
  13. data/docs/api/LabelApi.md +2355 -0
  14. data/docs/api/LanApi.md +795 -0
  15. data/docs/api/LoadBalancerApi.md +883 -0
  16. data/docs/api/LocationApi.md +259 -0
  17. data/docs/api/NicApi.md +1087 -0
  18. data/docs/api/PrivateCrossConnectApi.md +427 -0
  19. data/docs/api/RequestApi.md +283 -0
  20. data/docs/api/ServerApi.md +1573 -0
  21. data/docs/api/SnapshotApi.md +429 -0
  22. data/docs/api/UserManagementApi.md +2551 -0
  23. data/docs/api/VolumeApi.md +711 -0
  24. data/docs/models/AttachedVolumes.md +30 -0
  25. data/docs/models/BackupUnit.md +26 -0
  26. data/docs/models/BackupUnitProperties.md +22 -0
  27. data/docs/models/BackupUnitSSO.md +18 -0
  28. data/docs/models/BackupUnits.md +24 -0
  29. data/docs/models/BalancedNics.md +30 -0
  30. data/docs/models/Cdroms.md +30 -0
  31. data/docs/models/ConnectableDatacenter.md +22 -0
  32. data/docs/models/Contract.md +20 -0
  33. data/docs/models/ContractProperties.md +26 -0
  34. data/docs/models/DataCenterEntities.md +24 -0
  35. data/docs/models/Datacenter.md +28 -0
  36. data/docs/models/DatacenterElementMetadata.md +32 -0
  37. data/docs/models/DatacenterProperties.md +28 -0
  38. data/docs/models/Datacenters.md +30 -0
  39. data/docs/models/Error.md +20 -0
  40. data/docs/models/ErrorMessage.md +20 -0
  41. data/docs/models/FirewallRule.md +26 -0
  42. data/docs/models/FirewallRules.md +30 -0
  43. data/docs/models/FirewallruleProperties.md +34 -0
  44. data/docs/models/Group.md +26 -0
  45. data/docs/models/GroupEntities.md +20 -0
  46. data/docs/models/GroupMembers.md +24 -0
  47. data/docs/models/GroupProperties.md +36 -0
  48. data/docs/models/GroupShare.md +24 -0
  49. data/docs/models/GroupShareProperties.md +20 -0
  50. data/docs/models/GroupShares.md +24 -0
  51. data/docs/models/GroupUsers.md +24 -0
  52. data/docs/models/Groups.md +24 -0
  53. data/docs/models/IPFailover.md +20 -0
  54. data/docs/models/Image.md +26 -0
  55. data/docs/models/ImageProperties.md +54 -0
  56. data/docs/models/Images.md +24 -0
  57. data/docs/models/Info.md +22 -0
  58. data/docs/models/IpBlock.md +26 -0
  59. data/docs/models/IpBlockProperties.md +26 -0
  60. data/docs/models/IpBlocks.md +30 -0
  61. data/docs/models/IpConsumer.md +34 -0
  62. data/docs/models/KubernetesAutoScaling.md +20 -0
  63. data/docs/models/KubernetesCluster.md +28 -0
  64. data/docs/models/KubernetesClusterEntities.md +18 -0
  65. data/docs/models/KubernetesClusterForPost.md +28 -0
  66. data/docs/models/KubernetesClusterForPut.md +28 -0
  67. data/docs/models/KubernetesClusterProperties.md +30 -0
  68. data/docs/models/KubernetesClusterPropertiesForPost.md +26 -0
  69. data/docs/models/KubernetesClusterPropertiesForPut.md +26 -0
  70. data/docs/models/KubernetesClusters.md +24 -0
  71. data/docs/models/KubernetesConfig.md +24 -0
  72. data/docs/models/KubernetesConfigProperties.md +18 -0
  73. data/docs/models/KubernetesMaintenanceWindow.md +20 -0
  74. data/docs/models/KubernetesNode.md +26 -0
  75. data/docs/models/KubernetesNodeMetadata.md +26 -0
  76. data/docs/models/KubernetesNodePool.md +26 -0
  77. data/docs/models/KubernetesNodePoolForPost.md +26 -0
  78. data/docs/models/KubernetesNodePoolForPut.md +26 -0
  79. data/docs/models/KubernetesNodePoolLan.md +18 -0
  80. data/docs/models/KubernetesNodePoolProperties.md +49 -0
  81. data/docs/models/KubernetesNodePoolPropertiesForPost.md +47 -0
  82. data/docs/models/KubernetesNodePoolPropertiesForPut.md +34 -0
  83. data/docs/models/KubernetesNodePools.md +24 -0
  84. data/docs/models/KubernetesNodeProperties.md +24 -0
  85. data/docs/models/KubernetesNodes.md +24 -0
  86. data/docs/models/Label.md +26 -0
  87. data/docs/models/LabelProperties.md +26 -0
  88. data/docs/models/LabelResource.md +26 -0
  89. data/docs/models/LabelResourceProperties.md +20 -0
  90. data/docs/models/LabelResources.md +30 -0
  91. data/docs/models/Labels.md +24 -0
  92. data/docs/models/Lan.md +28 -0
  93. data/docs/models/LanEntities.md +18 -0
  94. data/docs/models/LanNics.md +30 -0
  95. data/docs/models/LanPost.md +28 -0
  96. data/docs/models/LanProperties.md +24 -0
  97. data/docs/models/LanPropertiesPost.md +24 -0
  98. data/docs/models/Lans.md +30 -0
  99. data/docs/models/Loadbalancer.md +28 -0
  100. data/docs/models/LoadbalancerEntities.md +18 -0
  101. data/docs/models/LoadbalancerProperties.md +22 -0
  102. data/docs/models/Loadbalancers.md +30 -0
  103. data/docs/models/Location.md +26 -0
  104. data/docs/models/LocationProperties.md +22 -0
  105. data/docs/models/Locations.md +24 -0
  106. data/docs/models/Nic.md +28 -0
  107. data/docs/models/NicEntities.md +18 -0
  108. data/docs/models/NicProperties.md +30 -0
  109. data/docs/models/Nics.md +30 -0
  110. data/docs/models/NoStateMetaData.md +30 -0
  111. data/docs/models/PaginationLinks.md +22 -0
  112. data/docs/models/Peer.md +26 -0
  113. data/docs/models/PrivateCrossConnect.md +26 -0
  114. data/docs/models/PrivateCrossConnectProperties.md +24 -0
  115. data/docs/models/PrivateCrossConnects.md +24 -0
  116. data/docs/models/Request.md +26 -0
  117. data/docs/models/RequestMetadata.md +24 -0
  118. data/docs/models/RequestProperties.md +24 -0
  119. data/docs/models/RequestStatus.md +24 -0
  120. data/docs/models/RequestStatusMetadata.md +24 -0
  121. data/docs/models/RequestTarget.md +20 -0
  122. data/docs/models/Requests.md +30 -0
  123. data/docs/models/Resource.md +28 -0
  124. data/docs/models/ResourceEntities.md +18 -0
  125. data/docs/models/ResourceGroups.md +24 -0
  126. data/docs/models/ResourceLimits.md +50 -0
  127. data/docs/models/ResourceProperties.md +20 -0
  128. data/docs/models/ResourceReference.md +22 -0
  129. data/docs/models/Resources.md +24 -0
  130. data/docs/models/ResourcesUsers.md +24 -0
  131. data/docs/models/S3Bucket.md +18 -0
  132. data/docs/models/S3Key.md +26 -0
  133. data/docs/models/S3KeyMetadata.md +20 -0
  134. data/docs/models/S3KeyProperties.md +20 -0
  135. data/docs/models/S3Keys.md +24 -0
  136. data/docs/models/S3ObjectStorageSSO.md +18 -0
  137. data/docs/models/Server.md +28 -0
  138. data/docs/models/ServerEntities.md +22 -0
  139. data/docs/models/ServerProperties.md +32 -0
  140. data/docs/models/Servers.md +30 -0
  141. data/docs/models/Snapshot.md +26 -0
  142. data/docs/models/SnapshotProperties.md +48 -0
  143. data/docs/models/Snapshots.md +24 -0
  144. data/docs/models/Type.md +15 -0
  145. data/docs/models/User.md +28 -0
  146. data/docs/models/UserMetadata.md +22 -0
  147. data/docs/models/UserPost.md +18 -0
  148. data/docs/models/UserProperties.md +32 -0
  149. data/docs/models/UserPropertiesPost.md +32 -0
  150. data/docs/models/UserPropertiesPut.md +30 -0
  151. data/docs/models/UserPut.md +20 -0
  152. data/docs/models/Users.md +30 -0
  153. data/docs/models/UsersEntities.md +20 -0
  154. data/docs/models/Volume.md +26 -0
  155. data/docs/models/VolumeProperties.md +54 -0
  156. data/docs/models/Volumes.md +30 -0
  157. data/docs/summary.md +168 -0
  158. data/gitbook.yaml +4 -0
  159. data/ionoscloud.gemspec +1 -1
  160. data/lib/ionoscloud/api/_api.rb +2 -2
  161. data/lib/ionoscloud/api/backup_unit_api.rb +1 -1
  162. data/lib/ionoscloud/api/contract_api.rb +1 -1
  163. data/lib/ionoscloud/api/data_center_api.rb +3 -3
  164. data/lib/ionoscloud/api/image_api.rb +1 -1
  165. data/lib/ionoscloud/api/ip_blocks_api.rb +19 -1
  166. data/lib/ionoscloud/api/kubernetes_api.rb +12 -12
  167. data/lib/ionoscloud/api/label_api.rb +1 -1
  168. data/lib/ionoscloud/api/lan_api.rb +1 -1
  169. data/lib/ionoscloud/api/load_balancer_api.rb +1 -1
  170. data/lib/ionoscloud/api/location_api.rb +1 -1
  171. data/lib/ionoscloud/api/nic_api.rb +1 -1
  172. data/lib/ionoscloud/api/private_cross_connect_api.rb +1 -1
  173. data/lib/ionoscloud/api/request_api.rb +31 -7
  174. data/lib/ionoscloud/api/server_api.rb +1 -1
  175. data/lib/ionoscloud/api/snapshot_api.rb +1 -1
  176. data/lib/ionoscloud/api/user_management_api.rb +27 -9
  177. data/lib/ionoscloud/api/volume_api.rb +1 -1
  178. data/lib/ionoscloud/api_client.rb +18 -21
  179. data/lib/ionoscloud/api_error.rb +1 -1
  180. data/lib/ionoscloud/configuration.rb +3 -3
  181. data/lib/ionoscloud/models/attached_volumes.rb +68 -12
  182. data/lib/ionoscloud/models/backup_unit.rb +48 -6
  183. data/lib/ionoscloud/models/backup_unit_properties.rb +30 -4
  184. data/lib/ionoscloud/models/backup_unit_sso.rb +12 -2
  185. data/lib/ionoscloud/models/backup_units.rb +43 -11
  186. data/lib/ionoscloud/models/balanced_nics.rb +68 -12
  187. data/lib/ionoscloud/models/cdroms.rb +68 -12
  188. data/lib/ionoscloud/models/connectable_datacenter.rb +30 -4
  189. data/lib/ionoscloud/models/contract.rb +21 -3
  190. data/lib/ionoscloud/models/contract_properties.rb +48 -6
  191. data/lib/ionoscloud/models/data_center_entities.rb +39 -5
  192. data/lib/ionoscloud/models/datacenter.rb +57 -7
  193. data/lib/ionoscloud/models/datacenter_element_metadata.rb +77 -11
  194. data/lib/ionoscloud/models/datacenter_properties.rb +59 -33
  195. data/lib/ionoscloud/models/datacenters.rb +68 -12
  196. data/lib/ionoscloud/models/error.rb +23 -7
  197. data/lib/ionoscloud/models/error_message.rb +21 -3
  198. data/lib/ionoscloud/models/firewall_rule.rb +48 -6
  199. data/lib/ionoscloud/models/firewall_rules.rb +68 -12
  200. data/lib/ionoscloud/models/firewallrule_properties.rb +120 -31
  201. data/lib/ionoscloud/models/group.rb +48 -6
  202. data/lib/ionoscloud/models/group_entities.rb +21 -3
  203. data/lib/ionoscloud/models/group_members.rb +41 -9
  204. data/lib/ionoscloud/models/group_properties.rb +93 -11
  205. data/lib/ionoscloud/models/group_share.rb +39 -5
  206. data/lib/ionoscloud/models/group_share_properties.rb +21 -3
  207. data/lib/ionoscloud/models/group_shares.rb +41 -9
  208. data/lib/ionoscloud/models/group_users.rb +41 -9
  209. data/lib/ionoscloud/models/groups.rb +41 -9
  210. data/lib/ionoscloud/models/image.rb +48 -6
  211. data/lib/ionoscloud/models/image_properties.rb +209 -23
  212. data/lib/ionoscloud/models/images.rb +41 -9
  213. data/lib/ionoscloud/models/info.rb +30 -4
  214. data/lib/ionoscloud/models/ip_block.rb +48 -6
  215. data/lib/ionoscloud/models/ip_block_properties.rb +52 -14
  216. data/lib/ionoscloud/models/ip_blocks.rb +97 -12
  217. data/lib/ionoscloud/models/ip_consumer.rb +103 -11
  218. data/lib/ionoscloud/models/ip_failover.rb +21 -3
  219. data/lib/ionoscloud/models/kubernetes_auto_scaling.rb +21 -3
  220. data/lib/ionoscloud/models/kubernetes_cluster.rb +57 -7
  221. data/lib/ionoscloud/models/kubernetes_cluster_entities.rb +12 -2
  222. data/lib/ionoscloud/models/kubernetes_cluster_for_post.rb +353 -0
  223. data/lib/ionoscloud/models/kubernetes_cluster_for_put.rb +353 -0
  224. data/lib/ionoscloud/models/kubernetes_cluster_properties.rb +91 -17
  225. data/lib/ionoscloud/models/kubernetes_cluster_properties_for_post.rb +303 -0
  226. data/lib/ionoscloud/models/kubernetes_cluster_properties_for_put.rb +303 -0
  227. data/lib/ionoscloud/models/kubernetes_clusters.rb +41 -9
  228. data/lib/ionoscloud/models/kubernetes_config.rb +39 -5
  229. data/lib/ionoscloud/models/kubernetes_config_properties.rb +12 -2
  230. data/lib/ionoscloud/models/kubernetes_maintenance_window.rb +21 -3
  231. data/lib/ionoscloud/models/kubernetes_node.rb +50 -8
  232. data/lib/ionoscloud/models/kubernetes_node_metadata.rb +50 -8
  233. data/lib/ionoscloud/models/kubernetes_node_pool.rb +48 -6
  234. data/lib/ionoscloud/models/kubernetes_node_pool_for_post.rb +336 -0
  235. data/lib/ionoscloud/models/kubernetes_node_pool_for_put.rb +48 -6
  236. data/lib/ionoscloud/models/kubernetes_node_pool_lan.rb +17 -2
  237. data/lib/ionoscloud/models/kubernetes_node_pool_properties.rb +170 -42
  238. data/lib/ionoscloud/models/kubernetes_node_pool_properties_for_post.rb +159 -37
  239. data/lib/ionoscloud/models/kubernetes_node_pool_properties_for_put.rb +80 -165
  240. data/lib/ionoscloud/models/kubernetes_node_pools.rb +41 -9
  241. data/lib/ionoscloud/models/kubernetes_node_properties.rb +48 -9
  242. data/lib/ionoscloud/models/kubernetes_nodes.rb +43 -11
  243. data/lib/ionoscloud/models/label.rb +48 -6
  244. data/lib/ionoscloud/models/label_properties.rb +48 -6
  245. data/lib/ionoscloud/models/label_resource.rb +48 -6
  246. data/lib/ionoscloud/models/label_resource_properties.rb +21 -3
  247. data/lib/ionoscloud/models/label_resources.rb +70 -14
  248. data/lib/ionoscloud/models/labels.rb +43 -11
  249. data/lib/ionoscloud/models/lan.rb +57 -7
  250. data/lib/ionoscloud/models/lan_entities.rb +12 -2
  251. data/lib/ionoscloud/models/lan_nics.rb +68 -12
  252. data/lib/ionoscloud/models/lan_post.rb +57 -7
  253. data/lib/ionoscloud/models/lan_properties.rb +41 -9
  254. data/lib/ionoscloud/models/lan_properties_post.rb +41 -9
  255. data/lib/ionoscloud/models/lans.rb +68 -12
  256. data/lib/ionoscloud/models/loadbalancer.rb +57 -7
  257. data/lib/ionoscloud/models/loadbalancer_entities.rb +12 -2
  258. data/lib/ionoscloud/models/loadbalancer_properties.rb +42 -33
  259. data/lib/ionoscloud/models/loadbalancers.rb +68 -12
  260. data/lib/ionoscloud/models/location.rb +48 -6
  261. data/lib/ionoscloud/models/location_properties.rb +34 -34
  262. data/lib/ionoscloud/models/locations.rb +41 -9
  263. data/lib/ionoscloud/models/nic.rb +57 -7
  264. data/lib/ionoscloud/models/nic_entities.rb +12 -2
  265. data/lib/ionoscloud/models/nic_properties.rb +68 -12
  266. data/lib/ionoscloud/models/nics.rb +68 -12
  267. data/lib/ionoscloud/models/no_state_meta_data.rb +66 -8
  268. data/lib/ionoscloud/models/pagination_links.rb +30 -4
  269. data/lib/ionoscloud/models/peer.rb +48 -6
  270. data/lib/ionoscloud/models/private_cross_connect.rb +48 -6
  271. data/lib/ionoscloud/models/private_cross_connect_properties.rb +43 -13
  272. data/lib/ionoscloud/models/private_cross_connects.rb +41 -9
  273. data/lib/ionoscloud/models/request.rb +48 -6
  274. data/lib/ionoscloud/models/request_metadata.rb +39 -5
  275. data/lib/ionoscloud/models/request_properties.rb +41 -9
  276. data/lib/ionoscloud/models/request_status.rb +39 -5
  277. data/lib/ionoscloud/models/request_status_metadata.rb +41 -9
  278. data/lib/ionoscloud/models/request_target.rb +21 -3
  279. data/lib/ionoscloud/models/requests.rb +69 -13
  280. data/lib/ionoscloud/models/resource.rb +57 -7
  281. data/lib/ionoscloud/models/resource_entities.rb +12 -2
  282. data/lib/ionoscloud/models/resource_groups.rb +41 -9
  283. data/lib/ionoscloud/models/resource_limits.rb +156 -18
  284. data/lib/ionoscloud/models/resource_properties.rb +21 -3
  285. data/lib/ionoscloud/models/resource_reference.rb +30 -4
  286. data/lib/ionoscloud/models/resources.rb +41 -9
  287. data/lib/ionoscloud/models/resources_users.rb +41 -9
  288. data/lib/ionoscloud/models/{kubernetes_cluster_properties_for_post_and_put.rb → s3_bucket.rb} +19 -28
  289. data/lib/ionoscloud/models/s3_key.rb +48 -6
  290. data/lib/ionoscloud/models/s3_key_metadata.rb +21 -3
  291. data/lib/ionoscloud/models/s3_key_properties.rb +23 -5
  292. data/lib/ionoscloud/models/s3_keys.rb +41 -9
  293. data/lib/ionoscloud/models/s3_object_storage_sso.rb +12 -2
  294. data/lib/ionoscloud/models/server.rb +57 -7
  295. data/lib/ionoscloud/models/server_entities.rb +30 -4
  296. data/lib/ionoscloud/models/server_properties.rb +77 -11
  297. data/lib/ionoscloud/models/servers.rb +68 -12
  298. data/lib/ionoscloud/models/snapshot.rb +48 -6
  299. data/lib/ionoscloud/models/snapshot_properties.rb +147 -17
  300. data/lib/ionoscloud/models/snapshots.rb +41 -9
  301. data/lib/ionoscloud/models/type.rb +2 -1
  302. data/lib/ionoscloud/models/user.rb +57 -7
  303. data/lib/ionoscloud/models/user_metadata.rb +30 -4
  304. data/lib/ionoscloud/models/user_post.rb +231 -0
  305. data/lib/ionoscloud/models/user_properties.rb +74 -18
  306. data/lib/ionoscloud/models/user_properties_post.rb +353 -0
  307. data/lib/ionoscloud/models/user_properties_put.rb +335 -0
  308. data/lib/ionoscloud/models/user_put.rb +249 -0
  309. data/lib/ionoscloud/models/users.rb +97 -12
  310. data/lib/ionoscloud/models/users_entities.rb +21 -3
  311. data/lib/ionoscloud/models/volume.rb +48 -6
  312. data/lib/ionoscloud/models/volume_properties.rb +193 -31
  313. data/lib/ionoscloud/models/volumes.rb +68 -12
  314. data/lib/ionoscloud/version.rb +2 -2
  315. data/lib/ionoscloud.rb +11 -2
  316. data/lib/test_driver.rb +104 -0
  317. data/spec/api_client_spec.rb +1 -1
  318. data/spec/configuration_spec.rb +1 -1
  319. data/spec/spec_helper.rb +1 -1
  320. metadata +172 -291
  321. data/DOCS.md +0 -14618
  322. data/spec/api/_api_spec.rb +0 -49
  323. data/spec/api/backup_unit_api_spec.rb +0 -140
  324. data/spec/api/contract_api_spec.rb +0 -49
  325. data/spec/api/data_center_api_spec.rb +0 -128
  326. data/spec/api/image_api_spec.rb +0 -111
  327. data/spec/api/ip_blocks_api_spec.rb +0 -126
  328. data/spec/api/kubernetes_api_spec.rb +0 -306
  329. data/spec/api/label_api_spec.rb +0 -480
  330. data/spec/api/lan_api_spec.rb +0 -186
  331. data/spec/api/load_balancer_api_spec.rb +0 -203
  332. data/spec/api/location_api_spec.rb +0 -80
  333. data/spec/api/nic_api_spec.rb +0 -251
  334. data/spec/api/private_cross_connect_api_spec.rb +0 -110
  335. data/spec/api/request_api_spec.rb +0 -84
  336. data/spec/api/server_api_spec.rb +0 -337
  337. data/spec/api/snapshot_api_spec.rb +0 -111
  338. data/spec/api/user_management_api_spec.rb +0 -495
  339. data/spec/api/volume_api_spec.rb +0 -171
  340. data/spec/models/attached_volumes_spec.rb +0 -70
  341. data/spec/models/backup_unit_properties_spec.rb +0 -46
  342. data/spec/models/backup_unit_spec.rb +0 -62
  343. data/spec/models/backup_unit_sso_spec.rb +0 -34
  344. data/spec/models/backup_units_spec.rb +0 -56
  345. data/spec/models/balanced_nics_spec.rb +0 -70
  346. data/spec/models/cdroms_spec.rb +0 -70
  347. data/spec/models/connectable_datacenter_spec.rb +0 -46
  348. data/spec/models/contract_properties_spec.rb +0 -58
  349. data/spec/models/contract_spec.rb +0 -40
  350. data/spec/models/data_center_entities_spec.rb +0 -52
  351. data/spec/models/datacenter_element_metadata_spec.rb +0 -80
  352. data/spec/models/datacenter_properties_spec.rb +0 -68
  353. data/spec/models/datacenter_spec.rb +0 -64
  354. data/spec/models/datacenters_spec.rb +0 -70
  355. data/spec/models/error_message_spec.rb +0 -40
  356. data/spec/models/error_spec.rb +0 -40
  357. data/spec/models/firewall_rule_spec.rb +0 -58
  358. data/spec/models/firewall_rules_spec.rb +0 -70
  359. data/spec/models/firewallrule_properties_spec.rb +0 -98
  360. data/spec/models/group_entities_spec.rb +0 -40
  361. data/spec/models/group_members_spec.rb +0 -52
  362. data/spec/models/group_properties_spec.rb +0 -88
  363. data/spec/models/group_share_properties_spec.rb +0 -40
  364. data/spec/models/group_share_spec.rb +0 -52
  365. data/spec/models/group_shares_spec.rb +0 -52
  366. data/spec/models/group_spec.rb +0 -58
  367. data/spec/models/group_users_spec.rb +0 -52
  368. data/spec/models/groups_spec.rb +0 -52
  369. data/spec/models/image_properties_spec.rb +0 -138
  370. data/spec/models/image_spec.rb +0 -58
  371. data/spec/models/images_spec.rb +0 -52
  372. data/spec/models/info_spec.rb +0 -46
  373. data/spec/models/ip_block_properties_spec.rb +0 -58
  374. data/spec/models/ip_block_spec.rb +0 -58
  375. data/spec/models/ip_blocks_spec.rb +0 -52
  376. data/spec/models/ip_consumer_spec.rb +0 -70
  377. data/spec/models/ip_failover_spec.rb +0 -40
  378. data/spec/models/kubernetes_auto_scaling_spec.rb +0 -40
  379. data/spec/models/kubernetes_cluster_entities_spec.rb +0 -34
  380. data/spec/models/kubernetes_cluster_properties_for_post_and_put_spec.rb +0 -46
  381. data/spec/models/kubernetes_cluster_properties_spec.rb +0 -58
  382. data/spec/models/kubernetes_cluster_spec.rb +0 -68
  383. data/spec/models/kubernetes_clusters_spec.rb +0 -56
  384. data/spec/models/kubernetes_config_properties_spec.rb +0 -34
  385. data/spec/models/kubernetes_config_spec.rb +0 -56
  386. data/spec/models/kubernetes_maintenance_window_spec.rb +0 -44
  387. data/spec/models/kubernetes_node_metadata_spec.rb +0 -62
  388. data/spec/models/kubernetes_node_pool_for_put_spec.rb +0 -62
  389. data/spec/models/kubernetes_node_pool_lan_spec.rb +0 -34
  390. data/spec/models/kubernetes_node_pool_properties_for_post_spec.rb +0 -132
  391. data/spec/models/kubernetes_node_pool_properties_for_put_spec.rb +0 -132
  392. data/spec/models/kubernetes_node_pool_properties_spec.rb +0 -138
  393. data/spec/models/kubernetes_node_pool_spec.rb +0 -62
  394. data/spec/models/kubernetes_node_pools_spec.rb +0 -56
  395. data/spec/models/kubernetes_node_properties_spec.rb +0 -46
  396. data/spec/models/kubernetes_node_spec.rb +0 -62
  397. data/spec/models/kubernetes_nodes_spec.rb +0 -56
  398. data/spec/models/label_properties_spec.rb +0 -58
  399. data/spec/models/label_resource_properties_spec.rb +0 -40
  400. data/spec/models/label_resource_spec.rb +0 -62
  401. data/spec/models/label_resources_spec.rb +0 -74
  402. data/spec/models/label_spec.rb +0 -62
  403. data/spec/models/labels_spec.rb +0 -56
  404. data/spec/models/lan_entities_spec.rb +0 -34
  405. data/spec/models/lan_nics_spec.rb +0 -70
  406. data/spec/models/lan_post_spec.rb +0 -64
  407. data/spec/models/lan_properties_post_spec.rb +0 -52
  408. data/spec/models/lan_properties_spec.rb +0 -52
  409. data/spec/models/lan_spec.rb +0 -64
  410. data/spec/models/lans_spec.rb +0 -70
  411. data/spec/models/loadbalancer_entities_spec.rb +0 -34
  412. data/spec/models/loadbalancer_properties_spec.rb +0 -50
  413. data/spec/models/loadbalancer_spec.rb +0 -64
  414. data/spec/models/loadbalancers_spec.rb +0 -70
  415. data/spec/models/location_properties_spec.rb +0 -50
  416. data/spec/models/location_spec.rb +0 -58
  417. data/spec/models/locations_spec.rb +0 -52
  418. data/spec/models/nic_entities_spec.rb +0 -34
  419. data/spec/models/nic_properties_spec.rb +0 -70
  420. data/spec/models/nic_spec.rb +0 -64
  421. data/spec/models/nics_spec.rb +0 -70
  422. data/spec/models/no_state_meta_data_spec.rb +0 -70
  423. data/spec/models/pagination_links_spec.rb +0 -46
  424. data/spec/models/peer_spec.rb +0 -58
  425. data/spec/models/private_cross_connect_properties_spec.rb +0 -52
  426. data/spec/models/private_cross_connect_spec.rb +0 -58
  427. data/spec/models/private_cross_connects_spec.rb +0 -52
  428. data/spec/models/request_metadata_spec.rb +0 -52
  429. data/spec/models/request_properties_spec.rb +0 -52
  430. data/spec/models/request_spec.rb +0 -58
  431. data/spec/models/request_status_metadata_spec.rb +0 -56
  432. data/spec/models/request_status_spec.rb +0 -52
  433. data/spec/models/request_target_spec.rb +0 -44
  434. data/spec/models/requests_spec.rb +0 -70
  435. data/spec/models/resource_entities_spec.rb +0 -34
  436. data/spec/models/resource_groups_spec.rb +0 -52
  437. data/spec/models/resource_limits_spec.rb +0 -130
  438. data/spec/models/resource_properties_spec.rb +0 -40
  439. data/spec/models/resource_reference_spec.rb +0 -46
  440. data/spec/models/resource_spec.rb +0 -64
  441. data/spec/models/resources_spec.rb +0 -52
  442. data/spec/models/resources_users_spec.rb +0 -52
  443. data/spec/models/s3_key_metadata_spec.rb +0 -40
  444. data/spec/models/s3_key_properties_spec.rb +0 -40
  445. data/spec/models/s3_key_spec.rb +0 -58
  446. data/spec/models/s3_keys_spec.rb +0 -52
  447. data/spec/models/s3_object_storage_sso_spec.rb +0 -34
  448. data/spec/models/server_entities_spec.rb +0 -46
  449. data/spec/models/server_properties_spec.rb +0 -84
  450. data/spec/models/server_spec.rb +0 -64
  451. data/spec/models/servers_spec.rb +0 -70
  452. data/spec/models/snapshot_properties_spec.rb +0 -128
  453. data/spec/models/snapshot_spec.rb +0 -58
  454. data/spec/models/snapshots_spec.rb +0 -52
  455. data/spec/models/type_spec.rb +0 -28
  456. data/spec/models/user_metadata_spec.rb +0 -46
  457. data/spec/models/user_properties_spec.rb +0 -82
  458. data/spec/models/user_spec.rb +0 -64
  459. data/spec/models/users_entities_spec.rb +0 -40
  460. data/spec/models/users_spec.rb +0 -52
  461. data/spec/models/volume_properties_spec.rb +0 -152
  462. data/spec/models/volume_spec.rb +0 -58
  463. data/spec/models/volumes_spec.rb +0 -70
@@ -0,0 +1,353 @@
1
+ =begin
2
+ #CLOUD API
3
+
4
+ #An enterprise-grade Infrastructure is provided as a Service (IaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive.
5
+
6
+ The version of the OpenAPI document: 5.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Ionoscloud
17
+ class KubernetesClusterForPost
18
+
19
+ # The resource's unique identifier.
20
+ attr_accessor :id
21
+
22
+
23
+ # The type of object
24
+ attr_accessor :type
25
+
26
+
27
+ # URL to the object representation (absolute path)
28
+ attr_accessor :href
29
+
30
+
31
+ attr_accessor :metadata
32
+
33
+
34
+ attr_accessor :properties
35
+
36
+
37
+ attr_accessor :entities
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+
65
+ :'id' => :'id',
66
+
67
+ :'type' => :'type',
68
+
69
+ :'href' => :'href',
70
+
71
+ :'metadata' => :'metadata',
72
+
73
+ :'properties' => :'properties',
74
+
75
+ :'entities' => :'entities'
76
+ }
77
+ end
78
+
79
+ # Returns all the JSON keys this model knows about
80
+ def self.acceptable_attributes
81
+ attribute_map.values
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.openapi_types
86
+ {
87
+
88
+ :'id' => :'String',
89
+
90
+ :'type' => :'String',
91
+
92
+ :'href' => :'String',
93
+
94
+ :'metadata' => :'DatacenterElementMetadata',
95
+
96
+ :'properties' => :'KubernetesClusterPropertiesForPost',
97
+
98
+ :'entities' => :'KubernetesClusterEntities'
99
+ }
100
+ end
101
+
102
+ # List of attributes with nullable: true
103
+ def self.openapi_nullable
104
+ Set.new([
105
+
106
+
107
+
108
+
109
+
110
+
111
+ ])
112
+ end
113
+
114
+ # Initializes the object
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ def initialize(attributes = {})
117
+ if (!attributes.is_a?(Hash))
118
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Ionoscloud::KubernetesClusterForPost` initialize method"
119
+ end
120
+
121
+ # check to see if the attribute exists and convert string to symbol for hash key
122
+ attributes = attributes.each_with_object({}) { |(k, v), h|
123
+ if (!self.class.attribute_map.key?(k.to_sym))
124
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::KubernetesClusterForPost`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
125
+ end
126
+ h[k.to_sym] = v
127
+ }
128
+
129
+
130
+ if attributes.key?(:'id')
131
+ self.id = attributes[:'id']
132
+ end
133
+
134
+
135
+ if attributes.key?(:'type')
136
+ self.type = attributes[:'type']
137
+ end
138
+
139
+
140
+ if attributes.key?(:'href')
141
+ self.href = attributes[:'href']
142
+ end
143
+
144
+
145
+ if attributes.key?(:'metadata')
146
+ self.metadata = attributes[:'metadata']
147
+ end
148
+
149
+
150
+ if attributes.key?(:'properties')
151
+ self.properties = attributes[:'properties']
152
+ end
153
+
154
+
155
+ if attributes.key?(:'entities')
156
+ self.entities = attributes[:'entities']
157
+ end
158
+ end
159
+
160
+ # Show invalid properties with the reasons. Usually used together with valid?
161
+ # @return Array for valid properties with the reasons
162
+ def list_invalid_properties
163
+ invalid_properties = Array.new
164
+
165
+
166
+
167
+
168
+
169
+ if @properties.nil?
170
+ invalid_properties.push('invalid value for "properties", properties cannot be nil.')
171
+ end
172
+
173
+
174
+ invalid_properties
175
+ end
176
+
177
+ # Check to see if the all the properties in the model are valid
178
+ # @return true if the model is valid
179
+ def valid?
180
+
181
+
182
+ type_validator = EnumAttributeValidator.new('String', ["k8s"])
183
+ return false unless type_validator.valid?(@type)
184
+
185
+
186
+
187
+ return false if @properties.nil?
188
+
189
+ true
190
+ end
191
+
192
+
193
+
194
+ # Custom attribute writer method checking allowed values (enum).
195
+ # @param [Object] type Object to be assigned
196
+ def type=(type)
197
+ validator = EnumAttributeValidator.new('String', ["k8s"])
198
+ unless validator.valid?(type)
199
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
200
+ end
201
+ @type = type
202
+ end
203
+
204
+
205
+
206
+
207
+
208
+ # Checks equality by comparing each attribute.
209
+ # @param [Object] Object to be compared
210
+ def ==(o)
211
+ return true if self.equal?(o)
212
+ self.class == o.class &&
213
+ id == o.id &&
214
+ type == o.type &&
215
+ href == o.href &&
216
+ metadata == o.metadata &&
217
+ properties == o.properties &&
218
+ entities == o.entities
219
+ end
220
+
221
+ # @see the `==` method
222
+ # @param [Object] Object to be compared
223
+ def eql?(o)
224
+ self == o
225
+ end
226
+
227
+ # Calculates hash code according to all attributes.
228
+ # @return [Integer] Hash code
229
+ def hash
230
+ [id, type, href, metadata, properties, entities].hash
231
+ end
232
+
233
+ # Builds the object from hash
234
+ # @param [Hash] attributes Model attributes in the form of hash
235
+ # @return [Object] Returns the model itself
236
+ def self.build_from_hash(attributes)
237
+ new.build_from_hash(attributes)
238
+ end
239
+
240
+ # Builds the object from hash
241
+ # @param [Hash] attributes Model attributes in the form of hash
242
+ # @return [Object] Returns the model itself
243
+ def build_from_hash(attributes)
244
+ return nil unless attributes.is_a?(Hash)
245
+ self.class.openapi_types.each_pair do |key, type|
246
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
247
+ self.send("#{key}=", nil)
248
+ elsif type =~ /\AArray<(.*)>/i
249
+ # check to ensure the input is an array given that the attribute
250
+ # is documented as an array but the input is not
251
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
252
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
253
+ end
254
+ elsif !attributes[self.class.attribute_map[key]].nil?
255
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
256
+ end
257
+ end
258
+
259
+ self
260
+ end
261
+
262
+ # Deserializes the data based on type
263
+ # @param string type Data type
264
+ # @param string value Value to be deserialized
265
+ # @return [Object] Deserialized data
266
+ def _deserialize(type, value)
267
+ case type.to_sym
268
+ when :Time
269
+ Time.parse(value)
270
+ when :Date
271
+ Date.parse(value)
272
+ when :String
273
+ value.to_s
274
+ when :Integer
275
+ value.to_i
276
+ when :Float
277
+ value.to_f
278
+ when :Boolean
279
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
280
+ true
281
+ else
282
+ false
283
+ end
284
+ when :Object
285
+ # generic object (usually a Hash), return directly
286
+ value
287
+ when /\AArray<(?<inner_type>.+)>\z/
288
+ inner_type = Regexp.last_match[:inner_type]
289
+ value.map { |v| _deserialize(inner_type, v) }
290
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
291
+ k_type = Regexp.last_match[:k_type]
292
+ v_type = Regexp.last_match[:v_type]
293
+ {}.tap do |hash|
294
+ value.each do |k, v|
295
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
296
+ end
297
+ end
298
+ else # model
299
+ # models (e.g. Pet) or oneOf
300
+ klass = Ionoscloud.const_get(type)
301
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
302
+ end
303
+ end
304
+
305
+ # Returns the string representation of the object
306
+ # @return [String] String presentation of the object
307
+ def to_s
308
+ to_hash.to_s
309
+ end
310
+
311
+ # to_body is an alias to to_hash (backward compatibility)
312
+ # @return [Hash] Returns the object in the form of hash
313
+ def to_body
314
+ to_hash
315
+ end
316
+
317
+ # Returns the object in the form of hash
318
+ # @return [Hash] Returns the object in the form of hash
319
+ def to_hash
320
+ hash = {}
321
+ self.class.attribute_map.each_pair do |attr, param|
322
+ value = self.send(attr)
323
+ if value.nil?
324
+ is_nullable = self.class.openapi_nullable.include?(attr)
325
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
326
+ end
327
+
328
+ hash[param] = _to_hash(value)
329
+ end
330
+ hash
331
+ end
332
+
333
+ # Outputs non-array value in the form of hash
334
+ # For object, use to_hash. Otherwise, just return the value
335
+ # @param [Object] value Any valid value
336
+ # @return [Hash] Returns the value in the form of hash
337
+ def _to_hash(value)
338
+ if value.is_a?(Array)
339
+ value.compact.map { |v| _to_hash(v) }
340
+ elsif value.is_a?(Hash)
341
+ {}.tap do |hash|
342
+ value.each { |k, v| hash[k] = _to_hash(v) }
343
+ end
344
+ elsif value.respond_to? :to_hash
345
+ value.to_hash
346
+ else
347
+ value
348
+ end
349
+ end
350
+
351
+ end
352
+
353
+ end
@@ -0,0 +1,353 @@
1
+ =begin
2
+ #CLOUD API
3
+
4
+ #An enterprise-grade Infrastructure is provided as a Service (IaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive.
5
+
6
+ The version of the OpenAPI document: 5.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Ionoscloud
17
+ class KubernetesClusterForPut
18
+
19
+ # The resource's unique identifier.
20
+ attr_accessor :id
21
+
22
+
23
+ # The type of object
24
+ attr_accessor :type
25
+
26
+
27
+ # URL to the object representation (absolute path)
28
+ attr_accessor :href
29
+
30
+
31
+ attr_accessor :metadata
32
+
33
+
34
+ attr_accessor :properties
35
+
36
+
37
+ attr_accessor :entities
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+
65
+ :'id' => :'id',
66
+
67
+ :'type' => :'type',
68
+
69
+ :'href' => :'href',
70
+
71
+ :'metadata' => :'metadata',
72
+
73
+ :'properties' => :'properties',
74
+
75
+ :'entities' => :'entities'
76
+ }
77
+ end
78
+
79
+ # Returns all the JSON keys this model knows about
80
+ def self.acceptable_attributes
81
+ attribute_map.values
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.openapi_types
86
+ {
87
+
88
+ :'id' => :'String',
89
+
90
+ :'type' => :'String',
91
+
92
+ :'href' => :'String',
93
+
94
+ :'metadata' => :'DatacenterElementMetadata',
95
+
96
+ :'properties' => :'KubernetesClusterPropertiesForPut',
97
+
98
+ :'entities' => :'KubernetesClusterEntities'
99
+ }
100
+ end
101
+
102
+ # List of attributes with nullable: true
103
+ def self.openapi_nullable
104
+ Set.new([
105
+
106
+
107
+
108
+
109
+
110
+
111
+ ])
112
+ end
113
+
114
+ # Initializes the object
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ def initialize(attributes = {})
117
+ if (!attributes.is_a?(Hash))
118
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Ionoscloud::KubernetesClusterForPut` initialize method"
119
+ end
120
+
121
+ # check to see if the attribute exists and convert string to symbol for hash key
122
+ attributes = attributes.each_with_object({}) { |(k, v), h|
123
+ if (!self.class.attribute_map.key?(k.to_sym))
124
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::KubernetesClusterForPut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
125
+ end
126
+ h[k.to_sym] = v
127
+ }
128
+
129
+
130
+ if attributes.key?(:'id')
131
+ self.id = attributes[:'id']
132
+ end
133
+
134
+
135
+ if attributes.key?(:'type')
136
+ self.type = attributes[:'type']
137
+ end
138
+
139
+
140
+ if attributes.key?(:'href')
141
+ self.href = attributes[:'href']
142
+ end
143
+
144
+
145
+ if attributes.key?(:'metadata')
146
+ self.metadata = attributes[:'metadata']
147
+ end
148
+
149
+
150
+ if attributes.key?(:'properties')
151
+ self.properties = attributes[:'properties']
152
+ end
153
+
154
+
155
+ if attributes.key?(:'entities')
156
+ self.entities = attributes[:'entities']
157
+ end
158
+ end
159
+
160
+ # Show invalid properties with the reasons. Usually used together with valid?
161
+ # @return Array for valid properties with the reasons
162
+ def list_invalid_properties
163
+ invalid_properties = Array.new
164
+
165
+
166
+
167
+
168
+
169
+ if @properties.nil?
170
+ invalid_properties.push('invalid value for "properties", properties cannot be nil.')
171
+ end
172
+
173
+
174
+ invalid_properties
175
+ end
176
+
177
+ # Check to see if the all the properties in the model are valid
178
+ # @return true if the model is valid
179
+ def valid?
180
+
181
+
182
+ type_validator = EnumAttributeValidator.new('String', ["k8s"])
183
+ return false unless type_validator.valid?(@type)
184
+
185
+
186
+
187
+ return false if @properties.nil?
188
+
189
+ true
190
+ end
191
+
192
+
193
+
194
+ # Custom attribute writer method checking allowed values (enum).
195
+ # @param [Object] type Object to be assigned
196
+ def type=(type)
197
+ validator = EnumAttributeValidator.new('String', ["k8s"])
198
+ unless validator.valid?(type)
199
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
200
+ end
201
+ @type = type
202
+ end
203
+
204
+
205
+
206
+
207
+
208
+ # Checks equality by comparing each attribute.
209
+ # @param [Object] Object to be compared
210
+ def ==(o)
211
+ return true if self.equal?(o)
212
+ self.class == o.class &&
213
+ id == o.id &&
214
+ type == o.type &&
215
+ href == o.href &&
216
+ metadata == o.metadata &&
217
+ properties == o.properties &&
218
+ entities == o.entities
219
+ end
220
+
221
+ # @see the `==` method
222
+ # @param [Object] Object to be compared
223
+ def eql?(o)
224
+ self == o
225
+ end
226
+
227
+ # Calculates hash code according to all attributes.
228
+ # @return [Integer] Hash code
229
+ def hash
230
+ [id, type, href, metadata, properties, entities].hash
231
+ end
232
+
233
+ # Builds the object from hash
234
+ # @param [Hash] attributes Model attributes in the form of hash
235
+ # @return [Object] Returns the model itself
236
+ def self.build_from_hash(attributes)
237
+ new.build_from_hash(attributes)
238
+ end
239
+
240
+ # Builds the object from hash
241
+ # @param [Hash] attributes Model attributes in the form of hash
242
+ # @return [Object] Returns the model itself
243
+ def build_from_hash(attributes)
244
+ return nil unless attributes.is_a?(Hash)
245
+ self.class.openapi_types.each_pair do |key, type|
246
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
247
+ self.send("#{key}=", nil)
248
+ elsif type =~ /\AArray<(.*)>/i
249
+ # check to ensure the input is an array given that the attribute
250
+ # is documented as an array but the input is not
251
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
252
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
253
+ end
254
+ elsif !attributes[self.class.attribute_map[key]].nil?
255
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
256
+ end
257
+ end
258
+
259
+ self
260
+ end
261
+
262
+ # Deserializes the data based on type
263
+ # @param string type Data type
264
+ # @param string value Value to be deserialized
265
+ # @return [Object] Deserialized data
266
+ def _deserialize(type, value)
267
+ case type.to_sym
268
+ when :Time
269
+ Time.parse(value)
270
+ when :Date
271
+ Date.parse(value)
272
+ when :String
273
+ value.to_s
274
+ when :Integer
275
+ value.to_i
276
+ when :Float
277
+ value.to_f
278
+ when :Boolean
279
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
280
+ true
281
+ else
282
+ false
283
+ end
284
+ when :Object
285
+ # generic object (usually a Hash), return directly
286
+ value
287
+ when /\AArray<(?<inner_type>.+)>\z/
288
+ inner_type = Regexp.last_match[:inner_type]
289
+ value.map { |v| _deserialize(inner_type, v) }
290
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
291
+ k_type = Regexp.last_match[:k_type]
292
+ v_type = Regexp.last_match[:v_type]
293
+ {}.tap do |hash|
294
+ value.each do |k, v|
295
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
296
+ end
297
+ end
298
+ else # model
299
+ # models (e.g. Pet) or oneOf
300
+ klass = Ionoscloud.const_get(type)
301
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
302
+ end
303
+ end
304
+
305
+ # Returns the string representation of the object
306
+ # @return [String] String presentation of the object
307
+ def to_s
308
+ to_hash.to_s
309
+ end
310
+
311
+ # to_body is an alias to to_hash (backward compatibility)
312
+ # @return [Hash] Returns the object in the form of hash
313
+ def to_body
314
+ to_hash
315
+ end
316
+
317
+ # Returns the object in the form of hash
318
+ # @return [Hash] Returns the object in the form of hash
319
+ def to_hash
320
+ hash = {}
321
+ self.class.attribute_map.each_pair do |attr, param|
322
+ value = self.send(attr)
323
+ if value.nil?
324
+ is_nullable = self.class.openapi_nullable.include?(attr)
325
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
326
+ end
327
+
328
+ hash[param] = _to_hash(value)
329
+ end
330
+ hash
331
+ end
332
+
333
+ # Outputs non-array value in the form of hash
334
+ # For object, use to_hash. Otherwise, just return the value
335
+ # @param [Object] value Any valid value
336
+ # @return [Hash] Returns the value in the form of hash
337
+ def _to_hash(value)
338
+ if value.is_a?(Array)
339
+ value.compact.map { |v| _to_hash(v) }
340
+ elsif value.is_a?(Hash)
341
+ {}.tap do |hash|
342
+ value.each { |k, v| hash[k] = _to_hash(v) }
343
+ end
344
+ elsif value.respond_to? :to_hash
345
+ value.to_hash
346
+ else
347
+ value
348
+ end
349
+ end
350
+
351
+ end
352
+
353
+ end