ionoscloud 6.0.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +70 -0
  3. data/README.md +10 -1
  4. data/docs/CHANGELOG.md +22 -0
  5. data/docs/README.md +2 -2
  6. data/docs/api/ApplicationLoadBalancersApi.md +1586 -0
  7. data/docs/api/BackupUnitsApi.md +14 -14
  8. data/docs/api/ContractResourcesApi.md +2 -2
  9. data/docs/api/DataCentersApi.md +15 -15
  10. data/docs/api/DefaultApi.md +2 -2
  11. data/docs/api/FirewallRulesApi.md +14 -14
  12. data/docs/api/FlowLogsApi.md +2 -2
  13. data/docs/api/IPBlocksApi.md +14 -14
  14. data/docs/api/ImagesApi.md +10 -10
  15. data/docs/api/KubernetesApi.md +30 -30
  16. data/docs/api/LANsApi.md +22 -22
  17. data/docs/api/LabelsApi.md +54 -54
  18. data/docs/api/LoadBalancersApi.md +22 -22
  19. data/docs/api/LocationsApi.md +6 -6
  20. data/docs/api/NATGatewaysApi.md +26 -26
  21. data/docs/api/NetworkInterfacesApi.md +14 -14
  22. data/docs/api/NetworkLoadBalancersApi.md +38 -38
  23. data/docs/api/PrivateCrossConnectsApi.md +10 -10
  24. data/docs/api/RequestsApi.md +8 -8
  25. data/docs/api/ServersApi.md +62 -52
  26. data/docs/api/SnapshotsApi.md +10 -10
  27. data/docs/api/TargetGroupsApi.md +516 -0
  28. data/docs/api/UserManagementApi.md +50 -50
  29. data/docs/api/UserS3KeysApi.md +12 -12
  30. data/docs/api/VolumesApi.md +18 -18
  31. data/docs/models/ApplicationLoadBalancer.md +28 -0
  32. data/docs/models/ApplicationLoadBalancerEntities.md +18 -0
  33. data/docs/models/ApplicationLoadBalancerForwardingRule.md +26 -0
  34. data/docs/models/ApplicationLoadBalancerForwardingRuleProperties.md +30 -0
  35. data/docs/models/ApplicationLoadBalancerForwardingRulePut.md +24 -0
  36. data/docs/models/ApplicationLoadBalancerForwardingRules.md +30 -0
  37. data/docs/models/ApplicationLoadBalancerHttpRule.md +34 -0
  38. data/docs/models/ApplicationLoadBalancerHttpRuleCondition.md +26 -0
  39. data/docs/models/ApplicationLoadBalancerProperties.md +26 -0
  40. data/docs/models/ApplicationLoadBalancerPut.md +24 -0
  41. data/docs/models/ApplicationLoadBalancers.md +30 -0
  42. data/docs/models/AttachedVolumes.md +1 -1
  43. data/docs/models/BackupUnits.md +1 -1
  44. data/docs/models/BalancedNics.md +1 -1
  45. data/docs/models/Cdroms.md +1 -1
  46. data/docs/models/Contracts.md +1 -1
  47. data/docs/models/Datacenters.md +1 -1
  48. data/docs/models/ErrorMessage.md +1 -1
  49. data/docs/models/FirewallRules.md +1 -1
  50. data/docs/models/FirewallruleProperties.md +1 -1
  51. data/docs/models/FlowLogs.md +1 -1
  52. data/docs/models/GroupMembers.md +1 -1
  53. data/docs/models/GroupShares.md +1 -1
  54. data/docs/models/GroupUsers.md +1 -1
  55. data/docs/models/Groups.md +1 -1
  56. data/docs/models/Images.md +1 -1
  57. data/docs/models/IpBlocks.md +3 -3
  58. data/docs/models/KubernetesClusterProperties.md +1 -1
  59. data/docs/models/KubernetesClusterPropertiesForPost.md +1 -1
  60. data/docs/models/KubernetesClusterPropertiesForPut.md +1 -1
  61. data/docs/models/KubernetesClusters.md +1 -1
  62. data/docs/models/KubernetesNodePoolProperties.md +1 -1
  63. data/docs/models/KubernetesNodePoolPropertiesForPost.md +1 -1
  64. data/docs/models/KubernetesNodePoolPropertiesForPut.md +1 -1
  65. data/docs/models/KubernetesNodePools.md +1 -1
  66. data/docs/models/KubernetesNodes.md +1 -1
  67. data/docs/models/LabelResources.md +1 -1
  68. data/docs/models/Labels.md +1 -1
  69. data/docs/models/LanNics.md +1 -1
  70. data/docs/models/Lans.md +1 -1
  71. data/docs/models/Loadbalancers.md +1 -1
  72. data/docs/models/Locations.md +1 -1
  73. data/docs/models/NatGatewayProperties.md +1 -1
  74. data/docs/models/NatGatewayRules.md +1 -1
  75. data/docs/models/NatGateways.md +1 -1
  76. data/docs/models/NetworkLoadBalancerForwardingRuleHealthCheck.md +4 -4
  77. data/docs/models/NetworkLoadBalancerForwardingRuleProperties.md +5 -5
  78. data/docs/models/NetworkLoadBalancerForwardingRuleTarget.md +3 -3
  79. data/docs/models/NetworkLoadBalancerForwardingRuleTargetHealthCheck.md +3 -3
  80. data/docs/models/NetworkLoadBalancerForwardingRules.md +1 -1
  81. data/docs/models/NetworkLoadBalancerProperties.md +2 -2
  82. data/docs/models/NetworkLoadBalancers.md +1 -1
  83. data/docs/models/NicProperties.md +3 -3
  84. data/docs/models/Nics.md +1 -1
  85. data/docs/models/PrivateCrossConnects.md +1 -1
  86. data/docs/models/Requests.md +3 -3
  87. data/docs/models/ResourceGroups.md +1 -1
  88. data/docs/models/Resources.md +1 -1
  89. data/docs/models/ResourcesUsers.md +1 -1
  90. data/docs/models/S3Keys.md +1 -1
  91. data/docs/models/Servers.md +1 -1
  92. data/docs/models/Snapshots.md +1 -1
  93. data/docs/models/TargetGroup.md +26 -0
  94. data/docs/models/TargetGroupHealthCheck.md +22 -0
  95. data/docs/models/TargetGroupHttpHealthCheck.md +28 -0
  96. data/docs/models/TargetGroupProperties.md +28 -0
  97. data/docs/models/TargetGroupPut.md +24 -0
  98. data/docs/models/TargetGroupTarget.md +26 -0
  99. data/docs/models/TargetGroups.md +30 -0
  100. data/docs/models/Templates.md +1 -1
  101. data/docs/models/Users.md +1 -1
  102. data/docs/models/VolumeProperties.md +4 -2
  103. data/docs/models/Volumes.md +1 -1
  104. data/git_push.sh +0 -3
  105. data/lib/ionoscloud/api/_api.rb +2 -2
  106. data/lib/ionoscloud/api/application_load_balancers_api.rb +1690 -0
  107. data/lib/ionoscloud/api/backup_units_api.rb +14 -14
  108. data/lib/ionoscloud/api/contract_resources_api.rb +2 -2
  109. data/lib/ionoscloud/api/data_centers_api.rb +16 -16
  110. data/lib/ionoscloud/api/firewall_rules_api.rb +14 -14
  111. data/lib/ionoscloud/api/flow_logs_api.rb +2 -2
  112. data/lib/ionoscloud/api/images_api.rb +10 -10
  113. data/lib/ionoscloud/api/ip_blocks_api.rb +14 -14
  114. data/lib/ionoscloud/api/kubernetes_api.rb +30 -30
  115. data/lib/ionoscloud/api/labels_api.rb +54 -54
  116. data/lib/ionoscloud/api/lans_api.rb +22 -22
  117. data/lib/ionoscloud/api/load_balancers_api.rb +22 -22
  118. data/lib/ionoscloud/api/locations_api.rb +6 -6
  119. data/lib/ionoscloud/api/nat_gateways_api.rb +26 -26
  120. data/lib/ionoscloud/api/network_interfaces_api.rb +14 -14
  121. data/lib/ionoscloud/api/network_load_balancers_api.rb +38 -38
  122. data/lib/ionoscloud/api/private_cross_connects_api.rb +10 -10
  123. data/lib/ionoscloud/api/requests_api.rb +8 -8
  124. data/lib/ionoscloud/api/servers_api.rb +52 -52
  125. data/lib/ionoscloud/api/snapshots_api.rb +10 -10
  126. data/lib/ionoscloud/api/target_groups_api.rb +530 -0
  127. data/lib/ionoscloud/api/user_management_api.rb +50 -50
  128. data/lib/ionoscloud/api/user_s3_keys_api.rb +12 -12
  129. data/lib/ionoscloud/api/volumes_api.rb +19 -19
  130. data/lib/ionoscloud/api_client.rb +1 -1
  131. data/lib/ionoscloud/configuration.rb +11 -26
  132. data/lib/ionoscloud/models/application_load_balancer.rb +319 -0
  133. data/lib/ionoscloud/models/application_load_balancer_entities.rb +226 -0
  134. data/lib/ionoscloud/models/application_load_balancer_forwarding_rule.rb +302 -0
  135. data/lib/ionoscloud/models/application_load_balancer_forwarding_rule_properties.rb +389 -0
  136. data/lib/ionoscloud/models/application_load_balancer_forwarding_rule_put.rb +285 -0
  137. data/lib/ionoscloud/models/application_load_balancer_forwarding_rules.rb +334 -0
  138. data/lib/ionoscloud/models/application_load_balancer_http_rule.rb +427 -0
  139. data/lib/ionoscloud/models/application_load_balancer_http_rule_condition.rb +355 -0
  140. data/lib/ionoscloud/models/application_load_balancer_properties.rb +314 -0
  141. data/lib/ionoscloud/models/application_load_balancer_put.rb +285 -0
  142. data/lib/ionoscloud/models/application_load_balancers.rb +334 -0
  143. data/lib/ionoscloud/models/attached_volumes.rb +1 -1
  144. data/lib/ionoscloud/models/backup_units.rb +1 -1
  145. data/lib/ionoscloud/models/balanced_nics.rb +1 -1
  146. data/lib/ionoscloud/models/cdroms.rb +1 -1
  147. data/lib/ionoscloud/models/contracts.rb +1 -1
  148. data/lib/ionoscloud/models/datacenters.rb +1 -1
  149. data/lib/ionoscloud/models/error_message.rb +1 -1
  150. data/lib/ionoscloud/models/firewall_rules.rb +1 -1
  151. data/lib/ionoscloud/models/firewallrule_properties.rb +6 -1
  152. data/lib/ionoscloud/models/flow_logs.rb +1 -1
  153. data/lib/ionoscloud/models/group_members.rb +1 -1
  154. data/lib/ionoscloud/models/group_shares.rb +1 -1
  155. data/lib/ionoscloud/models/group_users.rb +1 -1
  156. data/lib/ionoscloud/models/groups.rb +1 -1
  157. data/lib/ionoscloud/models/image_properties.rb +2 -2
  158. data/lib/ionoscloud/models/images.rb +1 -1
  159. data/lib/ionoscloud/models/ip_blocks.rb +3 -3
  160. data/lib/ionoscloud/models/kubernetes_cluster_properties.rb +1 -1
  161. data/lib/ionoscloud/models/kubernetes_cluster_properties_for_post.rb +1 -1
  162. data/lib/ionoscloud/models/kubernetes_cluster_properties_for_put.rb +1 -1
  163. data/lib/ionoscloud/models/kubernetes_clusters.rb +1 -1
  164. data/lib/ionoscloud/models/kubernetes_node_pool_properties.rb +1 -1
  165. data/lib/ionoscloud/models/kubernetes_node_pool_properties_for_post.rb +1 -1
  166. data/lib/ionoscloud/models/kubernetes_node_pool_properties_for_put.rb +1 -1
  167. data/lib/ionoscloud/models/kubernetes_node_pools.rb +1 -1
  168. data/lib/ionoscloud/models/kubernetes_nodes.rb +1 -1
  169. data/lib/ionoscloud/models/label_resources.rb +1 -1
  170. data/lib/ionoscloud/models/labels.rb +1 -1
  171. data/lib/ionoscloud/models/lan_nics.rb +1 -1
  172. data/lib/ionoscloud/models/lans.rb +1 -1
  173. data/lib/ionoscloud/models/loadbalancer_properties.rb +1 -0
  174. data/lib/ionoscloud/models/loadbalancers.rb +1 -1
  175. data/lib/ionoscloud/models/locations.rb +1 -1
  176. data/lib/ionoscloud/models/nat_gateway_properties.rb +1 -1
  177. data/lib/ionoscloud/models/nat_gateway_rules.rb +1 -1
  178. data/lib/ionoscloud/models/nat_gateways.rb +1 -1
  179. data/lib/ionoscloud/models/network_load_balancer_forwarding_rule_health_check.rb +4 -4
  180. data/lib/ionoscloud/models/network_load_balancer_forwarding_rule_properties.rb +5 -5
  181. data/lib/ionoscloud/models/network_load_balancer_forwarding_rule_target.rb +3 -3
  182. data/lib/ionoscloud/models/network_load_balancer_forwarding_rule_target_health_check.rb +3 -3
  183. data/lib/ionoscloud/models/network_load_balancer_forwarding_rules.rb +1 -1
  184. data/lib/ionoscloud/models/network_load_balancer_properties.rb +2 -2
  185. data/lib/ionoscloud/models/network_load_balancers.rb +1 -1
  186. data/lib/ionoscloud/models/nic_properties.rb +4 -3
  187. data/lib/ionoscloud/models/nics.rb +1 -1
  188. data/lib/ionoscloud/models/private_cross_connects.rb +1 -1
  189. data/lib/ionoscloud/models/requests.rb +3 -3
  190. data/lib/ionoscloud/models/resource_groups.rb +1 -1
  191. data/lib/ionoscloud/models/resources.rb +1 -1
  192. data/lib/ionoscloud/models/resources_users.rb +1 -1
  193. data/lib/ionoscloud/models/s3_keys.rb +1 -1
  194. data/lib/ionoscloud/models/servers.rb +1 -1
  195. data/lib/ionoscloud/models/snapshot_properties.rb +2 -2
  196. data/lib/ionoscloud/models/snapshots.rb +1 -1
  197. data/lib/ionoscloud/models/target_group.rb +302 -0
  198. data/lib/ionoscloud/models/target_group_health_check.rb +263 -0
  199. data/lib/ionoscloud/models/target_group_http_health_check.rb +373 -0
  200. data/lib/ionoscloud/models/target_group_properties.rb +376 -0
  201. data/lib/ionoscloud/models/target_group_put.rb +285 -0
  202. data/lib/ionoscloud/models/target_group_target.rb +314 -0
  203. data/lib/ionoscloud/models/target_groups.rb +334 -0
  204. data/lib/ionoscloud/models/templates.rb +1 -1
  205. data/lib/ionoscloud/models/users.rb +1 -1
  206. data/lib/ionoscloud/models/volume_properties.rb +25 -7
  207. data/lib/ionoscloud/models/volumes.rb +1 -1
  208. data/lib/ionoscloud/version.rb +1 -1
  209. data/lib/ionoscloud.rb +20 -0
  210. metadata +46 -5
