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,311 @@
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
+ # Returns a listing of all of the specified job's properties and their values.
8
+ class ResourceManager::Models::JobSummary # rubocop:disable Metrics/LineLength
9
+ # The job's OCID.
10
+ # @return [String]
11
+ attr_accessor :id
12
+
13
+ # OCID of the stack that is associated with the specified job.
14
+ # @return [String]
15
+ attr_accessor :stack_id
16
+
17
+ # OCID of the compartment where the stack of the associated job resides.
18
+ # @return [String]
19
+ attr_accessor :compartment_id
20
+
21
+ # The job's display name.
22
+ # @return [String]
23
+ attr_accessor :display_name
24
+
25
+ # The type of job executing
26
+ # @return [String]
27
+ attr_accessor :operation
28
+
29
+ # @return [OCI::ResourceManager::Models::ApplyJobPlanResolution]
30
+ attr_accessor :apply_job_plan_resolution
31
+
32
+ # The plan job OCID that was used (if this was an APPLY job and not auto approved).
33
+ # @return [String]
34
+ attr_accessor :resolved_plan_job_id
35
+
36
+ # The date and time the job was created.
37
+ # @return [DateTime]
38
+ attr_accessor :time_created
39
+
40
+ # The date and time the job succeeded or failed.
41
+ # @return [DateTime]
42
+ attr_accessor :time_finished
43
+
44
+ # Current state of the specified job. Allowed values are:
45
+ # - ACCEPTED
46
+ # - IN_PROGRESS
47
+ # - FAILED
48
+ # - SUCCEEDED
49
+ # - CANCELING
50
+ # - CANCELED
51
+ #
52
+ # @return [String]
53
+ attr_accessor :lifecycle_state
54
+
55
+ # Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace.
56
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/resourcetags.htm).
57
+ # Example: `{\"Department\": \"Finance\"}`
58
+ #
59
+ # @return [Hash<String, String>]
60
+ attr_accessor :freeform_tags
61
+
62
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
63
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/resourcetags.htm).
64
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
65
+ #
66
+ # @return [Hash<String, Hash<String, Object>>]
67
+ attr_accessor :defined_tags
68
+
69
+ # Attribute mapping from ruby-style variable name to JSON key.
70
+ def self.attribute_map
71
+ {
72
+ # rubocop:disable Style/SymbolLiteral
73
+ 'id': :'id',
74
+ 'stack_id': :'stackId',
75
+ 'compartment_id': :'compartmentId',
76
+ 'display_name': :'displayName',
77
+ 'operation': :'operation',
78
+ 'apply_job_plan_resolution': :'applyJobPlanResolution',
79
+ 'resolved_plan_job_id': :'resolvedPlanJobId',
80
+ 'time_created': :'timeCreated',
81
+ 'time_finished': :'timeFinished',
82
+ 'lifecycle_state': :'lifecycleState',
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
+ 'stack_id': :'String',
95
+ 'compartment_id': :'String',
96
+ 'display_name': :'String',
97
+ 'operation': :'String',
98
+ 'apply_job_plan_resolution': :'OCI::ResourceManager::Models::ApplyJobPlanResolution',
99
+ 'resolved_plan_job_id': :'String',
100
+ 'time_created': :'DateTime',
101
+ 'time_finished': :'DateTime',
102
+ 'lifecycle_state': :'String',
103
+ 'freeform_tags': :'Hash<String, String>',
104
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
105
+ # rubocop:enable Style/SymbolLiteral
106
+ }
107
+ end
108
+
109
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
110
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
111
+
112
+
113
+ # Initializes the object
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @option attributes [String] :id The value to assign to the {#id} property
116
+ # @option attributes [String] :stack_id The value to assign to the {#stack_id} property
117
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
118
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
119
+ # @option attributes [String] :operation The value to assign to the {#operation} property
120
+ # @option attributes [OCI::ResourceManager::Models::ApplyJobPlanResolution] :apply_job_plan_resolution The value to assign to the {#apply_job_plan_resolution} property
121
+ # @option attributes [String] :resolved_plan_job_id The value to assign to the {#resolved_plan_job_id} property
122
+ # @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
123
+ # @option attributes [DateTime] :time_finished The value to assign to the {#time_finished} property
124
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
125
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
126
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
127
+ def initialize(attributes = {})
128
+ return unless attributes.is_a?(Hash)
129
+
130
+ # convert string to symbol for hash key
131
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
132
+
133
+ self.id = attributes[:'id'] if attributes[:'id']
134
+
135
+ self.stack_id = attributes[:'stackId'] if attributes[:'stackId']
136
+
137
+ raise 'You cannot provide both :stackId and :stack_id' if attributes.key?(:'stackId') && attributes.key?(:'stack_id')
138
+
139
+ self.stack_id = attributes[:'stack_id'] if attributes[:'stack_id']
140
+
141
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
142
+
143
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
144
+
145
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
146
+
147
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
148
+
149
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
150
+
151
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
152
+
153
+ self.operation = attributes[:'operation'] if attributes[:'operation']
154
+
155
+ self.apply_job_plan_resolution = attributes[:'applyJobPlanResolution'] if attributes[:'applyJobPlanResolution']
156
+
157
+ raise 'You cannot provide both :applyJobPlanResolution and :apply_job_plan_resolution' if attributes.key?(:'applyJobPlanResolution') && attributes.key?(:'apply_job_plan_resolution')
158
+
159
+ self.apply_job_plan_resolution = attributes[:'apply_job_plan_resolution'] if attributes[:'apply_job_plan_resolution']
160
+
161
+ self.resolved_plan_job_id = attributes[:'resolvedPlanJobId'] if attributes[:'resolvedPlanJobId']
162
+
163
+ raise 'You cannot provide both :resolvedPlanJobId and :resolved_plan_job_id' if attributes.key?(:'resolvedPlanJobId') && attributes.key?(:'resolved_plan_job_id')
164
+
165
+ self.resolved_plan_job_id = attributes[:'resolved_plan_job_id'] if attributes[:'resolved_plan_job_id']
166
+
167
+ self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']
168
+
169
+ raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
170
+
171
+ self.time_created = attributes[:'time_created'] if attributes[:'time_created']
172
+
173
+ self.time_finished = attributes[:'timeFinished'] if attributes[:'timeFinished']
174
+
175
+ raise 'You cannot provide both :timeFinished and :time_finished' if attributes.key?(:'timeFinished') && attributes.key?(:'time_finished')
176
+
177
+ self.time_finished = attributes[:'time_finished'] if attributes[:'time_finished']
178
+
179
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
180
+
181
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
182
+
183
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
184
+
185
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
186
+
187
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
188
+
189
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
190
+
191
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
192
+
193
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
194
+
195
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
196
+ end
197
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
198
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
199
+
200
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
201
+
202
+
203
+ # Checks equality by comparing each attribute.
204
+ # @param [Object] other the other object to be compared
205
+ def ==(other)
206
+ return true if equal?(other)
207
+
208
+ self.class == other.class &&
209
+ id == other.id &&
210
+ stack_id == other.stack_id &&
211
+ compartment_id == other.compartment_id &&
212
+ display_name == other.display_name &&
213
+ operation == other.operation &&
214
+ apply_job_plan_resolution == other.apply_job_plan_resolution &&
215
+ resolved_plan_job_id == other.resolved_plan_job_id &&
216
+ time_created == other.time_created &&
217
+ time_finished == other.time_finished &&
218
+ lifecycle_state == other.lifecycle_state &&
219
+ freeform_tags == other.freeform_tags &&
220
+ defined_tags == other.defined_tags
221
+ end
222
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
223
+
224
+ # @see the `==` method
225
+ # @param [Object] other the other object to be compared
226
+ def eql?(other)
227
+ self == other
228
+ end
229
+
230
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
231
+
232
+
233
+ # Calculates hash code according to all attributes.
234
+ # @return [Fixnum] Hash code
235
+ def hash
236
+ [id, stack_id, compartment_id, display_name, operation, apply_job_plan_resolution, resolved_plan_job_id, time_created, time_finished, lifecycle_state, freeform_tags, defined_tags].hash
237
+ end
238
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
239
+
240
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
241
+
242
+
243
+ # Builds the object from hash
244
+ # @param [Hash] attributes Model attributes in the form of hash
245
+ # @return [Object] Returns the model itself
246
+ def build_from_hash(attributes)
247
+ return nil unless attributes.is_a?(Hash)
248
+
249
+ self.class.swagger_types.each_pair do |key, type|
250
+ if type =~ /^Array<(.*)>/i
251
+ # check to ensure the input is an array given that the the attribute
252
+ # is documented as an array but the input is not
253
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
254
+ public_method("#{key}=").call(
255
+ attributes[self.class.attribute_map[key]]
256
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
257
+ )
258
+ end
259
+ elsif !attributes[self.class.attribute_map[key]].nil?
260
+ public_method("#{key}=").call(
261
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
262
+ )
263
+ end
264
+ # or else data not found in attributes(hash), not an issue as the data can be optional
265
+ end
266
+
267
+ self
268
+ end
269
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
270
+
271
+ # Returns the string representation of the object
272
+ # @return [String] String presentation of the object
273
+ def to_s
274
+ to_hash.to_s
275
+ end
276
+
277
+ # Returns the object in the form of hash
278
+ # @return [Hash] Returns the object in the form of hash
279
+ def to_hash
280
+ hash = {}
281
+ self.class.attribute_map.each_pair do |attr, param|
282
+ value = public_method(attr).call
283
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
284
+
285
+ hash[param] = _to_hash(value)
286
+ end
287
+ hash
288
+ end
289
+
290
+ private
291
+
292
+ # Outputs non-array value in the form of hash
293
+ # For object, use to_hash. Otherwise, just return the value
294
+ # @param [Object] value Any valid value
295
+ # @return [Hash] Returns the value in the form of hash
296
+ def _to_hash(value)
297
+ if value.is_a?(Array)
298
+ value.compact.map { |v| _to_hash(v) }
299
+ elsif value.is_a?(Hash)
300
+ {}.tap do |hash|
301
+ value.each { |k, v| hash[k] = _to_hash(v) }
302
+ end
303
+ elsif value.respond_to? :to_hash
304
+ value.to_hash
305
+ else
306
+ value
307
+ end
308
+ end
309
+ end
310
+ end
311
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,225 @@
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
+ # Log entry for an operation resulting from a job's execution.
9
+ class ResourceManager::Models::LogEntry # rubocop:disable Metrics/LineLength
10
+ TYPE_ENUM = [
11
+ TYPE_TERRAFORM_CONSOLE = 'TERRAFORM_CONSOLE'.freeze,
12
+ TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
13
+ ].freeze
14
+
15
+ LEVEL_ENUM = [
16
+ LEVEL_TRACE = 'TRACE'.freeze,
17
+ LEVEL_DEBUG = 'DEBUG'.freeze,
18
+ LEVEL_INFO = 'INFO'.freeze,
19
+ LEVEL_WARN = 'WARN'.freeze,
20
+ LEVEL_ERROR = 'ERROR'.freeze,
21
+ LEVEL_FATAL = 'FATAL'.freeze,
22
+ LEVEL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
23
+ ].freeze
24
+
25
+ # Specifies the log type for the log entry.
26
+ # @return [String]
27
+ attr_reader :type
28
+
29
+ # Specifies the severity level of the log entry.
30
+ # @return [String]
31
+ attr_reader :level
32
+
33
+ # Date and time of the log entry.
34
+ # @return [DateTime]
35
+ attr_accessor :timestamp
36
+
37
+ # The log entry value.
38
+ # @return [String]
39
+ attr_accessor :message
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ # rubocop:disable Style/SymbolLiteral
45
+ 'type': :'type',
46
+ 'level': :'level',
47
+ 'timestamp': :'timestamp',
48
+ 'message': :'message'
49
+ # rubocop:enable Style/SymbolLiteral
50
+ }
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.swagger_types
55
+ {
56
+ # rubocop:disable Style/SymbolLiteral
57
+ 'type': :'String',
58
+ 'level': :'String',
59
+ 'timestamp': :'DateTime',
60
+ 'message': :'String'
61
+ # rubocop:enable Style/SymbolLiteral
62
+ }
63
+ end
64
+
65
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
66
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
67
+
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ # @option attributes [String] :type The value to assign to the {#type} property
72
+ # @option attributes [String] :level The value to assign to the {#level} property
73
+ # @option attributes [DateTime] :timestamp The value to assign to the {#timestamp} property
74
+ # @option attributes [String] :message The value to assign to the {#message} property
75
+ def initialize(attributes = {})
76
+ return unless attributes.is_a?(Hash)
77
+
78
+ # convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
80
+
81
+ self.type = attributes[:'type'] if attributes[:'type']
82
+
83
+ self.level = attributes[:'level'] if attributes[:'level']
84
+
85
+ self.timestamp = attributes[:'timestamp'] if attributes[:'timestamp']
86
+
87
+ self.message = attributes[:'message'] if attributes[:'message']
88
+ end
89
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
90
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
91
+
92
+ # Custom attribute writer method checking allowed values (enum).
93
+ # @param [Object] type Object to be assigned
94
+ def type=(type)
95
+ # rubocop:disable Style/ConditionalAssignment
96
+ if type && !TYPE_ENUM.include?(type)
97
+ # rubocop: disable Metrics/LineLength
98
+ OCI.logger.debug("Unknown value for 'type' [" + type + "]. Mapping to 'TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
99
+ # rubocop: enable Metrics/LineLength
100
+ @type = TYPE_UNKNOWN_ENUM_VALUE
101
+ else
102
+ @type = type
103
+ end
104
+ # rubocop:enable Style/ConditionalAssignment
105
+ end
106
+
107
+ # Custom attribute writer method checking allowed values (enum).
108
+ # @param [Object] level Object to be assigned
109
+ def level=(level)
110
+ # rubocop:disable Style/ConditionalAssignment
111
+ if level && !LEVEL_ENUM.include?(level)
112
+ # rubocop: disable Metrics/LineLength
113
+ OCI.logger.debug("Unknown value for 'level' [" + level + "]. Mapping to 'LEVEL_UNKNOWN_ENUM_VALUE'") if OCI.logger
114
+ # rubocop: enable Metrics/LineLength
115
+ @level = LEVEL_UNKNOWN_ENUM_VALUE
116
+ else
117
+ @level = level
118
+ end
119
+ # rubocop:enable Style/ConditionalAssignment
120
+ end
121
+
122
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
123
+
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] other the other object to be compared
127
+ def ==(other)
128
+ return true if equal?(other)
129
+
130
+ self.class == other.class &&
131
+ type == other.type &&
132
+ level == other.level &&
133
+ timestamp == other.timestamp &&
134
+ message == other.message
135
+ end
136
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
137
+
138
+ # @see the `==` method
139
+ # @param [Object] other the other object to be compared
140
+ def eql?(other)
141
+ self == other
142
+ end
143
+
144
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
145
+
146
+
147
+ # Calculates hash code according to all attributes.
148
+ # @return [Fixnum] Hash code
149
+ def hash
150
+ [type, level, timestamp, message].hash
151
+ end
152
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
153
+
154
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
155
+
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def build_from_hash(attributes)
161
+ return nil unless attributes.is_a?(Hash)
162
+
163
+ self.class.swagger_types.each_pair do |key, type|
164
+ if type =~ /^Array<(.*)>/i
165
+ # check to ensure the input is an array given that the the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
168
+ public_method("#{key}=").call(
169
+ attributes[self.class.attribute_map[key]]
170
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
171
+ )
172
+ end
173
+ elsif !attributes[self.class.attribute_map[key]].nil?
174
+ public_method("#{key}=").call(
175
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
176
+ )
177
+ end
178
+ # or else data not found in attributes(hash), not an issue as the data can be optional
179
+ end
180
+
181
+ self
182
+ end
183
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = public_method(attr).call
197
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ private
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+ end
224
+ end
225
+ # rubocop:enable Lint/UnneededCopDisableDirective