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,176 @@
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
+ # Request body for operationally managing a group.
8
+ #
9
+ class Streaming::Models::UpdateGroupDetails # rubocop:disable Metrics/LineLength
10
+ TYPE_ENUM = [
11
+ TYPE_AT_TIME = 'AT_TIME'.freeze,
12
+ TYPE_LATEST = 'LATEST'.freeze,
13
+ TYPE_TRIM_HORIZON = 'TRIM_HORIZON'.freeze
14
+ ].freeze
15
+
16
+ # The type of the cursor.
17
+ # @return [String]
18
+ attr_reader :type
19
+
20
+ # The time to consume from if type is AT_TIME.
21
+ # @return [DateTime]
22
+ attr_accessor :time
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ # rubocop:disable Style/SymbolLiteral
28
+ 'type': :'type',
29
+ 'time': :'time'
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
+ 'type': :'String',
39
+ 'time': :'DateTime'
40
+ # rubocop:enable Style/SymbolLiteral
41
+ }
42
+ end
43
+
44
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
45
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
46
+
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ # @option attributes [String] :type The value to assign to the {#type} property
51
+ # @option attributes [DateTime] :time The value to assign to the {#time} property
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ self.type = attributes[:'type'] if attributes[:'type']
59
+
60
+ self.time = attributes[:'time'] if attributes[:'time']
61
+ end
62
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
63
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
64
+
65
+ # Custom attribute writer method checking allowed values (enum).
66
+ # @param [Object] type Object to be assigned
67
+ def type=(type)
68
+ # rubocop: disable Metrics/LineLength
69
+ raise "Invalid value for 'type': this must be one of the values in TYPE_ENUM." if type && !TYPE_ENUM.include?(type)
70
+
71
+ # rubocop: enable Metrics/LineLength
72
+ @type = type
73
+ end
74
+
75
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
76
+
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] other the other object to be compared
80
+ def ==(other)
81
+ return true if equal?(other)
82
+
83
+ self.class == other.class &&
84
+ type == other.type &&
85
+ time == other.time
86
+ end
87
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
88
+
89
+ # @see the `==` method
90
+ # @param [Object] other the other object to be compared
91
+ def eql?(other)
92
+ self == other
93
+ end
94
+
95
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
96
+
97
+
98
+ # Calculates hash code according to all attributes.
99
+ # @return [Fixnum] Hash code
100
+ def hash
101
+ [type, time].hash
102
+ end
103
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
104
+
105
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
106
+
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+
114
+ self.class.swagger_types.each_pair do |key, type|
115
+ if type =~ /^Array<(.*)>/i
116
+ # check to ensure the input is an array given that the the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ public_method("#{key}=").call(
120
+ attributes[self.class.attribute_map[key]]
121
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
122
+ )
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ public_method("#{key}=").call(
126
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
127
+ )
128
+ end
129
+ # or else data not found in attributes(hash), not an issue as the data can be optional
130
+ end
131
+
132
+ self
133
+ end
134
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
135
+
136
+ # Returns the string representation of the object
137
+ # @return [String] String presentation of the object
138
+ def to_s
139
+ to_hash.to_s
140
+ end
141
+
142
+ # Returns the object in the form of hash
143
+ # @return [Hash] Returns the object in the form of hash
144
+ def to_hash
145
+ hash = {}
146
+ self.class.attribute_map.each_pair do |attr, param|
147
+ value = public_method(attr).call
148
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
149
+
150
+ hash[param] = _to_hash(value)
151
+ end
152
+ hash
153
+ end
154
+
155
+ private
156
+
157
+ # Outputs non-array value in the form of hash
158
+ # For object, use to_hash. Otherwise, just return the value
159
+ # @param [Object] value Any valid value
160
+ # @return [Hash] Returns the value in the form of hash
161
+ def _to_hash(value)
162
+ if value.is_a?(Array)
163
+ value.compact.map { |v| _to_hash(v) }
164
+ elsif value.is_a?(Hash)
165
+ {}.tap do |hash|
166
+ value.each { |k, v| hash[k] = _to_hash(v) }
167
+ end
168
+ elsif value.respond_to? :to_hash
169
+ value.to_hash
170
+ else
171
+ value
172
+ end
173
+ end
174
+ end
175
+ end
176
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,174 @@
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 update a stream.
8
+ class Streaming::Models::UpdateStreamDetails # rubocop:disable Metrics/LineLength
9
+ # 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.
10
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
11
+ #
12
+ # Example: `{\"Department\": \"Finance\"}`
13
+ #
14
+ # @return [Hash<String, String>]
15
+ attr_accessor :freeform_tags
16
+
17
+ # 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).
18
+ #
19
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
20
+ #
21
+ # @return [Hash<String, Hash<String, Object>>]
22
+ attr_accessor :defined_tags
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ # rubocop:disable Style/SymbolLiteral
28
+ 'freeform_tags': :'freeformTags',
29
+ 'defined_tags': :'definedTags'
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
+ 'freeform_tags': :'Hash<String, String>',
39
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
40
+ # rubocop:enable Style/SymbolLiteral
41
+ }
42
+ end
43
+
44
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
45
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
46
+
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
51
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
59
+
60
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
61
+
62
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
63
+
64
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
65
+
66
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
67
+
68
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
69
+ end
70
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
71
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
72
+
73
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
74
+
75
+
76
+ # Checks equality by comparing each attribute.
77
+ # @param [Object] other the other object to be compared
78
+ def ==(other)
79
+ return true if equal?(other)
80
+
81
+ self.class == other.class &&
82
+ freeform_tags == other.freeform_tags &&
83
+ defined_tags == other.defined_tags
84
+ end
85
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
86
+
87
+ # @see the `==` method
88
+ # @param [Object] other the other object to be compared
89
+ def eql?(other)
90
+ self == other
91
+ end
92
+
93
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
94
+
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Fixnum] Hash code
98
+ def hash
99
+ [freeform_tags, defined_tags].hash
100
+ end
101
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
102
+
103
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
104
+
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+
112
+ self.class.swagger_types.each_pair do |key, type|
113
+ if type =~ /^Array<(.*)>/i
114
+ # check to ensure the input is an array given that the the attribute
115
+ # is documented as an array but the input is not
116
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
117
+ public_method("#{key}=").call(
118
+ attributes[self.class.attribute_map[key]]
119
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
120
+ )
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ public_method("#{key}=").call(
124
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
125
+ )
126
+ end
127
+ # or else data not found in attributes(hash), not an issue as the data can be optional
128
+ end
129
+
130
+ self
131
+ end
132
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
133
+
134
+ # Returns the string representation of the object
135
+ # @return [String] String presentation of the object
136
+ def to_s
137
+ to_hash.to_s
138
+ end
139
+
140
+ # Returns the object in the form of hash
141
+ # @return [Hash] Returns the object in the form of hash
142
+ def to_hash
143
+ hash = {}
144
+ self.class.attribute_map.each_pair do |attr, param|
145
+ value = public_method(attr).call
146
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
147
+
148
+ hash[param] = _to_hash(value)
149
+ end
150
+ hash
151
+ end
152
+
153
+ private
154
+
155
+ # Outputs non-array value in the form of hash
156
+ # For object, use to_hash. Otherwise, just return the value
157
+ # @param [Object] value Any valid value
158
+ # @return [Hash] Returns the value in the form of hash
159
+ def _to_hash(value)
160
+ if value.is_a?(Array)
161
+ value.compact.map { |v| _to_hash(v) }
162
+ elsif value.is_a?(Hash)
163
+ {}.tap do |hash|
164
+ value.each { |k, v| hash[k] = _to_hash(v) }
165
+ end
166
+ elsif value.respond_to? :to_hash
167
+ value.to_hash
168
+ else
169
+ value
170
+ end
171
+ end
172
+ end
173
+ end
174
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,432 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'uri'
4
+ require 'logger'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
7
+ module OCI
8
+ # The API for the Streaming Service.
9
+ class Streaming::StreamAdminClient
10
+ # Client used to make HTTP requests.
11
+ # @return [OCI::ApiClient]
12
+ attr_reader :api_client
13
+
14
+ # Fully qualified endpoint URL
15
+ # @return [String]
16
+ attr_reader :endpoint
17
+
18
+ # The default retry configuration to apply to all operations in this service client. This can be overridden
19
+ # on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
20
+ # will not perform any retries
21
+ # @return [OCI::Retry::RetryConfig]
22
+ attr_reader :retry_config
23
+
24
+ # The region, which will usually correspond to a value in {OCI::Regions::REGION_ENUM}.
25
+ # @return [String]
26
+ attr_reader :region
27
+
28
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
29
+
30
+
31
+ # Creates a new StreamAdminClient.
32
+ # Notes:
33
+ # If a config is not specified, then the global OCI.config will be used.
34
+ #
35
+ # This client is not thread-safe
36
+ #
37
+ # Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the
38
+ # region. A region may be specified in the config or via or the region parameter. If specified in both, then the
39
+ # region parameter will be used.
40
+ # @param [Config] config A Config object.
41
+ # @param [String] region A region used to determine the service endpoint. This will usually
42
+ # correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
43
+ # @param [String] endpoint The fully qualified endpoint URL
44
+ # @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
45
+ # a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
46
+ # so that the instance principals signer can be provided to the client
47
+ # @param [OCI::ApiClientProxySettings] proxy_settings If your environment requires you to use a proxy server for outgoing HTTP requests
48
+ # the details for the proxy can be provided in this parameter
49
+ # @param [OCI::Retry::RetryConfig] retry_config The retry configuration for this service client. This represents the default retry configuration to
50
+ # apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
51
+ # will not perform any retries
52
+ def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
53
+ # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
54
+ # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
55
+ # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
56
+ # pass it to this constructor.
57
+ #
58
+ # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
59
+ # so try and load the config from the default file.
60
+ config ||= OCI.config unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
61
+ config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
62
+ config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
63
+
64
+ if signer.nil?
65
+ signer = OCI::Signer.new(
66
+ config.user,
67
+ config.fingerprint,
68
+ config.tenancy,
69
+ config.key_file,
70
+ pass_phrase: config.pass_phrase,
71
+ private_key_content: config.key_content
72
+ )
73
+ end
74
+
75
+ @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
76
+ @retry_config = retry_config
77
+
78
+ if endpoint
79
+ @endpoint = endpoint + '/20180418'
80
+ else
81
+ region ||= config.region
82
+ region ||= signer.region if signer.respond_to?(:region)
83
+ self.region = region
84
+ end
85
+ logger.info "StreamAdminClient endpoint set to '#{@endpoint}'." if logger
86
+ end
87
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
88
+
89
+ # Set the region that will be used to determine the service endpoint.
90
+ # This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
91
+ # but may be an arbitrary string.
92
+ def region=(new_region)
93
+ @region = new_region
94
+
95
+ raise 'A region must be specified.' unless @region
96
+
97
+ @endpoint = OCI::Regions.get_service_endpoint_for_template(@region, 'https://streams.{region}.streaming.oci.{secondLevelDomain}') + '/20180418'
98
+ logger.info "StreamAdminClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
99
+ end
100
+
101
+ # @return [Logger] The logger for this client. May be nil.
102
+ def logger
103
+ @api_client.config.logger
104
+ end
105
+
106
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
107
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
108
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
109
+
110
+
111
+ # Starts the provisioning of a new stream.
112
+ # To track the progress of the provisioning, you can periodically call {#get_stream get_stream}.
113
+ # In the response, the `lifecycleState` parameter of the {Stream} object tells you its current state.
114
+ #
115
+ # @param [OCI::Streaming::Models::CreateStreamDetails] create_stream_details The stream to create.
116
+ # @param [Hash] opts the optional parameters
117
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
118
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
119
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
120
+ # particular request, please provide the request ID.
121
+ #
122
+ # @return [Response] A Response object with data of type {OCI::Streaming::Models::Stream Stream}
123
+ def create_stream(create_stream_details, opts = {})
124
+ logger.debug 'Calling operation StreamAdminClient#create_stream.' if logger
125
+
126
+ raise "Missing the required parameter 'create_stream_details' when calling create_stream." if create_stream_details.nil?
127
+
128
+ path = '/streams'
129
+ operation_signing_strategy = :standard
130
+
131
+ # rubocop:disable Style/NegatedIf
132
+ # Query Params
133
+ query_params = {}
134
+
135
+ # Header Params
136
+ header_params = {}
137
+ header_params[:accept] = 'application/json'
138
+ header_params[:'content-type'] = 'application/json'
139
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
140
+ # rubocop:enable Style/NegatedIf
141
+
142
+ post_body = @api_client.object_to_http_body(create_stream_details)
143
+
144
+ # rubocop:disable Metrics/BlockLength
145
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'StreamAdminClient#create_stream') do
146
+ @api_client.call_api(
147
+ :POST,
148
+ path,
149
+ endpoint,
150
+ header_params: header_params,
151
+ query_params: query_params,
152
+ operation_signing_strategy: operation_signing_strategy,
153
+ body: post_body,
154
+ return_type: 'OCI::Streaming::Models::Stream'
155
+ )
156
+ end
157
+ # rubocop:enable Metrics/BlockLength
158
+ end
159
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
160
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
161
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
162
+
163
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
164
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
165
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
166
+
167
+
168
+ # Deletes a stream and its content. Stream contents are deleted immediately. The service retains records of the stream itself for 90 days after deletion.
169
+ # The `lifeCycleState` parameter of the `Stream` object changes to `DELETING` and the stream becomes inaccessible for read or write operations.
170
+ # To verify that a stream has been deleted, make a {#get_stream get_stream} request. If the call returns the stream's
171
+ # lifecycle state as `DELETED`, then the stream has been deleted. If the call returns a \"404 Not Found\" error, that means all records of the
172
+ # stream have been deleted.
173
+ #
174
+ # @param [String] stream_id The OCID of the stream to delete.
175
+ # @param [Hash] opts the optional parameters
176
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
177
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
178
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
179
+ # particular request, please provide the request ID.
180
+ #
181
+ # @return [Response] A Response object with data of type nil
182
+ def delete_stream(stream_id, opts = {})
183
+ logger.debug 'Calling operation StreamAdminClient#delete_stream.' if logger
184
+
185
+ raise "Missing the required parameter 'stream_id' when calling delete_stream." if stream_id.nil?
186
+ raise "Parameter value for 'stream_id' must not be blank" if OCI::Internal::Util.blank_string?(stream_id)
187
+
188
+ path = '/streams/{streamId}'.sub('{streamId}', stream_id.to_s)
189
+ operation_signing_strategy = :standard
190
+
191
+ # rubocop:disable Style/NegatedIf
192
+ # Query Params
193
+ query_params = {}
194
+
195
+ # Header Params
196
+ header_params = {}
197
+ header_params[:accept] = 'application/json'
198
+ header_params[:'content-type'] = 'application/json'
199
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
200
+ # rubocop:enable Style/NegatedIf
201
+
202
+ post_body = nil
203
+
204
+ # rubocop:disable Metrics/BlockLength
205
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'StreamAdminClient#delete_stream') do
206
+ @api_client.call_api(
207
+ :DELETE,
208
+ path,
209
+ endpoint,
210
+ header_params: header_params,
211
+ query_params: query_params,
212
+ operation_signing_strategy: operation_signing_strategy,
213
+ body: post_body
214
+ )
215
+ end
216
+ # rubocop:enable Metrics/BlockLength
217
+ end
218
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
219
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
220
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
221
+
222
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
223
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
224
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
225
+
226
+
227
+ # Gets detailed information about a stream, including the number of partitions.
228
+ # @param [String] stream_id The OCID of the stream to retrieve.
229
+ # @param [Hash] opts the optional parameters
230
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
231
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
232
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
233
+ # particular request, please provide the request ID.
234
+ #
235
+ # @return [Response] A Response object with data of type {OCI::Streaming::Models::Stream Stream}
236
+ def get_stream(stream_id, opts = {})
237
+ logger.debug 'Calling operation StreamAdminClient#get_stream.' if logger
238
+
239
+ raise "Missing the required parameter 'stream_id' when calling get_stream." if stream_id.nil?
240
+ raise "Parameter value for 'stream_id' must not be blank" if OCI::Internal::Util.blank_string?(stream_id)
241
+
242
+ path = '/streams/{streamId}'.sub('{streamId}', stream_id.to_s)
243
+ operation_signing_strategy = :standard
244
+
245
+ # rubocop:disable Style/NegatedIf
246
+ # Query Params
247
+ query_params = {}
248
+
249
+ # Header Params
250
+ header_params = {}
251
+ header_params[:accept] = 'application/json'
252
+ header_params[:'content-type'] = 'application/json'
253
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
254
+ # rubocop:enable Style/NegatedIf
255
+
256
+ post_body = nil
257
+
258
+ # rubocop:disable Metrics/BlockLength
259
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'StreamAdminClient#get_stream') do
260
+ @api_client.call_api(
261
+ :GET,
262
+ path,
263
+ endpoint,
264
+ header_params: header_params,
265
+ query_params: query_params,
266
+ operation_signing_strategy: operation_signing_strategy,
267
+ body: post_body,
268
+ return_type: 'OCI::Streaming::Models::Stream'
269
+ )
270
+ end
271
+ # rubocop:enable Metrics/BlockLength
272
+ end
273
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
274
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
275
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
276
+
277
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
278
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
279
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
280
+
281
+
282
+ # Lists the streams.
283
+ # @param [String] compartment_id The OCID of the compartment.
284
+ # @param [Hash] opts the optional parameters
285
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
286
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
287
+ # @option opts [String] :id A filter to return only resources that match the given ID exactly.
288
+ #
289
+ # @option opts [String] :name A filter to return only resources that match the given name exactly.
290
+ #
291
+ # @option opts [Integer] :limit The maximum number of items to return. The value must be between 1 and 50. The default is 10. (default to 5)
292
+ # @option opts [String] :page The page at which to start retrieving results.
293
+ # @option opts [String] :sort_by The field to sort by. You can provide no more than one sort order. By default, `TIMECREATED` sorts results in descending order and `NAME` sorts results in ascending order.
294
+ #
295
+ # Allowed values are: NAME, TIMECREATED
296
+ # @option opts [String] :sort_order The sort order to use, either 'asc' or 'desc'.
297
+ #
298
+ # Allowed values are: ASC, DESC
299
+ # @option opts [String] :lifecycle_state A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
300
+ #
301
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
302
+ # particular request, please provide the request ID.
303
+ #
304
+ # @return [Response] A Response object with data of type Array<{OCI::Streaming::Models::StreamSummary StreamSummary}>
305
+ def list_streams(compartment_id, opts = {})
306
+ logger.debug 'Calling operation StreamAdminClient#list_streams.' if logger
307
+
308
+ raise "Missing the required parameter 'compartment_id' when calling list_streams." if compartment_id.nil?
309
+
310
+ if opts[:sort_by] && !%w[NAME TIMECREATED].include?(opts[:sort_by])
311
+ raise 'Invalid value for "sort_by", must be one of NAME, TIMECREATED.'
312
+ end
313
+
314
+ if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
315
+ raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
316
+ end
317
+
318
+ if opts[:lifecycle_state] && !OCI::Streaming::Models::Stream::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
319
+ raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Streaming::Models::Stream::LIFECYCLE_STATE_ENUM.'
320
+ end
321
+
322
+ path = '/streams'
323
+ operation_signing_strategy = :standard
324
+
325
+ # rubocop:disable Style/NegatedIf
326
+ # Query Params
327
+ query_params = {}
328
+ query_params[:compartmentId] = compartment_id
329
+ query_params[:id] = opts[:id] if opts[:id]
330
+ query_params[:name] = opts[:name] if opts[:name]
331
+ query_params[:limit] = opts[:limit] if opts[:limit]
332
+ query_params[:page] = opts[:page] if opts[:page]
333
+ query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
334
+ query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
335
+ query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
336
+
337
+ # Header Params
338
+ header_params = {}
339
+ header_params[:accept] = 'application/json'
340
+ header_params[:'content-type'] = 'application/json'
341
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
342
+ # rubocop:enable Style/NegatedIf
343
+
344
+ post_body = nil
345
+
346
+ # rubocop:disable Metrics/BlockLength
347
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'StreamAdminClient#list_streams') do
348
+ @api_client.call_api(
349
+ :GET,
350
+ path,
351
+ endpoint,
352
+ header_params: header_params,
353
+ query_params: query_params,
354
+ operation_signing_strategy: operation_signing_strategy,
355
+ body: post_body,
356
+ return_type: 'Array<OCI::Streaming::Models::StreamSummary>'
357
+ )
358
+ end
359
+ # rubocop:enable Metrics/BlockLength
360
+ end
361
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
362
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
363
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
364
+
365
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
366
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
367
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
368
+
369
+
370
+ # Updates the tags applied to the stream.
371
+ #
372
+ # @param [String] stream_id The OCID of the stream to update.
373
+ # @param [OCI::Streaming::Models::UpdateStreamDetails] update_stream_details The stream is updated with the tags provided.
374
+ # @param [Hash] opts the optional parameters
375
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
376
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
377
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
378
+ # particular request, please provide the request ID.
379
+ #
380
+ # @return [Response] A Response object with data of type {OCI::Streaming::Models::Stream Stream}
381
+ def update_stream(stream_id, update_stream_details, opts = {})
382
+ logger.debug 'Calling operation StreamAdminClient#update_stream.' if logger
383
+
384
+ raise "Missing the required parameter 'stream_id' when calling update_stream." if stream_id.nil?
385
+ raise "Missing the required parameter 'update_stream_details' when calling update_stream." if update_stream_details.nil?
386
+ raise "Parameter value for 'stream_id' must not be blank" if OCI::Internal::Util.blank_string?(stream_id)
387
+
388
+ path = '/streams/{streamId}'.sub('{streamId}', stream_id.to_s)
389
+ operation_signing_strategy = :standard
390
+
391
+ # rubocop:disable Style/NegatedIf
392
+ # Query Params
393
+ query_params = {}
394
+
395
+ # Header Params
396
+ header_params = {}
397
+ header_params[:accept] = 'application/json'
398
+ header_params[:'content-type'] = 'application/json'
399
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
400
+ # rubocop:enable Style/NegatedIf
401
+
402
+ post_body = @api_client.object_to_http_body(update_stream_details)
403
+
404
+ # rubocop:disable Metrics/BlockLength
405
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'StreamAdminClient#update_stream') do
406
+ @api_client.call_api(
407
+ :PUT,
408
+ path,
409
+ endpoint,
410
+ header_params: header_params,
411
+ query_params: query_params,
412
+ operation_signing_strategy: operation_signing_strategy,
413
+ body: post_body,
414
+ return_type: 'OCI::Streaming::Models::Stream'
415
+ )
416
+ end
417
+ # rubocop:enable Metrics/BlockLength
418
+ end
419
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
420
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
421
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
422
+
423
+ private
424
+
425
+ def applicable_retry_config(opts = {})
426
+ return @retry_config unless opts.key?(:retry_config)
427
+
428
+ opts[:retry_config]
429
+ end
430
+ end
431
+ end
432
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength