oci 2.2.1 → 2.3.0

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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/lib/oci.rb +1 -0
  4. data/lib/oci/audit/audit_client_composite_operations.rb +16 -6
  5. data/lib/oci/container_engine/container_engine.rb +47 -0
  6. data/lib/oci/container_engine/container_engine_client.rb +1276 -0
  7. data/lib/oci/container_engine/container_engine_client_composite_operations.rb +320 -0
  8. data/lib/oci/container_engine/models/add_on_options.rb +164 -0
  9. data/lib/oci/container_engine/models/cluster.rb +296 -0
  10. data/lib/oci/container_engine/models/cluster_create_options.rb +178 -0
  11. data/lib/oci/container_engine/models/cluster_endpoints.rb +146 -0
  12. data/lib/oci/container_engine/models/cluster_lifecycle_state.rb +14 -0
  13. data/lib/oci/container_engine/models/cluster_metadata.rb +262 -0
  14. data/lib/oci/container_engine/models/cluster_options.rb +150 -0
  15. data/lib/oci/container_engine/models/cluster_summary.rb +296 -0
  16. data/lib/oci/container_engine/models/create_cluster_details.rb +198 -0
  17. data/lib/oci/container_engine/models/create_cluster_kubeconfig_content_details.rb +162 -0
  18. data/lib/oci/container_engine/models/create_node_pool_details.rb +272 -0
  19. data/lib/oci/container_engine/models/key_value.rb +156 -0
  20. data/lib/oci/container_engine/models/kubernetes_network_config.rb +164 -0
  21. data/lib/oci/container_engine/models/node.rb +281 -0
  22. data/lib/oci/container_engine/models/node_error.rb +180 -0
  23. data/lib/oci/container_engine/models/node_pool.rb +306 -0
  24. data/lib/oci/container_engine/models/node_pool_options.rb +170 -0
  25. data/lib/oci/container_engine/models/node_pool_summary.rb +296 -0
  26. data/lib/oci/container_engine/models/sort_order.rb +10 -0
  27. data/lib/oci/container_engine/models/update_cluster_details.rb +160 -0
  28. data/lib/oci/container_engine/models/update_node_pool_details.rb +202 -0
  29. data/lib/oci/container_engine/models/work_request.rb +288 -0
  30. data/lib/oci/container_engine/models/work_request_error.rb +167 -0
  31. data/lib/oci/container_engine/models/work_request_log_entry.rb +156 -0
  32. data/lib/oci/container_engine/models/work_request_operation_type.rb +15 -0
  33. data/lib/oci/container_engine/models/work_request_resource.rb +214 -0
  34. data/lib/oci/container_engine/models/work_request_status.rb +14 -0
  35. data/lib/oci/container_engine/models/work_request_summary.rb +288 -0
  36. data/lib/oci/container_engine/util.rb +46 -0
  37. data/lib/oci/errors.rb +21 -2
  38. data/lib/oci/load_balancer/load_balancer_client_composite_operations.rb +336 -133
  39. data/lib/oci/load_balancer/util.rb +19 -32
  40. data/lib/oci/regions.rb +2 -1
  41. data/lib/oci/version.rb +1 -1
  42. data/lib/oci/waiter.rb +47 -0
  43. metadata +34 -2
