ionoscloud 5.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (300) hide show
  1. checksums.yaml +7 -0
  2. data/DOCS.md +14618 -0
  3. data/Gemfile +9 -0
  4. data/README.md +55 -0
  5. data/Rakefile +10 -0
  6. data/git_push.sh +58 -0
  7. data/ionoscloud.gemspec +38 -0
  8. data/lib/ionoscloud.rb +181 -0
  9. data/lib/ionoscloud/api/_api.rb +96 -0
  10. data/lib/ionoscloud/api/backup_unit_api.rb +583 -0
  11. data/lib/ionoscloud/api/contract_api.rb +96 -0
  12. data/lib/ionoscloud/api/data_center_api.rb +532 -0
  13. data/lib/ionoscloud/api/image_api.rb +432 -0
  14. data/lib/ionoscloud/api/ip_blocks_api.rb +514 -0
  15. data/lib/ionoscloud/api/kubernetes_api.rb +1479 -0
  16. data/lib/ionoscloud/api/label_api.rb +2460 -0
  17. data/lib/ionoscloud/api/lan_api.rb +858 -0
  18. data/lib/ionoscloud/api/load_balancer_api.rb +950 -0
  19. data/lib/ionoscloud/api/location_api.rb +262 -0
  20. data/lib/ionoscloud/api/nic_api.rb +1222 -0
  21. data/lib/ionoscloud/api/private_cross_connect_api.rb +426 -0
  22. data/lib/ionoscloud/api/request_api.rb +283 -0
  23. data/lib/ionoscloud/api/server_api.rb +1679 -0
  24. data/lib/ionoscloud/api/snapshot_api.rb +432 -0
  25. data/lib/ionoscloud/api/user_management_api.rb +2495 -0
  26. data/lib/ionoscloud/api/volume_api.rb +763 -0
  27. data/lib/ionoscloud/api_client.rb +521 -0
  28. data/lib/ionoscloud/api_error.rb +57 -0
  29. data/lib/ionoscloud/configuration.rb +291 -0
  30. data/lib/ionoscloud/models/attached_volumes.rb +278 -0
  31. data/lib/ionoscloud/models/backup_unit.rb +294 -0
  32. data/lib/ionoscloud/models/backup_unit_properties.rb +242 -0
  33. data/lib/ionoscloud/models/backup_unit_sso.rb +217 -0
  34. data/lib/ionoscloud/models/backup_units.rb +283 -0
  35. data/lib/ionoscloud/models/balanced_nics.rb +278 -0
  36. data/lib/ionoscloud/models/cdroms.rb +278 -0
  37. data/lib/ionoscloud/models/connectable_datacenter.rb +234 -0
  38. data/lib/ionoscloud/models/contract.rb +231 -0
  39. data/lib/ionoscloud/models/contract_properties.rb +256 -0
  40. data/lib/ionoscloud/models/data_center_entities.rb +243 -0
  41. data/lib/ionoscloud/models/datacenter.rb +269 -0
  42. data/lib/ionoscloud/models/datacenter_element_metadata.rb +321 -0
  43. data/lib/ionoscloud/models/datacenter_properties.rb +296 -0
  44. data/lib/ionoscloud/models/datacenters.rb +278 -0
  45. data/lib/ionoscloud/models/error.rb +228 -0
  46. data/lib/ionoscloud/models/error_message.rb +227 -0
  47. data/lib/ionoscloud/models/firewall_rule.rb +260 -0
  48. data/lib/ionoscloud/models/firewall_rules.rb +278 -0
  49. data/lib/ionoscloud/models/firewallrule_properties.rb +468 -0
  50. data/lib/ionoscloud/models/group.rb +260 -0
  51. data/lib/ionoscloud/models/group_entities.rb +225 -0
  52. data/lib/ionoscloud/models/group_members.rb +249 -0
  53. data/lib/ionoscloud/models/group_properties.rb +307 -0
  54. data/lib/ionoscloud/models/group_share.rb +251 -0
  55. data/lib/ionoscloud/models/group_share_properties.rb +227 -0
  56. data/lib/ionoscloud/models/group_shares.rb +249 -0
  57. data/lib/ionoscloud/models/group_users.rb +250 -0
  58. data/lib/ionoscloud/models/groups.rb +249 -0
  59. data/lib/ionoscloud/models/image.rb +260 -0
  60. data/lib/ionoscloud/models/image_properties.rb +428 -0
  61. data/lib/ionoscloud/models/images.rb +249 -0
  62. data/lib/ionoscloud/models/info.rb +237 -0
  63. data/lib/ionoscloud/models/ip_block.rb +260 -0
  64. data/lib/ionoscloud/models/ip_block_properties.rb +271 -0
  65. data/lib/ionoscloud/models/ip_blocks.rb +249 -0
  66. data/lib/ionoscloud/models/ip_consumer.rb +270 -0
  67. data/lib/ionoscloud/models/ip_failover.rb +225 -0
  68. data/lib/ionoscloud/models/kubernetes_auto_scaling.rb +227 -0
  69. data/lib/ionoscloud/models/kubernetes_cluster.rb +303 -0
  70. data/lib/ionoscloud/models/kubernetes_cluster_entities.rb +216 -0
  71. data/lib/ionoscloud/models/kubernetes_cluster_properties.rb +265 -0
  72. data/lib/ionoscloud/models/kubernetes_cluster_properties_for_post_and_put.rb +241 -0
  73. data/lib/ionoscloud/models/kubernetes_clusters.rb +283 -0
  74. data/lib/ionoscloud/models/kubernetes_config.rb +285 -0
  75. data/lib/ionoscloud/models/kubernetes_config_properties.rb +217 -0
  76. data/lib/ionoscloud/models/kubernetes_maintenance_window.rb +261 -0
  77. data/lib/ionoscloud/models/kubernetes_node.rb +294 -0
  78. data/lib/ionoscloud/models/kubernetes_node_metadata.rb +291 -0
  79. data/lib/ionoscloud/models/kubernetes_node_pool.rb +294 -0
  80. data/lib/ionoscloud/models/kubernetes_node_pool_for_put.rb +294 -0
  81. data/lib/ionoscloud/models/kubernetes_node_pool_lan.rb +217 -0
  82. data/lib/ionoscloud/models/kubernetes_node_pool_properties.rb +476 -0
  83. data/lib/ionoscloud/models/kubernetes_node_pool_properties_for_post.rb +464 -0
  84. data/lib/ionoscloud/models/kubernetes_node_pool_properties_for_put.rb +464 -0
  85. data/lib/ionoscloud/models/kubernetes_node_pools.rb +283 -0
  86. data/lib/ionoscloud/models/kubernetes_node_properties.rb +252 -0
  87. data/lib/ionoscloud/models/kubernetes_nodes.rb +283 -0
  88. data/lib/ionoscloud/models/label.rb +294 -0
  89. data/lib/ionoscloud/models/label_properties.rb +257 -0
  90. data/lib/ionoscloud/models/label_resource.rb +294 -0
  91. data/lib/ionoscloud/models/label_resource_properties.rb +227 -0
  92. data/lib/ionoscloud/models/label_resources.rb +312 -0
  93. data/lib/ionoscloud/models/labels.rb +283 -0
  94. data/lib/ionoscloud/models/lan.rb +269 -0
  95. data/lib/ionoscloud/models/lan_entities.rb +216 -0
  96. data/lib/ionoscloud/models/lan_nics.rb +278 -0
  97. data/lib/ionoscloud/models/lan_post.rb +269 -0
  98. data/lib/ionoscloud/models/lan_properties.rb +249 -0
  99. data/lib/ionoscloud/models/lan_properties_post.rb +249 -0
  100. data/lib/ionoscloud/models/lans.rb +278 -0
  101. data/lib/ionoscloud/models/loadbalancer.rb +269 -0
  102. data/lib/ionoscloud/models/loadbalancer_entities.rb +216 -0
  103. data/lib/ionoscloud/models/loadbalancer_properties.rb +271 -0
  104. data/lib/ionoscloud/models/loadbalancers.rb +278 -0
  105. data/lib/ionoscloud/models/location.rb +260 -0
  106. data/lib/ionoscloud/models/location_properties.rb +263 -0
  107. data/lib/ionoscloud/models/locations.rb +249 -0
  108. data/lib/ionoscloud/models/nic.rb +269 -0
  109. data/lib/ionoscloud/models/nic_entities.rb +216 -0
  110. data/lib/ionoscloud/models/nic_properties.rb +284 -0
  111. data/lib/ionoscloud/models/nics.rb +278 -0
  112. data/lib/ionoscloud/models/no_state_meta_data.rb +277 -0
  113. data/lib/ionoscloud/models/pagination_links.rb +237 -0
  114. data/lib/ionoscloud/models/peer.rb +252 -0
  115. data/lib/ionoscloud/models/private_cross_connect.rb +260 -0
  116. data/lib/ionoscloud/models/private_cross_connect_properties.rb +251 -0
  117. data/lib/ionoscloud/models/private_cross_connects.rb +249 -0
  118. data/lib/ionoscloud/models/request.rb +260 -0
  119. data/lib/ionoscloud/models/request_metadata.rb +246 -0
  120. data/lib/ionoscloud/models/request_properties.rb +245 -0
  121. data/lib/ionoscloud/models/request_status.rb +246 -0
  122. data/lib/ionoscloud/models/request_status_metadata.rb +280 -0
  123. data/lib/ionoscloud/models/request_target.rb +259 -0
  124. data/lib/ionoscloud/models/requests.rb +293 -0
  125. data/lib/ionoscloud/models/resource.rb +265 -0
  126. data/lib/ionoscloud/models/resource_entities.rb +216 -0
  127. data/lib/ionoscloud/models/resource_groups.rb +250 -0
  128. data/lib/ionoscloud/models/resource_limits.rb +462 -0
  129. data/lib/ionoscloud/models/resource_properties.rb +227 -0
  130. data/lib/ionoscloud/models/resource_reference.rb +242 -0
  131. data/lib/ionoscloud/models/resources.rb +250 -0
  132. data/lib/ionoscloud/models/resources_users.rb +250 -0
  133. data/lib/ionoscloud/models/s3_key.rb +260 -0
  134. data/lib/ionoscloud/models/s3_key_metadata.rb +227 -0
  135. data/lib/ionoscloud/models/s3_key_properties.rb +227 -0
  136. data/lib/ionoscloud/models/s3_keys.rb +249 -0
  137. data/lib/ionoscloud/models/s3_object_storage_sso.rb +217 -0
  138. data/lib/ionoscloud/models/server.rb +269 -0
  139. data/lib/ionoscloud/models/server_entities.rb +234 -0
  140. data/lib/ionoscloud/models/server_properties.rb +341 -0
  141. data/lib/ionoscloud/models/servers.rb +278 -0
  142. data/lib/ionoscloud/models/snapshot.rb +260 -0
  143. data/lib/ionoscloud/models/snapshot_properties.rb +401 -0
  144. data/lib/ionoscloud/models/snapshots.rb +249 -0
  145. data/lib/ionoscloud/models/type.rb +59 -0
  146. data/lib/ionoscloud/models/user.rb +269 -0
  147. data/lib/ionoscloud/models/user_metadata.rb +237 -0
  148. data/lib/ionoscloud/models/user_properties.rb +297 -0
  149. data/lib/ionoscloud/models/users.rb +249 -0
  150. data/lib/ionoscloud/models/users_entities.rb +225 -0
  151. data/lib/ionoscloud/models/volume.rb +260 -0
  152. data/lib/ionoscloud/models/volume_properties.rb +463 -0
  153. data/lib/ionoscloud/models/volumes.rb +278 -0
  154. data/lib/ionoscloud/version.rb +15 -0
  155. data/spec/api/_api_spec.rb +49 -0
  156. data/spec/api/backup_unit_api_spec.rb +140 -0
  157. data/spec/api/contract_api_spec.rb +49 -0
  158. data/spec/api/data_center_api_spec.rb +128 -0
  159. data/spec/api/image_api_spec.rb +111 -0
  160. data/spec/api/ip_blocks_api_spec.rb +126 -0
  161. data/spec/api/kubernetes_api_spec.rb +306 -0
  162. data/spec/api/label_api_spec.rb +480 -0
  163. data/spec/api/lan_api_spec.rb +186 -0
  164. data/spec/api/load_balancer_api_spec.rb +203 -0
  165. data/spec/api/location_api_spec.rb +80 -0
  166. data/spec/api/nic_api_spec.rb +251 -0
  167. data/spec/api/private_cross_connect_api_spec.rb +110 -0
  168. data/spec/api/request_api_spec.rb +84 -0
  169. data/spec/api/server_api_spec.rb +337 -0
  170. data/spec/api/snapshot_api_spec.rb +111 -0
  171. data/spec/api/user_management_api_spec.rb +495 -0
  172. data/spec/api/volume_api_spec.rb +171 -0
  173. data/spec/api_client_spec.rb +226 -0
  174. data/spec/configuration_spec.rb +42 -0
  175. data/spec/models/attached_volumes_spec.rb +70 -0
  176. data/spec/models/backup_unit_properties_spec.rb +46 -0
  177. data/spec/models/backup_unit_spec.rb +62 -0
  178. data/spec/models/backup_unit_sso_spec.rb +34 -0
  179. data/spec/models/backup_units_spec.rb +56 -0
  180. data/spec/models/balanced_nics_spec.rb +70 -0
  181. data/spec/models/cdroms_spec.rb +70 -0
  182. data/spec/models/connectable_datacenter_spec.rb +46 -0
  183. data/spec/models/contract_properties_spec.rb +58 -0
  184. data/spec/models/contract_spec.rb +40 -0
  185. data/spec/models/data_center_entities_spec.rb +52 -0
  186. data/spec/models/datacenter_element_metadata_spec.rb +80 -0
  187. data/spec/models/datacenter_properties_spec.rb +68 -0
  188. data/spec/models/datacenter_spec.rb +64 -0
  189. data/spec/models/datacenters_spec.rb +70 -0
  190. data/spec/models/error_message_spec.rb +40 -0
  191. data/spec/models/error_spec.rb +40 -0
  192. data/spec/models/firewall_rule_spec.rb +58 -0
  193. data/spec/models/firewall_rules_spec.rb +70 -0
  194. data/spec/models/firewallrule_properties_spec.rb +98 -0
  195. data/spec/models/group_entities_spec.rb +40 -0
  196. data/spec/models/group_members_spec.rb +52 -0
  197. data/spec/models/group_properties_spec.rb +88 -0
  198. data/spec/models/group_share_properties_spec.rb +40 -0
  199. data/spec/models/group_share_spec.rb +52 -0
  200. data/spec/models/group_shares_spec.rb +52 -0
  201. data/spec/models/group_spec.rb +58 -0
  202. data/spec/models/group_users_spec.rb +52 -0
  203. data/spec/models/groups_spec.rb +52 -0
  204. data/spec/models/image_properties_spec.rb +138 -0
  205. data/spec/models/image_spec.rb +58 -0
  206. data/spec/models/images_spec.rb +52 -0
  207. data/spec/models/info_spec.rb +46 -0
  208. data/spec/models/ip_block_properties_spec.rb +58 -0
  209. data/spec/models/ip_block_spec.rb +58 -0
  210. data/spec/models/ip_blocks_spec.rb +52 -0
  211. data/spec/models/ip_consumer_spec.rb +70 -0
  212. data/spec/models/ip_failover_spec.rb +40 -0
  213. data/spec/models/kubernetes_auto_scaling_spec.rb +40 -0
  214. data/spec/models/kubernetes_cluster_entities_spec.rb +34 -0
  215. data/spec/models/kubernetes_cluster_properties_for_post_and_put_spec.rb +46 -0
  216. data/spec/models/kubernetes_cluster_properties_spec.rb +58 -0
  217. data/spec/models/kubernetes_cluster_spec.rb +68 -0
  218. data/spec/models/kubernetes_clusters_spec.rb +56 -0
  219. data/spec/models/kubernetes_config_properties_spec.rb +34 -0
  220. data/spec/models/kubernetes_config_spec.rb +56 -0
  221. data/spec/models/kubernetes_maintenance_window_spec.rb +44 -0
  222. data/spec/models/kubernetes_node_metadata_spec.rb +62 -0
  223. data/spec/models/kubernetes_node_pool_for_put_spec.rb +62 -0
  224. data/spec/models/kubernetes_node_pool_lan_spec.rb +34 -0
  225. data/spec/models/kubernetes_node_pool_properties_for_post_spec.rb +132 -0
  226. data/spec/models/kubernetes_node_pool_properties_for_put_spec.rb +132 -0
  227. data/spec/models/kubernetes_node_pool_properties_spec.rb +138 -0
  228. data/spec/models/kubernetes_node_pool_spec.rb +62 -0
  229. data/spec/models/kubernetes_node_pools_spec.rb +56 -0
  230. data/spec/models/kubernetes_node_properties_spec.rb +46 -0
  231. data/spec/models/kubernetes_node_spec.rb +62 -0
  232. data/spec/models/kubernetes_nodes_spec.rb +56 -0
  233. data/spec/models/label_properties_spec.rb +58 -0
  234. data/spec/models/label_resource_properties_spec.rb +40 -0
  235. data/spec/models/label_resource_spec.rb +62 -0
  236. data/spec/models/label_resources_spec.rb +74 -0
  237. data/spec/models/label_spec.rb +62 -0
  238. data/spec/models/labels_spec.rb +56 -0
  239. data/spec/models/lan_entities_spec.rb +34 -0
  240. data/spec/models/lan_nics_spec.rb +70 -0
  241. data/spec/models/lan_post_spec.rb +64 -0
  242. data/spec/models/lan_properties_post_spec.rb +52 -0
  243. data/spec/models/lan_properties_spec.rb +52 -0
  244. data/spec/models/lan_spec.rb +64 -0
  245. data/spec/models/lans_spec.rb +70 -0
  246. data/spec/models/loadbalancer_entities_spec.rb +34 -0
  247. data/spec/models/loadbalancer_properties_spec.rb +50 -0
  248. data/spec/models/loadbalancer_spec.rb +64 -0
  249. data/spec/models/loadbalancers_spec.rb +70 -0
  250. data/spec/models/location_properties_spec.rb +50 -0
  251. data/spec/models/location_spec.rb +58 -0
  252. data/spec/models/locations_spec.rb +52 -0
  253. data/spec/models/nic_entities_spec.rb +34 -0
  254. data/spec/models/nic_properties_spec.rb +70 -0
  255. data/spec/models/nic_spec.rb +64 -0
  256. data/spec/models/nics_spec.rb +70 -0
  257. data/spec/models/no_state_meta_data_spec.rb +70 -0
  258. data/spec/models/pagination_links_spec.rb +46 -0
  259. data/spec/models/peer_spec.rb +58 -0
  260. data/spec/models/private_cross_connect_properties_spec.rb +52 -0
  261. data/spec/models/private_cross_connect_spec.rb +58 -0
  262. data/spec/models/private_cross_connects_spec.rb +52 -0
  263. data/spec/models/request_metadata_spec.rb +52 -0
  264. data/spec/models/request_properties_spec.rb +52 -0
  265. data/spec/models/request_spec.rb +58 -0
  266. data/spec/models/request_status_metadata_spec.rb +56 -0
  267. data/spec/models/request_status_spec.rb +52 -0
  268. data/spec/models/request_target_spec.rb +44 -0
  269. data/spec/models/requests_spec.rb +70 -0
  270. data/spec/models/resource_entities_spec.rb +34 -0
  271. data/spec/models/resource_groups_spec.rb +52 -0
  272. data/spec/models/resource_limits_spec.rb +130 -0
  273. data/spec/models/resource_properties_spec.rb +40 -0
  274. data/spec/models/resource_reference_spec.rb +46 -0
  275. data/spec/models/resource_spec.rb +64 -0
  276. data/spec/models/resources_spec.rb +52 -0
  277. data/spec/models/resources_users_spec.rb +52 -0
  278. data/spec/models/s3_key_metadata_spec.rb +40 -0
  279. data/spec/models/s3_key_properties_spec.rb +40 -0
  280. data/spec/models/s3_key_spec.rb +58 -0
  281. data/spec/models/s3_keys_spec.rb +52 -0
  282. data/spec/models/s3_object_storage_sso_spec.rb +34 -0
  283. data/spec/models/server_entities_spec.rb +46 -0
  284. data/spec/models/server_properties_spec.rb +84 -0
  285. data/spec/models/server_spec.rb +64 -0
  286. data/spec/models/servers_spec.rb +70 -0
  287. data/spec/models/snapshot_properties_spec.rb +128 -0
  288. data/spec/models/snapshot_spec.rb +58 -0
  289. data/spec/models/snapshots_spec.rb +52 -0
  290. data/spec/models/type_spec.rb +28 -0
  291. data/spec/models/user_metadata_spec.rb +46 -0
  292. data/spec/models/user_properties_spec.rb +82 -0
  293. data/spec/models/user_spec.rb +64 -0
  294. data/spec/models/users_entities_spec.rb +40 -0
  295. data/spec/models/users_spec.rb +52 -0
  296. data/spec/models/volume_properties_spec.rb +152 -0
  297. data/spec/models/volume_spec.rb +58 -0
  298. data/spec/models/volumes_spec.rb +70 -0
  299. data/spec/spec_helper.rb +111 -0
  300. metadata +532 -0
