oci 2.3.4 → 2.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/oci/core/models/create_virtual_circuit_public_prefix_details.rb +1 -1
  4. data/lib/oci/core/models/update_boot_volume_details.rb +18 -4
  5. data/lib/oci/core/models/update_volume_details.rb +18 -4
  6. data/lib/oci/core/models/virtual_circuit.rb +1 -1
  7. data/lib/oci/core/models/vnic.rb +1 -1
  8. data/lib/oci/core/models/volume_group.rb +18 -4
  9. data/lib/oci/database/database.rb +18 -0
  10. data/lib/oci/database/database_client.rb +1779 -427
  11. data/lib/oci/database/database_client_composite_operations.rb +316 -0
  12. data/lib/oci/database/models/autonomous_data_warehouse.rb +391 -0
  13. data/lib/oci/database/models/autonomous_data_warehouse_backup.rb +316 -0
  14. data/lib/oci/database/models/autonomous_data_warehouse_backup_summary.rb +316 -0
  15. data/lib/oci/database/models/autonomous_data_warehouse_connection_strings.rb +167 -0
  16. data/lib/oci/database/models/autonomous_data_warehouse_summary.rb +391 -0
  17. data/lib/oci/database/models/autonomous_database.rb +391 -0
  18. data/lib/oci/database/models/autonomous_database_backup.rb +316 -0
  19. data/lib/oci/database/models/autonomous_database_backup_summary.rb +316 -0
  20. data/lib/oci/database/models/autonomous_database_connection_strings.rb +167 -0
  21. data/lib/oci/database/models/autonomous_database_summary.rb +391 -0
  22. data/lib/oci/database/models/create_autonomous_data_warehouse_backup_details.rb +165 -0
  23. data/lib/oci/database/models/create_autonomous_data_warehouse_details.rb +287 -0
  24. data/lib/oci/database/models/create_autonomous_database_backup_details.rb +165 -0
  25. data/lib/oci/database/models/create_autonomous_database_details.rb +287 -0
  26. data/lib/oci/database/models/db_system.rb +1 -1
  27. data/lib/oci/database/models/db_system_summary.rb +1 -1
  28. data/lib/oci/database/models/launch_db_system_details.rb +1 -1
  29. data/lib/oci/database/models/launch_db_system_from_backup_details.rb +1 -1
  30. data/lib/oci/database/models/restore_autonomous_data_warehouse_details.rb +147 -0
  31. data/lib/oci/database/models/restore_autonomous_database_details.rb +147 -0
  32. data/lib/oci/database/models/update_autonomous_data_warehouse_details.rb +230 -0
  33. data/lib/oci/database/models/update_autonomous_database_details.rb +230 -0
  34. data/lib/oci/identity/identity.rb +1 -0
  35. data/lib/oci/identity/identity_client.rb +64 -1
  36. data/lib/oci/identity/models/availability_domain.rb +11 -1
  37. data/lib/oci/identity/models/fault_domain.rb +187 -0
  38. data/lib/oci/version.rb +1 -1
  39. metadata +21 -2