@@ -0,0 +1,226 @@
1
+ =begin
2
+ #CLOUD API
3
+
4
+ #IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on.
5
+
6
+ The version of the OpenAPI document: 6.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 ApplicationLoadBalancerEntities
18
+
19
+ attr_accessor :forwardingrules
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+
25
+ :'forwardingrules' => :'forwardingrules'
26
+ }
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+
38
+ :'forwardingrules' => :'ApplicationLoadBalancerForwardingRules'
39
+ }
40
+ end
41
+
42
+ # List of attributes with nullable: true
43
+ def self.openapi_nullable
44
+ Set.new([
45
+
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Ionoscloud::ApplicationLoadBalancerEntities` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::ApplicationLoadBalancerEntities`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+
65
+ if attributes.key?(:'forwardingrules')
66
+ self.forwardingrules = attributes[:'forwardingrules']
67
+ end
68
+ end
69
+
70
+ # Show invalid properties with the reasons. Usually used together with valid?
71
+ # @return Array for valid properties with the reasons
72
+ def list_invalid_properties
73
+ invalid_properties = Array.new
74
+
75
+ invalid_properties
76
+ end
77
+
78
+ # Check to see if the all the properties in the model are valid
79
+ # @return true if the model is valid
80
+ def valid?
81
+
82
+ true
83
+ end
84
+
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ forwardingrules == o.forwardingrules
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Integer] Hash code
102
+ def hash
103
+ [forwardingrules].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def self.build_from_hash(attributes)
110
+ new.build_from_hash(attributes)
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def build_from_hash(attributes)
117
+ return nil unless attributes.is_a?(Hash)
118
+ self.class.openapi_types.each_pair do |key, type|
119
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
120
+ self.send("#{key}=", nil)
121
+ elsif type =~ /\AArray<(.*)>/i
122
+ # check to ensure the input is an array given that the attribute
123
+ # is documented as an array but the input is not
124
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
125
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
126
+ end
127
+ elsif !attributes[self.class.attribute_map[key]].nil?
128
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
129
+ end
130
+ end
131
+
132
+ self
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def _deserialize(type, value)
140
+ case type.to_sym
141
+ when :Time
142
+ Time.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :Boolean
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ # models (e.g. Pet) or oneOf
173
+ klass = Ionoscloud.const_get(type)
174
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ if value.nil?
197
+ is_nullable = self.class.openapi_nullable.include?(attr)
198
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
+ end
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+
224
+ end
225
+
226
+ end
@@ -0,0 +1,302 @@
1
+ =begin
2
+ #CLOUD API
3
+
4
+ #IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on.
5
+
6
+ The version of the OpenAPI document: 6.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 ApplicationLoadBalancerForwardingRule
18
+
19
+ # The resource's unique identifier.
20
+ attr_accessor :id
21
+
22
+
23
+ # The type of object that has been created.
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
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+
40
+ :'id' => :'id',
41
+
42
+ :'type' => :'type',
43
+
44
+ :'href' => :'href',
45
+
46
+ :'metadata' => :'metadata',
47
+
48
+ :'properties' => :'properties'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+
61
+ :'id' => :'String',
62
+
63
+ :'type' => :'Type',
64
+
65
+ :'href' => :'String',
66
+
67
+ :'metadata' => :'DatacenterElementMetadata',
68
+
69
+ :'properties' => :'ApplicationLoadBalancerForwardingRuleProperties'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+
77
+
78
+
79
+
80
+
81
+ ])
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ if (!attributes.is_a?(Hash))
88
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Ionoscloud::ApplicationLoadBalancerForwardingRule` initialize method"
89
+ end
90
+
91
+ # check to see if the attribute exists and convert string to symbol for hash key
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!self.class.attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::ApplicationLoadBalancerForwardingRule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+
100
+ if attributes.key?(:'id')
101
+ self.id = attributes[:'id']
102
+ end
103
+
104
+
105
+ if attributes.key?(:'type')
106
+ self.type = attributes[:'type']
107
+ end
108
+
109
+
110
+ if attributes.key?(:'href')
111
+ self.href = attributes[:'href']
112
+ end
113
+
114
+
115
+ if attributes.key?(:'metadata')
116
+ self.metadata = attributes[:'metadata']
117
+ end
118
+
119
+
120
+ if attributes.key?(:'properties')
121
+ self.properties = attributes[:'properties']
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ invalid_properties = Array.new
129
+
130
+
131
+
132
+
133
+
134
+ if @properties.nil?
135
+ invalid_properties.push('invalid value for "properties", properties cannot be nil.')
136
+ end
137
+
138
+ invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+
145
+
146
+
147
+
148
+
149
+ return false if @properties.nil?
150
+ true
151
+ end
152
+
153
+
154
+
155
+
156
+
157
+
158
+ # Checks equality by comparing each attribute.
159
+ # @param [Object] Object to be compared
160
+ def ==(o)
161
+ return true if self.equal?(o)
162
+ self.class == o.class &&
163
+ id == o.id &&
164
+ type == o.type &&
165
+ href == o.href &&
166
+ metadata == o.metadata &&
167
+ properties == o.properties
168
+ end
169
+
170
+ # @see the `==` method
171
+ # @param [Object] Object to be compared
172
+ def eql?(o)
173
+ self == o
174
+ end
175
+
176
+ # Calculates hash code according to all attributes.
177
+ # @return [Integer] Hash code
178
+ def hash
179
+ [id, type, href, metadata, properties].hash
180
+ end
181
+
182
+ # Builds the object from hash
183
+ # @param [Hash] attributes Model attributes in the form of hash
184
+ # @return [Object] Returns the model itself
185
+ def self.build_from_hash(attributes)
186
+ new.build_from_hash(attributes)
187
+ end
188
+
189
+ # Builds the object from hash
190
+ # @param [Hash] attributes Model attributes in the form of hash
191
+ # @return [Object] Returns the model itself
192
+ def build_from_hash(attributes)
193
+ return nil unless attributes.is_a?(Hash)
194
+ self.class.openapi_types.each_pair do |key, type|
195
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
196
+ self.send("#{key}=", nil)
197
+ elsif type =~ /\AArray<(.*)>/i
198
+ # check to ensure the input is an array given that the attribute
199
+ # is documented as an array but the input is not
200
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
201
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
202
+ end
203
+ elsif !attributes[self.class.attribute_map[key]].nil?
204
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
205
+ end
206
+ end
207
+
208
+ self
209
+ end
210
+
211
+ # Deserializes the data based on type
212
+ # @param string type Data type
213
+ # @param string value Value to be deserialized
214
+ # @return [Object] Deserialized data
215
+ def _deserialize(type, value)
216
+ case type.to_sym
217
+ when :Time
218
+ Time.parse(value)
219
+ when :Date
220
+ Date.parse(value)
221
+ when :String
222
+ value.to_s
223
+ when :Integer
224
+ value.to_i
225
+ when :Float
226
+ value.to_f
227
+ when :Boolean
228
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
229
+ true
230
+ else
231
+ false
232
+ end
233
+ when :Object
234
+ # generic object (usually a Hash), return directly
235
+ value
236
+ when /\AArray<(?<inner_type>.+)>\z/
237
+ inner_type = Regexp.last_match[:inner_type]
238
+ value.map { |v| _deserialize(inner_type, v) }
239
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
240
+ k_type = Regexp.last_match[:k_type]
241
+ v_type = Regexp.last_match[:v_type]
242
+ {}.tap do |hash|
243
+ value.each do |k, v|
244
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
245
+ end
246
+ end
247
+ else # model
248
+ # models (e.g. Pet) or oneOf
249
+ klass = Ionoscloud.const_get(type)
250
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
251
+ end
252
+ end
253
+
254
+ # Returns the string representation of the object
255
+ # @return [String] String presentation of the object
256
+ def to_s
257
+ to_hash.to_s
258
+ end
259
+
260
+ # to_body is an alias to to_hash (backward compatibility)
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_body
263
+ to_hash
264
+ end
265
+
266
+ # Returns the object in the form of hash
267
+ # @return [Hash] Returns the object in the form of hash
268
+ def to_hash
269
+ hash = {}
270
+ self.class.attribute_map.each_pair do |attr, param|
271
+ value = self.send(attr)
272
+ if value.nil?
273
+ is_nullable = self.class.openapi_nullable.include?(attr)
274
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
275
+ end
276
+
277
+ hash[param] = _to_hash(value)
278
+ end
279
+ hash
280
+ end
281
+
282
+ # Outputs non-array value in the form of hash
283
+ # For object, use to_hash. Otherwise, just return the value
284
+ # @param [Object] value Any valid value
285
+ # @return [Hash] Returns the value in the form of hash
286
+ def _to_hash(value)
287
+ if value.is_a?(Array)
288
+ value.compact.map { |v| _to_hash(v) }
289
+ elsif value.is_a?(Hash)
290
+ {}.tap do |hash|
291
+ value.each { |k, v| hash[k] = _to_hash(v) }
292
+ end
293
+ elsif value.respond_to? :to_hash
294
+ value.to_hash
295
+ else
296
+ value
297
+ end
298
+ end
299
+
300
+ end
301
+
302
+ end