ionoscloud 6.0.1 → 6.1.1
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/docs/CHANGELOG.md +28 -0
- data/docs/api/ApplicationLoadBalancersApi.md +1586 -0
- data/docs/api/ServersApi.md +3 -1
- data/docs/api/TargetGroupsApi.md +516 -0
- data/docs/models/ApplicationLoadBalancer.md +28 -0
- data/docs/models/ApplicationLoadBalancerEntities.md +18 -0
- data/docs/models/ApplicationLoadBalancerForwardingRule.md +26 -0
- data/docs/models/ApplicationLoadBalancerForwardingRuleProperties.md +30 -0
- data/docs/models/ApplicationLoadBalancerForwardingRulePut.md +24 -0
- data/docs/models/ApplicationLoadBalancerForwardingRules.md +30 -0
- data/docs/models/ApplicationLoadBalancerHttpRule.md +34 -0
- data/docs/models/ApplicationLoadBalancerHttpRuleCondition.md +26 -0
- data/docs/models/ApplicationLoadBalancerProperties.md +26 -0
- data/docs/models/ApplicationLoadBalancerPut.md +24 -0
- data/docs/models/ApplicationLoadBalancers.md +30 -0
- data/docs/models/GroupProperties.md +3 -1
- data/docs/models/KubernetesClusterProperties.md +0 -2
- data/docs/models/KubernetesClusterPropertiesForPost.md +0 -2
- data/docs/models/KubernetesNodePoolProperties.md +1 -3
- data/docs/models/KubernetesNodePoolPropertiesForPost.md +1 -3
- data/docs/models/TargetGroup.md +26 -0
- data/docs/models/TargetGroupHealthCheck.md +22 -0
- data/docs/models/TargetGroupHttpHealthCheck.md +28 -0
- data/docs/models/TargetGroupProperties.md +28 -0
- data/docs/models/TargetGroupPut.md +24 -0
- data/docs/models/TargetGroupTarget.md +26 -0
- data/docs/models/TargetGroups.md +30 -0
- data/docs/models/VolumeProperties.md +3 -1
- data/lib/ionoscloud/api/application_load_balancers_api.rb +1690 -0
- data/lib/ionoscloud/api/servers_api.rb +3 -0
- data/lib/ionoscloud/api/target_groups_api.rb +530 -0
- data/lib/ionoscloud/api_client.rb +1 -1
- data/lib/ionoscloud/configuration.rb +11 -26
- data/lib/ionoscloud/models/application_load_balancer.rb +319 -0
- data/lib/ionoscloud/models/application_load_balancer_entities.rb +226 -0
- data/lib/ionoscloud/models/application_load_balancer_forwarding_rule.rb +302 -0
- data/lib/ionoscloud/models/application_load_balancer_forwarding_rule_properties.rb +389 -0
- data/lib/ionoscloud/models/application_load_balancer_forwarding_rule_put.rb +285 -0
- data/lib/ionoscloud/models/application_load_balancer_forwarding_rules.rb +334 -0
- data/lib/ionoscloud/models/application_load_balancer_http_rule.rb +427 -0
- data/lib/ionoscloud/models/application_load_balancer_http_rule_condition.rb +355 -0
- data/lib/ionoscloud/models/application_load_balancer_properties.rb +314 -0
- data/lib/ionoscloud/models/application_load_balancer_put.rb +285 -0
- data/lib/ionoscloud/models/application_load_balancers.rb +334 -0
- data/lib/ionoscloud/models/group_properties.rb +22 -4
- data/lib/ionoscloud/models/kubernetes_cluster_properties.rb +1 -21
- data/lib/ionoscloud/models/kubernetes_cluster_properties_for_post.rb +1 -21
- data/lib/ionoscloud/models/kubernetes_node_pool_properties.rb +4 -22
- data/lib/ionoscloud/models/kubernetes_node_pool_properties_for_post.rb +4 -22
- data/lib/ionoscloud/models/target_group.rb +302 -0
- data/lib/ionoscloud/models/target_group_health_check.rb +263 -0
- data/lib/ionoscloud/models/target_group_http_health_check.rb +373 -0
- data/lib/ionoscloud/models/target_group_properties.rb +376 -0
- data/lib/ionoscloud/models/target_group_put.rb +285 -0
- data/lib/ionoscloud/models/target_group_target.rb +314 -0
- data/lib/ionoscloud/models/target_groups.rb +334 -0
- data/lib/ionoscloud/models/volume_properties.rb +36 -4
- data/lib/ionoscloud/version.rb +1 -1
- data/lib/ionoscloud.rb +20 -0
- metadata +45 -6
- data/lib/test_driver.rb +0 -119
@@ -0,0 +1,263 @@
|
|
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 TargetGroupHealthCheck
|
18
|
+
|
19
|
+
# The maximum time in milliseconds to wait for a target to respond to a check. For target VMs with 'Check Interval' set, the lesser of the two values is used once the TCP connection is established.
|
20
|
+
attr_accessor :check_timeout
|
21
|
+
|
22
|
+
|
23
|
+
# The interval in milliseconds between consecutive health checks; default is 2000.
|
24
|
+
attr_accessor :check_interval
|
25
|
+
|
26
|
+
|
27
|
+
# The maximum number of attempts to reconnect to a target after a connection failure. Valid range is 0 to 65535, and default is three reconnection attempts.
|
28
|
+
attr_accessor :retries
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
|
34
|
+
:'check_timeout' => :'checkTimeout',
|
35
|
+
|
36
|
+
:'check_interval' => :'checkInterval',
|
37
|
+
|
38
|
+
:'retries' => :'retries'
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Returns all the JSON keys this model knows about
|
43
|
+
def self.acceptable_attributes
|
44
|
+
attribute_map.values
|
45
|
+
end
|
46
|
+
|
47
|
+
# Attribute type mapping.
|
48
|
+
def self.openapi_types
|
49
|
+
{
|
50
|
+
|
51
|
+
:'check_timeout' => :'Integer',
|
52
|
+
|
53
|
+
:'check_interval' => :'Integer',
|
54
|
+
|
55
|
+
:'retries' => :'Integer'
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# List of attributes with nullable: true
|
60
|
+
def self.openapi_nullable
|
61
|
+
Set.new([
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
])
|
66
|
+
end
|
67
|
+
|
68
|
+
# Initializes the object
|
69
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
70
|
+
def initialize(attributes = {})
|
71
|
+
if (!attributes.is_a?(Hash))
|
72
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Ionoscloud::TargetGroupHealthCheck` initialize method"
|
73
|
+
end
|
74
|
+
|
75
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
77
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
78
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::TargetGroupHealthCheck`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
79
|
+
end
|
80
|
+
h[k.to_sym] = v
|
81
|
+
}
|
82
|
+
|
83
|
+
|
84
|
+
if attributes.key?(:'check_timeout')
|
85
|
+
self.check_timeout = attributes[:'check_timeout']
|
86
|
+
end
|
87
|
+
|
88
|
+
|
89
|
+
if attributes.key?(:'check_interval')
|
90
|
+
self.check_interval = attributes[:'check_interval']
|
91
|
+
end
|
92
|
+
|
93
|
+
|
94
|
+
if attributes.key?(:'retries')
|
95
|
+
self.retries = attributes[:'retries']
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
100
|
+
# @return Array for valid properties with the reasons
|
101
|
+
def list_invalid_properties
|
102
|
+
invalid_properties = Array.new
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
invalid_properties
|
107
|
+
end
|
108
|
+
|
109
|
+
# Check to see if the all the properties in the model are valid
|
110
|
+
# @return true if the model is valid
|
111
|
+
def valid?
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
true
|
116
|
+
end
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
# Checks equality by comparing each attribute.
|
122
|
+
# @param [Object] Object to be compared
|
123
|
+
def ==(o)
|
124
|
+
return true if self.equal?(o)
|
125
|
+
self.class == o.class &&
|
126
|
+
check_timeout == o.check_timeout &&
|
127
|
+
check_interval == o.check_interval &&
|
128
|
+
retries == o.retries
|
129
|
+
end
|
130
|
+
|
131
|
+
# @see the `==` method
|
132
|
+
# @param [Object] Object to be compared
|
133
|
+
def eql?(o)
|
134
|
+
self == o
|
135
|
+
end
|
136
|
+
|
137
|
+
# Calculates hash code according to all attributes.
|
138
|
+
# @return [Integer] Hash code
|
139
|
+
def hash
|
140
|
+
[check_timeout, check_interval, retries].hash
|
141
|
+
end
|
142
|
+
|
143
|
+
# Builds the object from hash
|
144
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
145
|
+
# @return [Object] Returns the model itself
|
146
|
+
def self.build_from_hash(attributes)
|
147
|
+
new.build_from_hash(attributes)
|
148
|
+
end
|
149
|
+
|
150
|
+
# Builds the object from hash
|
151
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
152
|
+
# @return [Object] Returns the model itself
|
153
|
+
def build_from_hash(attributes)
|
154
|
+
return nil unless attributes.is_a?(Hash)
|
155
|
+
self.class.openapi_types.each_pair do |key, type|
|
156
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
157
|
+
self.send("#{key}=", nil)
|
158
|
+
elsif type =~ /\AArray<(.*)>/i
|
159
|
+
# check to ensure the input is an array given that the attribute
|
160
|
+
# is documented as an array but the input is not
|
161
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
162
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
163
|
+
end
|
164
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
165
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
self
|
170
|
+
end
|
171
|
+
|
172
|
+
# Deserializes the data based on type
|
173
|
+
# @param string type Data type
|
174
|
+
# @param string value Value to be deserialized
|
175
|
+
# @return [Object] Deserialized data
|
176
|
+
def _deserialize(type, value)
|
177
|
+
case type.to_sym
|
178
|
+
when :Time
|
179
|
+
Time.parse(value)
|
180
|
+
when :Date
|
181
|
+
Date.parse(value)
|
182
|
+
when :String
|
183
|
+
value.to_s
|
184
|
+
when :Integer
|
185
|
+
value.to_i
|
186
|
+
when :Float
|
187
|
+
value.to_f
|
188
|
+
when :Boolean
|
189
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
190
|
+
true
|
191
|
+
else
|
192
|
+
false
|
193
|
+
end
|
194
|
+
when :Object
|
195
|
+
# generic object (usually a Hash), return directly
|
196
|
+
value
|
197
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
198
|
+
inner_type = Regexp.last_match[:inner_type]
|
199
|
+
value.map { |v| _deserialize(inner_type, v) }
|
200
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
201
|
+
k_type = Regexp.last_match[:k_type]
|
202
|
+
v_type = Regexp.last_match[:v_type]
|
203
|
+
{}.tap do |hash|
|
204
|
+
value.each do |k, v|
|
205
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
else # model
|
209
|
+
# models (e.g. Pet) or oneOf
|
210
|
+
klass = Ionoscloud.const_get(type)
|
211
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
# Returns the string representation of the object
|
216
|
+
# @return [String] String presentation of the object
|
217
|
+
def to_s
|
218
|
+
to_hash.to_s
|
219
|
+
end
|
220
|
+
|
221
|
+
# to_body is an alias to to_hash (backward compatibility)
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
223
|
+
def to_body
|
224
|
+
to_hash
|
225
|
+
end
|
226
|
+
|
227
|
+
# Returns the object in the form of hash
|
228
|
+
# @return [Hash] Returns the object in the form of hash
|
229
|
+
def to_hash
|
230
|
+
hash = {}
|
231
|
+
self.class.attribute_map.each_pair do |attr, param|
|
232
|
+
value = self.send(attr)
|
233
|
+
if value.nil?
|
234
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
235
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
236
|
+
end
|
237
|
+
|
238
|
+
hash[param] = _to_hash(value)
|
239
|
+
end
|
240
|
+
hash
|
241
|
+
end
|
242
|
+
|
243
|
+
# Outputs non-array value in the form of hash
|
244
|
+
# For object, use to_hash. Otherwise, just return the value
|
245
|
+
# @param [Object] value Any valid value
|
246
|
+
# @return [Hash] Returns the value in the form of hash
|
247
|
+
def _to_hash(value)
|
248
|
+
if value.is_a?(Array)
|
249
|
+
value.compact.map { |v| _to_hash(v) }
|
250
|
+
elsif value.is_a?(Hash)
|
251
|
+
{}.tap do |hash|
|
252
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
253
|
+
end
|
254
|
+
elsif value.respond_to? :to_hash
|
255
|
+
value.to_hash
|
256
|
+
else
|
257
|
+
value
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
end
|
262
|
+
|
263
|
+
end
|
@@ -0,0 +1,373 @@
|
|
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 TargetGroupHttpHealthCheck
|
18
|
+
|
19
|
+
# The path (destination URL) for the HTTP health check request; the default is /.
|
20
|
+
attr_accessor :path
|
21
|
+
|
22
|
+
|
23
|
+
# The method for the HTTP health check.
|
24
|
+
attr_accessor :method
|
25
|
+
|
26
|
+
|
27
|
+
#
|
28
|
+
attr_accessor :match_type
|
29
|
+
|
30
|
+
|
31
|
+
# The response returned by the request, depending on the match type.
|
32
|
+
attr_accessor :response
|
33
|
+
|
34
|
+
|
35
|
+
#
|
36
|
+
attr_accessor :regex
|
37
|
+
|
38
|
+
|
39
|
+
#
|
40
|
+
attr_accessor :negate
|
41
|
+
|
42
|
+
class EnumAttributeValidator
|
43
|
+
attr_reader :datatype
|
44
|
+
attr_reader :allowable_values
|
45
|
+
|
46
|
+
def initialize(datatype, allowable_values)
|
47
|
+
@allowable_values = allowable_values.map do |value|
|
48
|
+
case datatype.to_s
|
49
|
+
when /Integer/i
|
50
|
+
value.to_i
|
51
|
+
when /Float/i
|
52
|
+
value.to_f
|
53
|
+
else
|
54
|
+
value
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def valid?(value)
|
60
|
+
!value || allowable_values.include?(value)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
65
|
+
def self.attribute_map
|
66
|
+
{
|
67
|
+
|
68
|
+
:'path' => :'path',
|
69
|
+
|
70
|
+
:'method' => :'method',
|
71
|
+
|
72
|
+
:'match_type' => :'matchType',
|
73
|
+
|
74
|
+
:'response' => :'response',
|
75
|
+
|
76
|
+
:'regex' => :'regex',
|
77
|
+
|
78
|
+
:'negate' => :'negate'
|
79
|
+
}
|
80
|
+
end
|
81
|
+
|
82
|
+
# Returns all the JSON keys this model knows about
|
83
|
+
def self.acceptable_attributes
|
84
|
+
attribute_map.values
|
85
|
+
end
|
86
|
+
|
87
|
+
# Attribute type mapping.
|
88
|
+
def self.openapi_types
|
89
|
+
{
|
90
|
+
|
91
|
+
:'path' => :'String',
|
92
|
+
|
93
|
+
:'method' => :'String',
|
94
|
+
|
95
|
+
:'match_type' => :'String',
|
96
|
+
|
97
|
+
:'response' => :'String',
|
98
|
+
|
99
|
+
:'regex' => :'Boolean',
|
100
|
+
|
101
|
+
:'negate' => :'Boolean'
|
102
|
+
}
|
103
|
+
end
|
104
|
+
|
105
|
+
# List of attributes with nullable: true
|
106
|
+
def self.openapi_nullable
|
107
|
+
Set.new([
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
])
|
115
|
+
end
|
116
|
+
|
117
|
+
# Initializes the object
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
def initialize(attributes = {})
|
120
|
+
if (!attributes.is_a?(Hash))
|
121
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Ionoscloud::TargetGroupHttpHealthCheck` initialize method"
|
122
|
+
end
|
123
|
+
|
124
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
125
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
126
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
127
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::TargetGroupHttpHealthCheck`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
128
|
+
end
|
129
|
+
h[k.to_sym] = v
|
130
|
+
}
|
131
|
+
|
132
|
+
|
133
|
+
if attributes.key?(:'path')
|
134
|
+
self.path = attributes[:'path']
|
135
|
+
end
|
136
|
+
|
137
|
+
|
138
|
+
if attributes.key?(:'method')
|
139
|
+
self.method = attributes[:'method']
|
140
|
+
end
|
141
|
+
|
142
|
+
|
143
|
+
if attributes.key?(:'match_type')
|
144
|
+
self.match_type = attributes[:'match_type']
|
145
|
+
end
|
146
|
+
|
147
|
+
|
148
|
+
if attributes.key?(:'response')
|
149
|
+
self.response = attributes[:'response']
|
150
|
+
end
|
151
|
+
|
152
|
+
|
153
|
+
if attributes.key?(:'regex')
|
154
|
+
self.regex = attributes[:'regex']
|
155
|
+
end
|
156
|
+
|
157
|
+
|
158
|
+
if attributes.key?(:'negate')
|
159
|
+
self.negate = attributes[:'negate']
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
164
|
+
# @return Array for valid properties with the reasons
|
165
|
+
def list_invalid_properties
|
166
|
+
invalid_properties = Array.new
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
if @match_type.nil?
|
171
|
+
invalid_properties.push('invalid value for "match_type", match_type cannot be nil.')
|
172
|
+
end
|
173
|
+
|
174
|
+
|
175
|
+
if @response.nil?
|
176
|
+
invalid_properties.push('invalid value for "response", response cannot be nil.')
|
177
|
+
end
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
invalid_properties
|
182
|
+
end
|
183
|
+
|
184
|
+
# Check to see if the all the properties in the model are valid
|
185
|
+
# @return true if the model is valid
|
186
|
+
def valid?
|
187
|
+
|
188
|
+
|
189
|
+
method_validator = EnumAttributeValidator.new('String', ["HEAD", "PUT", "POST", "GET", "TRACE", "PATCH", "OPTIONS"])
|
190
|
+
return false unless method_validator.valid?(@method)
|
191
|
+
|
192
|
+
return false if @match_type.nil?
|
193
|
+
match_type_validator = EnumAttributeValidator.new('String', ["STATUS_CODE", "RESPONSE_BODY"])
|
194
|
+
return false unless match_type_validator.valid?(@match_type)
|
195
|
+
|
196
|
+
return false if @response.nil?
|
197
|
+
|
198
|
+
|
199
|
+
true
|
200
|
+
end
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
# Custom attribute writer method checking allowed values (enum).
|
205
|
+
# @param [Object] method Object to be assigned
|
206
|
+
def method=(method)
|
207
|
+
validator = EnumAttributeValidator.new('String', ["HEAD", "PUT", "POST", "GET", "TRACE", "PATCH", "OPTIONS"])
|
208
|
+
unless validator.valid?(method)
|
209
|
+
fail ArgumentError, "invalid value for \"method\", must be one of #{validator.allowable_values}."
|
210
|
+
end
|
211
|
+
@method = method
|
212
|
+
end
|
213
|
+
|
214
|
+
|
215
|
+
# Custom attribute writer method checking allowed values (enum).
|
216
|
+
# @param [Object] match_type Object to be assigned
|
217
|
+
def match_type=(match_type)
|
218
|
+
validator = EnumAttributeValidator.new('String', ["STATUS_CODE", "RESPONSE_BODY"])
|
219
|
+
unless validator.valid?(match_type)
|
220
|
+
fail ArgumentError, "invalid value for \"match_type\", must be one of #{validator.allowable_values}."
|
221
|
+
end
|
222
|
+
@match_type = match_type
|
223
|
+
end
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
# Checks equality by comparing each attribute.
|
229
|
+
# @param [Object] Object to be compared
|
230
|
+
def ==(o)
|
231
|
+
return true if self.equal?(o)
|
232
|
+
self.class == o.class &&
|
233
|
+
path == o.path &&
|
234
|
+
method == o.method &&
|
235
|
+
match_type == o.match_type &&
|
236
|
+
response == o.response &&
|
237
|
+
regex == o.regex &&
|
238
|
+
negate == o.negate
|
239
|
+
end
|
240
|
+
|
241
|
+
# @see the `==` method
|
242
|
+
# @param [Object] Object to be compared
|
243
|
+
def eql?(o)
|
244
|
+
self == o
|
245
|
+
end
|
246
|
+
|
247
|
+
# Calculates hash code according to all attributes.
|
248
|
+
# @return [Integer] Hash code
|
249
|
+
def hash
|
250
|
+
[path, method, match_type, response, regex, negate].hash
|
251
|
+
end
|
252
|
+
|
253
|
+
# Builds the object from hash
|
254
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
255
|
+
# @return [Object] Returns the model itself
|
256
|
+
def self.build_from_hash(attributes)
|
257
|
+
new.build_from_hash(attributes)
|
258
|
+
end
|
259
|
+
|
260
|
+
# Builds the object from hash
|
261
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
262
|
+
# @return [Object] Returns the model itself
|
263
|
+
def build_from_hash(attributes)
|
264
|
+
return nil unless attributes.is_a?(Hash)
|
265
|
+
self.class.openapi_types.each_pair do |key, type|
|
266
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
267
|
+
self.send("#{key}=", nil)
|
268
|
+
elsif type =~ /\AArray<(.*)>/i
|
269
|
+
# check to ensure the input is an array given that the attribute
|
270
|
+
# is documented as an array but the input is not
|
271
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
272
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
273
|
+
end
|
274
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
275
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
276
|
+
end
|
277
|
+
end
|
278
|
+
|
279
|
+
self
|
280
|
+
end
|
281
|
+
|
282
|
+
# Deserializes the data based on type
|
283
|
+
# @param string type Data type
|
284
|
+
# @param string value Value to be deserialized
|
285
|
+
# @return [Object] Deserialized data
|
286
|
+
def _deserialize(type, value)
|
287
|
+
case type.to_sym
|
288
|
+
when :Time
|
289
|
+
Time.parse(value)
|
290
|
+
when :Date
|
291
|
+
Date.parse(value)
|
292
|
+
when :String
|
293
|
+
value.to_s
|
294
|
+
when :Integer
|
295
|
+
value.to_i
|
296
|
+
when :Float
|
297
|
+
value.to_f
|
298
|
+
when :Boolean
|
299
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
300
|
+
true
|
301
|
+
else
|
302
|
+
false
|
303
|
+
end
|
304
|
+
when :Object
|
305
|
+
# generic object (usually a Hash), return directly
|
306
|
+
value
|
307
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
308
|
+
inner_type = Regexp.last_match[:inner_type]
|
309
|
+
value.map { |v| _deserialize(inner_type, v) }
|
310
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
311
|
+
k_type = Regexp.last_match[:k_type]
|
312
|
+
v_type = Regexp.last_match[:v_type]
|
313
|
+
{}.tap do |hash|
|
314
|
+
value.each do |k, v|
|
315
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
316
|
+
end
|
317
|
+
end
|
318
|
+
else # model
|
319
|
+
# models (e.g. Pet) or oneOf
|
320
|
+
klass = Ionoscloud.const_get(type)
|
321
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
322
|
+
end
|
323
|
+
end
|
324
|
+
|
325
|
+
# Returns the string representation of the object
|
326
|
+
# @return [String] String presentation of the object
|
327
|
+
def to_s
|
328
|
+
to_hash.to_s
|
329
|
+
end
|
330
|
+
|
331
|
+
# to_body is an alias to to_hash (backward compatibility)
|
332
|
+
# @return [Hash] Returns the object in the form of hash
|
333
|
+
def to_body
|
334
|
+
to_hash
|
335
|
+
end
|
336
|
+
|
337
|
+
# Returns the object in the form of hash
|
338
|
+
# @return [Hash] Returns the object in the form of hash
|
339
|
+
def to_hash
|
340
|
+
hash = {}
|
341
|
+
self.class.attribute_map.each_pair do |attr, param|
|
342
|
+
value = self.send(attr)
|
343
|
+
if value.nil?
|
344
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
345
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
346
|
+
end
|
347
|
+
|
348
|
+
hash[param] = _to_hash(value)
|
349
|
+
end
|
350
|
+
hash
|
351
|
+
end
|
352
|
+
|
353
|
+
# Outputs non-array value in the form of hash
|
354
|
+
# For object, use to_hash. Otherwise, just return the value
|
355
|
+
# @param [Object] value Any valid value
|
356
|
+
# @return [Hash] Returns the value in the form of hash
|
357
|
+
def _to_hash(value)
|
358
|
+
if value.is_a?(Array)
|
359
|
+
value.compact.map { |v| _to_hash(v) }
|
360
|
+
elsif value.is_a?(Hash)
|
361
|
+
{}.tap do |hash|
|
362
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
363
|
+
end
|
364
|
+
elsif value.respond_to? :to_hash
|
365
|
+
value.to_hash
|
366
|
+
else
|
367
|
+
value
|
368
|
+
end
|
369
|
+
end
|
370
|
+
|
371
|
+
end
|
372
|
+
|
373
|
+
end
|