@@ -0,0 +1,164 @@
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 the network configuration for Kubernetes.
8
+ class ContainerEngine::Models::KubernetesNetworkConfig # rubocop:disable Metrics/LineLength
9
+ # The CIDR block for Kubernetes pods.
10
+ # @return [String]
11
+ attr_accessor :pods_cidr
12
+
13
+ # The CIDR block for Kubernetes services.
14
+ # @return [String]
15
+ attr_accessor :services_cidr
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ # rubocop:disable Style/SymbolLiteral
21
+ 'pods_cidr': :'podsCidr',
22
+ 'services_cidr': :'servicesCidr'
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
+ 'pods_cidr': :'String',
32
+ 'services_cidr': :'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] :pods_cidr The value to assign to the {#pods_cidr} property
44
+ # @option attributes [String] :services_cidr The value to assign to the {#services_cidr} 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.pods_cidr = attributes[:'podsCidr'] if attributes[:'podsCidr']
52
+
53
+ raise 'You cannot provide both :podsCidr and :pods_cidr' if attributes.key?(:'podsCidr') && attributes.key?(:'pods_cidr')
54
+
55
+ self.pods_cidr = attributes[:'pods_cidr'] if attributes[:'pods_cidr']
56
+
57
+ self.services_cidr = attributes[:'servicesCidr'] if attributes[:'servicesCidr']
58
+
59
+ raise 'You cannot provide both :servicesCidr and :services_cidr' if attributes.key?(:'servicesCidr') && attributes.key?(:'services_cidr')
60
+
61
+ self.services_cidr = attributes[:'services_cidr'] if attributes[:'services_cidr']
62
+ end
63
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
64
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
65
+
66
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
67
+
68
+
69
+ # Checks equality by comparing each attribute.
70
+ # @param [Object] other the other object to be compared
71
+ def ==(other)
72
+ return true if equal?(other)
73
+ self.class == other.class &&
74
+ pods_cidr == other.pods_cidr &&
75
+ services_cidr == other.services_cidr
76
+ end
77
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
78
+
79
+ # @see the `==` method
80
+ # @param [Object] other the other object to be compared
81
+ def eql?(other)
82
+ self == other
83
+ end
84
+
85
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
86
+
87
+
88
+ # Calculates hash code according to all attributes.
89
+ # @return [Fixnum] Hash code
90
+ def hash
91
+ [pods_cidr, services_cidr].hash
92
+ end
93
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
94
+
95
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
96
+
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def build_from_hash(attributes)
102
+ return nil unless attributes.is_a?(Hash)
103
+ self.class.swagger_types.each_pair do |key, type|
104
+ if type =~ /^Array<(.*)>/i
105
+ # check to ensure the input is an array given that the the attribute
106
+ # is documented as an array but the input is not
107
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
108
+ public_method("#{key}=").call(
109
+ attributes[self.class.attribute_map[key]]
110
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
111
+ )
112
+ end
113
+ elsif !attributes[self.class.attribute_map[key]].nil?
114
+ public_method("#{key}=").call(
115
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
116
+ )
117
+ end
118
+ # or else data not found in attributes(hash), not an issue as the data can be optional
119
+ end
120
+
121
+ self
122
+ end
123
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
124
+
125
+ # Returns the string representation of the object
126
+ # @return [String] String presentation of the object
127
+ def to_s
128
+ to_hash.to_s
129
+ end
130
+
131
+ # Returns the object in the form of hash
132
+ # @return [Hash] Returns the object in the form of hash
133
+ def to_hash
134
+ hash = {}
135
+ self.class.attribute_map.each_pair do |attr, param|
136
+ value = public_method(attr).call
137
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
138
+ hash[param] = _to_hash(value)
139
+ end
140
+ hash
141
+ end
142
+
143
+ private
144
+
145
+ # Outputs non-array value in the form of hash
146
+ # For object, use to_hash. Otherwise, just return the value
147
+ # @param [Object] value Any valid value
148
+ # @return [Hash] Returns the value in the form of hash
149
+ def _to_hash(value)
150
+ if value.is_a?(Array)
151
+ value.compact.map { |v| _to_hash(v) }
152
+ elsif value.is_a?(Hash)
153
+ {}.tap do |hash|
154
+ value.each { |k, v| hash[k] = _to_hash(v) }
155
+ end
156
+ elsif value.respond_to? :to_hash
157
+ value.to_hash
158
+ else
159
+ value
160
+ end
161
+ end
162
+ end
163
+ end
164
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,281 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require 'logger'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective
7
+ module OCI
8
+ # The properties that define a node.
9
+ class ContainerEngine::Models::Node # rubocop:disable Metrics/LineLength
10
+ LIFECYCLE_STATE_ENUM = [
11
+ LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
12
+ LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
13
+ LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
14
+ LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
15
+ LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
16
+ LIFECYCLE_STATE_FAILING = 'FAILING'.freeze,
17
+ LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze,
18
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
19
+ ].freeze
20
+
21
+ # The OCID of the compute instance backing this node.
22
+ # @return [String]
23
+ attr_accessor :id
24
+
25
+ # The name of the node.
26
+ # @return [String]
27
+ attr_accessor :name
28
+
29
+ # The name of the availability domain in which this node is placed.
30
+ # @return [String]
31
+ attr_accessor :availability_domain
32
+
33
+ # The OCID of the subnet in which this node is placed.
34
+ # @return [String]
35
+ attr_accessor :subnet_id
36
+
37
+ # The OCID of the node pool to which this node belongs.
38
+ # @return [String]
39
+ attr_accessor :node_pool_id
40
+
41
+ # The public IP address of this node.
42
+ # @return [String]
43
+ attr_accessor :public_ip
44
+
45
+ # An error that may be associated with the node.
46
+ # @return [OCI::ContainerEngine::Models::NodeError]
47
+ attr_accessor :node_error
48
+
49
+ # The state of the node.
50
+ # @return [String]
51
+ attr_reader :lifecycle_state
52
+
53
+ # Details about the state of the node.
54
+ # @return [String]
55
+ attr_accessor :lifecycle_details
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
+ 'name': :'name',
63
+ 'availability_domain': :'availabilityDomain',
64
+ 'subnet_id': :'subnetId',
65
+ 'node_pool_id': :'nodePoolId',
66
+ 'public_ip': :'publicIp',
67
+ 'node_error': :'nodeError',
68
+ 'lifecycle_state': :'lifecycleState',
69
+ 'lifecycle_details': :'lifecycleDetails'
70
+ # rubocop:enable Style/SymbolLiteral
71
+ }
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.swagger_types
76
+ {
77
+ # rubocop:disable Style/SymbolLiteral
78
+ 'id': :'String',
79
+ 'name': :'String',
80
+ 'availability_domain': :'String',
81
+ 'subnet_id': :'String',
82
+ 'node_pool_id': :'String',
83
+ 'public_ip': :'String',
84
+ 'node_error': :'OCI::ContainerEngine::Models::NodeError',
85
+ 'lifecycle_state': :'String',
86
+ 'lifecycle_details': :'String'
87
+ # rubocop:enable Style/SymbolLiteral
88
+ }
89
+ end
90
+
91
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
92
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
93
+
94
+
95
+ # Initializes the object
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ # @option attributes [String] :id The value to assign to the {#id} property
98
+ # @option attributes [String] :name The value to assign to the {#name} property
99
+ # @option attributes [String] :availability_domain The value to assign to the {#availability_domain} property
100
+ # @option attributes [String] :subnet_id The value to assign to the {#subnet_id} property
101
+ # @option attributes [String] :node_pool_id The value to assign to the {#node_pool_id} property
102
+ # @option attributes [String] :public_ip The value to assign to the {#public_ip} property
103
+ # @option attributes [OCI::ContainerEngine::Models::NodeError] :node_error The value to assign to the {#node_error} property
104
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
105
+ # @option attributes [String] :lifecycle_details The value to assign to the {#lifecycle_details} property
106
+ def initialize(attributes = {})
107
+ return unless attributes.is_a?(Hash)
108
+
109
+ # convert string to symbol for hash key
110
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
111
+
112
+ self.id = attributes[:'id'] if attributes[:'id']
113
+
114
+ self.name = attributes[:'name'] if attributes[:'name']
115
+
116
+ self.availability_domain = attributes[:'availabilityDomain'] if attributes[:'availabilityDomain']
117
+
118
+ raise 'You cannot provide both :availabilityDomain and :availability_domain' if attributes.key?(:'availabilityDomain') && attributes.key?(:'availability_domain')
119
+
120
+ self.availability_domain = attributes[:'availability_domain'] if attributes[:'availability_domain']
121
+
122
+ self.subnet_id = attributes[:'subnetId'] if attributes[:'subnetId']
123
+
124
+ raise 'You cannot provide both :subnetId and :subnet_id' if attributes.key?(:'subnetId') && attributes.key?(:'subnet_id')
125
+
126
+ self.subnet_id = attributes[:'subnet_id'] if attributes[:'subnet_id']
127
+
128
+ self.node_pool_id = attributes[:'nodePoolId'] if attributes[:'nodePoolId']
129
+
130
+ raise 'You cannot provide both :nodePoolId and :node_pool_id' if attributes.key?(:'nodePoolId') && attributes.key?(:'node_pool_id')
131
+
132
+ self.node_pool_id = attributes[:'node_pool_id'] if attributes[:'node_pool_id']
133
+
134
+ self.public_ip = attributes[:'publicIp'] if attributes[:'publicIp']
135
+
136
+ raise 'You cannot provide both :publicIp and :public_ip' if attributes.key?(:'publicIp') && attributes.key?(:'public_ip')
137
+
138
+ self.public_ip = attributes[:'public_ip'] if attributes[:'public_ip']
139
+
140
+ self.node_error = attributes[:'nodeError'] if attributes[:'nodeError']
141
+
142
+ raise 'You cannot provide both :nodeError and :node_error' if attributes.key?(:'nodeError') && attributes.key?(:'node_error')
143
+
144
+ self.node_error = attributes[:'node_error'] if attributes[:'node_error']
145
+
146
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
147
+
148
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
149
+
150
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
151
+
152
+ self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']
153
+
154
+ raise 'You cannot provide both :lifecycleDetails and :lifecycle_details' if attributes.key?(:'lifecycleDetails') && attributes.key?(:'lifecycle_details')
155
+
156
+ self.lifecycle_details = attributes[:'lifecycle_details'] if attributes[:'lifecycle_details']
157
+ end
158
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
159
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
160
+
161
+ # Custom attribute writer method checking allowed values (enum).
162
+ # @param [Object] lifecycle_state Object to be assigned
163
+ def lifecycle_state=(lifecycle_state)
164
+ # rubocop:disable Style/ConditionalAssignment
165
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
166
+ # rubocop: disable Metrics/LineLength
167
+ OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
168
+ # rubocop: enable Metrics/LineLength
169
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
170
+ else
171
+ @lifecycle_state = lifecycle_state
172
+ end
173
+ # rubocop:enable Style/ConditionalAssignment
174
+ end
175
+
176
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
177
+
178
+
179
+ # Checks equality by comparing each attribute.
180
+ # @param [Object] other the other object to be compared
181
+ def ==(other)
182
+ return true if equal?(other)
183
+ self.class == other.class &&
184
+ id == other.id &&
185
+ name == other.name &&
186
+ availability_domain == other.availability_domain &&
187
+ subnet_id == other.subnet_id &&
188
+ node_pool_id == other.node_pool_id &&
189
+ public_ip == other.public_ip &&
190
+ node_error == other.node_error &&
191
+ lifecycle_state == other.lifecycle_state &&
192
+ lifecycle_details == other.lifecycle_details
193
+ end
194
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
195
+
196
+ # @see the `==` method
197
+ # @param [Object] other the other object to be compared
198
+ def eql?(other)
199
+ self == other
200
+ end
201
+
202
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
203
+
204
+
205
+ # Calculates hash code according to all attributes.
206
+ # @return [Fixnum] Hash code
207
+ def hash
208
+ [id, name, availability_domain, subnet_id, node_pool_id, public_ip, node_error, lifecycle_state, lifecycle_details].hash
209
+ end
210
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
211
+
212
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
213
+
214
+
215
+ # Builds the object from hash
216
+ # @param [Hash] attributes Model attributes in the form of hash
217
+ # @return [Object] Returns the model itself
218
+ def build_from_hash(attributes)
219
+ return nil unless attributes.is_a?(Hash)
220
+ self.class.swagger_types.each_pair do |key, type|
221
+ if type =~ /^Array<(.*)>/i
222
+ # check to ensure the input is an array given that the the attribute
223
+ # is documented as an array but the input is not
224
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
225
+ public_method("#{key}=").call(
226
+ attributes[self.class.attribute_map[key]]
227
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
228
+ )
229
+ end
230
+ elsif !attributes[self.class.attribute_map[key]].nil?
231
+ public_method("#{key}=").call(
232
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
233
+ )
234
+ end
235
+ # or else data not found in attributes(hash), not an issue as the data can be optional
236
+ end
237
+
238
+ self
239
+ end
240
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
241
+
242
+ # Returns the string representation of the object
243
+ # @return [String] String presentation of the object
244
+ def to_s
245
+ to_hash.to_s
246
+ end
247
+
248
+ # Returns the object in the form of hash
249
+ # @return [Hash] Returns the object in the form of hash
250
+ def to_hash
251
+ hash = {}
252
+ self.class.attribute_map.each_pair do |attr, param|
253
+ value = public_method(attr).call
254
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ private
261
+
262
+ # Outputs non-array value in the form of hash
263
+ # For object, use to_hash. Otherwise, just return the value
264
+ # @param [Object] value Any valid value
265
+ # @return [Hash] Returns the value in the form of hash
266
+ def _to_hash(value)
267
+ if value.is_a?(Array)
268
+ value.compact.map { |v| _to_hash(v) }
269
+ elsif value.is_a?(Hash)
270
+ {}.tap do |hash|
271
+ value.each { |k, v| hash[k] = _to_hash(v) }
272
+ end
273
+ elsif value.respond_to? :to_hash
274
+ value.to_hash
275
+ else
276
+ value
277
+ end
278
+ end
279
+ end
280
+ end
281
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,180 @@
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 an upstream error while managing a node.
8
+ class ContainerEngine::Models::NodeError # rubocop:disable Metrics/LineLength
9
+ # **[Required]** A short error code that defines the upstream error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
10
+ # @return [String]
11
+ attr_accessor :code
12
+
13
+ # **[Required]** A human-readable error string of the upstream error.
14
+ # @return [String]
15
+ attr_accessor :message
16
+
17
+ # The status of the HTTP response encountered in the upstream error.
18
+ # @return [String]
19
+ attr_accessor :status
20
+
21
+ # Unique Oracle-assigned identifier for the upstream request. If you need to contact Oracle about a particular upstream request, please provide the request ID.
22
+ # @return [String]
23
+ attr_accessor :opc_request_id
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ # rubocop:disable Style/SymbolLiteral
29
+ 'code': :'code',
30
+ 'message': :'message',
31
+ 'status': :'status',
32
+ 'opc_request_id': :'opc-request-id'
33
+ # rubocop:enable Style/SymbolLiteral
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.swagger_types
39
+ {
40
+ # rubocop:disable Style/SymbolLiteral
41
+ 'code': :'String',
42
+ 'message': :'String',
43
+ 'status': :'String',
44
+ 'opc_request_id': :'String'
45
+ # rubocop:enable Style/SymbolLiteral
46
+ }
47
+ end
48
+
49
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
50
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
51
+
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ # @option attributes [String] :code The value to assign to the {#code} property
56
+ # @option attributes [String] :message The value to assign to the {#message} property
57
+ # @option attributes [String] :status The value to assign to the {#status} property
58
+ # @option attributes [String] :opc_request_id The value to assign to the {#opc_request_id} property
59
+ def initialize(attributes = {})
60
+ return unless attributes.is_a?(Hash)
61
+
62
+ # convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
64
+
65
+ self.code = attributes[:'code'] if attributes[:'code']
66
+
67
+ self.message = attributes[:'message'] if attributes[:'message']
68
+
69
+ self.status = attributes[:'status'] if attributes[:'status']
70
+
71
+ self.opc_request_id = attributes[:'opc-request-id'] if attributes[:'opc-request-id']
72
+
73
+ raise 'You cannot provide both :opc-request-id and :opc_request_id' if attributes.key?(:'opc-request-id') && attributes.key?(:'opc_request_id')
74
+
75
+ self.opc_request_id = attributes[:'opc_request_id'] if attributes[:'opc_request_id']
76
+ end
77
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
78
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
79
+
80
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
81
+
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] other the other object to be compared
85
+ def ==(other)
86
+ return true if equal?(other)
87
+ self.class == other.class &&
88
+ code == other.code &&
89
+ message == other.message &&
90
+ status == other.status &&
91
+ opc_request_id == other.opc_request_id
92
+ end
93
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
94
+
95
+ # @see the `==` method
96
+ # @param [Object] other the other object to be compared
97
+ def eql?(other)
98
+ self == other
99
+ end
100
+
101
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
102
+
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Fixnum] Hash code
106
+ def hash
107
+ [code, message, status, opc_request_id].hash
108
+ end
109
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
110
+
111
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
112
+
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.swagger_types.each_pair do |key, type|
120
+ if type =~ /^Array<(.*)>/i
121
+ # check to ensure the input is an array given that the the attribute
122
+ # is documented as an array but the input is not
123
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
124
+ public_method("#{key}=").call(
125
+ attributes[self.class.attribute_map[key]]
126
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
127
+ )
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ public_method("#{key}=").call(
131
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
132
+ )
133
+ end
134
+ # or else data not found in attributes(hash), not an issue as the data can be optional
135
+ end
136
+
137
+ self
138
+ end
139
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
140
+
141
+ # Returns the string representation of the object
142
+ # @return [String] String presentation of the object
143
+ def to_s
144
+ to_hash.to_s
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = public_method(attr).call
153
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
154
+ hash[param] = _to_hash(value)
155
+ end
156
+ hash
157
+ end
158
+
159
+ private
160
+
161
+ # Outputs non-array value in the form of hash
162
+ # For object, use to_hash. Otherwise, just return the value
163
+ # @param [Object] value Any valid value
164
+ # @return [Hash] Returns the value in the form of hash
165
+ def _to_hash(value)
166
+ if value.is_a?(Array)
167
+ value.compact.map { |v| _to_hash(v) }
168
+ elsif value.is_a?(Hash)
169
+ {}.tap do |hash|
170
+ value.each { |k, v| hash[k] = _to_hash(v) }
171
+ end
172
+ elsif value.respond_to? :to_hash
173
+ value.to_hash
174
+ else
175
+ value
176
+ end
177
+ end
178
+ end
179
+ end
180
+ # rubocop:enable Lint/UnneededCopDisableDirective