oci 2.2.1 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/oci.rb +1 -0
- data/lib/oci/audit/audit_client_composite_operations.rb +16 -6
- data/lib/oci/container_engine/container_engine.rb +47 -0
- data/lib/oci/container_engine/container_engine_client.rb +1276 -0
- data/lib/oci/container_engine/container_engine_client_composite_operations.rb +320 -0
- data/lib/oci/container_engine/models/add_on_options.rb +164 -0
- data/lib/oci/container_engine/models/cluster.rb +296 -0
- data/lib/oci/container_engine/models/cluster_create_options.rb +178 -0
- data/lib/oci/container_engine/models/cluster_endpoints.rb +146 -0
- data/lib/oci/container_engine/models/cluster_lifecycle_state.rb +14 -0
- data/lib/oci/container_engine/models/cluster_metadata.rb +262 -0
- data/lib/oci/container_engine/models/cluster_options.rb +150 -0
- data/lib/oci/container_engine/models/cluster_summary.rb +296 -0
- data/lib/oci/container_engine/models/create_cluster_details.rb +198 -0
- data/lib/oci/container_engine/models/create_cluster_kubeconfig_content_details.rb +162 -0
- data/lib/oci/container_engine/models/create_node_pool_details.rb +272 -0
- data/lib/oci/container_engine/models/key_value.rb +156 -0
- data/lib/oci/container_engine/models/kubernetes_network_config.rb +164 -0
- data/lib/oci/container_engine/models/node.rb +281 -0
- data/lib/oci/container_engine/models/node_error.rb +180 -0
- data/lib/oci/container_engine/models/node_pool.rb +306 -0
- data/lib/oci/container_engine/models/node_pool_options.rb +170 -0
- data/lib/oci/container_engine/models/node_pool_summary.rb +296 -0
- data/lib/oci/container_engine/models/sort_order.rb +10 -0
- data/lib/oci/container_engine/models/update_cluster_details.rb +160 -0
- data/lib/oci/container_engine/models/update_node_pool_details.rb +202 -0
- data/lib/oci/container_engine/models/work_request.rb +288 -0
- data/lib/oci/container_engine/models/work_request_error.rb +167 -0
- data/lib/oci/container_engine/models/work_request_log_entry.rb +156 -0
- data/lib/oci/container_engine/models/work_request_operation_type.rb +15 -0
- data/lib/oci/container_engine/models/work_request_resource.rb +214 -0
- data/lib/oci/container_engine/models/work_request_status.rb +14 -0
- data/lib/oci/container_engine/models/work_request_summary.rb +288 -0
- data/lib/oci/container_engine/util.rb +46 -0
- data/lib/oci/errors.rb +21 -2
- data/lib/oci/load_balancer/load_balancer_client_composite_operations.rb +336 -133
- data/lib/oci/load_balancer/util.rb +19 -32
- data/lib/oci/regions.rb +2 -1
- data/lib/oci/version.rb +1 -1
- data/lib/oci/waiter.rb +47 -0
- metadata +34 -2
@@ -0,0 +1,296 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
# rubocop:disable Lint/UnneededCopDisableDirective
|
6
|
+
module OCI
|
7
|
+
# The properties that define a node pool summary.
|
8
|
+
class ContainerEngine::Models::NodePoolSummary # rubocop:disable Metrics/LineLength
|
9
|
+
# The OCID of the node pool.
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :id
|
12
|
+
|
13
|
+
# The OCID of the compartment in which the node pool exists.
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :compartment_id
|
16
|
+
|
17
|
+
# The OCID of the cluster to which this node pool is attached.
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :cluster_id
|
20
|
+
|
21
|
+
# The name of the node pool.
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :name
|
24
|
+
|
25
|
+
# The version of Kubernetes running on the nodes in the node pool.
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :kubernetes_version
|
28
|
+
|
29
|
+
# The OCID of the image running on the nodes in the node pool.
|
30
|
+
# @return [String]
|
31
|
+
attr_accessor :node_image_id
|
32
|
+
|
33
|
+
# The name of the image running on the nodes in the node pool.
|
34
|
+
# @return [String]
|
35
|
+
attr_accessor :node_image_name
|
36
|
+
|
37
|
+
# The name of the node shape of the nodes in the node pool.
|
38
|
+
# @return [String]
|
39
|
+
attr_accessor :node_shape
|
40
|
+
|
41
|
+
# A list of key/value pairs to add to nodes after they join the Kubernetes cluster.
|
42
|
+
# @return [Array<OCI::ContainerEngine::Models::KeyValue>]
|
43
|
+
attr_accessor :initial_node_labels
|
44
|
+
|
45
|
+
# The SSH public key on each node in the node pool.
|
46
|
+
# @return [String]
|
47
|
+
attr_accessor :ssh_public_key
|
48
|
+
|
49
|
+
# The number of nodes in each subnet.
|
50
|
+
# @return [Integer]
|
51
|
+
attr_accessor :quantity_per_subnet
|
52
|
+
|
53
|
+
# The OCIDs of the subnets in which to place nodes for this node pool.
|
54
|
+
# @return [Array<String>]
|
55
|
+
attr_accessor :subnet_ids
|
56
|
+
|
57
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
58
|
+
def self.attribute_map
|
59
|
+
{
|
60
|
+
# rubocop:disable Style/SymbolLiteral
|
61
|
+
'id': :'id',
|
62
|
+
'compartment_id': :'compartmentId',
|
63
|
+
'cluster_id': :'clusterId',
|
64
|
+
'name': :'name',
|
65
|
+
'kubernetes_version': :'kubernetesVersion',
|
66
|
+
'node_image_id': :'nodeImageId',
|
67
|
+
'node_image_name': :'nodeImageName',
|
68
|
+
'node_shape': :'nodeShape',
|
69
|
+
'initial_node_labels': :'initialNodeLabels',
|
70
|
+
'ssh_public_key': :'sshPublicKey',
|
71
|
+
'quantity_per_subnet': :'quantityPerSubnet',
|
72
|
+
'subnet_ids': :'subnetIds'
|
73
|
+
# rubocop:enable Style/SymbolLiteral
|
74
|
+
}
|
75
|
+
end
|
76
|
+
|
77
|
+
# Attribute type mapping.
|
78
|
+
def self.swagger_types
|
79
|
+
{
|
80
|
+
# rubocop:disable Style/SymbolLiteral
|
81
|
+
'id': :'String',
|
82
|
+
'compartment_id': :'String',
|
83
|
+
'cluster_id': :'String',
|
84
|
+
'name': :'String',
|
85
|
+
'kubernetes_version': :'String',
|
86
|
+
'node_image_id': :'String',
|
87
|
+
'node_image_name': :'String',
|
88
|
+
'node_shape': :'String',
|
89
|
+
'initial_node_labels': :'Array<OCI::ContainerEngine::Models::KeyValue>',
|
90
|
+
'ssh_public_key': :'String',
|
91
|
+
'quantity_per_subnet': :'Integer',
|
92
|
+
'subnet_ids': :'Array<String>'
|
93
|
+
# rubocop:enable Style/SymbolLiteral
|
94
|
+
}
|
95
|
+
end
|
96
|
+
|
97
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
98
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
99
|
+
|
100
|
+
|
101
|
+
# Initializes the object
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
# @option attributes [String] :id The value to assign to the {#id} property
|
104
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
105
|
+
# @option attributes [String] :cluster_id The value to assign to the {#cluster_id} property
|
106
|
+
# @option attributes [String] :name The value to assign to the {#name} property
|
107
|
+
# @option attributes [String] :kubernetes_version The value to assign to the {#kubernetes_version} property
|
108
|
+
# @option attributes [String] :node_image_id The value to assign to the {#node_image_id} property
|
109
|
+
# @option attributes [String] :node_image_name The value to assign to the {#node_image_name} property
|
110
|
+
# @option attributes [String] :node_shape The value to assign to the {#node_shape} property
|
111
|
+
# @option attributes [Array<OCI::ContainerEngine::Models::KeyValue>] :initial_node_labels The value to assign to the {#initial_node_labels} property
|
112
|
+
# @option attributes [String] :ssh_public_key The value to assign to the {#ssh_public_key} property
|
113
|
+
# @option attributes [Integer] :quantity_per_subnet The value to assign to the {#quantity_per_subnet} property
|
114
|
+
# @option attributes [Array<String>] :subnet_ids The value to assign to the {#subnet_ids} property
|
115
|
+
def initialize(attributes = {})
|
116
|
+
return unless attributes.is_a?(Hash)
|
117
|
+
|
118
|
+
# convert string to symbol for hash key
|
119
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
120
|
+
|
121
|
+
self.id = attributes[:'id'] if attributes[:'id']
|
122
|
+
|
123
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
124
|
+
|
125
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
126
|
+
|
127
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
128
|
+
|
129
|
+
self.cluster_id = attributes[:'clusterId'] if attributes[:'clusterId']
|
130
|
+
|
131
|
+
raise 'You cannot provide both :clusterId and :cluster_id' if attributes.key?(:'clusterId') && attributes.key?(:'cluster_id')
|
132
|
+
|
133
|
+
self.cluster_id = attributes[:'cluster_id'] if attributes[:'cluster_id']
|
134
|
+
|
135
|
+
self.name = attributes[:'name'] if attributes[:'name']
|
136
|
+
|
137
|
+
self.kubernetes_version = attributes[:'kubernetesVersion'] if attributes[:'kubernetesVersion']
|
138
|
+
|
139
|
+
raise 'You cannot provide both :kubernetesVersion and :kubernetes_version' if attributes.key?(:'kubernetesVersion') && attributes.key?(:'kubernetes_version')
|
140
|
+
|
141
|
+
self.kubernetes_version = attributes[:'kubernetes_version'] if attributes[:'kubernetes_version']
|
142
|
+
|
143
|
+
self.node_image_id = attributes[:'nodeImageId'] if attributes[:'nodeImageId']
|
144
|
+
|
145
|
+
raise 'You cannot provide both :nodeImageId and :node_image_id' if attributes.key?(:'nodeImageId') && attributes.key?(:'node_image_id')
|
146
|
+
|
147
|
+
self.node_image_id = attributes[:'node_image_id'] if attributes[:'node_image_id']
|
148
|
+
|
149
|
+
self.node_image_name = attributes[:'nodeImageName'] if attributes[:'nodeImageName']
|
150
|
+
|
151
|
+
raise 'You cannot provide both :nodeImageName and :node_image_name' if attributes.key?(:'nodeImageName') && attributes.key?(:'node_image_name')
|
152
|
+
|
153
|
+
self.node_image_name = attributes[:'node_image_name'] if attributes[:'node_image_name']
|
154
|
+
|
155
|
+
self.node_shape = attributes[:'nodeShape'] if attributes[:'nodeShape']
|
156
|
+
|
157
|
+
raise 'You cannot provide both :nodeShape and :node_shape' if attributes.key?(:'nodeShape') && attributes.key?(:'node_shape')
|
158
|
+
|
159
|
+
self.node_shape = attributes[:'node_shape'] if attributes[:'node_shape']
|
160
|
+
|
161
|
+
self.initial_node_labels = attributes[:'initialNodeLabels'] if attributes[:'initialNodeLabels']
|
162
|
+
|
163
|
+
raise 'You cannot provide both :initialNodeLabels and :initial_node_labels' if attributes.key?(:'initialNodeLabels') && attributes.key?(:'initial_node_labels')
|
164
|
+
|
165
|
+
self.initial_node_labels = attributes[:'initial_node_labels'] if attributes[:'initial_node_labels']
|
166
|
+
|
167
|
+
self.ssh_public_key = attributes[:'sshPublicKey'] if attributes[:'sshPublicKey']
|
168
|
+
|
169
|
+
raise 'You cannot provide both :sshPublicKey and :ssh_public_key' if attributes.key?(:'sshPublicKey') && attributes.key?(:'ssh_public_key')
|
170
|
+
|
171
|
+
self.ssh_public_key = attributes[:'ssh_public_key'] if attributes[:'ssh_public_key']
|
172
|
+
|
173
|
+
self.quantity_per_subnet = attributes[:'quantityPerSubnet'] if attributes[:'quantityPerSubnet']
|
174
|
+
|
175
|
+
raise 'You cannot provide both :quantityPerSubnet and :quantity_per_subnet' if attributes.key?(:'quantityPerSubnet') && attributes.key?(:'quantity_per_subnet')
|
176
|
+
|
177
|
+
self.quantity_per_subnet = attributes[:'quantity_per_subnet'] if attributes[:'quantity_per_subnet']
|
178
|
+
|
179
|
+
self.subnet_ids = attributes[:'subnetIds'] if attributes[:'subnetIds']
|
180
|
+
|
181
|
+
raise 'You cannot provide both :subnetIds and :subnet_ids' if attributes.key?(:'subnetIds') && attributes.key?(:'subnet_ids')
|
182
|
+
|
183
|
+
self.subnet_ids = attributes[:'subnet_ids'] if attributes[:'subnet_ids']
|
184
|
+
end
|
185
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
186
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
187
|
+
|
188
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
189
|
+
|
190
|
+
|
191
|
+
# Checks equality by comparing each attribute.
|
192
|
+
# @param [Object] other the other object to be compared
|
193
|
+
def ==(other)
|
194
|
+
return true if equal?(other)
|
195
|
+
self.class == other.class &&
|
196
|
+
id == other.id &&
|
197
|
+
compartment_id == other.compartment_id &&
|
198
|
+
cluster_id == other.cluster_id &&
|
199
|
+
name == other.name &&
|
200
|
+
kubernetes_version == other.kubernetes_version &&
|
201
|
+
node_image_id == other.node_image_id &&
|
202
|
+
node_image_name == other.node_image_name &&
|
203
|
+
node_shape == other.node_shape &&
|
204
|
+
initial_node_labels == other.initial_node_labels &&
|
205
|
+
ssh_public_key == other.ssh_public_key &&
|
206
|
+
quantity_per_subnet == other.quantity_per_subnet &&
|
207
|
+
subnet_ids == other.subnet_ids
|
208
|
+
end
|
209
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
210
|
+
|
211
|
+
# @see the `==` method
|
212
|
+
# @param [Object] other the other object to be compared
|
213
|
+
def eql?(other)
|
214
|
+
self == other
|
215
|
+
end
|
216
|
+
|
217
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
218
|
+
|
219
|
+
|
220
|
+
# Calculates hash code according to all attributes.
|
221
|
+
# @return [Fixnum] Hash code
|
222
|
+
def hash
|
223
|
+
[id, compartment_id, cluster_id, name, kubernetes_version, node_image_id, node_image_name, node_shape, initial_node_labels, ssh_public_key, quantity_per_subnet, subnet_ids].hash
|
224
|
+
end
|
225
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
226
|
+
|
227
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
228
|
+
|
229
|
+
|
230
|
+
# Builds the object from hash
|
231
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
232
|
+
# @return [Object] Returns the model itself
|
233
|
+
def build_from_hash(attributes)
|
234
|
+
return nil unless attributes.is_a?(Hash)
|
235
|
+
self.class.swagger_types.each_pair do |key, type|
|
236
|
+
if type =~ /^Array<(.*)>/i
|
237
|
+
# check to ensure the input is an array given that the the attribute
|
238
|
+
# is documented as an array but the input is not
|
239
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
240
|
+
public_method("#{key}=").call(
|
241
|
+
attributes[self.class.attribute_map[key]]
|
242
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
243
|
+
)
|
244
|
+
end
|
245
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
246
|
+
public_method("#{key}=").call(
|
247
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
248
|
+
)
|
249
|
+
end
|
250
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
251
|
+
end
|
252
|
+
|
253
|
+
self
|
254
|
+
end
|
255
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
256
|
+
|
257
|
+
# Returns the string representation of the object
|
258
|
+
# @return [String] String presentation of the object
|
259
|
+
def to_s
|
260
|
+
to_hash.to_s
|
261
|
+
end
|
262
|
+
|
263
|
+
# Returns the object in the form of hash
|
264
|
+
# @return [Hash] Returns the object in the form of hash
|
265
|
+
def to_hash
|
266
|
+
hash = {}
|
267
|
+
self.class.attribute_map.each_pair do |attr, param|
|
268
|
+
value = public_method(attr).call
|
269
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
270
|
+
hash[param] = _to_hash(value)
|
271
|
+
end
|
272
|
+
hash
|
273
|
+
end
|
274
|
+
|
275
|
+
private
|
276
|
+
|
277
|
+
# Outputs non-array value in the form of hash
|
278
|
+
# For object, use to_hash. Otherwise, just return the value
|
279
|
+
# @param [Object] value Any valid value
|
280
|
+
# @return [Hash] Returns the value in the form of hash
|
281
|
+
def _to_hash(value)
|
282
|
+
if value.is_a?(Array)
|
283
|
+
value.compact.map { |v| _to_hash(v) }
|
284
|
+
elsif value.is_a?(Hash)
|
285
|
+
{}.tap do |hash|
|
286
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
287
|
+
end
|
288
|
+
elsif value.respond_to? :to_hash
|
289
|
+
value.to_hash
|
290
|
+
else
|
291
|
+
value
|
292
|
+
end
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|
296
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|
@@ -0,0 +1,160 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
# rubocop:disable Lint/UnneededCopDisableDirective
|
6
|
+
module OCI
|
7
|
+
# The properties that define a request to update a cluster.
|
8
|
+
class ContainerEngine::Models::UpdateClusterDetails # rubocop:disable Metrics/LineLength
|
9
|
+
# The new name for the cluster. Avoid entering confidential information.
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :name
|
12
|
+
|
13
|
+
# The version of Kubernetes to which the cluster masters should be upgraded.
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :kubernetes_version
|
16
|
+
|
17
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
18
|
+
def self.attribute_map
|
19
|
+
{
|
20
|
+
# rubocop:disable Style/SymbolLiteral
|
21
|
+
'name': :'name',
|
22
|
+
'kubernetes_version': :'kubernetesVersion'
|
23
|
+
# rubocop:enable Style/SymbolLiteral
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.swagger_types
|
29
|
+
{
|
30
|
+
# rubocop:disable Style/SymbolLiteral
|
31
|
+
'name': :'String',
|
32
|
+
'kubernetes_version': :'String'
|
33
|
+
# rubocop:enable Style/SymbolLiteral
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
38
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
39
|
+
|
40
|
+
|
41
|
+
# Initializes the object
|
42
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
43
|
+
# @option attributes [String] :name The value to assign to the {#name} property
|
44
|
+
# @option attributes [String] :kubernetes_version The value to assign to the {#kubernetes_version} property
|
45
|
+
def initialize(attributes = {})
|
46
|
+
return unless attributes.is_a?(Hash)
|
47
|
+
|
48
|
+
# convert string to symbol for hash key
|
49
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
50
|
+
|
51
|
+
self.name = attributes[:'name'] if attributes[:'name']
|
52
|
+
|
53
|
+
self.kubernetes_version = attributes[:'kubernetesVersion'] if attributes[:'kubernetesVersion']
|
54
|
+
|
55
|
+
raise 'You cannot provide both :kubernetesVersion and :kubernetes_version' if attributes.key?(:'kubernetesVersion') && attributes.key?(:'kubernetes_version')
|
56
|
+
|
57
|
+
self.kubernetes_version = attributes[:'kubernetes_version'] if attributes[:'kubernetes_version']
|
58
|
+
end
|
59
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
60
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
61
|
+
|
62
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
63
|
+
|
64
|
+
|
65
|
+
# Checks equality by comparing each attribute.
|
66
|
+
# @param [Object] other the other object to be compared
|
67
|
+
def ==(other)
|
68
|
+
return true if equal?(other)
|
69
|
+
self.class == other.class &&
|
70
|
+
name == other.name &&
|
71
|
+
kubernetes_version == other.kubernetes_version
|
72
|
+
end
|
73
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
74
|
+
|
75
|
+
# @see the `==` method
|
76
|
+
# @param [Object] other the other object to be compared
|
77
|
+
def eql?(other)
|
78
|
+
self == other
|
79
|
+
end
|
80
|
+
|
81
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
82
|
+
|
83
|
+
|
84
|
+
# Calculates hash code according to all attributes.
|
85
|
+
# @return [Fixnum] Hash code
|
86
|
+
def hash
|
87
|
+
[name, kubernetes_version].hash
|
88
|
+
end
|
89
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
90
|
+
|
91
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
92
|
+
|
93
|
+
|
94
|
+
# Builds the object from hash
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
# @return [Object] Returns the model itself
|
97
|
+
def build_from_hash(attributes)
|
98
|
+
return nil unless attributes.is_a?(Hash)
|
99
|
+
self.class.swagger_types.each_pair do |key, type|
|
100
|
+
if type =~ /^Array<(.*)>/i
|
101
|
+
# check to ensure the input is an array given that the the attribute
|
102
|
+
# is documented as an array but the input is not
|
103
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
104
|
+
public_method("#{key}=").call(
|
105
|
+
attributes[self.class.attribute_map[key]]
|
106
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
107
|
+
)
|
108
|
+
end
|
109
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
110
|
+
public_method("#{key}=").call(
|
111
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
112
|
+
)
|
113
|
+
end
|
114
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
115
|
+
end
|
116
|
+
|
117
|
+
self
|
118
|
+
end
|
119
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
120
|
+
|
121
|
+
# Returns the string representation of the object
|
122
|
+
# @return [String] String presentation of the object
|
123
|
+
def to_s
|
124
|
+
to_hash.to_s
|
125
|
+
end
|
126
|
+
|
127
|
+
# Returns the object in the form of hash
|
128
|
+
# @return [Hash] Returns the object in the form of hash
|
129
|
+
def to_hash
|
130
|
+
hash = {}
|
131
|
+
self.class.attribute_map.each_pair do |attr, param|
|
132
|
+
value = public_method(attr).call
|
133
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
134
|
+
hash[param] = _to_hash(value)
|
135
|
+
end
|
136
|
+
hash
|
137
|
+
end
|
138
|
+
|
139
|
+
private
|
140
|
+
|
141
|
+
# Outputs non-array value in the form of hash
|
142
|
+
# For object, use to_hash. Otherwise, just return the value
|
143
|
+
# @param [Object] value Any valid value
|
144
|
+
# @return [Hash] Returns the value in the form of hash
|
145
|
+
def _to_hash(value)
|
146
|
+
if value.is_a?(Array)
|
147
|
+
value.compact.map { |v| _to_hash(v) }
|
148
|
+
elsif value.is_a?(Hash)
|
149
|
+
{}.tap do |hash|
|
150
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
151
|
+
end
|
152
|
+
elsif value.respond_to? :to_hash
|
153
|
+
value.to_hash
|
154
|
+
else
|
155
|
+
value
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
160
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|