oci 2.5.0 → 2.5.1

Sign up to get free protection for your applications and to get access to all the features.
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,273 @@
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
+ # The subscription's configuration.
9
+ #
10
+ class Ons::Models::Subscription # rubocop:disable Metrics/LineLength
11
+ LIFECYCLE_STATE_ENUM = [
12
+ LIFECYCLE_STATE_PENDING = 'PENDING'.freeze,
13
+ LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
14
+ LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
15
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
16
+ ].freeze
17
+
18
+ # **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription.
19
+ #
20
+ # @return [String]
21
+ attr_accessor :id
22
+
23
+ # **[Required]** The subscription protocol. Valid values: EMAIL, HTTPS.
24
+ #
25
+ # @return [String]
26
+ attr_accessor :protocol
27
+
28
+ # **[Required]** The endpoint of the subscription. Valid values depend on the protocol.
29
+ # For EMAIL, only an email address is valid. For HTTPS, only a PagerDuty URL is valid. A URL cannot exceed 512 characters.
30
+ # Avoid entering confidential information.
31
+ #
32
+ # @return [String]
33
+ attr_accessor :endpoint
34
+
35
+ # **[Required]** The lifecycle state of the subscription.
36
+ # @return [String]
37
+ attr_reader :lifecycle_state
38
+
39
+ # The delivery policy of the subscription. Stored as a JSON string.
40
+ # @return [String]
41
+ attr_accessor :deliver_policy
42
+
43
+ # For optimistic concurrency control. See `if-match`.
44
+ #
45
+ # @return [String]
46
+ attr_accessor :etag
47
+
48
+ # 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).
49
+ #
50
+ # Example: `{\"Department\": \"Finance\"}`
51
+ #
52
+ # @return [Hash<String, String>]
53
+ attr_accessor :freeform_tags
54
+
55
+ # 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).
56
+ #
57
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
58
+ #
59
+ # @return [Hash<String, Hash<String, Object>>]
60
+ attr_accessor :defined_tags
61
+
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ # rubocop:disable Style/SymbolLiteral
66
+ 'id': :'id',
67
+ 'protocol': :'protocol',
68
+ 'endpoint': :'endpoint',
69
+ 'lifecycle_state': :'lifecycleState',
70
+ 'deliver_policy': :'deliverPolicy',
71
+ 'etag': :'etag',
72
+ 'freeform_tags': :'freeformTags',
73
+ 'defined_tags': :'definedTags'
74
+ # rubocop:enable Style/SymbolLiteral
75
+ }
76
+ end
77
+
78
+ # Attribute type mapping.
79
+ def self.swagger_types
80
+ {
81
+ # rubocop:disable Style/SymbolLiteral
82
+ 'id': :'String',
83
+ 'protocol': :'String',
84
+ 'endpoint': :'String',
85
+ 'lifecycle_state': :'String',
86
+ 'deliver_policy': :'String',
87
+ 'etag': :'String',
88
+ 'freeform_tags': :'Hash<String, String>',
89
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
90
+ # rubocop:enable Style/SymbolLiteral
91
+ }
92
+ end
93
+
94
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
95
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
96
+
97
+
98
+ # Initializes the object
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @option attributes [String] :id The value to assign to the {#id} property
101
+ # @option attributes [String] :protocol The value to assign to the {#protocol} property
102
+ # @option attributes [String] :endpoint The value to assign to the {#endpoint} property
103
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
104
+ # @option attributes [String] :deliver_policy The value to assign to the {#deliver_policy} property
105
+ # @option attributes [String] :etag The value to assign to the {#etag} property
106
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
107
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
108
+ def initialize(attributes = {})
109
+ return unless attributes.is_a?(Hash)
110
+
111
+ # convert string to symbol for hash key
112
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
113
+
114
+ self.id = attributes[:'id'] if attributes[:'id']
115
+
116
+ self.protocol = attributes[:'protocol'] if attributes[:'protocol']
117
+
118
+ self.endpoint = attributes[:'endpoint'] if attributes[:'endpoint']
119
+
120
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
121
+ self.lifecycle_state = "PENDING" if lifecycle_state.nil? && !attributes.key?(:'lifecycleState') # rubocop:disable Style/StringLiterals
122
+
123
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
124
+
125
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
126
+ self.lifecycle_state = "PENDING" if lifecycle_state.nil? && !attributes.key?(:'lifecycleState') && !attributes.key?(:'lifecycle_state') # rubocop:disable Style/StringLiterals
127
+
128
+ self.deliver_policy = attributes[:'deliverPolicy'] if attributes[:'deliverPolicy']
129
+
130
+ raise 'You cannot provide both :deliverPolicy and :deliver_policy' if attributes.key?(:'deliverPolicy') && attributes.key?(:'deliver_policy')
131
+
132
+ self.deliver_policy = attributes[:'deliver_policy'] if attributes[:'deliver_policy']
133
+
134
+ self.etag = attributes[:'etag'] if attributes[:'etag']
135
+
136
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
137
+
138
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
139
+
140
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
141
+
142
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
143
+
144
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
145
+
146
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
147
+ end
148
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
149
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
150
+
151
+ # Custom attribute writer method checking allowed values (enum).
152
+ # @param [Object] lifecycle_state Object to be assigned
153
+ def lifecycle_state=(lifecycle_state)
154
+ # rubocop:disable Style/ConditionalAssignment
155
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
156
+ # rubocop: disable Metrics/LineLength
157
+ OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
158
+ # rubocop: enable Metrics/LineLength
159
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
160
+ else
161
+ @lifecycle_state = lifecycle_state
162
+ end
163
+ # rubocop:enable Style/ConditionalAssignment
164
+ end
165
+
166
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
167
+
168
+
169
+ # Checks equality by comparing each attribute.
170
+ # @param [Object] other the other object to be compared
171
+ def ==(other)
172
+ return true if equal?(other)
173
+
174
+ self.class == other.class &&
175
+ id == other.id &&
176
+ protocol == other.protocol &&
177
+ endpoint == other.endpoint &&
178
+ lifecycle_state == other.lifecycle_state &&
179
+ deliver_policy == other.deliver_policy &&
180
+ etag == other.etag &&
181
+ freeform_tags == other.freeform_tags &&
182
+ defined_tags == other.defined_tags
183
+ end
184
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
185
+
186
+ # @see the `==` method
187
+ # @param [Object] other the other object to be compared
188
+ def eql?(other)
189
+ self == other
190
+ end
191
+
192
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
193
+
194
+
195
+ # Calculates hash code according to all attributes.
196
+ # @return [Fixnum] Hash code
197
+ def hash
198
+ [id, protocol, endpoint, lifecycle_state, deliver_policy, etag, freeform_tags, defined_tags].hash
199
+ end
200
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
201
+
202
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
203
+
204
+
205
+ # Builds the object from hash
206
+ # @param [Hash] attributes Model attributes in the form of hash
207
+ # @return [Object] Returns the model itself
208
+ def build_from_hash(attributes)
209
+ return nil unless attributes.is_a?(Hash)
210
+
211
+ self.class.swagger_types.each_pair do |key, type|
212
+ if type =~ /^Array<(.*)>/i
213
+ # check to ensure the input is an array given that the the attribute
214
+ # is documented as an array but the input is not
215
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
216
+ public_method("#{key}=").call(
217
+ attributes[self.class.attribute_map[key]]
218
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
219
+ )
220
+ end
221
+ elsif !attributes[self.class.attribute_map[key]].nil?
222
+ public_method("#{key}=").call(
223
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
224
+ )
225
+ end
226
+ # or else data not found in attributes(hash), not an issue as the data can be optional
227
+ end
228
+
229
+ self
230
+ end
231
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
232
+
233
+ # Returns the string representation of the object
234
+ # @return [String] String presentation of the object
235
+ def to_s
236
+ to_hash.to_s
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = public_method(attr).call
245
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
246
+
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ private
253
+
254
+ # Outputs non-array value in the form of hash
255
+ # For object, use to_hash. Otherwise, just return the value
256
+ # @param [Object] value Any valid value
257
+ # @return [Hash] Returns the value in the form of hash
258
+ def _to_hash(value)
259
+ if value.is_a?(Array)
260
+ value.compact.map { |v| _to_hash(v) }
261
+ elsif value.is_a?(Hash)
262
+ {}.tap do |hash|
263
+ value.each { |k, v| hash[k] = _to_hash(v) }
264
+ end
265
+ elsif value.respond_to? :to_hash
266
+ value.to_hash
267
+ else
268
+ value
269
+ end
270
+ end
271
+ end
272
+ end
273
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,300 @@
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
+ # The subscription's configuration summary.
9
+ #
10
+ class Ons::Models::SubscriptionSummary # rubocop:disable Metrics/LineLength
11
+ LIFECYCLE_STATE_ENUM = [
12
+ LIFECYCLE_STATE_PENDING = 'PENDING'.freeze,
13
+ LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
14
+ LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
15
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
16
+ ].freeze
17
+
18
+ # **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription.
19
+ #
20
+ # @return [String]
21
+ attr_accessor :id
22
+
23
+ # **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the associated topic.
24
+ #
25
+ # @return [String]
26
+ attr_accessor :topic_id
27
+
28
+ # **[Required]** The protocol used for the subscription. Valid values: EMAIL, HTTPS.
29
+ #
30
+ # @return [String]
31
+ attr_accessor :protocol
32
+
33
+ # **[Required]** The endpoint of the subscription. Valid values depend on the protocol.
34
+ # For EMAIL, only an email address is valid. For HTTPS, only a PagerDuty URL is valid. A URL cannot exceed 512 characters.
35
+ # Avoid entering confidential information.
36
+ #
37
+ # @return [String]
38
+ attr_accessor :endpoint
39
+
40
+ # **[Required]** The lifecycle state of the subscription. Default value for a newly created subscription: PENDING.
41
+ #
42
+ # @return [String]
43
+ attr_reader :lifecycle_state
44
+
45
+ # The time when this suscription was created.
46
+ # @return [Integer]
47
+ attr_accessor :created_time
48
+
49
+ # @return [OCI::Ons::Models::DeliveryPolicy]
50
+ attr_accessor :delivery_policy
51
+
52
+ # For optimistic concurrency control. See `if-match`.
53
+ #
54
+ # @return [String]
55
+ attr_accessor :etag
56
+
57
+ # 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).
58
+ #
59
+ # Example: `{\"Department\": \"Finance\"}`
60
+ #
61
+ # @return [Hash<String, String>]
62
+ attr_accessor :freeform_tags
63
+
64
+ # 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).
65
+ #
66
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
67
+ #
68
+ # @return [Hash<String, Hash<String, Object>>]
69
+ attr_accessor :defined_tags
70
+
71
+ # Attribute mapping from ruby-style variable name to JSON key.
72
+ def self.attribute_map
73
+ {
74
+ # rubocop:disable Style/SymbolLiteral
75
+ 'id': :'id',
76
+ 'topic_id': :'topicId',
77
+ 'protocol': :'protocol',
78
+ 'endpoint': :'endpoint',
79
+ 'lifecycle_state': :'lifecycleState',
80
+ 'created_time': :'createdTime',
81
+ 'delivery_policy': :'deliveryPolicy',
82
+ 'etag': :'etag',
83
+ 'freeform_tags': :'freeformTags',
84
+ 'defined_tags': :'definedTags'
85
+ # rubocop:enable Style/SymbolLiteral
86
+ }
87
+ end
88
+
89
+ # Attribute type mapping.
90
+ def self.swagger_types
91
+ {
92
+ # rubocop:disable Style/SymbolLiteral
93
+ 'id': :'String',
94
+ 'topic_id': :'String',
95
+ 'protocol': :'String',
96
+ 'endpoint': :'String',
97
+ 'lifecycle_state': :'String',
98
+ 'created_time': :'Integer',
99
+ 'delivery_policy': :'OCI::Ons::Models::DeliveryPolicy',
100
+ 'etag': :'String',
101
+ 'freeform_tags': :'Hash<String, String>',
102
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
103
+ # rubocop:enable Style/SymbolLiteral
104
+ }
105
+ end
106
+
107
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
108
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
109
+
110
+
111
+ # Initializes the object
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @option attributes [String] :id The value to assign to the {#id} property
114
+ # @option attributes [String] :topic_id The value to assign to the {#topic_id} property
115
+ # @option attributes [String] :protocol The value to assign to the {#protocol} property
116
+ # @option attributes [String] :endpoint The value to assign to the {#endpoint} property
117
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
118
+ # @option attributes [Integer] :created_time The value to assign to the {#created_time} property
119
+ # @option attributes [OCI::Ons::Models::DeliveryPolicy] :delivery_policy The value to assign to the {#delivery_policy} property
120
+ # @option attributes [String] :etag The value to assign to the {#etag} property
121
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
122
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
123
+ def initialize(attributes = {})
124
+ return unless attributes.is_a?(Hash)
125
+
126
+ # convert string to symbol for hash key
127
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
128
+
129
+ self.id = attributes[:'id'] if attributes[:'id']
130
+
131
+ self.topic_id = attributes[:'topicId'] if attributes[:'topicId']
132
+
133
+ raise 'You cannot provide both :topicId and :topic_id' if attributes.key?(:'topicId') && attributes.key?(:'topic_id')
134
+
135
+ self.topic_id = attributes[:'topic_id'] if attributes[:'topic_id']
136
+
137
+ self.protocol = attributes[:'protocol'] if attributes[:'protocol']
138
+
139
+ self.endpoint = attributes[:'endpoint'] if attributes[:'endpoint']
140
+
141
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
142
+
143
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
144
+
145
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
146
+
147
+ self.created_time = attributes[:'createdTime'] if attributes[:'createdTime']
148
+
149
+ raise 'You cannot provide both :createdTime and :created_time' if attributes.key?(:'createdTime') && attributes.key?(:'created_time')
150
+
151
+ self.created_time = attributes[:'created_time'] if attributes[:'created_time']
152
+
153
+ self.delivery_policy = attributes[:'deliveryPolicy'] if attributes[:'deliveryPolicy']
154
+
155
+ raise 'You cannot provide both :deliveryPolicy and :delivery_policy' if attributes.key?(:'deliveryPolicy') && attributes.key?(:'delivery_policy')
156
+
157
+ self.delivery_policy = attributes[:'delivery_policy'] if attributes[:'delivery_policy']
158
+
159
+ self.etag = attributes[:'etag'] if attributes[:'etag']
160
+
161
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
162
+
163
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
164
+
165
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
166
+
167
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
168
+
169
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
170
+
171
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
172
+ end
173
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
174
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
175
+
176
+ # Custom attribute writer method checking allowed values (enum).
177
+ # @param [Object] lifecycle_state Object to be assigned
178
+ def lifecycle_state=(lifecycle_state)
179
+ # rubocop:disable Style/ConditionalAssignment
180
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
181
+ # rubocop: disable Metrics/LineLength
182
+ OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
183
+ # rubocop: enable Metrics/LineLength
184
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
185
+ else
186
+ @lifecycle_state = lifecycle_state
187
+ end
188
+ # rubocop:enable Style/ConditionalAssignment
189
+ end
190
+
191
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
192
+
193
+
194
+ # Checks equality by comparing each attribute.
195
+ # @param [Object] other the other object to be compared
196
+ def ==(other)
197
+ return true if equal?(other)
198
+
199
+ self.class == other.class &&
200
+ id == other.id &&
201
+ topic_id == other.topic_id &&
202
+ protocol == other.protocol &&
203
+ endpoint == other.endpoint &&
204
+ lifecycle_state == other.lifecycle_state &&
205
+ created_time == other.created_time &&
206
+ delivery_policy == other.delivery_policy &&
207
+ etag == other.etag &&
208
+ freeform_tags == other.freeform_tags &&
209
+ defined_tags == other.defined_tags
210
+ end
211
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
212
+
213
+ # @see the `==` method
214
+ # @param [Object] other the other object to be compared
215
+ def eql?(other)
216
+ self == other
217
+ end
218
+
219
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
220
+
221
+
222
+ # Calculates hash code according to all attributes.
223
+ # @return [Fixnum] Hash code
224
+ def hash
225
+ [id, topic_id, protocol, endpoint, lifecycle_state, created_time, delivery_policy, etag, freeform_tags, defined_tags].hash
226
+ end
227
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
228
+
229
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
230
+
231
+
232
+ # Builds the object from hash
233
+ # @param [Hash] attributes Model attributes in the form of hash
234
+ # @return [Object] Returns the model itself
235
+ def build_from_hash(attributes)
236
+ return nil unless attributes.is_a?(Hash)
237
+
238
+ self.class.swagger_types.each_pair do |key, type|
239
+ if type =~ /^Array<(.*)>/i
240
+ # check to ensure the input is an array given that the the attribute
241
+ # is documented as an array but the input is not
242
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
243
+ public_method("#{key}=").call(
244
+ attributes[self.class.attribute_map[key]]
245
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
246
+ )
247
+ end
248
+ elsif !attributes[self.class.attribute_map[key]].nil?
249
+ public_method("#{key}=").call(
250
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
251
+ )
252
+ end
253
+ # or else data not found in attributes(hash), not an issue as the data can be optional
254
+ end
255
+
256
+ self
257
+ end
258
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
259
+
260
+ # Returns the string representation of the object
261
+ # @return [String] String presentation of the object
262
+ def to_s
263
+ to_hash.to_s
264
+ end
265
+
266
+ # Returns the object in the form of hash
267
+ # @return [Hash] Returns the object in the form of hash
268
+ def to_hash
269
+ hash = {}
270
+ self.class.attribute_map.each_pair do |attr, param|
271
+ value = public_method(attr).call
272
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
273
+
274
+ hash[param] = _to_hash(value)
275
+ end
276
+ hash
277
+ end
278
+
279
+ private
280
+
281
+ # Outputs non-array value in the form of hash
282
+ # For object, use to_hash. Otherwise, just return the value
283
+ # @param [Object] value Any valid value
284
+ # @return [Hash] Returns the value in the form of hash
285
+ def _to_hash(value)
286
+ if value.is_a?(Array)
287
+ value.compact.map { |v| _to_hash(v) }
288
+ elsif value.is_a?(Hash)
289
+ {}.tap do |hash|
290
+ value.each { |k, v| hash[k] = _to_hash(v) }
291
+ end
292
+ elsif value.respond_to? :to_hash
293
+ value.to_hash
294
+ else
295
+ value
296
+ end
297
+ end
298
+ end
299
+ end
300
+ # rubocop:enable Lint/UnneededCopDisableDirective