ionoscloud 6.0.2 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/docs/CHANGELOG.md +8 -0
  4. data/docs/api/ApplicationLoadBalancersApi.md +1586 -0
  5. data/docs/api/TargetGroupsApi.md +516 -0
  6. data/docs/models/ApplicationLoadBalancer.md +28 -0
  7. data/docs/models/ApplicationLoadBalancerEntities.md +18 -0
  8. data/docs/models/ApplicationLoadBalancerForwardingRule.md +26 -0
  9. data/docs/models/ApplicationLoadBalancerForwardingRuleProperties.md +30 -0
  10. data/docs/models/ApplicationLoadBalancerForwardingRulePut.md +24 -0
  11. data/docs/models/ApplicationLoadBalancerForwardingRules.md +30 -0
  12. data/docs/models/ApplicationLoadBalancerHttpRule.md +34 -0
  13. data/docs/models/ApplicationLoadBalancerHttpRuleCondition.md +26 -0
  14. data/docs/models/ApplicationLoadBalancerProperties.md +26 -0
  15. data/docs/models/ApplicationLoadBalancerPut.md +24 -0
  16. data/docs/models/ApplicationLoadBalancers.md +30 -0
  17. data/docs/models/TargetGroup.md +26 -0
  18. data/docs/models/TargetGroupHealthCheck.md +22 -0
  19. data/docs/models/TargetGroupHttpHealthCheck.md +28 -0
  20. data/docs/models/TargetGroupProperties.md +28 -0
  21. data/docs/models/TargetGroupPut.md +24 -0
  22. data/docs/models/TargetGroupTarget.md +26 -0
  23. data/docs/models/TargetGroups.md +30 -0
  24. data/lib/ionoscloud/api/application_load_balancers_api.rb +1690 -0
  25. data/lib/ionoscloud/api/target_groups_api.rb +530 -0
  26. data/lib/ionoscloud/api_client.rb +1 -1
  27. data/lib/ionoscloud/models/application_load_balancer.rb +319 -0
  28. data/lib/ionoscloud/models/application_load_balancer_entities.rb +226 -0
  29. data/lib/ionoscloud/models/application_load_balancer_forwarding_rule.rb +302 -0
  30. data/lib/ionoscloud/models/application_load_balancer_forwarding_rule_properties.rb +389 -0
  31. data/lib/ionoscloud/models/application_load_balancer_forwarding_rule_put.rb +285 -0
  32. data/lib/ionoscloud/models/application_load_balancer_forwarding_rules.rb +334 -0
  33. data/lib/ionoscloud/models/application_load_balancer_http_rule.rb +427 -0
  34. data/lib/ionoscloud/models/application_load_balancer_http_rule_condition.rb +355 -0
  35. data/lib/ionoscloud/models/application_load_balancer_properties.rb +314 -0
  36. data/lib/ionoscloud/models/application_load_balancer_put.rb +285 -0
  37. data/lib/ionoscloud/models/application_load_balancers.rb +334 -0
  38. data/lib/ionoscloud/models/target_group.rb +302 -0
  39. data/lib/ionoscloud/models/target_group_health_check.rb +263 -0
  40. data/lib/ionoscloud/models/target_group_http_health_check.rb +373 -0
  41. data/lib/ionoscloud/models/target_group_properties.rb +376 -0
  42. data/lib/ionoscloud/models/target_group_put.rb +285 -0
  43. data/lib/ionoscloud/models/target_group_target.rb +314 -0
  44. data/lib/ionoscloud/models/target_groups.rb +334 -0
  45. data/lib/ionoscloud/version.rb +1 -1
  46. data/lib/ionoscloud.rb +20 -0
  47. metadata +42 -2
@@ -0,0 +1,355 @@
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 ApplicationLoadBalancerHttpRuleCondition
18
+
19
+ # Type of the HTTP rule condition.
20
+ attr_accessor :type
21
+
22
+
23
+ # Matching rule for the HTTP rule condition attribute; mandatory for HEADER, PATH, QUERY, METHOD, HOST, and COOKIE types; must be null when type is SOURCE_IP.
24
+ attr_accessor :condition
25
+
26
+
27
+ # Specifies whether the condition is negated or not; the default is False.
28
+ attr_accessor :negate
29
+
30
+
31
+ # Must be null when type is PATH, METHOD, HOST, or SOURCE_IP. Key can only be set when type is COOKIES, HEADER, or QUERY.
32
+ attr_accessor :key
33
+
34
+
35
+ # Mandatory for conditions CONTAINS, EQUALS, MATCHES, STARTS_WITH, ENDS_WITH; must be null when condition is EXISTS; should be a valid CIDR if provided and if type is SOURCE_IP.
36
+ attr_accessor :value
37
+
38
+ class EnumAttributeValidator
39
+ attr_reader :datatype
40
+ attr_reader :allowable_values
41
+
42
+ def initialize(datatype, allowable_values)
43
+ @allowable_values = allowable_values.map do |value|
44
+ case datatype.to_s
45
+ when /Integer/i
46
+ value.to_i
47
+ when /Float/i
48
+ value.to_f
49
+ else
50
+ value
51
+ end
52
+ end
53
+ end
54
+
55
+ def valid?(value)
56
+ !value || allowable_values.include?(value)
57
+ end
58
+ end
59
+
60
+ # Attribute mapping from ruby-style variable name to JSON key.
61
+ def self.attribute_map
62
+ {
63
+
64
+ :'type' => :'type',
65
+
66
+ :'condition' => :'condition',
67
+
68
+ :'negate' => :'negate',
69
+
70
+ :'key' => :'key',
71
+
72
+ :'value' => :'value'
73
+ }
74
+ end
75
+
76
+ # Returns all the JSON keys this model knows about
77
+ def self.acceptable_attributes
78
+ attribute_map.values
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.openapi_types
83
+ {
84
+
85
+ :'type' => :'String',
86
+
87
+ :'condition' => :'String',
88
+
89
+ :'negate' => :'Boolean',
90
+
91
+ :'key' => :'String',
92
+
93
+ :'value' => :'String'
94
+ }
95
+ end
96
+
97
+ # List of attributes with nullable: true
98
+ def self.openapi_nullable
99
+ Set.new([
100
+
101
+
102
+
103
+
104
+
105
+ ])
106
+ end
107
+
108
+ # Initializes the object
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ def initialize(attributes = {})
111
+ if (!attributes.is_a?(Hash))
112
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Ionoscloud::ApplicationLoadBalancerHttpRuleCondition` initialize method"
113
+ end
114
+
115
+ # check to see if the attribute exists and convert string to symbol for hash key
116
+ attributes = attributes.each_with_object({}) { |(k, v), h|
117
+ if (!self.class.attribute_map.key?(k.to_sym))
118
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::ApplicationLoadBalancerHttpRuleCondition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
119
+ end
120
+ h[k.to_sym] = v
121
+ }
122
+
123
+
124
+ if attributes.key?(:'type')
125
+ self.type = attributes[:'type']
126
+ end
127
+
128
+
129
+ if attributes.key?(:'condition')
130
+ self.condition = attributes[:'condition']
131
+ end
132
+
133
+
134
+ if attributes.key?(:'negate')
135
+ self.negate = attributes[:'negate']
136
+ end
137
+
138
+
139
+ if attributes.key?(:'key')
140
+ self.key = attributes[:'key']
141
+ end
142
+
143
+
144
+ if attributes.key?(:'value')
145
+ self.value = attributes[:'value']
146
+ end
147
+ end
148
+
149
+ # Show invalid properties with the reasons. Usually used together with valid?
150
+ # @return Array for valid properties with the reasons
151
+ def list_invalid_properties
152
+ invalid_properties = Array.new
153
+
154
+ if @type.nil?
155
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
156
+ end
157
+
158
+
159
+ if @condition.nil?
160
+ invalid_properties.push('invalid value for "condition", condition cannot be nil.')
161
+ end
162
+
163
+
164
+
165
+
166
+ invalid_properties
167
+ end
168
+
169
+ # Check to see if the all the properties in the model are valid
170
+ # @return true if the model is valid
171
+ def valid?
172
+
173
+ return false if @type.nil?
174
+ type_validator = EnumAttributeValidator.new('String', ["HEADER", "PATH", "QUERY", "METHOD", "HOST", "COOKIE", "SOURCE_IP"])
175
+ return false unless type_validator.valid?(@type)
176
+
177
+ return false if @condition.nil?
178
+ condition_validator = EnumAttributeValidator.new('String', ["EXISTS", "CONTAINS", "EQUALS", "MATCHES", "STARTS_WITH", "ENDS_WITH"])
179
+ return false unless condition_validator.valid?(@condition)
180
+
181
+
182
+
183
+ true
184
+ end
185
+
186
+
187
+ # Custom attribute writer method checking allowed values (enum).
188
+ # @param [Object] type Object to be assigned
189
+ def type=(type)
190
+ validator = EnumAttributeValidator.new('String', ["HEADER", "PATH", "QUERY", "METHOD", "HOST", "COOKIE", "SOURCE_IP"])
191
+ unless validator.valid?(type)
192
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
193
+ end
194
+ @type = type
195
+ end
196
+
197
+
198
+ # Custom attribute writer method checking allowed values (enum).
199
+ # @param [Object] condition Object to be assigned
200
+ def condition=(condition)
201
+ validator = EnumAttributeValidator.new('String', ["EXISTS", "CONTAINS", "EQUALS", "MATCHES", "STARTS_WITH", "ENDS_WITH"])
202
+ unless validator.valid?(condition)
203
+ fail ArgumentError, "invalid value for \"condition\", must be one of #{validator.allowable_values}."
204
+ end
205
+ @condition = condition
206
+ end
207
+
208
+
209
+
210
+
211
+ # Checks equality by comparing each attribute.
212
+ # @param [Object] Object to be compared
213
+ def ==(o)
214
+ return true if self.equal?(o)
215
+ self.class == o.class &&
216
+ type == o.type &&
217
+ condition == o.condition &&
218
+ negate == o.negate &&
219
+ key == o.key &&
220
+ value == o.value
221
+ end
222
+
223
+ # @see the `==` method
224
+ # @param [Object] Object to be compared
225
+ def eql?(o)
226
+ self == o
227
+ end
228
+
229
+ # Calculates hash code according to all attributes.
230
+ # @return [Integer] Hash code
231
+ def hash
232
+ [type, condition, negate, key, value].hash
233
+ end
234
+
235
+ # Builds the object from hash
236
+ # @param [Hash] attributes Model attributes in the form of hash
237
+ # @return [Object] Returns the model itself
238
+ def self.build_from_hash(attributes)
239
+ new.build_from_hash(attributes)
240
+ end
241
+
242
+ # Builds the object from hash
243
+ # @param [Hash] attributes Model attributes in the form of hash
244
+ # @return [Object] Returns the model itself
245
+ def build_from_hash(attributes)
246
+ return nil unless attributes.is_a?(Hash)
247
+ self.class.openapi_types.each_pair do |key, type|
248
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
249
+ self.send("#{key}=", nil)
250
+ elsif type =~ /\AArray<(.*)>/i
251
+ # check to ensure the input is an array given that the attribute
252
+ # is documented as an array but the input is not
253
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
254
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
255
+ end
256
+ elsif !attributes[self.class.attribute_map[key]].nil?
257
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
258
+ end
259
+ end
260
+
261
+ self
262
+ end
263
+
264
+ # Deserializes the data based on type
265
+ # @param string type Data type
266
+ # @param string value Value to be deserialized
267
+ # @return [Object] Deserialized data
268
+ def _deserialize(type, value)
269
+ case type.to_sym
270
+ when :Time
271
+ Time.parse(value)
272
+ when :Date
273
+ Date.parse(value)
274
+ when :String
275
+ value.to_s
276
+ when :Integer
277
+ value.to_i
278
+ when :Float
279
+ value.to_f
280
+ when :Boolean
281
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
282
+ true
283
+ else
284
+ false
285
+ end
286
+ when :Object
287
+ # generic object (usually a Hash), return directly
288
+ value
289
+ when /\AArray<(?<inner_type>.+)>\z/
290
+ inner_type = Regexp.last_match[:inner_type]
291
+ value.map { |v| _deserialize(inner_type, v) }
292
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
293
+ k_type = Regexp.last_match[:k_type]
294
+ v_type = Regexp.last_match[:v_type]
295
+ {}.tap do |hash|
296
+ value.each do |k, v|
297
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
298
+ end
299
+ end
300
+ else # model
301
+ # models (e.g. Pet) or oneOf
302
+ klass = Ionoscloud.const_get(type)
303
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
304
+ end
305
+ end
306
+
307
+ # Returns the string representation of the object
308
+ # @return [String] String presentation of the object
309
+ def to_s
310
+ to_hash.to_s
311
+ end
312
+
313
+ # to_body is an alias to to_hash (backward compatibility)
314
+ # @return [Hash] Returns the object in the form of hash
315
+ def to_body
316
+ to_hash
317
+ end
318
+
319
+ # Returns the object in the form of hash
320
+ # @return [Hash] Returns the object in the form of hash
321
+ def to_hash
322
+ hash = {}
323
+ self.class.attribute_map.each_pair do |attr, param|
324
+ value = self.send(attr)
325
+ if value.nil?
326
+ is_nullable = self.class.openapi_nullable.include?(attr)
327
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
328
+ end
329
+
330
+ hash[param] = _to_hash(value)
331
+ end
332
+ hash
333
+ end
334
+
335
+ # Outputs non-array value in the form of hash
336
+ # For object, use to_hash. Otherwise, just return the value
337
+ # @param [Object] value Any valid value
338
+ # @return [Hash] Returns the value in the form of hash
339
+ def _to_hash(value)
340
+ if value.is_a?(Array)
341
+ value.compact.map { |v| _to_hash(v) }
342
+ elsif value.is_a?(Hash)
343
+ {}.tap do |hash|
344
+ value.each { |k, v| hash[k] = _to_hash(v) }
345
+ end
346
+ elsif value.respond_to? :to_hash
347
+ value.to_hash
348
+ else
349
+ value
350
+ end
351
+ end
352
+
353
+ end
354
+
355
+ end
@@ -0,0 +1,314 @@
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 ApplicationLoadBalancerProperties
18
+
19
+ # The name of the Application Load Balancer.
20
+ attr_accessor :name
21
+
22
+
23
+ # ID of the listening (inbound) LAN.
24
+ attr_accessor :listener_lan
25
+
26
+
27
+ # Collection of the Application Load Balancer IP addresses. (Inbound and outbound) IPs of the listenerLan are customer-reserved public IPs for the public Load Balancers, and private IPs for the private Load Balancers.
28
+ attr_accessor :ips
29
+
30
+
31
+ # ID of the balanced private target LAN (outbound).
32
+ attr_accessor :target_lan
33
+
34
+
35
+ # Collection of private IP addresses with the subnet mask of the Application Load Balancer. IPs must contain valid a subnet mask. If no IP is provided, the system will generate an IP with /24 subnet.
36
+ attr_accessor :lb_private_ips
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+
42
+ :'name' => :'name',
43
+
44
+ :'listener_lan' => :'listenerLan',
45
+
46
+ :'ips' => :'ips',
47
+
48
+ :'target_lan' => :'targetLan',
49
+
50
+ :'lb_private_ips' => :'lbPrivateIps'
51
+ }
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+
63
+ :'name' => :'String',
64
+
65
+ :'listener_lan' => :'Integer',
66
+
67
+ :'ips' => :'Array<String>',
68
+
69
+ :'target_lan' => :'Integer',
70
+
71
+ :'lb_private_ips' => :'Array<String>'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+
79
+
80
+
81
+
82
+
83
+ ])
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Ionoscloud::ApplicationLoadBalancerProperties` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ attributes = attributes.each_with_object({}) { |(k, v), h|
95
+ if (!self.class.attribute_map.key?(k.to_sym))
96
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::ApplicationLoadBalancerProperties`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
97
+ end
98
+ h[k.to_sym] = v
99
+ }
100
+
101
+
102
+ if attributes.key?(:'name')
103
+ self.name = attributes[:'name']
104
+ end
105
+
106
+
107
+ if attributes.key?(:'listener_lan')
108
+ self.listener_lan = attributes[:'listener_lan']
109
+ end
110
+
111
+
112
+ if attributes.key?(:'ips') && (value = attributes[:'ips']).is_a?(Array)
113
+ self.ips = value
114
+ end
115
+
116
+
117
+ if attributes.key?(:'target_lan')
118
+ self.target_lan = attributes[:'target_lan']
119
+ end
120
+
121
+
122
+ if attributes.key?(:'lb_private_ips') && (value = attributes[:'lb_private_ips']).is_a?(Array)
123
+ self.lb_private_ips = value
124
+ end
125
+ end
126
+
127
+ # Show invalid properties with the reasons. Usually used together with valid?
128
+ # @return Array for valid properties with the reasons
129
+ def list_invalid_properties
130
+ invalid_properties = Array.new
131
+
132
+ if @name.nil?
133
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
134
+ end
135
+
136
+
137
+ if @listener_lan.nil?
138
+ invalid_properties.push('invalid value for "listener_lan", listener_lan cannot be nil.')
139
+ end
140
+
141
+
142
+
143
+ if @target_lan.nil?
144
+ invalid_properties.push('invalid value for "target_lan", target_lan cannot be nil.')
145
+ end
146
+
147
+
148
+ invalid_properties
149
+ end
150
+
151
+ # Check to see if the all the properties in the model are valid
152
+ # @return true if the model is valid
153
+ def valid?
154
+
155
+ return false if @name.nil?
156
+
157
+ return false if @listener_lan.nil?
158
+
159
+
160
+ return false if @target_lan.nil?
161
+
162
+ true
163
+ end
164
+
165
+
166
+
167
+
168
+
169
+
170
+ # Checks equality by comparing each attribute.
171
+ # @param [Object] Object to be compared
172
+ def ==(o)
173
+ return true if self.equal?(o)
174
+ self.class == o.class &&
175
+ name == o.name &&
176
+ listener_lan == o.listener_lan &&
177
+ ips == o.ips &&
178
+ target_lan == o.target_lan &&
179
+ lb_private_ips == o.lb_private_ips
180
+ end
181
+
182
+ # @see the `==` method
183
+ # @param [Object] Object to be compared
184
+ def eql?(o)
185
+ self == o
186
+ end
187
+
188
+ # Calculates hash code according to all attributes.
189
+ # @return [Integer] Hash code
190
+ def hash
191
+ [name, listener_lan, ips, target_lan, lb_private_ips].hash
192
+ end
193
+
194
+ # Builds the object from hash
195
+ # @param [Hash] attributes Model attributes in the form of hash
196
+ # @return [Object] Returns the model itself
197
+ def self.build_from_hash(attributes)
198
+ new.build_from_hash(attributes)
199
+ end
200
+
201
+ # Builds the object from hash
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ # @return [Object] Returns the model itself
204
+ def build_from_hash(attributes)
205
+ return nil unless attributes.is_a?(Hash)
206
+ self.class.openapi_types.each_pair do |key, type|
207
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
208
+ self.send("#{key}=", nil)
209
+ elsif type =~ /\AArray<(.*)>/i
210
+ # check to ensure the input is an array given that the attribute
211
+ # is documented as an array but the input is not
212
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
213
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
214
+ end
215
+ elsif !attributes[self.class.attribute_map[key]].nil?
216
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
217
+ end
218
+ end
219
+
220
+ self
221
+ end
222
+
223
+ # Deserializes the data based on type
224
+ # @param string type Data type
225
+ # @param string value Value to be deserialized
226
+ # @return [Object] Deserialized data
227
+ def _deserialize(type, value)
228
+ case type.to_sym
229
+ when :Time
230
+ Time.parse(value)
231
+ when :Date
232
+ Date.parse(value)
233
+ when :String
234
+ value.to_s
235
+ when :Integer
236
+ value.to_i
237
+ when :Float
238
+ value.to_f
239
+ when :Boolean
240
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
241
+ true
242
+ else
243
+ false
244
+ end
245
+ when :Object
246
+ # generic object (usually a Hash), return directly
247
+ value
248
+ when /\AArray<(?<inner_type>.+)>\z/
249
+ inner_type = Regexp.last_match[:inner_type]
250
+ value.map { |v| _deserialize(inner_type, v) }
251
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
252
+ k_type = Regexp.last_match[:k_type]
253
+ v_type = Regexp.last_match[:v_type]
254
+ {}.tap do |hash|
255
+ value.each do |k, v|
256
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
257
+ end
258
+ end
259
+ else # model
260
+ # models (e.g. Pet) or oneOf
261
+ klass = Ionoscloud.const_get(type)
262
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
263
+ end
264
+ end
265
+
266
+ # Returns the string representation of the object
267
+ # @return [String] String presentation of the object
268
+ def to_s
269
+ to_hash.to_s
270
+ end
271
+
272
+ # to_body is an alias to to_hash (backward compatibility)
273
+ # @return [Hash] Returns the object in the form of hash
274
+ def to_body
275
+ to_hash
276
+ end
277
+
278
+ # Returns the object in the form of hash
279
+ # @return [Hash] Returns the object in the form of hash
280
+ def to_hash
281
+ hash = {}
282
+ self.class.attribute_map.each_pair do |attr, param|
283
+ value = self.send(attr)
284
+ if value.nil?
285
+ is_nullable = self.class.openapi_nullable.include?(attr)
286
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
287
+ end
288
+
289
+ hash[param] = _to_hash(value)
290
+ end
291
+ hash
292
+ end
293
+
294
+ # Outputs non-array value in the form of hash
295
+ # For object, use to_hash. Otherwise, just return the value
296
+ # @param [Object] value Any valid value
297
+ # @return [Hash] Returns the value in the form of hash
298
+ def _to_hash(value)
299
+ if value.is_a?(Array)
300
+ value.compact.map { |v| _to_hash(v) }
301
+ elsif value.is_a?(Hash)
302
+ {}.tap do |hash|
303
+ value.each { |k, v| hash[k] = _to_hash(v) }
304
+ end
305
+ elsif value.respond_to? :to_hash
306
+ value.to_hash
307
+ else
308
+ value
309
+ end
310
+ end
311
+
312
+ end
313
+
314
+ end