oci 2.4.7 → 2.5.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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -1
  3. data/lib/oci.rb +1 -0
  4. data/lib/oci/announcements_service/announcement_client.rb +47 -36
  5. data/lib/oci/announcements_service/announcements_service.rb +0 -1
  6. data/lib/oci/announcements_service/models/affected_resource.rb +4 -4
  7. data/lib/oci/announcements_service/models/announcement.rb +10 -14
  8. data/lib/oci/announcements_service/models/announcement_summary.rb +1 -1
  9. data/lib/oci/announcements_service/models/announcement_user_status_details.rb +5 -5
  10. data/lib/oci/announcements_service/models/announcements_collection.rb +3 -3
  11. data/lib/oci/announcements_service/models/base_announcement.rb +28 -18
  12. data/lib/oci/audit/audit_client.rb +17 -10
  13. data/lib/oci/container_engine/container_engine_client.rb +17 -10
  14. data/lib/oci/core/blockstorage_client.rb +17 -10
  15. data/lib/oci/core/compute_client.rb +17 -10
  16. data/lib/oci/core/compute_management_client.rb +17 -10
  17. data/lib/oci/core/models/create_subnet_details.rb +1 -1
  18. data/lib/oci/core/models/subnet.rb +1 -1
  19. data/lib/oci/core/virtual_network_client.rb +17 -10
  20. data/lib/oci/database/database_client.rb +17 -10
  21. data/lib/oci/dns/dns_client.rb +17 -10
  22. data/lib/oci/email/email_client.rb +17 -10
  23. data/lib/oci/file_storage/file_storage_client.rb +17 -10
  24. data/lib/oci/healthchecks/health_checks_client.rb +17 -10
  25. data/lib/oci/identity/identity_client.rb +17 -10
  26. data/lib/oci/key_management/kms_crypto_client.rb +4 -5
  27. data/lib/oci/key_management/kms_management_client.rb +7 -8
  28. data/lib/oci/key_management/kms_vault_client.rb +20 -13
  29. data/lib/oci/key_management/models/create_key_details.rb +34 -1
  30. data/lib/oci/key_management/models/create_vault_details.rb +34 -1
  31. data/lib/oci/key_management/models/key_version.rb +1 -1
  32. data/lib/oci/key_management/models/update_key_details.rb +37 -4
  33. data/lib/oci/key_management/models/update_vault_details.rb +37 -4
  34. data/lib/oci/load_balancer/load_balancer_client.rb +17 -10
  35. data/lib/oci/object_storage/object_storage_client.rb +17 -10
  36. data/lib/oci/regions.rb +20 -4
  37. data/lib/oci/resource_search/resource_search_client.rb +17 -10
  38. data/lib/oci/streaming/models/create_cursor_details.rb +205 -0
  39. data/lib/oci/streaming/models/create_group_cursor_details.rb +237 -0
  40. data/lib/oci/streaming/models/create_stream_details.rb +227 -0
  41. data/lib/oci/streaming/models/cursor.rb +150 -0
  42. data/lib/oci/streaming/models/group.rb +179 -0
  43. data/lib/oci/streaming/models/message.rb +199 -0
  44. data/lib/oci/streaming/models/partition_reservation.rb +192 -0
  45. data/lib/oci/streaming/models/put_messages_details.rb +149 -0
  46. data/lib/oci/{announcements_service/models/notification_followup_details.rb → streaming/models/put_messages_details_entry.rb} +19 -22
  47. data/lib/oci/streaming/models/put_messages_result.rb +165 -0
  48. data/lib/oci/streaming/models/put_messages_result_entry.rb +196 -0
  49. data/lib/oci/streaming/models/stream.rb +319 -0
  50. data/lib/oci/streaming/models/stream_summary.rb +291 -0
  51. data/lib/oci/streaming/models/update_group_details.rb +176 -0
  52. data/lib/oci/streaming/models/update_stream_details.rb +174 -0
  53. data/lib/oci/streaming/stream_admin_client.rb +432 -0
  54. data/lib/oci/streaming/stream_admin_client_composite_operations.rb +143 -0
  55. data/lib/oci/streaming/stream_client.rb +602 -0
  56. data/lib/oci/streaming/stream_client_composite_operations.rb +24 -0
  57. data/lib/oci/streaming/streaming.rb +35 -0
  58. data/lib/oci/streaming/util.rb +2 -0
  59. data/lib/oci/version.rb +1 -1
  60. data/lib/oci/waas/waas_client.rb +17 -10
  61. metadata +51 -3
