pnap_rancher_api 2.0.4 → 2.0.5
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/VERSION +1 -1
- data/docs/Cluster.md +1 -1
- data/docs/ClustersApi.md +1 -1
- data/docs/WorkloadClusterConfig.md +2 -2
- data/lib/pnap_rancher_api/api/clusters_api.rb +7 -7
- data/lib/pnap_rancher_api/api_client.rb +17 -14
- data/lib/pnap_rancher_api/api_error.rb +1 -1
- data/lib/pnap_rancher_api/api_model_base.rb +88 -0
- data/lib/pnap_rancher_api/configuration.rb +11 -1
- data/lib/pnap_rancher_api/models/cluster.rb +22 -79
- data/lib/pnap_rancher_api/models/delete_result.rb +31 -78
- data/lib/pnap_rancher_api/models/error.rb +21 -78
- data/lib/pnap_rancher_api/models/node.rb +11 -78
- data/lib/pnap_rancher_api/models/node_pool.rb +13 -80
- data/lib/pnap_rancher_api/models/rancher_cluster_certificates.rb +11 -78
- data/lib/pnap_rancher_api/models/rancher_cluster_config.rb +11 -78
- data/lib/pnap_rancher_api/models/rancher_server_metadata.rb +11 -78
- data/lib/pnap_rancher_api/models/ssh_config.rb +11 -78
- data/lib/pnap_rancher_api/models/workload_cluster_config.rb +33 -80
- data/lib/pnap_rancher_api/version.rb +1 -2
- data/lib/pnap_rancher_api.rb +2 -1
- data/pnap_rancher_api.gemspec +6 -6
- data/spec/api/clusters_api_spec.rb +2 -2
- data/spec/models/cluster_spec.rb +2 -2
- data/spec/models/delete_result_spec.rb +2 -2
- data/spec/models/error_spec.rb +2 -2
- data/spec/models/node_pool_spec.rb +2 -2
- data/spec/models/node_spec.rb +2 -2
- data/spec/models/rancher_cluster_certificates_spec.rb +2 -2
- data/spec/models/rancher_cluster_config_spec.rb +2 -2
- data/spec/models/rancher_server_metadata_spec.rb +2 -2
- data/spec/models/ssh_config_spec.rb +2 -2
- data/spec/models/workload_cluster_config_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +14 -10
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module RancherApi
|
|
17
|
-
class Error
|
|
17
|
+
class Error < ApiModelBase
|
|
18
18
|
# The description detailing the cause of the error code.
|
|
19
19
|
attr_accessor :message
|
|
20
20
|
|
|
@@ -29,9 +29,14 @@ module RancherApi
|
|
|
29
29
|
}
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
32
37
|
# Returns all the JSON keys this model knows about
|
|
33
38
|
def self.acceptable_attributes
|
|
34
|
-
|
|
39
|
+
acceptable_attribute_map.values
|
|
35
40
|
end
|
|
36
41
|
|
|
37
42
|
# Attribute type mapping.
|
|
@@ -56,9 +61,10 @@ module RancherApi
|
|
|
56
61
|
end
|
|
57
62
|
|
|
58
63
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
65
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
-
if (!
|
|
61
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::Error`. Please check the name to make sure it's valid. List of attributes: " +
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::Error`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
68
|
end
|
|
63
69
|
h[k.to_sym] = v
|
|
64
70
|
}
|
|
@@ -96,6 +102,16 @@ module RancherApi
|
|
|
96
102
|
true
|
|
97
103
|
end
|
|
98
104
|
|
|
105
|
+
# Custom attribute writer method with validation
|
|
106
|
+
# @param [Object] message Value to be assigned
|
|
107
|
+
def message=(message)
|
|
108
|
+
if message.nil?
|
|
109
|
+
fail ArgumentError, 'message cannot be nil'
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
@message = message
|
|
113
|
+
end
|
|
114
|
+
|
|
99
115
|
# Checks equality by comparing each attribute.
|
|
100
116
|
# @param [Object] Object to be compared
|
|
101
117
|
def ==(o)
|
|
@@ -140,61 +156,6 @@ module RancherApi
|
|
|
140
156
|
new(transformed_hash)
|
|
141
157
|
end
|
|
142
158
|
|
|
143
|
-
# Deserializes the data based on type
|
|
144
|
-
# @param string type Data type
|
|
145
|
-
# @param string value Value to be deserialized
|
|
146
|
-
# @return [Object] Deserialized data
|
|
147
|
-
def self._deserialize(type, value)
|
|
148
|
-
case type.to_sym
|
|
149
|
-
when :Time
|
|
150
|
-
Time.parse(value)
|
|
151
|
-
when :Date
|
|
152
|
-
Date.parse(value)
|
|
153
|
-
when :String
|
|
154
|
-
value.to_s
|
|
155
|
-
when :Integer
|
|
156
|
-
value.to_i
|
|
157
|
-
when :Float
|
|
158
|
-
value.to_f
|
|
159
|
-
when :Boolean
|
|
160
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
161
|
-
true
|
|
162
|
-
else
|
|
163
|
-
false
|
|
164
|
-
end
|
|
165
|
-
when :Object
|
|
166
|
-
# generic object (usually a Hash), return directly
|
|
167
|
-
value
|
|
168
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
169
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
170
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
171
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
172
|
-
k_type = Regexp.last_match[:k_type]
|
|
173
|
-
v_type = Regexp.last_match[:v_type]
|
|
174
|
-
{}.tap do |hash|
|
|
175
|
-
value.each do |k, v|
|
|
176
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
177
|
-
end
|
|
178
|
-
end
|
|
179
|
-
else # model
|
|
180
|
-
# models (e.g. Pet) or oneOf
|
|
181
|
-
klass = RancherApi.const_get(type)
|
|
182
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
183
|
-
end
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
# Returns the string representation of the object
|
|
187
|
-
# @return [String] String presentation of the object
|
|
188
|
-
def to_s
|
|
189
|
-
to_hash.to_s
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
193
|
-
# @return [Hash] Returns the object in the form of hash
|
|
194
|
-
def to_body
|
|
195
|
-
to_hash
|
|
196
|
-
end
|
|
197
|
-
|
|
198
159
|
# Returns the object in the form of hash
|
|
199
160
|
# @return [Hash] Returns the object in the form of hash
|
|
200
161
|
def to_hash
|
|
@@ -211,24 +172,6 @@ module RancherApi
|
|
|
211
172
|
hash
|
|
212
173
|
end
|
|
213
174
|
|
|
214
|
-
# Outputs non-array value in the form of hash
|
|
215
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
216
|
-
# @param [Object] value Any valid value
|
|
217
|
-
# @return [Hash] Returns the value in the form of hash
|
|
218
|
-
def _to_hash(value)
|
|
219
|
-
if value.is_a?(Array)
|
|
220
|
-
value.compact.map { |v| _to_hash(v) }
|
|
221
|
-
elsif value.is_a?(Hash)
|
|
222
|
-
{}.tap do |hash|
|
|
223
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
224
|
-
end
|
|
225
|
-
elsif value.respond_to? :to_hash
|
|
226
|
-
value.to_hash
|
|
227
|
-
else
|
|
228
|
-
value
|
|
229
|
-
end
|
|
230
|
-
end
|
|
231
|
-
|
|
232
175
|
end
|
|
233
176
|
|
|
234
177
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module RancherApi
|
|
17
17
|
# Node details.
|
|
18
|
-
class Node
|
|
18
|
+
class Node < ApiModelBase
|
|
19
19
|
# The server identifier.
|
|
20
20
|
attr_accessor :server_id
|
|
21
21
|
|
|
@@ -26,9 +26,14 @@ module RancherApi
|
|
|
26
26
|
}
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
# Returns attribute mapping this model knows about
|
|
30
|
+
def self.acceptable_attribute_map
|
|
31
|
+
attribute_map
|
|
32
|
+
end
|
|
33
|
+
|
|
29
34
|
# Returns all the JSON keys this model knows about
|
|
30
35
|
def self.acceptable_attributes
|
|
31
|
-
|
|
36
|
+
acceptable_attribute_map.values
|
|
32
37
|
end
|
|
33
38
|
|
|
34
39
|
# Attribute type mapping.
|
|
@@ -52,9 +57,10 @@ module RancherApi
|
|
|
52
57
|
end
|
|
53
58
|
|
|
54
59
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
60
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
55
61
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
56
|
-
if (!
|
|
57
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::Node`. Please check the name to make sure it's valid. List of attributes: " +
|
|
62
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::Node`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
58
64
|
end
|
|
59
65
|
h[k.to_sym] = v
|
|
60
66
|
}
|
|
@@ -122,61 +128,6 @@ module RancherApi
|
|
|
122
128
|
new(transformed_hash)
|
|
123
129
|
end
|
|
124
130
|
|
|
125
|
-
# Deserializes the data based on type
|
|
126
|
-
# @param string type Data type
|
|
127
|
-
# @param string value Value to be deserialized
|
|
128
|
-
# @return [Object] Deserialized data
|
|
129
|
-
def self._deserialize(type, value)
|
|
130
|
-
case type.to_sym
|
|
131
|
-
when :Time
|
|
132
|
-
Time.parse(value)
|
|
133
|
-
when :Date
|
|
134
|
-
Date.parse(value)
|
|
135
|
-
when :String
|
|
136
|
-
value.to_s
|
|
137
|
-
when :Integer
|
|
138
|
-
value.to_i
|
|
139
|
-
when :Float
|
|
140
|
-
value.to_f
|
|
141
|
-
when :Boolean
|
|
142
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
143
|
-
true
|
|
144
|
-
else
|
|
145
|
-
false
|
|
146
|
-
end
|
|
147
|
-
when :Object
|
|
148
|
-
# generic object (usually a Hash), return directly
|
|
149
|
-
value
|
|
150
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
151
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
152
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
153
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
154
|
-
k_type = Regexp.last_match[:k_type]
|
|
155
|
-
v_type = Regexp.last_match[:v_type]
|
|
156
|
-
{}.tap do |hash|
|
|
157
|
-
value.each do |k, v|
|
|
158
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
159
|
-
end
|
|
160
|
-
end
|
|
161
|
-
else # model
|
|
162
|
-
# models (e.g. Pet) or oneOf
|
|
163
|
-
klass = RancherApi.const_get(type)
|
|
164
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
165
|
-
end
|
|
166
|
-
end
|
|
167
|
-
|
|
168
|
-
# Returns the string representation of the object
|
|
169
|
-
# @return [String] String presentation of the object
|
|
170
|
-
def to_s
|
|
171
|
-
to_hash.to_s
|
|
172
|
-
end
|
|
173
|
-
|
|
174
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
175
|
-
# @return [Hash] Returns the object in the form of hash
|
|
176
|
-
def to_body
|
|
177
|
-
to_hash
|
|
178
|
-
end
|
|
179
|
-
|
|
180
131
|
# Returns the object in the form of hash
|
|
181
132
|
# @return [Hash] Returns the object in the form of hash
|
|
182
133
|
def to_hash
|
|
@@ -193,24 +144,6 @@ module RancherApi
|
|
|
193
144
|
hash
|
|
194
145
|
end
|
|
195
146
|
|
|
196
|
-
# Outputs non-array value in the form of hash
|
|
197
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
198
|
-
# @param [Object] value Any valid value
|
|
199
|
-
# @return [Hash] Returns the value in the form of hash
|
|
200
|
-
def _to_hash(value)
|
|
201
|
-
if value.is_a?(Array)
|
|
202
|
-
value.compact.map { |v| _to_hash(v) }
|
|
203
|
-
elsif value.is_a?(Hash)
|
|
204
|
-
{}.tap do |hash|
|
|
205
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
206
|
-
end
|
|
207
|
-
elsif value.respond_to? :to_hash
|
|
208
|
-
value.to_hash
|
|
209
|
-
else
|
|
210
|
-
value
|
|
211
|
-
end
|
|
212
|
-
end
|
|
213
|
-
|
|
214
147
|
end
|
|
215
148
|
|
|
216
149
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module RancherApi
|
|
17
17
|
# Node Pool Configuration. A node pool contains the name and configuration for a cluster's node pool. Node pools are set of nodes with a common configuration and specification.
|
|
18
|
-
class NodePool
|
|
18
|
+
class NodePool < ApiModelBase
|
|
19
19
|
# The name of the node pool.
|
|
20
20
|
attr_accessor :name
|
|
21
21
|
|
|
@@ -41,9 +41,14 @@ module RancherApi
|
|
|
41
41
|
}
|
|
42
42
|
end
|
|
43
43
|
|
|
44
|
+
# Returns attribute mapping this model knows about
|
|
45
|
+
def self.acceptable_attribute_map
|
|
46
|
+
attribute_map
|
|
47
|
+
end
|
|
48
|
+
|
|
44
49
|
# Returns all the JSON keys this model knows about
|
|
45
50
|
def self.acceptable_attributes
|
|
46
|
-
|
|
51
|
+
acceptable_attribute_map.values
|
|
47
52
|
end
|
|
48
53
|
|
|
49
54
|
# Attribute type mapping.
|
|
@@ -71,9 +76,10 @@ module RancherApi
|
|
|
71
76
|
end
|
|
72
77
|
|
|
73
78
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
79
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
74
80
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
75
|
-
if (!
|
|
76
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::NodePool`. Please check the name to make sure it's valid. List of attributes: " +
|
|
81
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
82
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::NodePool`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
77
83
|
end
|
|
78
84
|
h[k.to_sym] = v
|
|
79
85
|
}
|
|
@@ -113,7 +119,7 @@ module RancherApi
|
|
|
113
119
|
end
|
|
114
120
|
|
|
115
121
|
if !@name.nil? && @name.to_s.length < 1
|
|
116
|
-
invalid_properties.push('invalid value for "name", the character length must be
|
|
122
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
117
123
|
end
|
|
118
124
|
|
|
119
125
|
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9().-])+$/)
|
|
@@ -146,7 +152,7 @@ module RancherApi
|
|
|
146
152
|
end
|
|
147
153
|
|
|
148
154
|
if name.to_s.length < 1
|
|
149
|
-
fail ArgumentError, 'invalid value for "name", the character length must be
|
|
155
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
150
156
|
end
|
|
151
157
|
|
|
152
158
|
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9().-])+$/)
|
|
@@ -204,61 +210,6 @@ module RancherApi
|
|
|
204
210
|
new(transformed_hash)
|
|
205
211
|
end
|
|
206
212
|
|
|
207
|
-
# Deserializes the data based on type
|
|
208
|
-
# @param string type Data type
|
|
209
|
-
# @param string value Value to be deserialized
|
|
210
|
-
# @return [Object] Deserialized data
|
|
211
|
-
def self._deserialize(type, value)
|
|
212
|
-
case type.to_sym
|
|
213
|
-
when :Time
|
|
214
|
-
Time.parse(value)
|
|
215
|
-
when :Date
|
|
216
|
-
Date.parse(value)
|
|
217
|
-
when :String
|
|
218
|
-
value.to_s
|
|
219
|
-
when :Integer
|
|
220
|
-
value.to_i
|
|
221
|
-
when :Float
|
|
222
|
-
value.to_f
|
|
223
|
-
when :Boolean
|
|
224
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
225
|
-
true
|
|
226
|
-
else
|
|
227
|
-
false
|
|
228
|
-
end
|
|
229
|
-
when :Object
|
|
230
|
-
# generic object (usually a Hash), return directly
|
|
231
|
-
value
|
|
232
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
233
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
234
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
235
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
236
|
-
k_type = Regexp.last_match[:k_type]
|
|
237
|
-
v_type = Regexp.last_match[:v_type]
|
|
238
|
-
{}.tap do |hash|
|
|
239
|
-
value.each do |k, v|
|
|
240
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
241
|
-
end
|
|
242
|
-
end
|
|
243
|
-
else # model
|
|
244
|
-
# models (e.g. Pet) or oneOf
|
|
245
|
-
klass = RancherApi.const_get(type)
|
|
246
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
247
|
-
end
|
|
248
|
-
end
|
|
249
|
-
|
|
250
|
-
# Returns the string representation of the object
|
|
251
|
-
# @return [String] String presentation of the object
|
|
252
|
-
def to_s
|
|
253
|
-
to_hash.to_s
|
|
254
|
-
end
|
|
255
|
-
|
|
256
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
257
|
-
# @return [Hash] Returns the object in the form of hash
|
|
258
|
-
def to_body
|
|
259
|
-
to_hash
|
|
260
|
-
end
|
|
261
|
-
|
|
262
213
|
# Returns the object in the form of hash
|
|
263
214
|
# @return [Hash] Returns the object in the form of hash
|
|
264
215
|
def to_hash
|
|
@@ -275,24 +226,6 @@ module RancherApi
|
|
|
275
226
|
hash
|
|
276
227
|
end
|
|
277
228
|
|
|
278
|
-
# Outputs non-array value in the form of hash
|
|
279
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
280
|
-
# @param [Object] value Any valid value
|
|
281
|
-
# @return [Hash] Returns the value in the form of hash
|
|
282
|
-
def _to_hash(value)
|
|
283
|
-
if value.is_a?(Array)
|
|
284
|
-
value.compact.map { |v| _to_hash(v) }
|
|
285
|
-
elsif value.is_a?(Hash)
|
|
286
|
-
{}.tap do |hash|
|
|
287
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
288
|
-
end
|
|
289
|
-
elsif value.respond_to? :to_hash
|
|
290
|
-
value.to_hash
|
|
291
|
-
else
|
|
292
|
-
value
|
|
293
|
-
end
|
|
294
|
-
end
|
|
295
|
-
|
|
296
229
|
end
|
|
297
230
|
|
|
298
231
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module RancherApi
|
|
17
17
|
# (Write-only) Define the custom SSL certificates to be used instead of defaults.
|
|
18
|
-
class RancherClusterCertificates
|
|
18
|
+
class RancherClusterCertificates < ApiModelBase
|
|
19
19
|
# The SSL CA certificate to be used for rancher admin.
|
|
20
20
|
attr_accessor :ca_certificate
|
|
21
21
|
|
|
@@ -34,9 +34,14 @@ module RancherApi
|
|
|
34
34
|
}
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
37
42
|
# Returns all the JSON keys this model knows about
|
|
38
43
|
def self.acceptable_attributes
|
|
39
|
-
|
|
44
|
+
acceptable_attribute_map.values
|
|
40
45
|
end
|
|
41
46
|
|
|
42
47
|
# Attribute type mapping.
|
|
@@ -62,9 +67,10 @@ module RancherApi
|
|
|
62
67
|
end
|
|
63
68
|
|
|
64
69
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
71
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
-
if (!
|
|
67
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::RancherClusterCertificates`. Please check the name to make sure it's valid. List of attributes: " +
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::RancherClusterCertificates`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
74
|
end
|
|
69
75
|
h[k.to_sym] = v
|
|
70
76
|
}
|
|
@@ -142,61 +148,6 @@ module RancherApi
|
|
|
142
148
|
new(transformed_hash)
|
|
143
149
|
end
|
|
144
150
|
|
|
145
|
-
# Deserializes the data based on type
|
|
146
|
-
# @param string type Data type
|
|
147
|
-
# @param string value Value to be deserialized
|
|
148
|
-
# @return [Object] Deserialized data
|
|
149
|
-
def self._deserialize(type, value)
|
|
150
|
-
case type.to_sym
|
|
151
|
-
when :Time
|
|
152
|
-
Time.parse(value)
|
|
153
|
-
when :Date
|
|
154
|
-
Date.parse(value)
|
|
155
|
-
when :String
|
|
156
|
-
value.to_s
|
|
157
|
-
when :Integer
|
|
158
|
-
value.to_i
|
|
159
|
-
when :Float
|
|
160
|
-
value.to_f
|
|
161
|
-
when :Boolean
|
|
162
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
163
|
-
true
|
|
164
|
-
else
|
|
165
|
-
false
|
|
166
|
-
end
|
|
167
|
-
when :Object
|
|
168
|
-
# generic object (usually a Hash), return directly
|
|
169
|
-
value
|
|
170
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
171
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
172
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
173
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
174
|
-
k_type = Regexp.last_match[:k_type]
|
|
175
|
-
v_type = Regexp.last_match[:v_type]
|
|
176
|
-
{}.tap do |hash|
|
|
177
|
-
value.each do |k, v|
|
|
178
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
179
|
-
end
|
|
180
|
-
end
|
|
181
|
-
else # model
|
|
182
|
-
# models (e.g. Pet) or oneOf
|
|
183
|
-
klass = RancherApi.const_get(type)
|
|
184
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
185
|
-
end
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
# Returns the string representation of the object
|
|
189
|
-
# @return [String] String presentation of the object
|
|
190
|
-
def to_s
|
|
191
|
-
to_hash.to_s
|
|
192
|
-
end
|
|
193
|
-
|
|
194
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
195
|
-
# @return [Hash] Returns the object in the form of hash
|
|
196
|
-
def to_body
|
|
197
|
-
to_hash
|
|
198
|
-
end
|
|
199
|
-
|
|
200
151
|
# Returns the object in the form of hash
|
|
201
152
|
# @return [Hash] Returns the object in the form of hash
|
|
202
153
|
def to_hash
|
|
@@ -213,24 +164,6 @@ module RancherApi
|
|
|
213
164
|
hash
|
|
214
165
|
end
|
|
215
166
|
|
|
216
|
-
# Outputs non-array value in the form of hash
|
|
217
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
218
|
-
# @param [Object] value Any valid value
|
|
219
|
-
# @return [Hash] Returns the value in the form of hash
|
|
220
|
-
def _to_hash(value)
|
|
221
|
-
if value.is_a?(Array)
|
|
222
|
-
value.compact.map { |v| _to_hash(v) }
|
|
223
|
-
elsif value.is_a?(Hash)
|
|
224
|
-
{}.tap do |hash|
|
|
225
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
226
|
-
end
|
|
227
|
-
elsif value.respond_to? :to_hash
|
|
228
|
-
value.to_hash
|
|
229
|
-
else
|
|
230
|
-
value
|
|
231
|
-
end
|
|
232
|
-
end
|
|
233
|
-
|
|
234
167
|
end
|
|
235
168
|
|
|
236
169
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module RancherApi
|
|
17
17
|
# (Write-only) Rancher configuration parameters.
|
|
18
|
-
class RancherClusterConfig
|
|
18
|
+
class RancherClusterConfig < ApiModelBase
|
|
19
19
|
# Shared secret used to join a server or agent to a cluster.
|
|
20
20
|
attr_accessor :token
|
|
21
21
|
|
|
@@ -49,9 +49,14 @@ module RancherApi
|
|
|
49
49
|
}
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
+
# Returns attribute mapping this model knows about
|
|
53
|
+
def self.acceptable_attribute_map
|
|
54
|
+
attribute_map
|
|
55
|
+
end
|
|
56
|
+
|
|
52
57
|
# Returns all the JSON keys this model knows about
|
|
53
58
|
def self.acceptable_attributes
|
|
54
|
-
|
|
59
|
+
acceptable_attribute_map.values
|
|
55
60
|
end
|
|
56
61
|
|
|
57
62
|
# Attribute type mapping.
|
|
@@ -81,9 +86,10 @@ module RancherApi
|
|
|
81
86
|
end
|
|
82
87
|
|
|
83
88
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
89
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
84
90
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
85
|
-
if (!
|
|
86
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::RancherClusterConfig`. Please check the name to make sure it's valid. List of attributes: " +
|
|
91
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::RancherClusterConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
87
93
|
end
|
|
88
94
|
h[k.to_sym] = v
|
|
89
95
|
}
|
|
@@ -185,61 +191,6 @@ module RancherApi
|
|
|
185
191
|
new(transformed_hash)
|
|
186
192
|
end
|
|
187
193
|
|
|
188
|
-
# Deserializes the data based on type
|
|
189
|
-
# @param string type Data type
|
|
190
|
-
# @param string value Value to be deserialized
|
|
191
|
-
# @return [Object] Deserialized data
|
|
192
|
-
def self._deserialize(type, value)
|
|
193
|
-
case type.to_sym
|
|
194
|
-
when :Time
|
|
195
|
-
Time.parse(value)
|
|
196
|
-
when :Date
|
|
197
|
-
Date.parse(value)
|
|
198
|
-
when :String
|
|
199
|
-
value.to_s
|
|
200
|
-
when :Integer
|
|
201
|
-
value.to_i
|
|
202
|
-
when :Float
|
|
203
|
-
value.to_f
|
|
204
|
-
when :Boolean
|
|
205
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
206
|
-
true
|
|
207
|
-
else
|
|
208
|
-
false
|
|
209
|
-
end
|
|
210
|
-
when :Object
|
|
211
|
-
# generic object (usually a Hash), return directly
|
|
212
|
-
value
|
|
213
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
214
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
215
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
216
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
217
|
-
k_type = Regexp.last_match[:k_type]
|
|
218
|
-
v_type = Regexp.last_match[:v_type]
|
|
219
|
-
{}.tap do |hash|
|
|
220
|
-
value.each do |k, v|
|
|
221
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
222
|
-
end
|
|
223
|
-
end
|
|
224
|
-
else # model
|
|
225
|
-
# models (e.g. Pet) or oneOf
|
|
226
|
-
klass = RancherApi.const_get(type)
|
|
227
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
228
|
-
end
|
|
229
|
-
end
|
|
230
|
-
|
|
231
|
-
# Returns the string representation of the object
|
|
232
|
-
# @return [String] String presentation of the object
|
|
233
|
-
def to_s
|
|
234
|
-
to_hash.to_s
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
238
|
-
# @return [Hash] Returns the object in the form of hash
|
|
239
|
-
def to_body
|
|
240
|
-
to_hash
|
|
241
|
-
end
|
|
242
|
-
|
|
243
194
|
# Returns the object in the form of hash
|
|
244
195
|
# @return [Hash] Returns the object in the form of hash
|
|
245
196
|
def to_hash
|
|
@@ -256,24 +207,6 @@ module RancherApi
|
|
|
256
207
|
hash
|
|
257
208
|
end
|
|
258
209
|
|
|
259
|
-
# Outputs non-array value in the form of hash
|
|
260
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
261
|
-
# @param [Object] value Any valid value
|
|
262
|
-
# @return [Hash] Returns the value in the form of hash
|
|
263
|
-
def _to_hash(value)
|
|
264
|
-
if value.is_a?(Array)
|
|
265
|
-
value.compact.map { |v| _to_hash(v) }
|
|
266
|
-
elsif value.is_a?(Hash)
|
|
267
|
-
{}.tap do |hash|
|
|
268
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
269
|
-
end
|
|
270
|
-
elsif value.respond_to? :to_hash
|
|
271
|
-
value.to_hash
|
|
272
|
-
else
|
|
273
|
-
value
|
|
274
|
-
end
|
|
275
|
-
end
|
|
276
|
-
|
|
277
210
|
end
|
|
278
211
|
|
|
279
212
|
end
|