oci 2.5.0 → 2.5.1

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 (141) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -1
  3. data/lib/oci.rb +4 -0
  4. data/lib/oci/auth/federation_client.rb +4 -4
  5. data/lib/oci/auth/signers/instance_principals_security_token_signer.rb +22 -16
  6. data/lib/oci/autoscaling/auto_scaling_client.rb +774 -0
  7. data/lib/oci/autoscaling/auto_scaling_client_composite_operations.rb +24 -0
  8. data/lib/oci/autoscaling/autoscaling.rb +38 -0
  9. data/lib/oci/autoscaling/models/action.rb +182 -0
  10. data/lib/oci/autoscaling/models/auto_scaling_configuration.rb +282 -0
  11. data/lib/oci/autoscaling/models/auto_scaling_configuration_summary.rb +234 -0
  12. data/lib/oci/autoscaling/models/auto_scaling_policy.rb +222 -0
  13. data/lib/oci/autoscaling/models/auto_scaling_policy_summary.rb +179 -0
  14. data/lib/oci/autoscaling/models/capacity.rb +170 -0
  15. data/lib/oci/autoscaling/models/condition.rb +186 -0
  16. data/lib/oci/autoscaling/models/create_auto_scaling_configuration_details.rb +256 -0
  17. data/lib/oci/autoscaling/models/create_auto_scaling_policy_details.rb +196 -0
  18. data/lib/oci/autoscaling/models/create_condition_details.rb +176 -0
  19. data/lib/oci/autoscaling/models/create_threshold_policy_details.rb +166 -0
  20. data/lib/oci/autoscaling/models/instance_pool_resource.rb +148 -0
  21. data/lib/oci/autoscaling/models/metric.rb +186 -0
  22. data/lib/oci/autoscaling/models/resource.rb +177 -0
  23. data/lib/oci/autoscaling/models/threshold.rb +188 -0
  24. data/lib/oci/autoscaling/models/threshold_policy.rb +173 -0
  25. data/lib/oci/autoscaling/models/update_auto_scaling_configuration_details.rb +219 -0
  26. data/lib/oci/autoscaling/models/update_auto_scaling_policy_details.rb +194 -0
  27. data/lib/oci/autoscaling/models/update_condition_details.rb +176 -0
  28. data/lib/oci/autoscaling/models/update_threshold_policy_details.rb +164 -0
  29. data/lib/oci/autoscaling/util.rb +2 -0
  30. data/lib/oci/core/blockstorage_client.rb +1 -1
  31. data/lib/oci/core/compute_client.rb +1 -1
  32. data/lib/oci/core/compute_management_client.rb +135 -1
  33. data/lib/oci/core/compute_management_client_composite_operations.rb +80 -0
  34. data/lib/oci/core/core.rb +8 -0
  35. data/lib/oci/core/models/attach_load_balancer_details.rb +191 -0
  36. data/lib/oci/core/models/create_instance_pool_details.rb +19 -4
  37. data/lib/oci/core/models/detach_load_balancer_details.rb +167 -0
  38. data/lib/oci/core/models/image.rb +14 -1
  39. data/lib/oci/core/models/instance.rb +18 -2
  40. data/lib/oci/core/models/instance_agent_config.rb +154 -0
  41. data/lib/oci/core/models/instance_agent_features.rb +154 -0
  42. data/lib/oci/core/models/instance_pool.rb +19 -4
  43. data/lib/oci/core/models/instance_pool_instance_load_balancer_backend.rb +219 -0
  44. data/lib/oci/core/models/instance_pool_load_balancer_attachment.rb +253 -0
  45. data/lib/oci/core/models/instance_summary.rb +19 -4
  46. data/lib/oci/core/models/launch_instance_agent_config_details.rb +155 -0
  47. data/lib/oci/core/models/launch_instance_details.rb +14 -1
  48. data/lib/oci/core/models/update_instance_agent_config_details.rb +154 -0
  49. data/lib/oci/core/models/update_instance_details.rb +16 -1
  50. data/lib/oci/core/virtual_network_client.rb +1 -1
  51. data/lib/oci/database/database_client.rb +12 -14
  52. data/lib/oci/database/models/autonomous_data_warehouse_connection_strings.rb +3 -1
  53. data/lib/oci/database/models/autonomous_database_connection_strings.rb +3 -1
  54. data/lib/oci/database/models/create_data_guard_association_details.rb +2 -7
  55. data/lib/oci/database/models/create_data_guard_association_to_existing_db_system_details.rb +5 -1
  56. data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +4 -1
  57. data/lib/oci/database/models/database_summary.rb +1 -1
  58. data/lib/oci/database/models/db_node.rb +15 -1
  59. data/lib/oci/database/models/db_node_summary.rb +15 -1
  60. data/lib/oci/database/models/db_system.rb +15 -1
  61. data/lib/oci/database/models/db_system_summary.rb +15 -1
  62. data/lib/oci/database/models/db_version_summary.rb +1 -1
  63. data/lib/oci/database/models/launch_db_system_base.rb +33 -2
  64. data/lib/oci/database/models/launch_db_system_details.rb +5 -1
  65. data/lib/oci/database/models/launch_db_system_from_backup_details.rb +5 -1
  66. data/lib/oci/database/models/update_db_system_details.rb +1 -1
  67. data/lib/oci/identity/identity.rb +4 -0
  68. data/lib/oci/identity/identity_client.rb +468 -12
  69. data/lib/oci/identity/identity_client_composite_operations.rb +79 -0
  70. data/lib/oci/identity/models/change_tag_namespace_compartment_detail.rb +154 -0
  71. data/lib/oci/identity/models/create_identity_provider_details.rb +2 -1
  72. data/lib/oci/identity/models/mfa_totp_device.rb +279 -0
  73. data/lib/oci/identity/models/mfa_totp_device_summary.rb +267 -0
  74. data/lib/oci/identity/models/mfa_totp_token.rb +155 -0
  75. data/lib/oci/identity/models/tag_namespace_summary.rb +1 -1
  76. data/lib/oci/identity/models/user.rb +18 -4
  77. data/lib/oci/monitoring/models/aggregated_datapoint.rb +166 -0
  78. data/lib/oci/monitoring/models/alarm.rb +538 -0
  79. data/lib/oci/monitoring/models/alarm_history_collection.rb +183 -0
  80. data/lib/oci/monitoring/models/alarm_history_entry.rb +187 -0
  81. data/lib/oci/monitoring/models/alarm_status_summary.rb +277 -0
  82. data/lib/oci/monitoring/models/alarm_summary.rb +386 -0
  83. data/lib/oci/monitoring/models/create_alarm_details.rb +423 -0
  84. data/lib/oci/monitoring/models/datapoint.rb +179 -0
  85. data/lib/oci/monitoring/models/failed_metric_record.rb +166 -0
  86. data/lib/oci/monitoring/models/list_metrics_details.rb +271 -0
  87. data/lib/oci/monitoring/models/metric.rb +197 -0
  88. data/lib/oci/monitoring/models/metric_data.rb +243 -0
  89. data/lib/oci/monitoring/models/metric_data_details.rb +227 -0
  90. data/lib/oci/monitoring/models/post_metric_data_details.rb +194 -0
  91. data/lib/oci/monitoring/models/post_metric_data_response_details.rb +170 -0
  92. data/lib/oci/monitoring/models/summarize_metrics_data_details.rb +229 -0
  93. data/lib/oci/monitoring/models/suppression.rb +196 -0
  94. data/lib/oci/monitoring/models/update_alarm_details.rb +423 -0
  95. data/lib/oci/monitoring/monitoring.rb +37 -0
  96. data/lib/oci/monitoring/monitoring_client.rb +923 -0
  97. data/lib/oci/monitoring/monitoring_client_composite_operations.rb +145 -0
  98. data/lib/oci/monitoring/util.rb +2 -0
  99. data/lib/oci/ons/models/backoff_retry_policy.rb +192 -0
  100. data/lib/oci/ons/models/confirmation_result.rb +221 -0
  101. data/lib/oci/ons/models/create_subscription_details.rb +238 -0
  102. data/lib/oci/ons/models/create_topic_details.rb +209 -0
  103. data/lib/oci/ons/models/delivery_policy.rb +153 -0
  104. data/lib/oci/ons/models/message_details.rb +163 -0
  105. data/lib/oci/ons/models/notification_topic.rb +302 -0
  106. data/lib/oci/ons/models/notification_topic_summary.rb +303 -0
  107. data/lib/oci/ons/models/publish_result.rb +168 -0
  108. data/lib/oci/ons/models/subscription.rb +273 -0
  109. data/lib/oci/ons/models/subscription_summary.rb +300 -0
  110. data/lib/oci/ons/models/topic_attributes_details.rb +184 -0
  111. data/lib/oci/ons/models/update_subscription_details.rb +188 -0
  112. data/lib/oci/ons/notification_control_plane_client.rb +463 -0
  113. data/lib/oci/ons/notification_control_plane_client_composite_operations.rb +24 -0
  114. data/lib/oci/ons/notification_data_plane_client.rb +680 -0
  115. data/lib/oci/ons/notification_data_plane_client_composite_operations.rb +104 -0
  116. data/lib/oci/ons/ons.rb +33 -0
  117. data/lib/oci/ons/util.rb +2 -0
  118. data/lib/oci/regions.rb +5 -0
  119. data/lib/oci/resource_manager/models/apply_job_plan_resolution.rb +189 -0
  120. data/lib/oci/resource_manager/models/config_source.rb +208 -0
  121. data/lib/oci/resource_manager/models/create_config_source_details.rb +187 -0
  122. data/lib/oci/resource_manager/models/create_job_details.rb +225 -0
  123. data/lib/oci/resource_manager/models/create_stack_details.rb +239 -0
  124. data/lib/oci/resource_manager/models/create_zip_upload_config_source_details.rb +166 -0
  125. data/lib/oci/resource_manager/models/failure_details.rb +185 -0
  126. data/lib/oci/resource_manager/models/job.rb +399 -0
  127. data/lib/oci/resource_manager/models/job_summary.rb +311 -0
  128. data/lib/oci/resource_manager/models/log_entry.rb +225 -0
  129. data/lib/oci/resource_manager/models/stack.rb +305 -0
  130. data/lib/oci/resource_manager/models/stack_summary.rb +249 -0
  131. data/lib/oci/resource_manager/models/update_config_source_details.rb +184 -0
  132. data/lib/oci/resource_manager/models/update_job_details.rb +188 -0
  133. data/lib/oci/resource_manager/models/update_stack_details.rb +225 -0
  134. data/lib/oci/resource_manager/models/update_zip_upload_config_source_details.rb +164 -0
  135. data/lib/oci/resource_manager/models/zip_upload_config_source.rb +149 -0
  136. data/lib/oci/resource_manager/resource_manager.rb +36 -0
  137. data/lib/oci/resource_manager/resource_manager_client.rb +1264 -0
  138. data/lib/oci/resource_manager/resource_manager_client_composite_operations.rb +263 -0
  139. data/lib/oci/resource_manager/util.rb +2 -0
  140. data/lib/oci/version.rb +1 -1
  141. metadata +100 -2