@@ -0,0 +1,319 @@
1
+ # Copyright (c) 2016, 2019, 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
+ # Detailed representation of a stream, including all its partitions.
9
+ class Streaming::Models::Stream # rubocop:disable Metrics/LineLength
10
+ LIFECYCLE_STATE_ENUM = [
11
+ LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
12
+ LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
13
+ LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
14
+ LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
15
+ LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
16
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
17
+ ].freeze
18
+
19
+ # **[Required]** The name of the stream. Avoid entering confidential information.
20
+ #
21
+ # Example: `TelemetryEvents`
22
+ #
23
+ # @return [String]
24
+ attr_accessor :name
25
+
26
+ # **[Required]** The OCID of the stream.
27
+ # @return [String]
28
+ attr_accessor :id
29
+
30
+ # **[Required]** The number of partitions in the stream.
31
+ # @return [Integer]
32
+ attr_accessor :partitions
33
+
34
+ # **[Required]** The retention period of the stream, in hours. This property is read-only.
35
+ # @return [Integer]
36
+ attr_accessor :retention_in_hours
37
+
38
+ # **[Required]** The OCID of the stream.
39
+ # @return [String]
40
+ attr_accessor :compartment_id
41
+
42
+ # **[Required]** The current state of the stream.
43
+ # @return [String]
44
+ attr_reader :lifecycle_state
45
+
46
+ # Any additional details about the current state of the stream.
47
+ # @return [String]
48
+ attr_accessor :lifecycle_state_details
49
+
50
+ # **[Required]** The date and time the stream was created, expressed in in [RFC 3339](https://tools.ietf.org/rfc/rfc3339) timestamp format.
51
+ #
52
+ # Example: `2018-04-20T00:00:07.405Z`
53
+ #
54
+ # @return [DateTime]
55
+ attr_accessor :time_created
56
+
57
+ # **[Required]** The endpoint to use when creating the StreamClient to consume or publish messages in the stream.
58
+ # @return [String]
59
+ attr_accessor :messages_endpoint
60
+
61
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Exists for cross-compatibility only.
62
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
63
+ #
64
+ # Example: `{\"Department\": \"Finance\"}`
65
+ #
66
+ # @return [Hash<String, String>]
67
+ attr_accessor :freeform_tags
68
+
69
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
70
+ #
71
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}'
72
+ #
73
+ # @return [Hash<String, Hash<String, Object>>]
74
+ attr_accessor :defined_tags
75
+
76
+ # Attribute mapping from ruby-style variable name to JSON key.
77
+ def self.attribute_map
78
+ {
79
+ # rubocop:disable Style/SymbolLiteral
80
+ 'name': :'name',
81
+ 'id': :'id',
82
+ 'partitions': :'partitions',
83
+ 'retention_in_hours': :'retentionInHours',
84
+ 'compartment_id': :'compartmentId',
85
+ 'lifecycle_state': :'lifecycleState',
86
+ 'lifecycle_state_details': :'lifecycleStateDetails',
87
+ 'time_created': :'timeCreated',
88
+ 'messages_endpoint': :'messagesEndpoint',
89
+ 'freeform_tags': :'freeformTags',
90
+ 'defined_tags': :'definedTags'
91
+ # rubocop:enable Style/SymbolLiteral
92
+ }
93
+ end
94
+
95
+ # Attribute type mapping.
96
+ def self.swagger_types
97
+ {
98
+ # rubocop:disable Style/SymbolLiteral
99
+ 'name': :'String',
100
+ 'id': :'String',
101
+ 'partitions': :'Integer',
102
+ 'retention_in_hours': :'Integer',
103
+ 'compartment_id': :'String',
104
+ 'lifecycle_state': :'String',
105
+ 'lifecycle_state_details': :'String',
106
+ 'time_created': :'DateTime',
107
+ 'messages_endpoint': :'String',
108
+ 'freeform_tags': :'Hash<String, String>',
109
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
110
+ # rubocop:enable Style/SymbolLiteral
111
+ }
112
+ end
113
+
114
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
115
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
116
+
117
+
118
+ # Initializes the object
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @option attributes [String] :name The value to assign to the {#name} property
121
+ # @option attributes [String] :id The value to assign to the {#id} property
122
+ # @option attributes [Integer] :partitions The value to assign to the {#partitions} property
123
+ # @option attributes [Integer] :retention_in_hours The value to assign to the {#retention_in_hours} property
124
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
125
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
126
+ # @option attributes [String] :lifecycle_state_details The value to assign to the {#lifecycle_state_details} property
127
+ # @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
128
+ # @option attributes [String] :messages_endpoint The value to assign to the {#messages_endpoint} property
129
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
130
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
131
+ def initialize(attributes = {})
132
+ return unless attributes.is_a?(Hash)
133
+
134
+ # convert string to symbol for hash key
135
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
136
+
137
+ self.name = attributes[:'name'] if attributes[:'name']
138
+
139
+ self.id = attributes[:'id'] if attributes[:'id']
140
+
141
+ self.partitions = attributes[:'partitions'] if attributes[:'partitions']
142
+
143
+ self.retention_in_hours = attributes[:'retentionInHours'] if attributes[:'retentionInHours']
144
+
145
+ raise 'You cannot provide both :retentionInHours and :retention_in_hours' if attributes.key?(:'retentionInHours') && attributes.key?(:'retention_in_hours')
146
+
147
+ self.retention_in_hours = attributes[:'retention_in_hours'] if attributes[:'retention_in_hours']
148
+
149
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
150
+
151
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
152
+
153
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
154
+
155
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
156
+
157
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
158
+
159
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
160
+
161
+ self.lifecycle_state_details = attributes[:'lifecycleStateDetails'] if attributes[:'lifecycleStateDetails']
162
+
163
+ raise 'You cannot provide both :lifecycleStateDetails and :lifecycle_state_details' if attributes.key?(:'lifecycleStateDetails') && attributes.key?(:'lifecycle_state_details')
164
+
165
+ self.lifecycle_state_details = attributes[:'lifecycle_state_details'] if attributes[:'lifecycle_state_details']
166
+
167
+ self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']
168
+
169
+ raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
170
+
171
+ self.time_created = attributes[:'time_created'] if attributes[:'time_created']
172
+
173
+ self.messages_endpoint = attributes[:'messagesEndpoint'] if attributes[:'messagesEndpoint']
174
+
175
+ raise 'You cannot provide both :messagesEndpoint and :messages_endpoint' if attributes.key?(:'messagesEndpoint') && attributes.key?(:'messages_endpoint')
176
+
177
+ self.messages_endpoint = attributes[:'messages_endpoint'] if attributes[:'messages_endpoint']
178
+
179
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
180
+
181
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
182
+
183
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
184
+
185
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
186
+
187
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
188
+
189
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
190
+ end
191
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
192
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
193
+
194
+ # Custom attribute writer method checking allowed values (enum).
195
+ # @param [Object] lifecycle_state Object to be assigned
196
+ def lifecycle_state=(lifecycle_state)
197
+ # rubocop:disable Style/ConditionalAssignment
198
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
199
+ # rubocop: disable Metrics/LineLength
200
+ OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
201
+ # rubocop: enable Metrics/LineLength
202
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
203
+ else
204
+ @lifecycle_state = lifecycle_state
205
+ end
206
+ # rubocop:enable Style/ConditionalAssignment
207
+ end
208
+
209
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
210
+
211
+
212
+ # Checks equality by comparing each attribute.
213
+ # @param [Object] other the other object to be compared
214
+ def ==(other)
215
+ return true if equal?(other)
216
+
217
+ self.class == other.class &&
218
+ name == other.name &&
219
+ id == other.id &&
220
+ partitions == other.partitions &&
221
+ retention_in_hours == other.retention_in_hours &&
222
+ compartment_id == other.compartment_id &&
223
+ lifecycle_state == other.lifecycle_state &&
224
+ lifecycle_state_details == other.lifecycle_state_details &&
225
+ time_created == other.time_created &&
226
+ messages_endpoint == other.messages_endpoint &&
227
+ freeform_tags == other.freeform_tags &&
228
+ defined_tags == other.defined_tags
229
+ end
230
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
231
+
232
+ # @see the `==` method
233
+ # @param [Object] other the other object to be compared
234
+ def eql?(other)
235
+ self == other
236
+ end
237
+
238
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
239
+
240
+
241
+ # Calculates hash code according to all attributes.
242
+ # @return [Fixnum] Hash code
243
+ def hash
244
+ [name, id, partitions, retention_in_hours, compartment_id, lifecycle_state, lifecycle_state_details, time_created, messages_endpoint, freeform_tags, defined_tags].hash
245
+ end
246
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
247
+
248
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
249
+
250
+
251
+ # Builds the object from hash
252
+ # @param [Hash] attributes Model attributes in the form of hash
253
+ # @return [Object] Returns the model itself
254
+ def build_from_hash(attributes)
255
+ return nil unless attributes.is_a?(Hash)
256
+
257
+ self.class.swagger_types.each_pair do |key, type|
258
+ if type =~ /^Array<(.*)>/i
259
+ # check to ensure the input is an array given that the the attribute
260
+ # is documented as an array but the input is not
261
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
262
+ public_method("#{key}=").call(
263
+ attributes[self.class.attribute_map[key]]
264
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
265
+ )
266
+ end
267
+ elsif !attributes[self.class.attribute_map[key]].nil?
268
+ public_method("#{key}=").call(
269
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
270
+ )
271
+ end
272
+ # or else data not found in attributes(hash), not an issue as the data can be optional
273
+ end
274
+
275
+ self
276
+ end
277
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
278
+
279
+ # Returns the string representation of the object
280
+ # @return [String] String presentation of the object
281
+ def to_s
282
+ to_hash.to_s
283
+ end
284
+
285
+ # Returns the object in the form of hash
286
+ # @return [Hash] Returns the object in the form of hash
287
+ def to_hash
288
+ hash = {}
289
+ self.class.attribute_map.each_pair do |attr, param|
290
+ value = public_method(attr).call
291
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
292
+
293
+ hash[param] = _to_hash(value)
294
+ end
295
+ hash
296
+ end
297
+
298
+ private
299
+
300
+ # Outputs non-array value in the form of hash
301
+ # For object, use to_hash. Otherwise, just return the value
302
+ # @param [Object] value Any valid value
303
+ # @return [Hash] Returns the value in the form of hash
304
+ def _to_hash(value)
305
+ if value.is_a?(Array)
306
+ value.compact.map { |v| _to_hash(v) }
307
+ elsif value.is_a?(Hash)
308
+ {}.tap do |hash|
309
+ value.each { |k, v| hash[k] = _to_hash(v) }
310
+ end
311
+ elsif value.respond_to? :to_hash
312
+ value.to_hash
313
+ else
314
+ value
315
+ end
316
+ end
317
+ end
318
+ end
319
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,291 @@
1
+ # Copyright (c) 2016, 2019, 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
+ # Summary representation of a stream.
9
+ class Streaming::Models::StreamSummary # rubocop:disable Metrics/LineLength
10
+ LIFECYCLE_STATE_ENUM = [
11
+ LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
12
+ LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
13
+ LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
14
+ LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
15
+ LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
16
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
17
+ ].freeze
18
+
19
+ # **[Required]** The name of the stream.
20
+ #
21
+ # Example: `TelemetryEvents`
22
+ #
23
+ # @return [String]
24
+ attr_accessor :name
25
+
26
+ # **[Required]** The OCID of the stream.
27
+ # @return [String]
28
+ attr_accessor :id
29
+
30
+ # **[Required]** The number of partitions in the stream.
31
+ # @return [Integer]
32
+ attr_accessor :partitions
33
+
34
+ # **[Required]** The OCID of the compartment that contains the stream.
35
+ # @return [String]
36
+ attr_accessor :compartment_id
37
+
38
+ # **[Required]** The current state of the stream.
39
+ # @return [String]
40
+ attr_reader :lifecycle_state
41
+
42
+ # **[Required]** The date and time the stream was created, expressed in [RFC 3339](https://tools.ietf.org/rfc/rfc3339) timestamp format.
43
+ #
44
+ # Example: `2018-04-20T00:00:07.405Z`
45
+ #
46
+ # @return [DateTime]
47
+ attr_accessor :time_created
48
+
49
+ # **[Required]** The endpoint to use when creating the StreamClient to consume or publish messages in the stream.
50
+ # @return [String]
51
+ attr_accessor :messages_endpoint
52
+
53
+ # Free-form tags for this resource. Each tag is a simple key-value pair that is applied with no predefined name, type, or namespace. Exists for cross-compatibility only.
54
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
55
+ #
56
+ # Example: `{\"Department\": \"Finance\"}`
57
+ #
58
+ # @return [Hash<String, String>]
59
+ attr_accessor :freeform_tags
60
+
61
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
62
+ #
63
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
64
+ #
65
+ # @return [Hash<String, Hash<String, Object>>]
66
+ attr_accessor :defined_tags
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ # rubocop:disable Style/SymbolLiteral
72
+ 'name': :'name',
73
+ 'id': :'id',
74
+ 'partitions': :'partitions',
75
+ 'compartment_id': :'compartmentId',
76
+ 'lifecycle_state': :'lifecycleState',
77
+ 'time_created': :'timeCreated',
78
+ 'messages_endpoint': :'messagesEndpoint',
79
+ 'freeform_tags': :'freeformTags',
80
+ 'defined_tags': :'definedTags'
81
+ # rubocop:enable Style/SymbolLiteral
82
+ }
83
+ end
84
+
85
+ # Attribute type mapping.
86
+ def self.swagger_types
87
+ {
88
+ # rubocop:disable Style/SymbolLiteral
89
+ 'name': :'String',
90
+ 'id': :'String',
91
+ 'partitions': :'Integer',
92
+ 'compartment_id': :'String',
93
+ 'lifecycle_state': :'String',
94
+ 'time_created': :'DateTime',
95
+ 'messages_endpoint': :'String',
96
+ 'freeform_tags': :'Hash<String, String>',
97
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
98
+ # rubocop:enable Style/SymbolLiteral
99
+ }
100
+ end
101
+
102
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
103
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
104
+
105
+
106
+ # Initializes the object
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @option attributes [String] :name The value to assign to the {#name} property
109
+ # @option attributes [String] :id The value to assign to the {#id} property
110
+ # @option attributes [Integer] :partitions The value to assign to the {#partitions} property
111
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
112
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
113
+ # @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
114
+ # @option attributes [String] :messages_endpoint The value to assign to the {#messages_endpoint} property
115
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
116
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
117
+ def initialize(attributes = {})
118
+ return unless attributes.is_a?(Hash)
119
+
120
+ # convert string to symbol for hash key
121
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
122
+
123
+ self.name = attributes[:'name'] if attributes[:'name']
124
+
125
+ self.id = attributes[:'id'] if attributes[:'id']
126
+
127
+ self.partitions = attributes[:'partitions'] if attributes[:'partitions']
128
+
129
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
130
+
131
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
132
+
133
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
134
+
135
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
136
+
137
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
138
+
139
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
140
+
141
+ self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']
142
+
143
+ raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
144
+
145
+ self.time_created = attributes[:'time_created'] if attributes[:'time_created']
146
+
147
+ self.messages_endpoint = attributes[:'messagesEndpoint'] if attributes[:'messagesEndpoint']
148
+
149
+ raise 'You cannot provide both :messagesEndpoint and :messages_endpoint' if attributes.key?(:'messagesEndpoint') && attributes.key?(:'messages_endpoint')
150
+
151
+ self.messages_endpoint = attributes[:'messages_endpoint'] if attributes[:'messages_endpoint']
152
+
153
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
154
+
155
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
156
+
157
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
158
+
159
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
160
+
161
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
162
+
163
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
164
+ end
165
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
166
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
167
+
168
+ # Custom attribute writer method checking allowed values (enum).
169
+ # @param [Object] lifecycle_state Object to be assigned
170
+ def lifecycle_state=(lifecycle_state)
171
+ # rubocop:disable Style/ConditionalAssignment
172
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
173
+ # rubocop: disable Metrics/LineLength
174
+ OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
175
+ # rubocop: enable Metrics/LineLength
176
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
177
+ else
178
+ @lifecycle_state = lifecycle_state
179
+ end
180
+ # rubocop:enable Style/ConditionalAssignment
181
+ end
182
+
183
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
184
+
185
+
186
+ # Checks equality by comparing each attribute.
187
+ # @param [Object] other the other object to be compared
188
+ def ==(other)
189
+ return true if equal?(other)
190
+
191
+ self.class == other.class &&
192
+ name == other.name &&
193
+ id == other.id &&
194
+ partitions == other.partitions &&
195
+ compartment_id == other.compartment_id &&
196
+ lifecycle_state == other.lifecycle_state &&
197
+ time_created == other.time_created &&
198
+ messages_endpoint == other.messages_endpoint &&
199
+ freeform_tags == other.freeform_tags &&
200
+ defined_tags == other.defined_tags
201
+ end
202
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
203
+
204
+ # @see the `==` method
205
+ # @param [Object] other the other object to be compared
206
+ def eql?(other)
207
+ self == other
208
+ end
209
+
210
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
211
+
212
+
213
+ # Calculates hash code according to all attributes.
214
+ # @return [Fixnum] Hash code
215
+ def hash
216
+ [name, id, partitions, compartment_id, lifecycle_state, time_created, messages_endpoint, freeform_tags, defined_tags].hash
217
+ end
218
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
219
+
220
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
221
+
222
+
223
+ # Builds the object from hash
224
+ # @param [Hash] attributes Model attributes in the form of hash
225
+ # @return [Object] Returns the model itself
226
+ def build_from_hash(attributes)
227
+ return nil unless attributes.is_a?(Hash)
228
+
229
+ self.class.swagger_types.each_pair do |key, type|
230
+ if type =~ /^Array<(.*)>/i
231
+ # check to ensure the input is an array given that the the attribute
232
+ # is documented as an array but the input is not
233
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
234
+ public_method("#{key}=").call(
235
+ attributes[self.class.attribute_map[key]]
236
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
237
+ )
238
+ end
239
+ elsif !attributes[self.class.attribute_map[key]].nil?
240
+ public_method("#{key}=").call(
241
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
242
+ )
243
+ end
244
+ # or else data not found in attributes(hash), not an issue as the data can be optional
245
+ end
246
+
247
+ self
248
+ end
249
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
250
+
251
+ # Returns the string representation of the object
252
+ # @return [String] String presentation of the object
253
+ def to_s
254
+ to_hash.to_s
255
+ end
256
+
257
+ # Returns the object in the form of hash
258
+ # @return [Hash] Returns the object in the form of hash
259
+ def to_hash
260
+ hash = {}
261
+ self.class.attribute_map.each_pair do |attr, param|
262
+ value = public_method(attr).call
263
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
264
+
265
+ hash[param] = _to_hash(value)
266
+ end
267
+ hash
268
+ end
269
+
270
+ private
271
+
272
+ # Outputs non-array value in the form of hash
273
+ # For object, use to_hash. Otherwise, just return the value
274
+ # @param [Object] value Any valid value
275
+ # @return [Hash] Returns the value in the form of hash
276
+ def _to_hash(value)
277
+ if value.is_a?(Array)
278
+ value.compact.map { |v| _to_hash(v) }
279
+ elsif value.is_a?(Hash)
280
+ {}.tap do |hash|
281
+ value.each { |k, v| hash[k] = _to_hash(v) }
282
+ end
283
+ elsif value.respond_to? :to_hash
284
+ value.to_hash
285
+ else
286
+ value
287
+ end
288
+ end
289
+ end
290
+ end
291
+ # rubocop:enable Lint/UnneededCopDisableDirective