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,250 @@
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
+ # Resources assigned to this group.
18
+ class ResourceGroups
19
+ # The resource's unique identifier
20
+ attr_accessor :id
21
+
22
+ # The type of the resource
23
+ attr_accessor :type
24
+
25
+ # URL to the object representation (absolute path)
26
+ attr_accessor :href
27
+
28
+ # Array of items in that collection
29
+ attr_accessor :items
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'id' => :'id',
35
+ :'type' => :'type',
36
+ :'href' => :'href',
37
+ :'items' => :'items'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'id' => :'String',
50
+ :'type' => :'Type',
51
+ :'href' => :'String',
52
+ :'items' => :'Array<Resource>'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Ionoscloud::ResourceGroups` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::ResourceGroups`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'id')
78
+ self.id = attributes[:'id']
79
+ end
80
+
81
+ if attributes.key?(:'type')
82
+ self.type = attributes[:'type']
83
+ end
84
+
85
+ if attributes.key?(:'href')
86
+ self.href = attributes[:'href']
87
+ end
88
+
89
+ if attributes.key?(:'items')
90
+ if (value = attributes[:'items']).is_a?(Array)
91
+ self.items = value
92
+ end
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ invalid_properties = Array.new
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ true
107
+ end
108
+
109
+ # Checks equality by comparing each attribute.
110
+ # @param [Object] Object to be compared
111
+ def ==(o)
112
+ return true if self.equal?(o)
113
+ self.class == o.class &&
114
+ id == o.id &&
115
+ type == o.type &&
116
+ href == o.href &&
117
+ items == o.items
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [id, type, href, items].hash
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 self.build_from_hash(attributes)
136
+ new.build_from_hash(attributes)
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def build_from_hash(attributes)
143
+ return nil unless attributes.is_a?(Hash)
144
+ self.class.openapi_types.each_pair do |key, type|
145
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
146
+ self.send("#{key}=", nil)
147
+ elsif type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
151
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
+ end
153
+ elsif !attributes[self.class.attribute_map[key]].nil?
154
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ end
156
+ end
157
+
158
+ self
159
+ end
160
+
161
+ # Deserializes the data based on type
162
+ # @param string type Data type
163
+ # @param string value Value to be deserialized
164
+ # @return [Object] Deserialized data
165
+ def _deserialize(type, value)
166
+ case type.to_sym
167
+ when :Time
168
+ Time.parse(value)
169
+ when :Date
170
+ Date.parse(value)
171
+ when :String
172
+ value.to_s
173
+ when :Integer
174
+ value.to_i
175
+ when :Float
176
+ value.to_f
177
+ when :Boolean
178
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
179
+ true
180
+ else
181
+ false
182
+ end
183
+ when :Object
184
+ # generic object (usually a Hash), return directly
185
+ value
186
+ when /\AArray<(?<inner_type>.+)>\z/
187
+ inner_type = Regexp.last_match[:inner_type]
188
+ value.map { |v| _deserialize(inner_type, v) }
189
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
190
+ k_type = Regexp.last_match[:k_type]
191
+ v_type = Regexp.last_match[:v_type]
192
+ {}.tap do |hash|
193
+ value.each do |k, v|
194
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
195
+ end
196
+ end
197
+ else # model
198
+ # models (e.g. Pet) or oneOf
199
+ klass = Ionoscloud.const_get(type)
200
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
201
+ end
202
+ end
203
+
204
+ # Returns the string representation of the object
205
+ # @return [String] String presentation of the object
206
+ def to_s
207
+ to_hash.to_s
208
+ end
209
+
210
+ # to_body is an alias to to_hash (backward compatibility)
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_body
213
+ to_hash
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ if value.nil?
223
+ is_nullable = self.class.openapi_nullable.include?(attr)
224
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
+ end
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ # Outputs non-array value in the form of hash
233
+ # For object, use to_hash. Otherwise, just return the value
234
+ # @param [Object] value Any valid value
235
+ # @return [Hash] Returns the value in the form of hash
236
+ def _to_hash(value)
237
+ if value.is_a?(Array)
238
+ value.compact.map { |v| _to_hash(v) }
239
+ elsif value.is_a?(Hash)
240
+ {}.tap do |hash|
241
+ value.each { |k, v| hash[k] = _to_hash(v) }
242
+ end
243
+ elsif value.respond_to? :to_hash
244
+ value.to_hash
245
+ else
246
+ value
247
+ end
248
+ end
249
+ end
250
+ end
@@ -0,0 +1,462 @@
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 ResourceLimits
18
+ # maximum number of cores per server
19
+ attr_accessor :cores_per_server
20
+
21
+ # maximum cores per contract
22
+ attr_accessor :cores_per_contract
23
+
24
+ # number of cores provisioned
25
+ attr_accessor :cores_provisioned
26
+
27
+ # maximum ram per server
28
+ attr_accessor :ram_per_server
29
+
30
+ # maximum ram per contract
31
+ attr_accessor :ram_per_contract
32
+
33
+ # ram provisioned
34
+ attr_accessor :ram_provisioned
35
+
36
+ # hdd limit per volume
37
+ attr_accessor :hdd_limit_per_volume
38
+
39
+ # hdd limit per contract
40
+ attr_accessor :hdd_limit_per_contract
41
+
42
+ # hdd volume provisioned
43
+ attr_accessor :hdd_volume_provisioned
44
+
45
+ # ssd limit per volume
46
+ attr_accessor :ssd_limit_per_volume
47
+
48
+ # ssd limit per contract
49
+ attr_accessor :ssd_limit_per_contract
50
+
51
+ # ssd volume provisioned
52
+ attr_accessor :ssd_volume_provisioned
53
+
54
+ # total reservable ip limit of the customer
55
+ attr_accessor :reservable_ips
56
+
57
+ # reserved ips on a contract
58
+ attr_accessor :reserved_ips_on_contract
59
+
60
+ # reserved ips in use
61
+ attr_accessor :reserved_ips_in_use
62
+
63
+ # k8s clusters total limit
64
+ attr_accessor :k8s_cluster_limit_total
65
+
66
+ # k8s clusters provisioned
67
+ attr_accessor :k8s_clusters_provisioned
68
+
69
+ # Attribute mapping from ruby-style variable name to JSON key.
70
+ def self.attribute_map
71
+ {
72
+ :'cores_per_server' => :'coresPerServer',
73
+ :'cores_per_contract' => :'coresPerContract',
74
+ :'cores_provisioned' => :'coresProvisioned',
75
+ :'ram_per_server' => :'ramPerServer',
76
+ :'ram_per_contract' => :'ramPerContract',
77
+ :'ram_provisioned' => :'ramProvisioned',
78
+ :'hdd_limit_per_volume' => :'hddLimitPerVolume',
79
+ :'hdd_limit_per_contract' => :'hddLimitPerContract',
80
+ :'hdd_volume_provisioned' => :'hddVolumeProvisioned',
81
+ :'ssd_limit_per_volume' => :'ssdLimitPerVolume',
82
+ :'ssd_limit_per_contract' => :'ssdLimitPerContract',
83
+ :'ssd_volume_provisioned' => :'ssdVolumeProvisioned',
84
+ :'reservable_ips' => :'reservableIps',
85
+ :'reserved_ips_on_contract' => :'reservedIpsOnContract',
86
+ :'reserved_ips_in_use' => :'reservedIpsInUse',
87
+ :'k8s_cluster_limit_total' => :'k8sClusterLimitTotal',
88
+ :'k8s_clusters_provisioned' => :'k8sClustersProvisioned'
89
+ }
90
+ end
91
+
92
+ # Returns all the JSON keys this model knows about
93
+ def self.acceptable_attributes
94
+ attribute_map.values
95
+ end
96
+
97
+ # Attribute type mapping.
98
+ def self.openapi_types
99
+ {
100
+ :'cores_per_server' => :'Integer',
101
+ :'cores_per_contract' => :'Integer',
102
+ :'cores_provisioned' => :'Integer',
103
+ :'ram_per_server' => :'Integer',
104
+ :'ram_per_contract' => :'Integer',
105
+ :'ram_provisioned' => :'Integer',
106
+ :'hdd_limit_per_volume' => :'Integer',
107
+ :'hdd_limit_per_contract' => :'Integer',
108
+ :'hdd_volume_provisioned' => :'Integer',
109
+ :'ssd_limit_per_volume' => :'Integer',
110
+ :'ssd_limit_per_contract' => :'Integer',
111
+ :'ssd_volume_provisioned' => :'Integer',
112
+ :'reservable_ips' => :'Integer',
113
+ :'reserved_ips_on_contract' => :'Integer',
114
+ :'reserved_ips_in_use' => :'Integer',
115
+ :'k8s_cluster_limit_total' => :'Integer',
116
+ :'k8s_clusters_provisioned' => :'Integer'
117
+ }
118
+ end
119
+
120
+ # List of attributes with nullable: true
121
+ def self.openapi_nullable
122
+ Set.new([
123
+ ])
124
+ end
125
+
126
+ # Initializes the object
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ def initialize(attributes = {})
129
+ if (!attributes.is_a?(Hash))
130
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Ionoscloud::ResourceLimits` initialize method"
131
+ end
132
+
133
+ # check to see if the attribute exists and convert string to symbol for hash key
134
+ attributes = attributes.each_with_object({}) { |(k, v), h|
135
+ if (!self.class.attribute_map.key?(k.to_sym))
136
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::ResourceLimits`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
137
+ end
138
+ h[k.to_sym] = v
139
+ }
140
+
141
+ if attributes.key?(:'cores_per_server')
142
+ self.cores_per_server = attributes[:'cores_per_server']
143
+ end
144
+
145
+ if attributes.key?(:'cores_per_contract')
146
+ self.cores_per_contract = attributes[:'cores_per_contract']
147
+ end
148
+
149
+ if attributes.key?(:'cores_provisioned')
150
+ self.cores_provisioned = attributes[:'cores_provisioned']
151
+ end
152
+
153
+ if attributes.key?(:'ram_per_server')
154
+ self.ram_per_server = attributes[:'ram_per_server']
155
+ end
156
+
157
+ if attributes.key?(:'ram_per_contract')
158
+ self.ram_per_contract = attributes[:'ram_per_contract']
159
+ end
160
+
161
+ if attributes.key?(:'ram_provisioned')
162
+ self.ram_provisioned = attributes[:'ram_provisioned']
163
+ end
164
+
165
+ if attributes.key?(:'hdd_limit_per_volume')
166
+ self.hdd_limit_per_volume = attributes[:'hdd_limit_per_volume']
167
+ end
168
+
169
+ if attributes.key?(:'hdd_limit_per_contract')
170
+ self.hdd_limit_per_contract = attributes[:'hdd_limit_per_contract']
171
+ end
172
+
173
+ if attributes.key?(:'hdd_volume_provisioned')
174
+ self.hdd_volume_provisioned = attributes[:'hdd_volume_provisioned']
175
+ end
176
+
177
+ if attributes.key?(:'ssd_limit_per_volume')
178
+ self.ssd_limit_per_volume = attributes[:'ssd_limit_per_volume']
179
+ end
180
+
181
+ if attributes.key?(:'ssd_limit_per_contract')
182
+ self.ssd_limit_per_contract = attributes[:'ssd_limit_per_contract']
183
+ end
184
+
185
+ if attributes.key?(:'ssd_volume_provisioned')
186
+ self.ssd_volume_provisioned = attributes[:'ssd_volume_provisioned']
187
+ end
188
+
189
+ if attributes.key?(:'reservable_ips')
190
+ self.reservable_ips = attributes[:'reservable_ips']
191
+ end
192
+
193
+ if attributes.key?(:'reserved_ips_on_contract')
194
+ self.reserved_ips_on_contract = attributes[:'reserved_ips_on_contract']
195
+ end
196
+
197
+ if attributes.key?(:'reserved_ips_in_use')
198
+ self.reserved_ips_in_use = attributes[:'reserved_ips_in_use']
199
+ end
200
+
201
+ if attributes.key?(:'k8s_cluster_limit_total')
202
+ self.k8s_cluster_limit_total = attributes[:'k8s_cluster_limit_total']
203
+ end
204
+
205
+ if attributes.key?(:'k8s_clusters_provisioned')
206
+ self.k8s_clusters_provisioned = attributes[:'k8s_clusters_provisioned']
207
+ end
208
+ end
209
+
210
+ # Show invalid properties with the reasons. Usually used together with valid?
211
+ # @return Array for valid properties with the reasons
212
+ def list_invalid_properties
213
+ invalid_properties = Array.new
214
+ if @cores_per_server.nil?
215
+ invalid_properties.push('invalid value for "cores_per_server", cores_per_server cannot be nil.')
216
+ end
217
+
218
+ if @cores_per_contract.nil?
219
+ invalid_properties.push('invalid value for "cores_per_contract", cores_per_contract cannot be nil.')
220
+ end
221
+
222
+ if @cores_provisioned.nil?
223
+ invalid_properties.push('invalid value for "cores_provisioned", cores_provisioned cannot be nil.')
224
+ end
225
+
226
+ if @ram_per_server.nil?
227
+ invalid_properties.push('invalid value for "ram_per_server", ram_per_server cannot be nil.')
228
+ end
229
+
230
+ if @ram_per_contract.nil?
231
+ invalid_properties.push('invalid value for "ram_per_contract", ram_per_contract cannot be nil.')
232
+ end
233
+
234
+ if @ram_provisioned.nil?
235
+ invalid_properties.push('invalid value for "ram_provisioned", ram_provisioned cannot be nil.')
236
+ end
237
+
238
+ if @hdd_limit_per_volume.nil?
239
+ invalid_properties.push('invalid value for "hdd_limit_per_volume", hdd_limit_per_volume cannot be nil.')
240
+ end
241
+
242
+ if @hdd_limit_per_contract.nil?
243
+ invalid_properties.push('invalid value for "hdd_limit_per_contract", hdd_limit_per_contract cannot be nil.')
244
+ end
245
+
246
+ if @hdd_volume_provisioned.nil?
247
+ invalid_properties.push('invalid value for "hdd_volume_provisioned", hdd_volume_provisioned cannot be nil.')
248
+ end
249
+
250
+ if @ssd_limit_per_volume.nil?
251
+ invalid_properties.push('invalid value for "ssd_limit_per_volume", ssd_limit_per_volume cannot be nil.')
252
+ end
253
+
254
+ if @ssd_limit_per_contract.nil?
255
+ invalid_properties.push('invalid value for "ssd_limit_per_contract", ssd_limit_per_contract cannot be nil.')
256
+ end
257
+
258
+ if @ssd_volume_provisioned.nil?
259
+ invalid_properties.push('invalid value for "ssd_volume_provisioned", ssd_volume_provisioned cannot be nil.')
260
+ end
261
+
262
+ if @reservable_ips.nil?
263
+ invalid_properties.push('invalid value for "reservable_ips", reservable_ips cannot be nil.')
264
+ end
265
+
266
+ if @reserved_ips_on_contract.nil?
267
+ invalid_properties.push('invalid value for "reserved_ips_on_contract", reserved_ips_on_contract cannot be nil.')
268
+ end
269
+
270
+ if @reserved_ips_in_use.nil?
271
+ invalid_properties.push('invalid value for "reserved_ips_in_use", reserved_ips_in_use cannot be nil.')
272
+ end
273
+
274
+ if @k8s_cluster_limit_total.nil?
275
+ invalid_properties.push('invalid value for "k8s_cluster_limit_total", k8s_cluster_limit_total cannot be nil.')
276
+ end
277
+
278
+ if @k8s_clusters_provisioned.nil?
279
+ invalid_properties.push('invalid value for "k8s_clusters_provisioned", k8s_clusters_provisioned cannot be nil.')
280
+ end
281
+
282
+ invalid_properties
283
+ end
284
+
285
+ # Check to see if the all the properties in the model are valid
286
+ # @return true if the model is valid
287
+ def valid?
288
+ return false if @cores_per_server.nil?
289
+ return false if @cores_per_contract.nil?
290
+ return false if @cores_provisioned.nil?
291
+ return false if @ram_per_server.nil?
292
+ return false if @ram_per_contract.nil?
293
+ return false if @ram_provisioned.nil?
294
+ return false if @hdd_limit_per_volume.nil?
295
+ return false if @hdd_limit_per_contract.nil?
296
+ return false if @hdd_volume_provisioned.nil?
297
+ return false if @ssd_limit_per_volume.nil?
298
+ return false if @ssd_limit_per_contract.nil?
299
+ return false if @ssd_volume_provisioned.nil?
300
+ return false if @reservable_ips.nil?
301
+ return false if @reserved_ips_on_contract.nil?
302
+ return false if @reserved_ips_in_use.nil?
303
+ return false if @k8s_cluster_limit_total.nil?
304
+ return false if @k8s_clusters_provisioned.nil?
305
+ true
306
+ end
307
+
308
+ # Checks equality by comparing each attribute.
309
+ # @param [Object] Object to be compared
310
+ def ==(o)
311
+ return true if self.equal?(o)
312
+ self.class == o.class &&
313
+ cores_per_server == o.cores_per_server &&
314
+ cores_per_contract == o.cores_per_contract &&
315
+ cores_provisioned == o.cores_provisioned &&
316
+ ram_per_server == o.ram_per_server &&
317
+ ram_per_contract == o.ram_per_contract &&
318
+ ram_provisioned == o.ram_provisioned &&
319
+ hdd_limit_per_volume == o.hdd_limit_per_volume &&
320
+ hdd_limit_per_contract == o.hdd_limit_per_contract &&
321
+ hdd_volume_provisioned == o.hdd_volume_provisioned &&
322
+ ssd_limit_per_volume == o.ssd_limit_per_volume &&
323
+ ssd_limit_per_contract == o.ssd_limit_per_contract &&
324
+ ssd_volume_provisioned == o.ssd_volume_provisioned &&
325
+ reservable_ips == o.reservable_ips &&
326
+ reserved_ips_on_contract == o.reserved_ips_on_contract &&
327
+ reserved_ips_in_use == o.reserved_ips_in_use &&
328
+ k8s_cluster_limit_total == o.k8s_cluster_limit_total &&
329
+ k8s_clusters_provisioned == o.k8s_clusters_provisioned
330
+ end
331
+
332
+ # @see the `==` method
333
+ # @param [Object] Object to be compared
334
+ def eql?(o)
335
+ self == o
336
+ end
337
+
338
+ # Calculates hash code according to all attributes.
339
+ # @return [Integer] Hash code
340
+ def hash
341
+ [cores_per_server, cores_per_contract, cores_provisioned, ram_per_server, ram_per_contract, ram_provisioned, hdd_limit_per_volume, hdd_limit_per_contract, hdd_volume_provisioned, ssd_limit_per_volume, ssd_limit_per_contract, ssd_volume_provisioned, reservable_ips, reserved_ips_on_contract, reserved_ips_in_use, k8s_cluster_limit_total, k8s_clusters_provisioned].hash
342
+ end
343
+
344
+ # Builds the object from hash
345
+ # @param [Hash] attributes Model attributes in the form of hash
346
+ # @return [Object] Returns the model itself
347
+ def self.build_from_hash(attributes)
348
+ new.build_from_hash(attributes)
349
+ end
350
+
351
+ # Builds the object from hash
352
+ # @param [Hash] attributes Model attributes in the form of hash
353
+ # @return [Object] Returns the model itself
354
+ def build_from_hash(attributes)
355
+ return nil unless attributes.is_a?(Hash)
356
+ self.class.openapi_types.each_pair do |key, type|
357
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
358
+ self.send("#{key}=", nil)
359
+ elsif type =~ /\AArray<(.*)>/i
360
+ # check to ensure the input is an array given that the attribute
361
+ # is documented as an array but the input is not
362
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
363
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
364
+ end
365
+ elsif !attributes[self.class.attribute_map[key]].nil?
366
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
367
+ end
368
+ end
369
+
370
+ self
371
+ end
372
+
373
+ # Deserializes the data based on type
374
+ # @param string type Data type
375
+ # @param string value Value to be deserialized
376
+ # @return [Object] Deserialized data
377
+ def _deserialize(type, value)
378
+ case type.to_sym
379
+ when :Time
380
+ Time.parse(value)
381
+ when :Date
382
+ Date.parse(value)
383
+ when :String
384
+ value.to_s
385
+ when :Integer
386
+ value.to_i
387
+ when :Float
388
+ value.to_f
389
+ when :Boolean
390
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
391
+ true
392
+ else
393
+ false
394
+ end
395
+ when :Object
396
+ # generic object (usually a Hash), return directly
397
+ value
398
+ when /\AArray<(?<inner_type>.+)>\z/
399
+ inner_type = Regexp.last_match[:inner_type]
400
+ value.map { |v| _deserialize(inner_type, v) }
401
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
402
+ k_type = Regexp.last_match[:k_type]
403
+ v_type = Regexp.last_match[:v_type]
404
+ {}.tap do |hash|
405
+ value.each do |k, v|
406
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
407
+ end
408
+ end
409
+ else # model
410
+ # models (e.g. Pet) or oneOf
411
+ klass = Ionoscloud.const_get(type)
412
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
413
+ end
414
+ end
415
+
416
+ # Returns the string representation of the object
417
+ # @return [String] String presentation of the object
418
+ def to_s
419
+ to_hash.to_s
420
+ end
421
+
422
+ # to_body is an alias to to_hash (backward compatibility)
423
+ # @return [Hash] Returns the object in the form of hash
424
+ def to_body
425
+ to_hash
426
+ end
427
+
428
+ # Returns the object in the form of hash
429
+ # @return [Hash] Returns the object in the form of hash
430
+ def to_hash
431
+ hash = {}
432
+ self.class.attribute_map.each_pair do |attr, param|
433
+ value = self.send(attr)
434
+ if value.nil?
435
+ is_nullable = self.class.openapi_nullable.include?(attr)
436
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
437
+ end
438
+
439
+ hash[param] = _to_hash(value)
440
+ end
441
+ hash
442
+ end
443
+
444
+ # Outputs non-array value in the form of hash
445
+ # For object, use to_hash. Otherwise, just return the value
446
+ # @param [Object] value Any valid value
447
+ # @return [Hash] Returns the value in the form of hash
448
+ def _to_hash(value)
449
+ if value.is_a?(Array)
450
+ value.compact.map { |v| _to_hash(v) }
451
+ elsif value.is_a?(Hash)
452
+ {}.tap do |hash|
453
+ value.each { |k, v| hash[k] = _to_hash(v) }
454
+ end
455
+ elsif value.respond_to? :to_hash
456
+ value.to_hash
457
+ else
458
+ value
459
+ end
460
+ end
461
+ end
462
+ end