@@ -0,0 +1,391 @@
1
+ # Copyright (c) 2016, 2018, 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
+ # An Oracle Autonomous Database.
9
+ #
10
+ class Database::Models::AutonomousDatabase # rubocop:disable Metrics/LineLength
11
+ LICENSE_MODEL_ENUM = [
12
+ LICENSE_MODEL_LICENSE_INCLUDED = 'LICENSE_INCLUDED'.freeze,
13
+ LICENSE_MODEL_BRING_YOUR_OWN_LICENSE = 'BRING_YOUR_OWN_LICENSE'.freeze,
14
+ LICENSE_MODEL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
15
+ ].freeze
16
+
17
+ LIFECYCLE_STATE_ENUM = [
18
+ LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING'.freeze,
19
+ LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE'.freeze,
20
+ LIFECYCLE_STATE_STOPPING = 'STOPPING'.freeze,
21
+ LIFECYCLE_STATE_STOPPED = 'STOPPED'.freeze,
22
+ LIFECYCLE_STATE_STARTING = 'STARTING'.freeze,
23
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING'.freeze,
24
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED'.freeze,
25
+ LIFECYCLE_STATE_UNAVAILABLE = 'UNAVAILABLE'.freeze,
26
+ LIFECYCLE_STATE_RESTORE_IN_PROGRESS = 'RESTORE_IN_PROGRESS'.freeze,
27
+ LIFECYCLE_STATE_BACKUP_IN_PROGRESS = 'BACKUP_IN_PROGRESS'.freeze,
28
+ LIFECYCLE_STATE_SCALE_IN_PROGRESS = 'SCALE_IN_PROGRESS'.freeze,
29
+ LIFECYCLE_STATE_AVAILABLE_NEEDS_ATTENTION = 'AVAILABLE_NEEDS_ATTENTION'.freeze,
30
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
31
+ ].freeze
32
+
33
+ # **[Required]** The OCID of the compartment.
34
+ # @return [String]
35
+ attr_accessor :compartment_id
36
+
37
+ # The connection string used to connect to the Autonomous Database. The username for the Service Console is ADMIN. Use the password you entered when creating the Autonomous Database for the password value.
38
+ # @return [OCI::Database::Models::AutonomousDatabaseConnectionStrings]
39
+ attr_accessor :connection_strings
40
+
41
+ # **[Required]** The number of CPU cores to be made available to the database.
42
+ # @return [Integer]
43
+ attr_accessor :cpu_core_count
44
+
45
+ # **[Required]** The quantity of data in the database, in terabytes.
46
+ # @return [Integer]
47
+ attr_accessor :data_storage_size_in_tbs
48
+
49
+ # **[Required]** The database name.
50
+ # @return [String]
51
+ attr_accessor :db_name
52
+
53
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
54
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
55
+ #
56
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
57
+ #
58
+ # @return [Hash<String, Hash<String, Object>>]
59
+ attr_accessor :defined_tags
60
+
61
+ # The user-friendly name for the Autonomous Database. The name does not have to be unique.
62
+ # @return [String]
63
+ attr_accessor :display_name
64
+
65
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
66
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
67
+ #
68
+ # Example: `{\"Department\": \"Finance\"}`
69
+ #
70
+ # @return [Hash<String, String>]
71
+ attr_accessor :freeform_tags
72
+
73
+ # **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the Autonomous Database.
74
+ # @return [String]
75
+ attr_accessor :id
76
+
77
+ # The Oracle license model that applies to the Oracle Autonomous Database. The default is BRING_YOUR_OWN_LICENSE.
78
+ #
79
+ # @return [String]
80
+ attr_reader :license_model
81
+
82
+ # Additional information about the current lifecycle state.
83
+ # @return [String]
84
+ attr_accessor :lifecycle_details
85
+
86
+ # **[Required]** The current state of the database.
87
+ # @return [String]
88
+ attr_reader :lifecycle_state
89
+
90
+ # The URL of the Service Console for the Autonomous Database.
91
+ # @return [String]
92
+ attr_accessor :service_console_url
93
+
94
+ # The date and time the database was created.
95
+ # @return [DateTime]
96
+ attr_accessor :time_created
97
+
98
+ # Attribute mapping from ruby-style variable name to JSON key.
99
+ def self.attribute_map
100
+ {
101
+ # rubocop:disable Style/SymbolLiteral
102
+ 'compartment_id': :'compartmentId',
103
+ 'connection_strings': :'connectionStrings',
104
+ 'cpu_core_count': :'cpuCoreCount',
105
+ 'data_storage_size_in_tbs': :'dataStorageSizeInTBs',
106
+ 'db_name': :'dbName',
107
+ 'defined_tags': :'definedTags',
108
+ 'display_name': :'displayName',
109
+ 'freeform_tags': :'freeformTags',
110
+ 'id': :'id',
111
+ 'license_model': :'licenseModel',
112
+ 'lifecycle_details': :'lifecycleDetails',
113
+ 'lifecycle_state': :'lifecycleState',
114
+ 'service_console_url': :'serviceConsoleUrl',
115
+ 'time_created': :'timeCreated'
116
+ # rubocop:enable Style/SymbolLiteral
117
+ }
118
+ end
119
+
120
+ # Attribute type mapping.
121
+ def self.swagger_types
122
+ {
123
+ # rubocop:disable Style/SymbolLiteral
124
+ 'compartment_id': :'String',
125
+ 'connection_strings': :'OCI::Database::Models::AutonomousDatabaseConnectionStrings',
126
+ 'cpu_core_count': :'Integer',
127
+ 'data_storage_size_in_tbs': :'Integer',
128
+ 'db_name': :'String',
129
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
130
+ 'display_name': :'String',
131
+ 'freeform_tags': :'Hash<String, String>',
132
+ 'id': :'String',
133
+ 'license_model': :'String',
134
+ 'lifecycle_details': :'String',
135
+ 'lifecycle_state': :'String',
136
+ 'service_console_url': :'String',
137
+ 'time_created': :'DateTime'
138
+ # rubocop:enable Style/SymbolLiteral
139
+ }
140
+ end
141
+
142
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
143
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
144
+
145
+
146
+ # Initializes the object
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
149
+ # @option attributes [OCI::Database::Models::AutonomousDatabaseConnectionStrings] :connection_strings The value to assign to the {#connection_strings} property
150
+ # @option attributes [Integer] :cpu_core_count The value to assign to the {#cpu_core_count} property
151
+ # @option attributes [Integer] :data_storage_size_in_tbs The value to assign to the {#data_storage_size_in_tbs} property
152
+ # @option attributes [String] :db_name The value to assign to the {#db_name} property
153
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
154
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
155
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
156
+ # @option attributes [String] :id The value to assign to the {#id} property
157
+ # @option attributes [String] :license_model The value to assign to the {#license_model} property
158
+ # @option attributes [String] :lifecycle_details The value to assign to the {#lifecycle_details} property
159
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
160
+ # @option attributes [String] :service_console_url The value to assign to the {#service_console_url} property
161
+ # @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
162
+ def initialize(attributes = {})
163
+ return unless attributes.is_a?(Hash)
164
+
165
+ # convert string to symbol for hash key
166
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
167
+
168
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
169
+
170
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
171
+
172
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
173
+
174
+ self.connection_strings = attributes[:'connectionStrings'] if attributes[:'connectionStrings']
175
+
176
+ raise 'You cannot provide both :connectionStrings and :connection_strings' if attributes.key?(:'connectionStrings') && attributes.key?(:'connection_strings')
177
+
178
+ self.connection_strings = attributes[:'connection_strings'] if attributes[:'connection_strings']
179
+
180
+ self.cpu_core_count = attributes[:'cpuCoreCount'] if attributes[:'cpuCoreCount']
181
+
182
+ raise 'You cannot provide both :cpuCoreCount and :cpu_core_count' if attributes.key?(:'cpuCoreCount') && attributes.key?(:'cpu_core_count')
183
+
184
+ self.cpu_core_count = attributes[:'cpu_core_count'] if attributes[:'cpu_core_count']
185
+
186
+ self.data_storage_size_in_tbs = attributes[:'dataStorageSizeInTBs'] if attributes[:'dataStorageSizeInTBs']
187
+
188
+ raise 'You cannot provide both :dataStorageSizeInTBs and :data_storage_size_in_tbs' if attributes.key?(:'dataStorageSizeInTBs') && attributes.key?(:'data_storage_size_in_tbs')
189
+
190
+ self.data_storage_size_in_tbs = attributes[:'data_storage_size_in_tbs'] if attributes[:'data_storage_size_in_tbs']
191
+
192
+ self.db_name = attributes[:'dbName'] if attributes[:'dbName']
193
+
194
+ raise 'You cannot provide both :dbName and :db_name' if attributes.key?(:'dbName') && attributes.key?(:'db_name')
195
+
196
+ self.db_name = attributes[:'db_name'] if attributes[:'db_name']
197
+
198
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
199
+
200
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
201
+
202
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
203
+
204
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
205
+
206
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
207
+
208
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
209
+
210
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
211
+
212
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
213
+
214
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
215
+
216
+ self.id = attributes[:'id'] if attributes[:'id']
217
+
218
+ self.license_model = attributes[:'licenseModel'] if attributes[:'licenseModel']
219
+
220
+ raise 'You cannot provide both :licenseModel and :license_model' if attributes.key?(:'licenseModel') && attributes.key?(:'license_model')
221
+
222
+ self.license_model = attributes[:'license_model'] if attributes[:'license_model']
223
+
224
+ self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']
225
+
226
+ raise 'You cannot provide both :lifecycleDetails and :lifecycle_details' if attributes.key?(:'lifecycleDetails') && attributes.key?(:'lifecycle_details')
227
+
228
+ self.lifecycle_details = attributes[:'lifecycle_details'] if attributes[:'lifecycle_details']
229
+
230
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
231
+
232
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
233
+
234
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
235
+
236
+ self.service_console_url = attributes[:'serviceConsoleUrl'] if attributes[:'serviceConsoleUrl']
237
+
238
+ raise 'You cannot provide both :serviceConsoleUrl and :service_console_url' if attributes.key?(:'serviceConsoleUrl') && attributes.key?(:'service_console_url')
239
+
240
+ self.service_console_url = attributes[:'service_console_url'] if attributes[:'service_console_url']
241
+
242
+ self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']
243
+
244
+ raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
245
+
246
+ self.time_created = attributes[:'time_created'] if attributes[:'time_created']
247
+ end
248
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
249
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
250
+
251
+ # Custom attribute writer method checking allowed values (enum).
252
+ # @param [Object] license_model Object to be assigned
253
+ def license_model=(license_model)
254
+ # rubocop:disable Style/ConditionalAssignment
255
+ if license_model && !LICENSE_MODEL_ENUM.include?(license_model)
256
+ # rubocop: disable Metrics/LineLength
257
+ OCI.logger.debug("Unknown value for 'license_model' [" + license_model + "]. Mapping to 'LICENSE_MODEL_UNKNOWN_ENUM_VALUE'") if OCI.logger
258
+ # rubocop: enable Metrics/LineLength
259
+ @license_model = LICENSE_MODEL_UNKNOWN_ENUM_VALUE
260
+ else
261
+ @license_model = license_model
262
+ end
263
+ # rubocop:enable Style/ConditionalAssignment
264
+ end
265
+
266
+ # Custom attribute writer method checking allowed values (enum).
267
+ # @param [Object] lifecycle_state Object to be assigned
268
+ def lifecycle_state=(lifecycle_state)
269
+ # rubocop:disable Style/ConditionalAssignment
270
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
271
+ # rubocop: disable Metrics/LineLength
272
+ OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
273
+ # rubocop: enable Metrics/LineLength
274
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
275
+ else
276
+ @lifecycle_state = lifecycle_state
277
+ end
278
+ # rubocop:enable Style/ConditionalAssignment
279
+ end
280
+
281
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
282
+
283
+
284
+ # Checks equality by comparing each attribute.
285
+ # @param [Object] other the other object to be compared
286
+ def ==(other)
287
+ return true if equal?(other)
288
+ self.class == other.class &&
289
+ compartment_id == other.compartment_id &&
290
+ connection_strings == other.connection_strings &&
291
+ cpu_core_count == other.cpu_core_count &&
292
+ data_storage_size_in_tbs == other.data_storage_size_in_tbs &&
293
+ db_name == other.db_name &&
294
+ defined_tags == other.defined_tags &&
295
+ display_name == other.display_name &&
296
+ freeform_tags == other.freeform_tags &&
297
+ id == other.id &&
298
+ license_model == other.license_model &&
299
+ lifecycle_details == other.lifecycle_details &&
300
+ lifecycle_state == other.lifecycle_state &&
301
+ service_console_url == other.service_console_url &&
302
+ time_created == other.time_created
303
+ end
304
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
305
+
306
+ # @see the `==` method
307
+ # @param [Object] other the other object to be compared
308
+ def eql?(other)
309
+ self == other
310
+ end
311
+
312
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
313
+
314
+
315
+ # Calculates hash code according to all attributes.
316
+ # @return [Fixnum] Hash code
317
+ def hash
318
+ [compartment_id, connection_strings, cpu_core_count, data_storage_size_in_tbs, db_name, defined_tags, display_name, freeform_tags, id, license_model, lifecycle_details, lifecycle_state, service_console_url, time_created].hash
319
+ end
320
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
321
+
322
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
323
+
324
+
325
+ # Builds the object from hash
326
+ # @param [Hash] attributes Model attributes in the form of hash
327
+ # @return [Object] Returns the model itself
328
+ def build_from_hash(attributes)
329
+ return nil unless attributes.is_a?(Hash)
330
+ self.class.swagger_types.each_pair do |key, type|
331
+ if type =~ /^Array<(.*)>/i
332
+ # check to ensure the input is an array given that the the attribute
333
+ # is documented as an array but the input is not
334
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
335
+ public_method("#{key}=").call(
336
+ attributes[self.class.attribute_map[key]]
337
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
338
+ )
339
+ end
340
+ elsif !attributes[self.class.attribute_map[key]].nil?
341
+ public_method("#{key}=").call(
342
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
343
+ )
344
+ end
345
+ # or else data not found in attributes(hash), not an issue as the data can be optional
346
+ end
347
+
348
+ self
349
+ end
350
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
351
+
352
+ # Returns the string representation of the object
353
+ # @return [String] String presentation of the object
354
+ def to_s
355
+ to_hash.to_s
356
+ end
357
+
358
+ # Returns the object in the form of hash
359
+ # @return [Hash] Returns the object in the form of hash
360
+ def to_hash
361
+ hash = {}
362
+ self.class.attribute_map.each_pair do |attr, param|
363
+ value = public_method(attr).call
364
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
365
+ hash[param] = _to_hash(value)
366
+ end
367
+ hash
368
+ end
369
+
370
+ private
371
+
372
+ # Outputs non-array value in the form of hash
373
+ # For object, use to_hash. Otherwise, just return the value
374
+ # @param [Object] value Any valid value
375
+ # @return [Hash] Returns the value in the form of hash
376
+ def _to_hash(value)
377
+ if value.is_a?(Array)
378
+ value.compact.map { |v| _to_hash(v) }
379
+ elsif value.is_a?(Hash)
380
+ {}.tap do |hash|
381
+ value.each { |k, v| hash[k] = _to_hash(v) }
382
+ end
383
+ elsif value.respond_to? :to_hash
384
+ value.to_hash
385
+ else
386
+ value
387
+ end
388
+ end
389
+ end
390
+ end
391
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,316 @@
1
+ # Copyright (c) 2016, 2018, 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
+ # An Autonomous Database backup.
9
+ # To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see [Getting Started with Policies](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm).
10
+ #
11
+ class Database::Models::AutonomousDatabaseBackup # rubocop:disable Metrics/LineLength
12
+ LIFECYCLE_STATE_ENUM = [
13
+ LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
14
+ LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
15
+ LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
16
+ LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
17
+ LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
18
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
19
+ ].freeze
20
+
21
+ TYPE_ENUM = [
22
+ TYPE_INCREMENTAL = 'INCREMENTAL'.freeze,
23
+ TYPE_FULL = 'FULL'.freeze,
24
+ TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
25
+ ].freeze
26
+
27
+ # **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the Autonomous Database.
28
+ # @return [String]
29
+ attr_accessor :autonomous_database_id
30
+
31
+ # **[Required]** The OCID of the compartment.
32
+ # @return [String]
33
+ attr_accessor :compartment_id
34
+
35
+ # **[Required]** The user-friendly name for the backup. The name does not have to be unique.
36
+ # @return [String]
37
+ attr_accessor :display_name
38
+
39
+ # **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the Autonomous Database backup.
40
+ # @return [String]
41
+ attr_accessor :id
42
+
43
+ # **[Required]** Indicates whether the backup is user-initiated or automatic.
44
+ # @return [BOOLEAN]
45
+ attr_accessor :is_automatic
46
+
47
+ # Additional information about the current lifecycle state.
48
+ # @return [String]
49
+ attr_accessor :lifecycle_details
50
+
51
+ # **[Required]** The current state of the backup.
52
+ # @return [String]
53
+ attr_reader :lifecycle_state
54
+
55
+ # The date and time the backup completed.
56
+ # @return [DateTime]
57
+ attr_accessor :time_ended
58
+
59
+ # The date and time the backup started.
60
+ # @return [DateTime]
61
+ attr_accessor :time_started
62
+
63
+ # **[Required]** The type of backup.
64
+ # @return [String]
65
+ attr_reader :type
66
+
67
+ # Attribute mapping from ruby-style variable name to JSON key.
68
+ def self.attribute_map
69
+ {
70
+ # rubocop:disable Style/SymbolLiteral
71
+ 'autonomous_database_id': :'autonomousDatabaseId',
72
+ 'compartment_id': :'compartmentId',
73
+ 'display_name': :'displayName',
74
+ 'id': :'id',
75
+ 'is_automatic': :'isAutomatic',
76
+ 'lifecycle_details': :'lifecycleDetails',
77
+ 'lifecycle_state': :'lifecycleState',
78
+ 'time_ended': :'timeEnded',
79
+ 'time_started': :'timeStarted',
80
+ 'type': :'type'
81
+ # rubocop:enable Style/SymbolLiteral
82
+ }
83
+ end
84
+
85
+ # Attribute type mapping.
86
+ def self.swagger_types
87
+ {
88
+ # rubocop:disable Style/SymbolLiteral
89
+ 'autonomous_database_id': :'String',
90
+ 'compartment_id': :'String',
91
+ 'display_name': :'String',
92
+ 'id': :'String',
93
+ 'is_automatic': :'BOOLEAN',
94
+ 'lifecycle_details': :'String',
95
+ 'lifecycle_state': :'String',
96
+ 'time_ended': :'DateTime',
97
+ 'time_started': :'DateTime',
98
+ 'type': :'String'
99
+ # rubocop:enable Style/SymbolLiteral
100
+ }
101
+ end
102
+
103
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
104
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
105
+
106
+
107
+ # Initializes the object
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @option attributes [String] :autonomous_database_id The value to assign to the {#autonomous_database_id} property
110
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
111
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
112
+ # @option attributes [String] :id The value to assign to the {#id} property
113
+ # @option attributes [BOOLEAN] :is_automatic The value to assign to the {#is_automatic} property
114
+ # @option attributes [String] :lifecycle_details The value to assign to the {#lifecycle_details} property
115
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
116
+ # @option attributes [DateTime] :time_ended The value to assign to the {#time_ended} property
117
+ # @option attributes [DateTime] :time_started The value to assign to the {#time_started} property
118
+ # @option attributes [String] :type The value to assign to the {#type} property
119
+ def initialize(attributes = {})
120
+ return unless attributes.is_a?(Hash)
121
+
122
+ # convert string to symbol for hash key
123
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
124
+
125
+ self.autonomous_database_id = attributes[:'autonomousDatabaseId'] if attributes[:'autonomousDatabaseId']
126
+
127
+ raise 'You cannot provide both :autonomousDatabaseId and :autonomous_database_id' if attributes.key?(:'autonomousDatabaseId') && attributes.key?(:'autonomous_database_id')
128
+
129
+ self.autonomous_database_id = attributes[:'autonomous_database_id'] if attributes[:'autonomous_database_id']
130
+
131
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
132
+
133
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
134
+
135
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
136
+
137
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
138
+
139
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
140
+
141
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
142
+
143
+ self.id = attributes[:'id'] if attributes[:'id']
144
+
145
+ self.is_automatic = attributes[:'isAutomatic'] unless attributes[:'isAutomatic'].nil?
146
+
147
+ raise 'You cannot provide both :isAutomatic and :is_automatic' if attributes.key?(:'isAutomatic') && attributes.key?(:'is_automatic')
148
+
149
+ self.is_automatic = attributes[:'is_automatic'] unless attributes[:'is_automatic'].nil?
150
+
151
+ self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']
152
+
153
+ raise 'You cannot provide both :lifecycleDetails and :lifecycle_details' if attributes.key?(:'lifecycleDetails') && attributes.key?(:'lifecycle_details')
154
+
155
+ self.lifecycle_details = attributes[:'lifecycle_details'] if attributes[:'lifecycle_details']
156
+
157
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
158
+
159
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
160
+
161
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
162
+
163
+ self.time_ended = attributes[:'timeEnded'] if attributes[:'timeEnded']
164
+
165
+ raise 'You cannot provide both :timeEnded and :time_ended' if attributes.key?(:'timeEnded') && attributes.key?(:'time_ended')
166
+
167
+ self.time_ended = attributes[:'time_ended'] if attributes[:'time_ended']
168
+
169
+ self.time_started = attributes[:'timeStarted'] if attributes[:'timeStarted']
170
+
171
+ raise 'You cannot provide both :timeStarted and :time_started' if attributes.key?(:'timeStarted') && attributes.key?(:'time_started')
172
+
173
+ self.time_started = attributes[:'time_started'] if attributes[:'time_started']
174
+
175
+ self.type = attributes[:'type'] if attributes[:'type']
176
+ end
177
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
178
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
179
+
180
+ # Custom attribute writer method checking allowed values (enum).
181
+ # @param [Object] lifecycle_state Object to be assigned
182
+ def lifecycle_state=(lifecycle_state)
183
+ # rubocop:disable Style/ConditionalAssignment
184
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
185
+ # rubocop: disable Metrics/LineLength
186
+ OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
187
+ # rubocop: enable Metrics/LineLength
188
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
189
+ else
190
+ @lifecycle_state = lifecycle_state
191
+ end
192
+ # rubocop:enable Style/ConditionalAssignment
193
+ end
194
+
195
+ # Custom attribute writer method checking allowed values (enum).
196
+ # @param [Object] type Object to be assigned
197
+ def type=(type)
198
+ # rubocop:disable Style/ConditionalAssignment
199
+ if type && !TYPE_ENUM.include?(type)
200
+ # rubocop: disable Metrics/LineLength
201
+ OCI.logger.debug("Unknown value for 'type' [" + type + "]. Mapping to 'TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
202
+ # rubocop: enable Metrics/LineLength
203
+ @type = TYPE_UNKNOWN_ENUM_VALUE
204
+ else
205
+ @type = type
206
+ end
207
+ # rubocop:enable Style/ConditionalAssignment
208
+ end
209
+
210
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
211
+
212
+
213
+ # Checks equality by comparing each attribute.
214
+ # @param [Object] other the other object to be compared
215
+ def ==(other)
216
+ return true if equal?(other)
217
+ self.class == other.class &&
218
+ autonomous_database_id == other.autonomous_database_id &&
219
+ compartment_id == other.compartment_id &&
220
+ display_name == other.display_name &&
221
+ id == other.id &&
222
+ is_automatic == other.is_automatic &&
223
+ lifecycle_details == other.lifecycle_details &&
224
+ lifecycle_state == other.lifecycle_state &&
225
+ time_ended == other.time_ended &&
226
+ time_started == other.time_started &&
227
+ type == other.type
228
+ end
229
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
230
+
231
+ # @see the `==` method
232
+ # @param [Object] other the other object to be compared
233
+ def eql?(other)
234
+ self == other
235
+ end
236
+
237
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
238
+
239
+
240
+ # Calculates hash code according to all attributes.
241
+ # @return [Fixnum] Hash code
242
+ def hash
243
+ [autonomous_database_id, compartment_id, display_name, id, is_automatic, lifecycle_details, lifecycle_state, time_ended, time_started, type].hash
244
+ end
245
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
246
+
247
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
248
+
249
+
250
+ # Builds the object from hash
251
+ # @param [Hash] attributes Model attributes in the form of hash
252
+ # @return [Object] Returns the model itself
253
+ def build_from_hash(attributes)
254
+ return nil unless attributes.is_a?(Hash)
255
+ self.class.swagger_types.each_pair do |key, type|
256
+ if type =~ /^Array<(.*)>/i
257
+ # check to ensure the input is an array given that the the attribute
258
+ # is documented as an array but the input is not
259
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
260
+ public_method("#{key}=").call(
261
+ attributes[self.class.attribute_map[key]]
262
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
263
+ )
264
+ end
265
+ elsif !attributes[self.class.attribute_map[key]].nil?
266
+ public_method("#{key}=").call(
267
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
268
+ )
269
+ end
270
+ # or else data not found in attributes(hash), not an issue as the data can be optional
271
+ end
272
+
273
+ self
274
+ end
275
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
276
+
277
+ # Returns the string representation of the object
278
+ # @return [String] String presentation of the object
279
+ def to_s
280
+ to_hash.to_s
281
+ end
282
+
283
+ # Returns the object in the form of hash
284
+ # @return [Hash] Returns the object in the form of hash
285
+ def to_hash
286
+ hash = {}
287
+ self.class.attribute_map.each_pair do |attr, param|
288
+ value = public_method(attr).call
289
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
290
+ hash[param] = _to_hash(value)
291
+ end
292
+ hash
293
+ end
294
+
295
+ private
296
+
297
+ # Outputs non-array value in the form of hash
298
+ # For object, use to_hash. Otherwise, just return the value
299
+ # @param [Object] value Any valid value
300
+ # @return [Hash] Returns the value in the form of hash
301
+ def _to_hash(value)
302
+ if value.is_a?(Array)
303
+ value.compact.map { |v| _to_hash(v) }
304
+ elsif value.is_a?(Hash)
305
+ {}.tap do |hash|
306
+ value.each { |k, v| hash[k] = _to_hash(v) }
307
+ end
308
+ elsif value.respond_to? :to_hash
309
+ value.to_hash
310
+ else
311
+ value
312
+ end
313
+ end
314
+ end
315
+ end
316
+ # rubocop:enable Lint/UnneededCopDisableDirective