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