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,227 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # Object used to create a stream.
8
+ class Streaming::Models::CreateStreamDetails # rubocop:disable Metrics/LineLength
9
+ # **[Required]** The name of the stream. Avoid entering confidential information.
10
+ #
11
+ # Example: `TelemetryEvents`
12
+ #
13
+ # @return [String]
14
+ attr_accessor :name
15
+
16
+ # **[Required]** The number of partitions in the stream.
17
+ # @return [Integer]
18
+ attr_accessor :partitions
19
+
20
+ # **[Required]** The OCID of the compartment that contains the stream.
21
+ # @return [String]
22
+ attr_accessor :compartment_id
23
+
24
+ # The retention period of the stream, in hours. Accepted values are between 24 and 168 (7 days).
25
+ # If not specified, the stream will have a retention period of 24 hours.
26
+ #
27
+ # @return [Integer]
28
+ attr_accessor :retention_in_hours
29
+
30
+ # 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.
31
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
32
+ #
33
+ # Example: `{\"Department\": \"Finance\"}`
34
+ #
35
+ # @return [Hash<String, String>]
36
+ attr_accessor :freeform_tags
37
+
38
+ # 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).
39
+ #
40
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
41
+ #
42
+ # @return [Hash<String, Hash<String, Object>>]
43
+ attr_accessor :defined_tags
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ # rubocop:disable Style/SymbolLiteral
49
+ 'name': :'name',
50
+ 'partitions': :'partitions',
51
+ 'compartment_id': :'compartmentId',
52
+ 'retention_in_hours': :'retentionInHours',
53
+ 'freeform_tags': :'freeformTags',
54
+ 'defined_tags': :'definedTags'
55
+ # rubocop:enable Style/SymbolLiteral
56
+ }
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.swagger_types
61
+ {
62
+ # rubocop:disable Style/SymbolLiteral
63
+ 'name': :'String',
64
+ 'partitions': :'Integer',
65
+ 'compartment_id': :'String',
66
+ 'retention_in_hours': :'Integer',
67
+ 'freeform_tags': :'Hash<String, String>',
68
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
69
+ # rubocop:enable Style/SymbolLiteral
70
+ }
71
+ end
72
+
73
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
74
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
75
+
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ # @option attributes [String] :name The value to assign to the {#name} property
80
+ # @option attributes [Integer] :partitions The value to assign to the {#partitions} property
81
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
82
+ # @option attributes [Integer] :retention_in_hours The value to assign to the {#retention_in_hours} property
83
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
84
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
85
+ def initialize(attributes = {})
86
+ return unless attributes.is_a?(Hash)
87
+
88
+ # convert string to symbol for hash key
89
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
90
+
91
+ self.name = attributes[:'name'] if attributes[:'name']
92
+
93
+ self.partitions = attributes[:'partitions'] if attributes[:'partitions']
94
+
95
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
96
+
97
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
98
+
99
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
100
+
101
+ self.retention_in_hours = attributes[:'retentionInHours'] if attributes[:'retentionInHours']
102
+
103
+ raise 'You cannot provide both :retentionInHours and :retention_in_hours' if attributes.key?(:'retentionInHours') && attributes.key?(:'retention_in_hours')
104
+
105
+ self.retention_in_hours = attributes[:'retention_in_hours'] if attributes[:'retention_in_hours']
106
+
107
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
108
+
109
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
110
+
111
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
112
+
113
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
114
+
115
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
116
+
117
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
118
+ end
119
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
120
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
121
+
122
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
123
+
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] other the other object to be compared
127
+ def ==(other)
128
+ return true if equal?(other)
129
+
130
+ self.class == other.class &&
131
+ name == other.name &&
132
+ partitions == other.partitions &&
133
+ compartment_id == other.compartment_id &&
134
+ retention_in_hours == other.retention_in_hours &&
135
+ freeform_tags == other.freeform_tags &&
136
+ defined_tags == other.defined_tags
137
+ end
138
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
139
+
140
+ # @see the `==` method
141
+ # @param [Object] other the other object to be compared
142
+ def eql?(other)
143
+ self == other
144
+ end
145
+
146
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
147
+
148
+
149
+ # Calculates hash code according to all attributes.
150
+ # @return [Fixnum] Hash code
151
+ def hash
152
+ [name, partitions, compartment_id, retention_in_hours, freeform_tags, defined_tags].hash
153
+ end
154
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
155
+
156
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
157
+
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def build_from_hash(attributes)
163
+ return nil unless attributes.is_a?(Hash)
164
+
165
+ self.class.swagger_types.each_pair do |key, type|
166
+ if type =~ /^Array<(.*)>/i
167
+ # check to ensure the input is an array given that the the attribute
168
+ # is documented as an array but the input is not
169
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
170
+ public_method("#{key}=").call(
171
+ attributes[self.class.attribute_map[key]]
172
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
173
+ )
174
+ end
175
+ elsif !attributes[self.class.attribute_map[key]].nil?
176
+ public_method("#{key}=").call(
177
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
178
+ )
179
+ end
180
+ # or else data not found in attributes(hash), not an issue as the data can be optional
181
+ end
182
+
183
+ self
184
+ end
185
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
186
+
187
+ # Returns the string representation of the object
188
+ # @return [String] String presentation of the object
189
+ def to_s
190
+ to_hash.to_s
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = public_method(attr).call
199
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ private
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+ end
226
+ end
227
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,150 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # A cursor that indicates the position in the stream from which you want to begin consuming messages and which is required by the {#get_messages get_messages} operation.
8
+ #
9
+ class Streaming::Models::Cursor # rubocop:disable Metrics/LineLength
10
+ # **[Required]** The cursor to pass to the `GetMessages` operation.
11
+ # @return [String]
12
+ attr_accessor :value
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ # rubocop:disable Style/SymbolLiteral
18
+ 'value': :'value'
19
+ # rubocop:enable Style/SymbolLiteral
20
+ }
21
+ end
22
+
23
+ # Attribute type mapping.
24
+ def self.swagger_types
25
+ {
26
+ # rubocop:disable Style/SymbolLiteral
27
+ 'value': :'String'
28
+ # rubocop:enable Style/SymbolLiteral
29
+ }
30
+ end
31
+
32
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
33
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
34
+
35
+
36
+ # Initializes the object
37
+ # @param [Hash] attributes Model attributes in the form of hash
38
+ # @option attributes [String] :value The value to assign to the {#value} property
39
+ def initialize(attributes = {})
40
+ return unless attributes.is_a?(Hash)
41
+
42
+ # convert string to symbol for hash key
43
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
44
+
45
+ self.value = attributes[:'value'] if attributes[:'value']
46
+ end
47
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
48
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
49
+
50
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
51
+
52
+
53
+ # Checks equality by comparing each attribute.
54
+ # @param [Object] other the other object to be compared
55
+ def ==(other)
56
+ return true if equal?(other)
57
+
58
+ self.class == other.class &&
59
+ value == other.value
60
+ end
61
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
62
+
63
+ # @see the `==` method
64
+ # @param [Object] other the other object to be compared
65
+ def eql?(other)
66
+ self == other
67
+ end
68
+
69
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
70
+
71
+
72
+ # Calculates hash code according to all attributes.
73
+ # @return [Fixnum] Hash code
74
+ def hash
75
+ [value].hash
76
+ end
77
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
78
+
79
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
80
+
81
+
82
+ # Builds the object from hash
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ # @return [Object] Returns the model itself
85
+ def build_from_hash(attributes)
86
+ return nil unless attributes.is_a?(Hash)
87
+
88
+ self.class.swagger_types.each_pair do |key, type|
89
+ if type =~ /^Array<(.*)>/i
90
+ # check to ensure the input is an array given that the the attribute
91
+ # is documented as an array but the input is not
92
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
93
+ public_method("#{key}=").call(
94
+ attributes[self.class.attribute_map[key]]
95
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
96
+ )
97
+ end
98
+ elsif !attributes[self.class.attribute_map[key]].nil?
99
+ public_method("#{key}=").call(
100
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
101
+ )
102
+ end
103
+ # or else data not found in attributes(hash), not an issue as the data can be optional
104
+ end
105
+
106
+ self
107
+ end
108
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
109
+
110
+ # Returns the string representation of the object
111
+ # @return [String] String presentation of the object
112
+ def to_s
113
+ to_hash.to_s
114
+ end
115
+
116
+ # Returns the object in the form of hash
117
+ # @return [Hash] Returns the object in the form of hash
118
+ def to_hash
119
+ hash = {}
120
+ self.class.attribute_map.each_pair do |attr, param|
121
+ value = public_method(attr).call
122
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
123
+
124
+ hash[param] = _to_hash(value)
125
+ end
126
+ hash
127
+ end
128
+
129
+ private
130
+
131
+ # Outputs non-array value in the form of hash
132
+ # For object, use to_hash. Otherwise, just return the value
133
+ # @param [Object] value Any valid value
134
+ # @return [Hash] Returns the value in the form of hash
135
+ def _to_hash(value)
136
+ if value.is_a?(Array)
137
+ value.compact.map { |v| _to_hash(v) }
138
+ elsif value.is_a?(Hash)
139
+ {}.tap do |hash|
140
+ value.each { |k, v| hash[k] = _to_hash(v) }
141
+ end
142
+ elsif value.respond_to? :to_hash
143
+ value.to_hash
144
+ else
145
+ value
146
+ end
147
+ end
148
+ end
149
+ end
150
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,179 @@
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
+ # Represents the current state of a consumer group, including partition reservations and committed offsets.
9
+ #
10
+ class Streaming::Models::Group # rubocop:disable Metrics/LineLength
11
+ # The streamId for which the group exists.
12
+ # @return [String]
13
+ attr_accessor :stream_id
14
+
15
+ # The name of the consumer group.
16
+ # @return [String]
17
+ attr_accessor :group_name
18
+
19
+ # An array of the partition reservations of a group.
20
+ # @return [Array<OCI::Streaming::Models::PartitionReservation>]
21
+ attr_accessor :reservations
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ # rubocop:disable Style/SymbolLiteral
27
+ 'stream_id': :'streamId',
28
+ 'group_name': :'groupName',
29
+ 'reservations': :'reservations'
30
+ # rubocop:enable Style/SymbolLiteral
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ # rubocop:disable Style/SymbolLiteral
38
+ 'stream_id': :'String',
39
+ 'group_name': :'String',
40
+ 'reservations': :'Array<OCI::Streaming::Models::PartitionReservation>'
41
+ # rubocop:enable Style/SymbolLiteral
42
+ }
43
+ end
44
+
45
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
46
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
47
+
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ # @option attributes [String] :stream_id The value to assign to the {#stream_id} property
52
+ # @option attributes [String] :group_name The value to assign to the {#group_name} property
53
+ # @option attributes [Array<OCI::Streaming::Models::PartitionReservation>] :reservations The value to assign to the {#reservations} property
54
+ def initialize(attributes = {})
55
+ return unless attributes.is_a?(Hash)
56
+
57
+ # convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
59
+
60
+ self.stream_id = attributes[:'streamId'] if attributes[:'streamId']
61
+
62
+ raise 'You cannot provide both :streamId and :stream_id' if attributes.key?(:'streamId') && attributes.key?(:'stream_id')
63
+
64
+ self.stream_id = attributes[:'stream_id'] if attributes[:'stream_id']
65
+
66
+ self.group_name = attributes[:'groupName'] if attributes[:'groupName']
67
+
68
+ raise 'You cannot provide both :groupName and :group_name' if attributes.key?(:'groupName') && attributes.key?(:'group_name')
69
+
70
+ self.group_name = attributes[:'group_name'] if attributes[:'group_name']
71
+
72
+ self.reservations = attributes[:'reservations'] if attributes[:'reservations']
73
+ end
74
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
75
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
76
+
77
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
78
+
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] other the other object to be compared
82
+ def ==(other)
83
+ return true if equal?(other)
84
+
85
+ self.class == other.class &&
86
+ stream_id == other.stream_id &&
87
+ group_name == other.group_name &&
88
+ reservations == other.reservations
89
+ end
90
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
91
+
92
+ # @see the `==` method
93
+ # @param [Object] other the other object to be compared
94
+ def eql?(other)
95
+ self == other
96
+ end
97
+
98
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
99
+
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Fixnum] Hash code
103
+ def hash
104
+ [stream_id, group_name, reservations].hash
105
+ end
106
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
107
+
108
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
109
+
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+
117
+ self.class.swagger_types.each_pair do |key, type|
118
+ if type =~ /^Array<(.*)>/i
119
+ # check to ensure the input is an array given that the the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
122
+ public_method("#{key}=").call(
123
+ attributes[self.class.attribute_map[key]]
124
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
125
+ )
126
+ end
127
+ elsif !attributes[self.class.attribute_map[key]].nil?
128
+ public_method("#{key}=").call(
129
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
130
+ )
131
+ end
132
+ # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
138
+
139
+ # Returns the string representation of the object
140
+ # @return [String] String presentation of the object
141
+ def to_s
142
+ to_hash.to_s
143
+ end
144
+
145
+ # Returns the object in the form of hash
146
+ # @return [Hash] Returns the object in the form of hash
147
+ def to_hash
148
+ hash = {}
149
+ self.class.attribute_map.each_pair do |attr, param|
150
+ value = public_method(attr).call
151
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
152
+
153
+ hash[param] = _to_hash(value)
154
+ end
155
+ hash
156
+ end
157
+
158
+ private
159
+
160
+ # Outputs non-array value in the form of hash
161
+ # For object, use to_hash. Otherwise, just return the value
162
+ # @param [Object] value Any valid value
163
+ # @return [Hash] Returns the value in the form of hash
164
+ def _to_hash(value)
165
+ if value.is_a?(Array)
166
+ value.compact.map { |v| _to_hash(v) }
167
+ elsif value.is_a?(Hash)
168
+ {}.tap do |hash|
169
+ value.each { |k, v| hash[k] = _to_hash(v) }
170
+ end
171
+ elsif value.respond_to? :to_hash
172
+ value.to_hash
173
+ else
174
+ value
175
+ end
176
+ end
177
+ end
178
+ end
179
+ # rubocop:enable Lint/UnneededCopDisableDirective