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::AutonomousDatabaseSummary # 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,165 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # Details to create an Oracle Autonomous Data Warehouse backup.
8
+ #
9
+ class Database::Models::CreateAutonomousDataWarehouseBackupDetails # rubocop:disable Metrics/LineLength
10
+ # **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the Autonomous Data Warehouse backup.
11
+ # @return [String]
12
+ attr_accessor :autonomous_data_warehouse_id
13
+
14
+ # **[Required]** The user-friendly name for the backup. The name does not have to be unique.
15
+ # @return [String]
16
+ attr_accessor :display_name
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ # rubocop:disable Style/SymbolLiteral
22
+ 'autonomous_data_warehouse_id': :'autonomousDataWarehouseId',
23
+ 'display_name': :'displayName'
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
+ 'autonomous_data_warehouse_id': :'String',
33
+ 'display_name': :'String'
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] :autonomous_data_warehouse_id The value to assign to the {#autonomous_data_warehouse_id} property
45
+ # @option attributes [String] :display_name The value to assign to the {#display_name} 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.autonomous_data_warehouse_id = attributes[:'autonomousDataWarehouseId'] if attributes[:'autonomousDataWarehouseId']
53
+
54
+ raise 'You cannot provide both :autonomousDataWarehouseId and :autonomous_data_warehouse_id' if attributes.key?(:'autonomousDataWarehouseId') && attributes.key?(:'autonomous_data_warehouse_id')
55
+
56
+ self.autonomous_data_warehouse_id = attributes[:'autonomous_data_warehouse_id'] if attributes[:'autonomous_data_warehouse_id']
57
+
58
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
59
+
60
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
61
+
62
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
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, 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
+ self.class == other.class &&
75
+ autonomous_data_warehouse_id == other.autonomous_data_warehouse_id &&
76
+ display_name == other.display_name
77
+ end
78
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
79
+
80
+ # @see the `==` method
81
+ # @param [Object] other the other object to be compared
82
+ def eql?(other)
83
+ self == other
84
+ end
85
+
86
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
87
+
88
+
89
+ # Calculates hash code according to all attributes.
90
+ # @return [Fixnum] Hash code
91
+ def hash
92
+ [autonomous_data_warehouse_id, display_name].hash
93
+ end
94
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
95
+
96
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
97
+
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def build_from_hash(attributes)
103
+ return nil unless attributes.is_a?(Hash)
104
+ self.class.swagger_types.each_pair do |key, type|
105
+ if type =~ /^Array<(.*)>/i
106
+ # check to ensure the input is an array given that the the attribute
107
+ # is documented as an array but the input is not
108
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
109
+ public_method("#{key}=").call(
110
+ attributes[self.class.attribute_map[key]]
111
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
112
+ )
113
+ end
114
+ elsif !attributes[self.class.attribute_map[key]].nil?
115
+ public_method("#{key}=").call(
116
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
117
+ )
118
+ end
119
+ # or else data not found in attributes(hash), not an issue as the data can be optional
120
+ end
121
+
122
+ self
123
+ end
124
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
125
+
126
+ # Returns the string representation of the object
127
+ # @return [String] String presentation of the object
128
+ def to_s
129
+ to_hash.to_s
130
+ end
131
+
132
+ # Returns the object in the form of hash
133
+ # @return [Hash] Returns the object in the form of hash
134
+ def to_hash
135
+ hash = {}
136
+ self.class.attribute_map.each_pair do |attr, param|
137
+ value = public_method(attr).call
138
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
139
+ hash[param] = _to_hash(value)
140
+ end
141
+ hash
142
+ end
143
+
144
+ private
145
+
146
+ # Outputs non-array value in the form of hash
147
+ # For object, use to_hash. Otherwise, just return the value
148
+ # @param [Object] value Any valid value
149
+ # @return [Hash] Returns the value in the form of hash
150
+ def _to_hash(value)
151
+ if value.is_a?(Array)
152
+ value.compact.map { |v| _to_hash(v) }
153
+ elsif value.is_a?(Hash)
154
+ {}.tap do |hash|
155
+ value.each { |k, v| hash[k] = _to_hash(v) }
156
+ end
157
+ elsif value.respond_to? :to_hash
158
+ value.to_hash
159
+ else
160
+ value
161
+ end
162
+ end
163
+ end
164
+ end
165
+ # rubocop:enable Lint/UnneededCopDisableDirective