@@ -0,0 +1,184 @@
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
+ # The configuration details for updating the topic.
8
+ #
9
+ class Ons::Models::TopicAttributesDetails # rubocop:disable Metrics/LineLength
10
+ # **[Required]** The description of the topic. Avoid entering confidential information.
11
+ # @return [String]
12
+ attr_accessor :description
13
+
14
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
15
+ #
16
+ # Example: `{\"Department\": \"Finance\"}`
17
+ #
18
+ # @return [Hash<String, String>]
19
+ attr_accessor :freeform_tags
20
+
21
+ # 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).
22
+ #
23
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
24
+ #
25
+ # @return [Hash<String, Hash<String, Object>>]
26
+ attr_accessor :defined_tags
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ # rubocop:disable Style/SymbolLiteral
32
+ 'description': :'description',
33
+ 'freeform_tags': :'freeformTags',
34
+ 'defined_tags': :'definedTags'
35
+ # rubocop:enable Style/SymbolLiteral
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ # rubocop:disable Style/SymbolLiteral
43
+ 'description': :'String',
44
+ 'freeform_tags': :'Hash<String, String>',
45
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
46
+ # rubocop:enable Style/SymbolLiteral
47
+ }
48
+ end
49
+
50
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
51
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
52
+
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ # @option attributes [String] :description The value to assign to the {#description} property
57
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
58
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
59
+ def initialize(attributes = {})
60
+ return unless attributes.is_a?(Hash)
61
+
62
+ # convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
64
+
65
+ self.description = attributes[:'description'] if attributes[:'description']
66
+
67
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
68
+
69
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
70
+
71
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
72
+
73
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
74
+
75
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
76
+
77
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
78
+ end
79
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
80
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
81
+
82
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
83
+
84
+
85
+ # Checks equality by comparing each attribute.
86
+ # @param [Object] other the other object to be compared
87
+ def ==(other)
88
+ return true if equal?(other)
89
+
90
+ self.class == other.class &&
91
+ description == other.description &&
92
+ freeform_tags == other.freeform_tags &&
93
+ defined_tags == other.defined_tags
94
+ end
95
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
96
+
97
+ # @see the `==` method
98
+ # @param [Object] other the other object to be compared
99
+ def eql?(other)
100
+ self == other
101
+ end
102
+
103
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
104
+
105
+
106
+ # Calculates hash code according to all attributes.
107
+ # @return [Fixnum] Hash code
108
+ def hash
109
+ [description, freeform_tags, defined_tags].hash
110
+ end
111
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
112
+
113
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
114
+
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+
122
+ self.class.swagger_types.each_pair do |key, type|
123
+ if type =~ /^Array<(.*)>/i
124
+ # check to ensure the input is an array given that the the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ public_method("#{key}=").call(
128
+ attributes[self.class.attribute_map[key]]
129
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
130
+ )
131
+ end
132
+ elsif !attributes[self.class.attribute_map[key]].nil?
133
+ public_method("#{key}=").call(
134
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
135
+ )
136
+ end
137
+ # or else data not found in attributes(hash), not an issue as the data can be optional
138
+ end
139
+
140
+ self
141
+ end
142
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
143
+
144
+ # Returns the string representation of the object
145
+ # @return [String] String presentation of the object
146
+ def to_s
147
+ to_hash.to_s
148
+ end
149
+
150
+ # Returns the object in the form of hash
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_hash
153
+ hash = {}
154
+ self.class.attribute_map.each_pair do |attr, param|
155
+ value = public_method(attr).call
156
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ private
164
+
165
+ # Outputs non-array value in the form of hash
166
+ # For object, use to_hash. Otherwise, just return the value
167
+ # @param [Object] value Any valid value
168
+ # @return [Hash] Returns the value in the form of hash
169
+ def _to_hash(value)
170
+ if value.is_a?(Array)
171
+ value.compact.map { |v| _to_hash(v) }
172
+ elsif value.is_a?(Hash)
173
+ {}.tap do |hash|
174
+ value.each { |k, v| hash[k] = _to_hash(v) }
175
+ end
176
+ elsif value.respond_to? :to_hash
177
+ value.to_hash
178
+ else
179
+ value
180
+ end
181
+ end
182
+ end
183
+ end
184
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,188 @@
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
+ # The configuration details for updating the subscription.
8
+ #
9
+ class Ons::Models::UpdateSubscriptionDetails # rubocop:disable Metrics/LineLength
10
+ # The delivery policy of the subscription. Stored as a JSON string.
11
+ # @return [OCI::Ons::Models::DeliveryPolicy]
12
+ attr_accessor :delivery_policy
13
+
14
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
15
+ #
16
+ # Example: `{\"Department\": \"Finance\"}`
17
+ #
18
+ # @return [Hash<String, String>]
19
+ attr_accessor :freeform_tags
20
+
21
+ # 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).
22
+ #
23
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
24
+ #
25
+ # @return [Hash<String, Hash<String, Object>>]
26
+ attr_accessor :defined_tags
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ # rubocop:disable Style/SymbolLiteral
32
+ 'delivery_policy': :'deliveryPolicy',
33
+ 'freeform_tags': :'freeformTags',
34
+ 'defined_tags': :'definedTags'
35
+ # rubocop:enable Style/SymbolLiteral
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ # rubocop:disable Style/SymbolLiteral
43
+ 'delivery_policy': :'OCI::Ons::Models::DeliveryPolicy',
44
+ 'freeform_tags': :'Hash<String, String>',
45
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
46
+ # rubocop:enable Style/SymbolLiteral
47
+ }
48
+ end
49
+
50
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
51
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
52
+
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ # @option attributes [OCI::Ons::Models::DeliveryPolicy] :delivery_policy The value to assign to the {#delivery_policy} property
57
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
58
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
59
+ def initialize(attributes = {})
60
+ return unless attributes.is_a?(Hash)
61
+
62
+ # convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
64
+
65
+ self.delivery_policy = attributes[:'deliveryPolicy'] if attributes[:'deliveryPolicy']
66
+
67
+ raise 'You cannot provide both :deliveryPolicy and :delivery_policy' if attributes.key?(:'deliveryPolicy') && attributes.key?(:'delivery_policy')
68
+
69
+ self.delivery_policy = attributes[:'delivery_policy'] if attributes[:'delivery_policy']
70
+
71
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
72
+
73
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
74
+
75
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
76
+
77
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
78
+
79
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
80
+
81
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
82
+ end
83
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
84
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
85
+
86
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
87
+
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] other the other object to be compared
91
+ def ==(other)
92
+ return true if equal?(other)
93
+
94
+ self.class == other.class &&
95
+ delivery_policy == other.delivery_policy &&
96
+ freeform_tags == other.freeform_tags &&
97
+ defined_tags == other.defined_tags
98
+ end
99
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
100
+
101
+ # @see the `==` method
102
+ # @param [Object] other the other object to be compared
103
+ def eql?(other)
104
+ self == other
105
+ end
106
+
107
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
108
+
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Fixnum] Hash code
112
+ def hash
113
+ [delivery_policy, freeform_tags, defined_tags].hash
114
+ end
115
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
116
+
117
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
118
+
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+
126
+ self.class.swagger_types.each_pair do |key, type|
127
+ if type =~ /^Array<(.*)>/i
128
+ # check to ensure the input is an array given that the the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ public_method("#{key}=").call(
132
+ attributes[self.class.attribute_map[key]]
133
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
134
+ )
135
+ end
136
+ elsif !attributes[self.class.attribute_map[key]].nil?
137
+ public_method("#{key}=").call(
138
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
139
+ )
140
+ end
141
+ # or else data not found in attributes(hash), not an issue as the data can be optional
142
+ end
143
+
144
+ self
145
+ end
146
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
147
+
148
+ # Returns the string representation of the object
149
+ # @return [String] String presentation of the object
150
+ def to_s
151
+ to_hash.to_s
152
+ end
153
+
154
+ # Returns the object in the form of hash
155
+ # @return [Hash] Returns the object in the form of hash
156
+ def to_hash
157
+ hash = {}
158
+ self.class.attribute_map.each_pair do |attr, param|
159
+ value = public_method(attr).call
160
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
161
+
162
+ hash[param] = _to_hash(value)
163
+ end
164
+ hash
165
+ end
166
+
167
+ private
168
+
169
+ # Outputs non-array value in the form of hash
170
+ # For object, use to_hash. Otherwise, just return the value
171
+ # @param [Object] value Any valid value
172
+ # @return [Hash] Returns the value in the form of hash
173
+ def _to_hash(value)
174
+ if value.is_a?(Array)
175
+ value.compact.map { |v| _to_hash(v) }
176
+ elsif value.is_a?(Hash)
177
+ {}.tap do |hash|
178
+ value.each { |k, v| hash[k] = _to_hash(v) }
179
+ end
180
+ elsif value.respond_to? :to_hash
181
+ value.to_hash
182
+ else
183
+ value
184
+ end
185
+ end
186
+ end
187
+ end
188
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,463 @@
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
+ # Use the Notification API to broadcast messages to distributed components by topic, using a publish-subscribe pattern.
9
+ # For information about managing topics, subscriptions, and messages, see [Notification Overview](/iaas/Content/Notification/Concepts/notificationoverview.htm).
10
+ class Ons::NotificationControlPlaneClient
11
+ # Client used to make HTTP requests.
12
+ # @return [OCI::ApiClient]
13
+ attr_reader :api_client
14
+
15
+ # Fully qualified endpoint URL
16
+ # @return [String]
17
+ attr_reader :endpoint
18
+
19
+ # The default retry configuration to apply to all operations in this service client. This can be overridden
20
+ # on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
21
+ # will not perform any retries
22
+ # @return [OCI::Retry::RetryConfig]
23
+ attr_reader :retry_config
24
+
25
+ # The region, which will usually correspond to a value in {OCI::Regions::REGION_ENUM}.
26
+ # @return [String]
27
+ attr_reader :region
28
+
29
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
30
+
31
+
32
+ # Creates a new NotificationControlPlaneClient.
33
+ # Notes:
34
+ # If a config is not specified, then the global OCI.config will be used.
35
+ #
36
+ # This client is not thread-safe
37
+ #
38
+ # Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the
39
+ # region. A region may be specified in the config or via or the region parameter. If specified in both, then the
40
+ # region parameter will be used.
41
+ # @param [Config] config A Config object.
42
+ # @param [String] region A region used to determine the service endpoint. This will usually
43
+ # correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
44
+ # @param [String] endpoint The fully qualified endpoint URL
45
+ # @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
46
+ # a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
47
+ # so that the instance principals signer can be provided to the client
48
+ # @param [OCI::ApiClientProxySettings] proxy_settings If your environment requires you to use a proxy server for outgoing HTTP requests
49
+ # the details for the proxy can be provided in this parameter
50
+ # @param [OCI::Retry::RetryConfig] retry_config The retry configuration for this service client. This represents the default retry configuration to
51
+ # 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
52
+ # will not perform any retries
53
+ def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
54
+ # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
55
+ # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
56
+ # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
57
+ # pass it to this constructor.
58
+ #
59
+ # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
60
+ # so try and load the config from the default file.
61
+ config ||= OCI.config unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
62
+ config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
63
+ config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
64
+
65
+ if signer.nil?
66
+ signer = OCI::Signer.new(
67
+ config.user,
68
+ config.fingerprint,
69
+ config.tenancy,
70
+ config.key_file,
71
+ pass_phrase: config.pass_phrase,
72
+ private_key_content: config.key_content
73
+ )
74
+ end
75
+
76
+ @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
77
+ @retry_config = retry_config
78
+
79
+ if endpoint
80
+ @endpoint = endpoint + '/20181201'
81
+ else
82
+ region ||= config.region
83
+ region ||= signer.region if signer.respond_to?(:region)
84
+ self.region = region
85
+ end
86
+ logger.info "NotificationControlPlaneClient endpoint set to '#{@endpoint}'." if logger
87
+ end
88
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
89
+
90
+ # Set the region that will be used to determine the service endpoint.
91
+ # This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
92
+ # but may be an arbitrary string.
93
+ def region=(new_region)
94
+ @region = new_region
95
+
96
+ raise 'A region must be specified.' unless @region
97
+
98
+ @endpoint = OCI::Regions.get_service_endpoint(@region, :NotificationControlPlaneClient) + '/20181201'
99
+ logger.info "NotificationControlPlaneClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
100
+ end
101
+
102
+ # @return [Logger] The logger for this client. May be nil.
103
+ def logger
104
+ @api_client.config.logger
105
+ end
106
+
107
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
108
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
109
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
110
+
111
+
112
+ # Creates a topic in the specified compartment. For general information about topics, see
113
+ # [Managing Topics and Subscriptions](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/Notification/Tasks/managingtopicsandsubscriptions.htm).
114
+ #
115
+ # For the purposes of access control, you must provide the OCID of the compartment where you want the topic to reside.
116
+ # For information about access control and compartments, see [Overview of the IAM Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm).
117
+ #
118
+ # You must specify a display name for the topic.
119
+ #
120
+ # All Oracle Cloud Infrastructure resources, including topics, get an Oracle-assigned, unique ID called an
121
+ # Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response. You can also
122
+ # retrieve a resource's OCID by using a List API operation on that resource type, or by viewing the resource in the
123
+ # Console. Fore more information, see [Resource Identifiers](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
124
+ #
125
+ # @param [OCI::Ons::Models::CreateTopicDetails] create_topic_details The topic to create.
126
+ # @param [Hash] opts the optional parameters
127
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
128
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
129
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
130
+ # server error without risk of executing that same action again. Retry tokens expire after 24
131
+ # hours, but can be invalidated before that due to conflicting operations (for example, if a resource
132
+ # has been deleted and purged from the system, then a retry of the original creation request
133
+ # may be rejected).
134
+ #
135
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
136
+ # particular request, please provide the request ID.
137
+ #
138
+ # @return [Response] A Response object with data of type {OCI::Ons::Models::NotificationTopic NotificationTopic}
139
+ def create_topic(create_topic_details, opts = {})
140
+ logger.debug 'Calling operation NotificationControlPlaneClient#create_topic.' if logger
141
+
142
+ raise "Missing the required parameter 'create_topic_details' when calling create_topic." if create_topic_details.nil?
143
+
144
+ path = '/topics'
145
+ operation_signing_strategy = :standard
146
+
147
+ # rubocop:disable Style/NegatedIf
148
+ # Query Params
149
+ query_params = {}
150
+
151
+ # Header Params
152
+ header_params = {}
153
+ header_params[:accept] = 'application/json'
154
+ header_params[:'content-type'] = 'application/json'
155
+ header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
156
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
157
+ # rubocop:enable Style/NegatedIf
158
+ header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
159
+
160
+ post_body = @api_client.object_to_http_body(create_topic_details)
161
+
162
+ # rubocop:disable Metrics/BlockLength
163
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NotificationControlPlaneClient#create_topic') do
164
+ @api_client.call_api(
165
+ :POST,
166
+ path,
167
+ endpoint,
168
+ header_params: header_params,
169
+ query_params: query_params,
170
+ operation_signing_strategy: operation_signing_strategy,
171
+ body: post_body,
172
+ return_type: 'OCI::Ons::Models::NotificationTopic'
173
+ )
174
+ end
175
+ # rubocop:enable Metrics/BlockLength
176
+ end
177
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
178
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
179
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
180
+
181
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
182
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
183
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
184
+
185
+
186
+ # Deletes the specified topic.
187
+ #
188
+ # @param [String] topic_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the topic to delete.
189
+ #
190
+ # @param [Hash] opts the optional parameters
191
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
192
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
193
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
194
+ # particular request, please provide the request ID.
195
+ #
196
+ # @option opts [String] :if_match Used for optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
197
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
198
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
199
+ #
200
+ # @return [Response] A Response object with data of type nil
201
+ def delete_topic(topic_id, opts = {})
202
+ logger.debug 'Calling operation NotificationControlPlaneClient#delete_topic.' if logger
203
+
204
+ raise "Missing the required parameter 'topic_id' when calling delete_topic." if topic_id.nil?
205
+ raise "Parameter value for 'topic_id' must not be blank" if OCI::Internal::Util.blank_string?(topic_id)
206
+
207
+ path = '/topics/{topicId}'.sub('{topicId}', topic_id.to_s)
208
+ operation_signing_strategy = :standard
209
+
210
+ # rubocop:disable Style/NegatedIf
211
+ # Query Params
212
+ query_params = {}
213
+
214
+ # Header Params
215
+ header_params = {}
216
+ header_params[:accept] = 'application/json'
217
+ header_params[:'content-type'] = 'application/json'
218
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
219
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
220
+ # rubocop:enable Style/NegatedIf
221
+
222
+ post_body = nil
223
+
224
+ # rubocop:disable Metrics/BlockLength
225
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NotificationControlPlaneClient#delete_topic') do
226
+ @api_client.call_api(
227
+ :DELETE,
228
+ path,
229
+ endpoint,
230
+ header_params: header_params,
231
+ query_params: query_params,
232
+ operation_signing_strategy: operation_signing_strategy,
233
+ body: post_body
234
+ )
235
+ end
236
+ # rubocop:enable Metrics/BlockLength
237
+ end
238
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
239
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
240
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
241
+
242
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
243
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
244
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
245
+
246
+
247
+ # Gets the specified topic's configuration information.
248
+ #
249
+ # @param [String] topic_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the topic to retrieve.
250
+ #
251
+ # @param [Hash] opts the optional parameters
252
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
253
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
254
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
255
+ # particular request, please provide the request ID.
256
+ #
257
+ # @return [Response] A Response object with data of type {OCI::Ons::Models::NotificationTopic NotificationTopic}
258
+ def get_topic(topic_id, opts = {})
259
+ logger.debug 'Calling operation NotificationControlPlaneClient#get_topic.' if logger
260
+
261
+ raise "Missing the required parameter 'topic_id' when calling get_topic." if topic_id.nil?
262
+ raise "Parameter value for 'topic_id' must not be blank" if OCI::Internal::Util.blank_string?(topic_id)
263
+
264
+ path = '/topics/{topicId}'.sub('{topicId}', topic_id.to_s)
265
+ operation_signing_strategy = :standard
266
+
267
+ # rubocop:disable Style/NegatedIf
268
+ # Query Params
269
+ query_params = {}
270
+
271
+ # Header Params
272
+ header_params = {}
273
+ header_params[:accept] = 'application/json'
274
+ header_params[:'content-type'] = 'application/json'
275
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
276
+ # rubocop:enable Style/NegatedIf
277
+
278
+ post_body = nil
279
+
280
+ # rubocop:disable Metrics/BlockLength
281
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NotificationControlPlaneClient#get_topic') do
282
+ @api_client.call_api(
283
+ :GET,
284
+ path,
285
+ endpoint,
286
+ header_params: header_params,
287
+ query_params: query_params,
288
+ operation_signing_strategy: operation_signing_strategy,
289
+ body: post_body,
290
+ return_type: 'OCI::Ons::Models::NotificationTopic'
291
+ )
292
+ end
293
+ # rubocop:enable Metrics/BlockLength
294
+ end
295
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
296
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
297
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
298
+
299
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
300
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
301
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
302
+
303
+
304
+ # Lists topics in the specified compartment.
305
+ #
306
+ # @param [String] compartment_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment.
307
+ #
308
+ # @param [Hash] opts the optional parameters
309
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
310
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
311
+ # @option opts [String] :id A filter to only return resources that match the given id exactly.
312
+ #
313
+ # @option opts [String] :name A filter to only return resources that match the given name exactly.
314
+ #
315
+ # @option opts [String] :page For list pagination. The value of the opc-next-page response header from the previous \"List\" call. For important details about how pagination works, see [List Pagination](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
316
+ #
317
+ # @option opts [Integer] :limit For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
318
+ # (default to 10)
319
+ # @option opts [String] :sort_by The field to sort by. Only one field can be selected for sorting. Default value: TIMECREATED.
320
+ # (default to TIMECREATED)
321
+ # Allowed values are: TIMECREATED, LIFECYCLESTATE
322
+ # @option opts [String] :sort_order The sort order to use (ascending or descending). Default value: ASC.
323
+ # (default to ASC)
324
+ # Allowed values are: ASC, DESC
325
+ # @option opts [String] :lifecycle_state Filter returned list by specified lifecycle state. This parameter is case-insensitive.
326
+ #
327
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
328
+ # particular request, please provide the request ID.
329
+ #
330
+ # @return [Response] A Response object with data of type Array<{OCI::Ons::Models::NotificationTopicSummary NotificationTopicSummary}>
331
+ def list_topics(compartment_id, opts = {})
332
+ logger.debug 'Calling operation NotificationControlPlaneClient#list_topics.' if logger
333
+
334
+ raise "Missing the required parameter 'compartment_id' when calling list_topics." if compartment_id.nil?
335
+
336
+ if opts[:sort_by] && !%w[TIMECREATED LIFECYCLESTATE].include?(opts[:sort_by])
337
+ raise 'Invalid value for "sort_by", must be one of TIMECREATED, LIFECYCLESTATE.'
338
+ end
339
+
340
+ if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
341
+ raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
342
+ end
343
+
344
+ if opts[:lifecycle_state] && !OCI::Ons::Models::NotificationTopicSummary::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
345
+ raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Ons::Models::NotificationTopicSummary::LIFECYCLE_STATE_ENUM.'
346
+ end
347
+
348
+ path = '/topics'
349
+ operation_signing_strategy = :standard
350
+
351
+ # rubocop:disable Style/NegatedIf
352
+ # Query Params
353
+ query_params = {}
354
+ query_params[:compartmentId] = compartment_id
355
+ query_params[:id] = opts[:id] if opts[:id]
356
+ query_params[:name] = opts[:name] if opts[:name]
357
+ query_params[:page] = opts[:page] if opts[:page]
358
+ query_params[:limit] = opts[:limit] if opts[:limit]
359
+ query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
360
+ query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
361
+ query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
362
+
363
+ # Header Params
364
+ header_params = {}
365
+ header_params[:accept] = 'application/json'
366
+ header_params[:'content-type'] = 'application/json'
367
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
368
+ # rubocop:enable Style/NegatedIf
369
+
370
+ post_body = nil
371
+
372
+ # rubocop:disable Metrics/BlockLength
373
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NotificationControlPlaneClient#list_topics') do
374
+ @api_client.call_api(
375
+ :GET,
376
+ path,
377
+ endpoint,
378
+ header_params: header_params,
379
+ query_params: query_params,
380
+ operation_signing_strategy: operation_signing_strategy,
381
+ body: post_body,
382
+ return_type: 'Array<OCI::Ons::Models::NotificationTopicSummary>'
383
+ )
384
+ end
385
+ # rubocop:enable Metrics/BlockLength
386
+ end
387
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
388
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
389
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
390
+
391
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
392
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
393
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
394
+
395
+
396
+ # Updates the specified topic's configuration.
397
+ #
398
+ # @param [String] topic_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the topic to update.
399
+ #
400
+ # @param [Hash] opts the optional parameters
401
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
402
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
403
+ # @option opts [OCI::Ons::Models::TopicAttributesDetails] :topic_attributes_details TopicAttributes
404
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
405
+ # particular request, please provide the request ID.
406
+ #
407
+ # @option opts [String] :if_match Used for optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
408
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
409
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
410
+ #
411
+ # @return [Response] A Response object with data of type {OCI::Ons::Models::NotificationTopic NotificationTopic}
412
+ def update_topic(topic_id, opts = {})
413
+ logger.debug 'Calling operation NotificationControlPlaneClient#update_topic.' if logger
414
+
415
+ raise "Missing the required parameter 'topic_id' when calling update_topic." if topic_id.nil?
416
+ raise "Parameter value for 'topic_id' must not be blank" if OCI::Internal::Util.blank_string?(topic_id)
417
+
418
+ path = '/topics/{topicId}'.sub('{topicId}', topic_id.to_s)
419
+ operation_signing_strategy = :standard
420
+
421
+ # rubocop:disable Style/NegatedIf
422
+ # Query Params
423
+ query_params = {}
424
+
425
+ # Header Params
426
+ header_params = {}
427
+ header_params[:accept] = 'application/json'
428
+ header_params[:'content-type'] = 'application/json'
429
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
430
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
431
+ # rubocop:enable Style/NegatedIf
432
+
433
+ post_body = @api_client.object_to_http_body(opts[:topic_attributes_details])
434
+
435
+ # rubocop:disable Metrics/BlockLength
436
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NotificationControlPlaneClient#update_topic') do
437
+ @api_client.call_api(
438
+ :PUT,
439
+ path,
440
+ endpoint,
441
+ header_params: header_params,
442
+ query_params: query_params,
443
+ operation_signing_strategy: operation_signing_strategy,
444
+ body: post_body,
445
+ return_type: 'OCI::Ons::Models::NotificationTopic'
446
+ )
447
+ end
448
+ # rubocop:enable Metrics/BlockLength
449
+ end
450
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
451
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
452
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
453
+
454
+ private
455
+
456
+ def applicable_retry_config(opts = {})
457
+ return @retry_config unless opts.key?(:retry_config)
458
+
459
+ opts[:retry_config]
460
+ end
461
+ end
462
+ end
463
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength