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,427 @@
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 ApplicationLoadBalancerHttpRule
18
+
19
+ # The unique name of the Application Load Balancer HTTP rule.
20
+ attr_accessor :name
21
+
22
+
23
+ # Type of the HTTP rule.
24
+ attr_accessor :type
25
+
26
+
27
+ # The ID of the target group; mandatory and only valid for FORWARD actions.
28
+ attr_accessor :target_group
29
+
30
+
31
+ # Default is false; valid only for REDIRECT actions.
32
+ attr_accessor :drop_query
33
+
34
+
35
+ # The location for redirecting; mandatory and valid only for REDIRECT actions.
36
+ attr_accessor :location
37
+
38
+
39
+ # Valid only for REDIRECT and STATIC actions. For REDIRECT actions, default is 301 and possible values are 301, 302, 303, 307, and 308. For STATIC actions, default is 503 and valid range is 200 to 599.
40
+ attr_accessor :status_code
41
+
42
+
43
+ # The response message of the request; mandatory for STATIC actions.
44
+ attr_accessor :response_message
45
+
46
+
47
+ # Valid only for STATIC actions.
48
+ attr_accessor :content_type
49
+
50
+
51
+ # An array of items in the collection.The action is only performed if each and every condition is met; if no conditions are set, the rule will always be performed.
52
+ attr_accessor :conditions
53
+
54
+ class EnumAttributeValidator
55
+ attr_reader :datatype
56
+ attr_reader :allowable_values
57
+
58
+ def initialize(datatype, allowable_values)
59
+ @allowable_values = allowable_values.map do |value|
60
+ case datatype.to_s
61
+ when /Integer/i
62
+ value.to_i
63
+ when /Float/i
64
+ value.to_f
65
+ else
66
+ value
67
+ end
68
+ end
69
+ end
70
+
71
+ def valid?(value)
72
+ !value || allowable_values.include?(value)
73
+ end
74
+ end
75
+
76
+ # Attribute mapping from ruby-style variable name to JSON key.
77
+ def self.attribute_map
78
+ {
79
+
80
+ :'name' => :'name',
81
+
82
+ :'type' => :'type',
83
+
84
+ :'target_group' => :'targetGroup',
85
+
86
+ :'drop_query' => :'dropQuery',
87
+
88
+ :'location' => :'location',
89
+
90
+ :'status_code' => :'statusCode',
91
+
92
+ :'response_message' => :'responseMessage',
93
+
94
+ :'content_type' => :'contentType',
95
+
96
+ :'conditions' => :'conditions'
97
+ }
98
+ end
99
+
100
+ # Returns all the JSON keys this model knows about
101
+ def self.acceptable_attributes
102
+ attribute_map.values
103
+ end
104
+
105
+ # Attribute type mapping.
106
+ def self.openapi_types
107
+ {
108
+
109
+ :'name' => :'String',
110
+
111
+ :'type' => :'String',
112
+
113
+ :'target_group' => :'String',
114
+
115
+ :'drop_query' => :'Boolean',
116
+
117
+ :'location' => :'String',
118
+
119
+ :'status_code' => :'Integer',
120
+
121
+ :'response_message' => :'String',
122
+
123
+ :'content_type' => :'String',
124
+
125
+ :'conditions' => :'Array<ApplicationLoadBalancerHttpRuleCondition>'
126
+ }
127
+ end
128
+
129
+ # List of attributes with nullable: true
130
+ def self.openapi_nullable
131
+ Set.new([
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+ ])
142
+ end
143
+
144
+ # Initializes the object
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ def initialize(attributes = {})
147
+ if (!attributes.is_a?(Hash))
148
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Ionoscloud::ApplicationLoadBalancerHttpRule` initialize method"
149
+ end
150
+
151
+ # check to see if the attribute exists and convert string to symbol for hash key
152
+ attributes = attributes.each_with_object({}) { |(k, v), h|
153
+ if (!self.class.attribute_map.key?(k.to_sym))
154
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::ApplicationLoadBalancerHttpRule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
155
+ end
156
+ h[k.to_sym] = v
157
+ }
158
+
159
+
160
+ if attributes.key?(:'name')
161
+ self.name = attributes[:'name']
162
+ end
163
+
164
+
165
+ if attributes.key?(:'type')
166
+ self.type = attributes[:'type']
167
+ end
168
+
169
+
170
+ if attributes.key?(:'target_group')
171
+ self.target_group = attributes[:'target_group']
172
+ end
173
+
174
+
175
+ if attributes.key?(:'drop_query')
176
+ self.drop_query = attributes[:'drop_query']
177
+ end
178
+
179
+
180
+ if attributes.key?(:'location')
181
+ self.location = attributes[:'location']
182
+ end
183
+
184
+
185
+ if attributes.key?(:'status_code')
186
+ self.status_code = attributes[:'status_code']
187
+ end
188
+
189
+
190
+ if attributes.key?(:'response_message')
191
+ self.response_message = attributes[:'response_message']
192
+ end
193
+
194
+
195
+ if attributes.key?(:'content_type')
196
+ self.content_type = attributes[:'content_type']
197
+ end
198
+
199
+
200
+ if attributes.key?(:'conditions') && (value = attributes[:'conditions']).is_a?(Array)
201
+ self.conditions = value
202
+ end
203
+ end
204
+
205
+ # Show invalid properties with the reasons. Usually used together with valid?
206
+ # @return Array for valid properties with the reasons
207
+ def list_invalid_properties
208
+ invalid_properties = Array.new
209
+
210
+ if @name.nil?
211
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
212
+ end
213
+
214
+
215
+ if @type.nil?
216
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
217
+ end
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+ invalid_properties
227
+ end
228
+
229
+ # Check to see if the all the properties in the model are valid
230
+ # @return true if the model is valid
231
+ def valid?
232
+
233
+ return false if @name.nil?
234
+
235
+ return false if @type.nil?
236
+ type_validator = EnumAttributeValidator.new('String', ["FORWARD", "STATIC", "REDIRECT"])
237
+ return false unless type_validator.valid?(@type)
238
+
239
+
240
+
241
+
242
+ status_code_validator = EnumAttributeValidator.new('Integer', [301, 302, 303, 307, 308, 200, 503, 599])
243
+ return false unless status_code_validator.valid?(@status_code)
244
+
245
+
246
+
247
+ true
248
+ end
249
+
250
+
251
+
252
+ # Custom attribute writer method checking allowed values (enum).
253
+ # @param [Object] type Object to be assigned
254
+ def type=(type)
255
+ validator = EnumAttributeValidator.new('String', ["FORWARD", "STATIC", "REDIRECT"])
256
+ unless validator.valid?(type)
257
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
258
+ end
259
+ @type = type
260
+ end
261
+
262
+
263
+
264
+
265
+
266
+ # Custom attribute writer method checking allowed values (enum).
267
+ # @param [Object] status_code Object to be assigned
268
+ def status_code=(status_code)
269
+ validator = EnumAttributeValidator.new('Integer', [301, 302, 303, 307, 308, 200, 503, 599])
270
+ unless validator.valid?(status_code)
271
+ fail ArgumentError, "invalid value for \"status_code\", must be one of #{validator.allowable_values}."
272
+ end
273
+ @status_code = status_code
274
+ end
275
+
276
+
277
+
278
+
279
+ # Checks equality by comparing each attribute.
280
+ # @param [Object] Object to be compared
281
+ def ==(o)
282
+ return true if self.equal?(o)
283
+ self.class == o.class &&
284
+ name == o.name &&
285
+ type == o.type &&
286
+ target_group == o.target_group &&
287
+ drop_query == o.drop_query &&
288
+ location == o.location &&
289
+ status_code == o.status_code &&
290
+ response_message == o.response_message &&
291
+ content_type == o.content_type &&
292
+ conditions == o.conditions
293
+ end
294
+
295
+ # @see the `==` method
296
+ # @param [Object] Object to be compared
297
+ def eql?(o)
298
+ self == o
299
+ end
300
+
301
+ # Calculates hash code according to all attributes.
302
+ # @return [Integer] Hash code
303
+ def hash
304
+ [name, type, target_group, drop_query, location, status_code, response_message, content_type, conditions].hash
305
+ end
306
+
307
+ # Builds the object from hash
308
+ # @param [Hash] attributes Model attributes in the form of hash
309
+ # @return [Object] Returns the model itself
310
+ def self.build_from_hash(attributes)
311
+ new.build_from_hash(attributes)
312
+ end
313
+
314
+ # Builds the object from hash
315
+ # @param [Hash] attributes Model attributes in the form of hash
316
+ # @return [Object] Returns the model itself
317
+ def build_from_hash(attributes)
318
+ return nil unless attributes.is_a?(Hash)
319
+ self.class.openapi_types.each_pair do |key, type|
320
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
321
+ self.send("#{key}=", nil)
322
+ elsif type =~ /\AArray<(.*)>/i
323
+ # check to ensure the input is an array given that the attribute
324
+ # is documented as an array but the input is not
325
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
326
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
327
+ end
328
+ elsif !attributes[self.class.attribute_map[key]].nil?
329
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
330
+ end
331
+ end
332
+
333
+ self
334
+ end
335
+
336
+ # Deserializes the data based on type
337
+ # @param string type Data type
338
+ # @param string value Value to be deserialized
339
+ # @return [Object] Deserialized data
340
+ def _deserialize(type, value)
341
+ case type.to_sym
342
+ when :Time
343
+ Time.parse(value)
344
+ when :Date
345
+ Date.parse(value)
346
+ when :String
347
+ value.to_s
348
+ when :Integer
349
+ value.to_i
350
+ when :Float
351
+ value.to_f
352
+ when :Boolean
353
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
354
+ true
355
+ else
356
+ false
357
+ end
358
+ when :Object
359
+ # generic object (usually a Hash), return directly
360
+ value
361
+ when /\AArray<(?<inner_type>.+)>\z/
362
+ inner_type = Regexp.last_match[:inner_type]
363
+ value.map { |v| _deserialize(inner_type, v) }
364
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
365
+ k_type = Regexp.last_match[:k_type]
366
+ v_type = Regexp.last_match[:v_type]
367
+ {}.tap do |hash|
368
+ value.each do |k, v|
369
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
370
+ end
371
+ end
372
+ else # model
373
+ # models (e.g. Pet) or oneOf
374
+ klass = Ionoscloud.const_get(type)
375
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
376
+ end
377
+ end
378
+
379
+ # Returns the string representation of the object
380
+ # @return [String] String presentation of the object
381
+ def to_s
382
+ to_hash.to_s
383
+ end
384
+
385
+ # to_body is an alias to to_hash (backward compatibility)
386
+ # @return [Hash] Returns the object in the form of hash
387
+ def to_body
388
+ to_hash
389
+ end
390
+
391
+ # Returns the object in the form of hash
392
+ # @return [Hash] Returns the object in the form of hash
393
+ def to_hash
394
+ hash = {}
395
+ self.class.attribute_map.each_pair do |attr, param|
396
+ value = self.send(attr)
397
+ if value.nil?
398
+ is_nullable = self.class.openapi_nullable.include?(attr)
399
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
400
+ end
401
+
402
+ hash[param] = _to_hash(value)
403
+ end
404
+ hash
405
+ end
406
+
407
+ # Outputs non-array value in the form of hash
408
+ # For object, use to_hash. Otherwise, just return the value
409
+ # @param [Object] value Any valid value
410
+ # @return [Hash] Returns the value in the form of hash
411
+ def _to_hash(value)
412
+ if value.is_a?(Array)
413
+ value.compact.map { |v| _to_hash(v) }
414
+ elsif value.is_a?(Hash)
415
+ {}.tap do |hash|
416
+ value.each { |k, v| hash[k] = _to_hash(v) }
417
+ end
418
+ elsif value.respond_to? :to_hash
419
+ value.to_hash
420
+ else
421
+ value
422
+ end
423
+ end
424
+
425
+ end
426
+
427
+ end