@@ -0,0 +1,464 @@
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.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Ionoscloud
17
+ class KubernetesNodePoolPropertiesForPost
18
+ # A Kubernetes Node Pool Name. Valid Kubernetes Node Pool name must be 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between.
19
+ attr_accessor :name
20
+
21
+ # A valid uuid of the datacenter on which user has access
22
+ attr_accessor :datacenter_id
23
+
24
+ # Number of nodes part of the Node Pool
25
+ attr_accessor :node_count
26
+
27
+ # A valid cpu family name
28
+ attr_accessor :cpu_family
29
+
30
+ # Number of cores for node
31
+ attr_accessor :cores_count
32
+
33
+ # RAM size for node, minimum size 2048MB is recommended. Ram size must be set to multiple of 1024MB.
34
+ attr_accessor :ram_size
35
+
36
+ # The availability zone in which the target VM should exist
37
+ attr_accessor :availability_zone
38
+
39
+ # Hardware type of the volume
40
+ attr_accessor :storage_type
41
+
42
+ # The size of the volume in GB. The size should be greater than 10GB.
43
+ attr_accessor :storage_size
44
+
45
+ # The kubernetes version in which a nodepool is running. This imposes restrictions on what kubernetes versions can be run in a cluster's nodepools. Additionally, not all kubernetes versions are viable upgrade targets for all prior versions.
46
+ attr_accessor :k8s_version
47
+
48
+ attr_accessor :maintenance_window
49
+
50
+ attr_accessor :auto_scaling
51
+
52
+ # array of additional LANs attached to worker nodes
53
+ attr_accessor :lans
54
+
55
+ # map of labels attached to node pool
56
+ attr_accessor :labels
57
+
58
+ # map of annotations attached to node pool
59
+ attr_accessor :annotations
60
+
61
+ # Optional array of reserved public IP addresses to be used by the nodes. IPs must be from same location as the data center used for the node pool. The array must contain one extra IP than maximum number of nodes could be. (nodeCount+1 if fixed node amount or maxNodeCount+1 if auto scaling is used) The extra provided IP Will be used during rebuilding of nodes.
62
+ attr_accessor :public_ips
63
+
64
+ class EnumAttributeValidator
65
+ attr_reader :datatype
66
+ attr_reader :allowable_values
67
+
68
+ def initialize(datatype, allowable_values)
69
+ @allowable_values = allowable_values.map do |value|
70
+ case datatype.to_s
71
+ when /Integer/i
72
+ value.to_i
73
+ when /Float/i
74
+ value.to_f
75
+ else
76
+ value
77
+ end
78
+ end
79
+ end
80
+
81
+ def valid?(value)
82
+ !value || allowable_values.include?(value)
83
+ end
84
+ end
85
+
86
+ # Attribute mapping from ruby-style variable name to JSON key.
87
+ def self.attribute_map
88
+ {
89
+ :'name' => :'name',
90
+ :'datacenter_id' => :'datacenterId',
91
+ :'node_count' => :'nodeCount',
92
+ :'cpu_family' => :'cpuFamily',
93
+ :'cores_count' => :'coresCount',
94
+ :'ram_size' => :'ramSize',
95
+ :'availability_zone' => :'availabilityZone',
96
+ :'storage_type' => :'storageType',
97
+ :'storage_size' => :'storageSize',
98
+ :'k8s_version' => :'k8sVersion',
99
+ :'maintenance_window' => :'maintenanceWindow',
100
+ :'auto_scaling' => :'autoScaling',
101
+ :'lans' => :'lans',
102
+ :'labels' => :'labels',
103
+ :'annotations' => :'annotations',
104
+ :'public_ips' => :'publicIps'
105
+ }
106
+ end
107
+
108
+ # Returns all the JSON keys this model knows about
109
+ def self.acceptable_attributes
110
+ attribute_map.values
111
+ end
112
+
113
+ # Attribute type mapping.
114
+ def self.openapi_types
115
+ {
116
+ :'name' => :'String',
117
+ :'datacenter_id' => :'String',
118
+ :'node_count' => :'Integer',
119
+ :'cpu_family' => :'String',
120
+ :'cores_count' => :'Integer',
121
+ :'ram_size' => :'Integer',
122
+ :'availability_zone' => :'String',
123
+ :'storage_type' => :'String',
124
+ :'storage_size' => :'Integer',
125
+ :'k8s_version' => :'String',
126
+ :'maintenance_window' => :'KubernetesMaintenanceWindow',
127
+ :'auto_scaling' => :'KubernetesAutoScaling',
128
+ :'lans' => :'Array<KubernetesNodePoolLan>',
129
+ :'labels' => :'Hash<String, String>',
130
+ :'annotations' => :'Hash<String, String>',
131
+ :'public_ips' => :'Array<String>'
132
+ }
133
+ end
134
+
135
+ # List of attributes with nullable: true
136
+ def self.openapi_nullable
137
+ Set.new([
138
+ ])
139
+ end
140
+
141
+ # Initializes the object
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ def initialize(attributes = {})
144
+ if (!attributes.is_a?(Hash))
145
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Ionoscloud::KubernetesNodePoolPropertiesForPost` initialize method"
146
+ end
147
+
148
+ # check to see if the attribute exists and convert string to symbol for hash key
149
+ attributes = attributes.each_with_object({}) { |(k, v), h|
150
+ if (!self.class.attribute_map.key?(k.to_sym))
151
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::KubernetesNodePoolPropertiesForPost`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
152
+ end
153
+ h[k.to_sym] = v
154
+ }
155
+
156
+ if attributes.key?(:'name')
157
+ self.name = attributes[:'name']
158
+ end
159
+
160
+ if attributes.key?(:'datacenter_id')
161
+ self.datacenter_id = attributes[:'datacenter_id']
162
+ end
163
+
164
+ if attributes.key?(:'node_count')
165
+ self.node_count = attributes[:'node_count']
166
+ end
167
+
168
+ if attributes.key?(:'cpu_family')
169
+ self.cpu_family = attributes[:'cpu_family']
170
+ end
171
+
172
+ if attributes.key?(:'cores_count')
173
+ self.cores_count = attributes[:'cores_count']
174
+ end
175
+
176
+ if attributes.key?(:'ram_size')
177
+ self.ram_size = attributes[:'ram_size']
178
+ end
179
+
180
+ if attributes.key?(:'availability_zone')
181
+ self.availability_zone = attributes[:'availability_zone']
182
+ end
183
+
184
+ if attributes.key?(:'storage_type')
185
+ self.storage_type = attributes[:'storage_type']
186
+ end
187
+
188
+ if attributes.key?(:'storage_size')
189
+ self.storage_size = attributes[:'storage_size']
190
+ end
191
+
192
+ if attributes.key?(:'k8s_version')
193
+ self.k8s_version = attributes[:'k8s_version']
194
+ end
195
+
196
+ if attributes.key?(:'maintenance_window')
197
+ self.maintenance_window = attributes[:'maintenance_window']
198
+ end
199
+
200
+ if attributes.key?(:'auto_scaling')
201
+ self.auto_scaling = attributes[:'auto_scaling']
202
+ end
203
+
204
+ if attributes.key?(:'lans')
205
+ if (value = attributes[:'lans']).is_a?(Array)
206
+ self.lans = value
207
+ end
208
+ end
209
+
210
+ if attributes.key?(:'labels')
211
+ if (value = attributes[:'labels']).is_a?(Hash)
212
+ self.labels = value
213
+ end
214
+ end
215
+
216
+ if attributes.key?(:'annotations')
217
+ if (value = attributes[:'annotations']).is_a?(Hash)
218
+ self.annotations = value
219
+ end
220
+ end
221
+
222
+ if attributes.key?(:'public_ips')
223
+ if (value = attributes[:'public_ips']).is_a?(Array)
224
+ self.public_ips = value
225
+ end
226
+ end
227
+ end
228
+
229
+ # Show invalid properties with the reasons. Usually used together with valid?
230
+ # @return Array for valid properties with the reasons
231
+ def list_invalid_properties
232
+ invalid_properties = Array.new
233
+ if @name.nil?
234
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
235
+ end
236
+
237
+ if @datacenter_id.nil?
238
+ invalid_properties.push('invalid value for "datacenter_id", datacenter_id cannot be nil.')
239
+ end
240
+
241
+ if @node_count.nil?
242
+ invalid_properties.push('invalid value for "node_count", node_count cannot be nil.')
243
+ end
244
+
245
+ if @cpu_family.nil?
246
+ invalid_properties.push('invalid value for "cpu_family", cpu_family cannot be nil.')
247
+ end
248
+
249
+ if @cores_count.nil?
250
+ invalid_properties.push('invalid value for "cores_count", cores_count cannot be nil.')
251
+ end
252
+
253
+ if @ram_size.nil?
254
+ invalid_properties.push('invalid value for "ram_size", ram_size cannot be nil.')
255
+ end
256
+
257
+ if @availability_zone.nil?
258
+ invalid_properties.push('invalid value for "availability_zone", availability_zone cannot be nil.')
259
+ end
260
+
261
+ if @storage_type.nil?
262
+ invalid_properties.push('invalid value for "storage_type", storage_type cannot be nil.')
263
+ end
264
+
265
+ if @storage_size.nil?
266
+ invalid_properties.push('invalid value for "storage_size", storage_size cannot be nil.')
267
+ end
268
+
269
+ invalid_properties
270
+ end
271
+
272
+ # Check to see if the all the properties in the model are valid
273
+ # @return true if the model is valid
274
+ def valid?
275
+ return false if @name.nil?
276
+ return false if @datacenter_id.nil?
277
+ return false if @node_count.nil?
278
+ return false if @cpu_family.nil?
279
+ return false if @cores_count.nil?
280
+ return false if @ram_size.nil?
281
+ return false if @availability_zone.nil?
282
+ availability_zone_validator = EnumAttributeValidator.new('String', ["AUTO", "ZONE_1", "ZONE_2"])
283
+ return false unless availability_zone_validator.valid?(@availability_zone)
284
+ return false if @storage_type.nil?
285
+ storage_type_validator = EnumAttributeValidator.new('String', ["HDD", "SSD"])
286
+ return false unless storage_type_validator.valid?(@storage_type)
287
+ return false if @storage_size.nil?
288
+ true
289
+ end
290
+
291
+ # Custom attribute writer method checking allowed values (enum).
292
+ # @param [Object] availability_zone Object to be assigned
293
+ def availability_zone=(availability_zone)
294
+ validator = EnumAttributeValidator.new('String', ["AUTO", "ZONE_1", "ZONE_2"])
295
+ unless validator.valid?(availability_zone)
296
+ fail ArgumentError, "invalid value for \"availability_zone\", must be one of #{validator.allowable_values}."
297
+ end
298
+ @availability_zone = availability_zone
299
+ end
300
+
301
+ # Custom attribute writer method checking allowed values (enum).
302
+ # @param [Object] storage_type Object to be assigned
303
+ def storage_type=(storage_type)
304
+ validator = EnumAttributeValidator.new('String', ["HDD", "SSD"])
305
+ unless validator.valid?(storage_type)
306
+ fail ArgumentError, "invalid value for \"storage_type\", must be one of #{validator.allowable_values}."
307
+ end
308
+ @storage_type = storage_type
309
+ end
310
+
311
+ # Checks equality by comparing each attribute.
312
+ # @param [Object] Object to be compared
313
+ def ==(o)
314
+ return true if self.equal?(o)
315
+ self.class == o.class &&
316
+ name == o.name &&
317
+ datacenter_id == o.datacenter_id &&
318
+ node_count == o.node_count &&
319
+ cpu_family == o.cpu_family &&
320
+ cores_count == o.cores_count &&
321
+ ram_size == o.ram_size &&
322
+ availability_zone == o.availability_zone &&
323
+ storage_type == o.storage_type &&
324
+ storage_size == o.storage_size &&
325
+ k8s_version == o.k8s_version &&
326
+ maintenance_window == o.maintenance_window &&
327
+ auto_scaling == o.auto_scaling &&
328
+ lans == o.lans &&
329
+ labels == o.labels &&
330
+ annotations == o.annotations &&
331
+ public_ips == o.public_ips
332
+ end
333
+
334
+ # @see the `==` method
335
+ # @param [Object] Object to be compared
336
+ def eql?(o)
337
+ self == o
338
+ end
339
+
340
+ # Calculates hash code according to all attributes.
341
+ # @return [Integer] Hash code
342
+ def hash
343
+ [name, datacenter_id, node_count, cpu_family, cores_count, ram_size, availability_zone, storage_type, storage_size, k8s_version, maintenance_window, auto_scaling, lans, labels, annotations, public_ips].hash
344
+ end
345
+
346
+ # Builds the object from hash
347
+ # @param [Hash] attributes Model attributes in the form of hash
348
+ # @return [Object] Returns the model itself
349
+ def self.build_from_hash(attributes)
350
+ new.build_from_hash(attributes)
351
+ end
352
+
353
+ # Builds the object from hash
354
+ # @param [Hash] attributes Model attributes in the form of hash
355
+ # @return [Object] Returns the model itself
356
+ def build_from_hash(attributes)
357
+ return nil unless attributes.is_a?(Hash)
358
+ self.class.openapi_types.each_pair do |key, type|
359
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
360
+ self.send("#{key}=", nil)
361
+ elsif type =~ /\AArray<(.*)>/i
362
+ # check to ensure the input is an array given that the attribute
363
+ # is documented as an array but the input is not
364
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
365
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
366
+ end
367
+ elsif !attributes[self.class.attribute_map[key]].nil?
368
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
369
+ end
370
+ end
371
+
372
+ self
373
+ end
374
+
375
+ # Deserializes the data based on type
376
+ # @param string type Data type
377
+ # @param string value Value to be deserialized
378
+ # @return [Object] Deserialized data
379
+ def _deserialize(type, value)
380
+ case type.to_sym
381
+ when :Time
382
+ Time.parse(value)
383
+ when :Date
384
+ Date.parse(value)
385
+ when :String
386
+ value.to_s
387
+ when :Integer
388
+ value.to_i
389
+ when :Float
390
+ value.to_f
391
+ when :Boolean
392
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
393
+ true
394
+ else
395
+ false
396
+ end
397
+ when :Object
398
+ # generic object (usually a Hash), return directly
399
+ value
400
+ when /\AArray<(?<inner_type>.+)>\z/
401
+ inner_type = Regexp.last_match[:inner_type]
402
+ value.map { |v| _deserialize(inner_type, v) }
403
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
404
+ k_type = Regexp.last_match[:k_type]
405
+ v_type = Regexp.last_match[:v_type]
406
+ {}.tap do |hash|
407
+ value.each do |k, v|
408
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
409
+ end
410
+ end
411
+ else # model
412
+ # models (e.g. Pet) or oneOf
413
+ klass = Ionoscloud.const_get(type)
414
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
415
+ end
416
+ end
417
+
418
+ # Returns the string representation of the object
419
+ # @return [String] String presentation of the object
420
+ def to_s
421
+ to_hash.to_s
422
+ end
423
+
424
+ # to_body is an alias to to_hash (backward compatibility)
425
+ # @return [Hash] Returns the object in the form of hash
426
+ def to_body
427
+ to_hash
428
+ end
429
+
430
+ # Returns the object in the form of hash
431
+ # @return [Hash] Returns the object in the form of hash
432
+ def to_hash
433
+ hash = {}
434
+ self.class.attribute_map.each_pair do |attr, param|
435
+ value = self.send(attr)
436
+ if value.nil?
437
+ is_nullable = self.class.openapi_nullable.include?(attr)
438
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
439
+ end
440
+
441
+ hash[param] = _to_hash(value)
442
+ end
443
+ hash
444
+ end
445
+
446
+ # Outputs non-array value in the form of hash
447
+ # For object, use to_hash. Otherwise, just return the value
448
+ # @param [Object] value Any valid value
449
+ # @return [Hash] Returns the value in the form of hash
450
+ def _to_hash(value)
451
+ if value.is_a?(Array)
452
+ value.compact.map { |v| _to_hash(v) }
453
+ elsif value.is_a?(Hash)
454
+ {}.tap do |hash|
455
+ value.each { |k, v| hash[k] = _to_hash(v) }
456
+ end
457
+ elsif value.respond_to? :to_hash
458
+ value.to_hash
459
+ else
460
+ value
461
+ end
462
+ end
463
+ end
464
+ end