Class: OCI::Recovery::Models::ProtectedDatabase
- Inherits:
-
Object
- Object
- OCI::Recovery::Models::ProtectedDatabase
- Defined in:
- lib/oci/recovery/models/protected_database.rb
Overview
A protected database is an Oracle Cloud Database whose backups are managed by Oracle Database Autonomous Recovery Service. Each protected database requires a recovery service subnet and a protection policy to use Recovery Service as the backup destination for centralized backup and recovery
Constant Summary collapse
- DATABASE_SIZE_ENUM =
[ DATABASE_SIZE_XS = 'XS'.freeze, DATABASE_SIZE_S = 'S'.freeze, DATABASE_SIZE_M = 'M'.freeze, DATABASE_SIZE_L = 'L'.freeze, DATABASE_SIZE_XL = 'XL'.freeze, DATABASE_SIZE_XXL = 'XXL'.freeze, DATABASE_SIZE_AUTO = 'AUTO'.freeze, DATABASE_SIZE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- LIFECYCLE_STATE_ENUM =
[ LIFECYCLE_STATE_CREATING = 'CREATING'.freeze, LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze, LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze, LIFECYCLE_STATE_DELETING = 'DELETING'.freeze, LIFECYCLE_STATE_DELETED = 'DELETED'.freeze, LIFECYCLE_STATE_FAILED = 'FAILED'.freeze, LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- HEALTH_ENUM =
[ HEALTH_PROTECTED = 'PROTECTED'.freeze, HEALTH_WARNING = 'WARNING'.freeze, HEALTH_ALERT = 'ALERT'.freeze, HEALTH_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#change_rate ⇒ Float
The percentage of data changes that exist in the database between successive incremental backups.
-
#compartment_id ⇒ String
[Required] The OCID of the compartment that contains the protected database.
-
#compression_ratio ⇒ Float
The compression ratio of the protected database.
-
#database_id ⇒ String
The OCID of the protected database.
-
#database_size ⇒ String
[Required] The size of the protected database.
-
#database_size_in_gbs ⇒ Integer
The size of the database in GBs, in gigabytes.
-
#db_unique_name ⇒ String
[Required] The dbUniqueName for the protected database in Recovery Service.
-
#defined_tags ⇒ Hash<String, Hash<String, Object>>
Defined tags for this resource.
-
#display_name ⇒ String
The protected database name.
-
#freeform_tags ⇒ Hash<String, String>
Simple key-value pair that is applied without any predefined name, type or scope.
-
#health ⇒ String
Indicates the protection status of the database.
-
#health_details ⇒ String
A message describing the current health of the protected database.
-
#id ⇒ String
[Required] The OCID of the protected database.
-
#is_read_only_resource ⇒ BOOLEAN
Indicates whether the protected database is created by Recovery Service or created manually.
-
#is_redo_logs_shipped ⇒ BOOLEAN
The value TRUE indicates that the protected database is configured to use Real-time data protection, and redo-data is sent from the protected database to Recovery Service.
-
#lifecycle_details ⇒ String
Detailed description about the current lifecycle state of the protected database.
-
#lifecycle_state ⇒ String
The current state of the Protected Database.
- #metrics ⇒ OCI::Recovery::Models::Metrics
-
#protection_policy_id ⇒ String
[Required] The OCID of the protection policy associated with the protected database.
-
#recovery_service_subnets ⇒ Array<OCI::Recovery::Models::RecoveryServiceSubnetDetails>
[Required] List of recovery service subnet resources associated with the protected database.
-
#system_tags ⇒ Hash<String, Hash<String, Object>>
Usage of system tag keys.
-
#time_created ⇒ DateTime
An RFC3339 formatted datetime string that indicates the created time for a protected database.
-
#time_updated ⇒ DateTime
An RFC3339 formatted datetime string that indicates the last updated time for a protected database.
-
#vpc_user_name ⇒ String
[Required] The virtual private catalog (VPC) user credentials that authenticates the protected database to access Recovery Service.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ProtectedDatabase
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ ProtectedDatabase
Initializes the object
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
# File 'lib/oci/recovery/models/protected_database.rb', line 261 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.id = attributes[:'id'] if attributes[:'id'] self.display_name = attributes[:'displayName'] if attributes[:'displayName'] raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name') self.display_name = attributes[:'display_name'] if attributes[:'display_name'] self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId'] raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id') self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id'] self.db_unique_name = attributes[:'dbUniqueName'] if attributes[:'dbUniqueName'] raise 'You cannot provide both :dbUniqueName and :db_unique_name' if attributes.key?(:'dbUniqueName') && attributes.key?(:'db_unique_name') self.db_unique_name = attributes[:'db_unique_name'] if attributes[:'db_unique_name'] self.vpc_user_name = attributes[:'vpcUserName'] if attributes[:'vpcUserName'] raise 'You cannot provide both :vpcUserName and :vpc_user_name' if attributes.key?(:'vpcUserName') && attributes.key?(:'vpc_user_name') self.vpc_user_name = attributes[:'vpc_user_name'] if attributes[:'vpc_user_name'] self.database_size = attributes[:'databaseSize'] if attributes[:'databaseSize'] raise 'You cannot provide both :databaseSize and :database_size' if attributes.key?(:'databaseSize') && attributes.key?(:'database_size') self.database_size = attributes[:'database_size'] if attributes[:'database_size'] self.protection_policy_id = attributes[:'protectionPolicyId'] if attributes[:'protectionPolicyId'] raise 'You cannot provide both :protectionPolicyId and :protection_policy_id' if attributes.key?(:'protectionPolicyId') && attributes.key?(:'protection_policy_id') self.protection_policy_id = attributes[:'protection_policy_id'] if attributes[:'protection_policy_id'] self.recovery_service_subnets = attributes[:'recoveryServiceSubnets'] if attributes[:'recoveryServiceSubnets'] raise 'You cannot provide both :recoveryServiceSubnets and :recovery_service_subnets' if attributes.key?(:'recoveryServiceSubnets') && attributes.key?(:'recovery_service_subnets') self.recovery_service_subnets = attributes[:'recovery_service_subnets'] if attributes[:'recovery_service_subnets'] self.database_id = attributes[:'databaseId'] if attributes[:'databaseId'] raise 'You cannot provide both :databaseId and :database_id' if attributes.key?(:'databaseId') && attributes.key?(:'database_id') self.database_id = attributes[:'database_id'] if attributes[:'database_id'] self.database_size_in_gbs = attributes[:'databaseSizeInGBs'] if attributes[:'databaseSizeInGBs'] raise 'You cannot provide both :databaseSizeInGBs and :database_size_in_gbs' if attributes.key?(:'databaseSizeInGBs') && attributes.key?(:'database_size_in_gbs') self.database_size_in_gbs = attributes[:'database_size_in_gbs'] if attributes[:'database_size_in_gbs'] self.change_rate = attributes[:'changeRate'] if attributes[:'changeRate'] raise 'You cannot provide both :changeRate and :change_rate' if attributes.key?(:'changeRate') && attributes.key?(:'change_rate') self.change_rate = attributes[:'change_rate'] if attributes[:'change_rate'] self.compression_ratio = attributes[:'compressionRatio'] if attributes[:'compressionRatio'] raise 'You cannot provide both :compressionRatio and :compression_ratio' if attributes.key?(:'compressionRatio') && attributes.key?(:'compression_ratio') self.compression_ratio = attributes[:'compression_ratio'] if attributes[:'compression_ratio'] self.is_redo_logs_shipped = attributes[:'isRedoLogsShipped'] unless attributes[:'isRedoLogsShipped'].nil? raise 'You cannot provide both :isRedoLogsShipped and :is_redo_logs_shipped' if attributes.key?(:'isRedoLogsShipped') && attributes.key?(:'is_redo_logs_shipped') self.is_redo_logs_shipped = attributes[:'is_redo_logs_shipped'] unless attributes[:'is_redo_logs_shipped'].nil? self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated'] raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created') self.time_created = attributes[:'time_created'] if attributes[:'time_created'] self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated'] raise 'You cannot provide both :timeUpdated and :time_updated' if attributes.key?(:'timeUpdated') && attributes.key?(:'time_updated') self.time_updated = attributes[:'time_updated'] if attributes[:'time_updated'] self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState'] raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state') self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state'] self.health = attributes[:'health'] if attributes[:'health'] self.is_read_only_resource = attributes[:'isReadOnlyResource'] unless attributes[:'isReadOnlyResource'].nil? raise 'You cannot provide both :isReadOnlyResource and :is_read_only_resource' if attributes.key?(:'isReadOnlyResource') && attributes.key?(:'is_read_only_resource') self.is_read_only_resource = attributes[:'is_read_only_resource'] unless attributes[:'is_read_only_resource'].nil? self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails'] raise 'You cannot provide both :lifecycleDetails and :lifecycle_details' if attributes.key?(:'lifecycleDetails') && attributes.key?(:'lifecycle_details') self.lifecycle_details = attributes[:'lifecycle_details'] if attributes[:'lifecycle_details'] self.health_details = attributes[:'healthDetails'] if attributes[:'healthDetails'] raise 'You cannot provide both :healthDetails and :health_details' if attributes.key?(:'healthDetails') && attributes.key?(:'health_details') self.health_details = attributes[:'health_details'] if attributes[:'health_details'] self.metrics = attributes[:'metrics'] if attributes[:'metrics'] self. = attributes[:'freeformTags'] if attributes[:'freeformTags'] raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags') self. = attributes[:'freeform_tags'] if attributes[:'freeform_tags'] self. = attributes[:'definedTags'] if attributes[:'definedTags'] raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags') self. = attributes[:'defined_tags'] if attributes[:'defined_tags'] self. = attributes[:'systemTags'] if attributes[:'systemTags'] raise 'You cannot provide both :systemTags and :system_tags' if attributes.key?(:'systemTags') && attributes.key?(:'system_tags') self. = attributes[:'system_tags'] if attributes[:'system_tags'] end |
Instance Attribute Details
#change_rate ⇒ Float
The percentage of data changes that exist in the database between successive incremental backups.
86 87 88 |
# File 'lib/oci/recovery/models/protected_database.rb', line 86 def change_rate @change_rate end |
#compartment_id ⇒ String
[Required] The OCID of the compartment that contains the protected database.
54 55 56 |
# File 'lib/oci/recovery/models/protected_database.rb', line 54 def compartment_id @compartment_id end |
#compression_ratio ⇒ Float
The compression ratio of the protected database. The compression ratio represents the ratio of compressed block size to expanded block size.
90 91 92 |
# File 'lib/oci/recovery/models/protected_database.rb', line 90 def compression_ratio @compression_ratio end |
#database_id ⇒ String
The OCID of the protected database.
78 79 80 |
# File 'lib/oci/recovery/models/protected_database.rb', line 78 def database_id @database_id end |
#database_size ⇒ String
[Required] The size of the protected database. XS - Less than 5GB, S - 5GB to 50GB, M - 50GB to 500GB, L - 500GB to 1TB, XL - 1TB to 5TB, XXL - Greater than 5TB.
66 67 68 |
# File 'lib/oci/recovery/models/protected_database.rb', line 66 def database_size @database_size end |
#database_size_in_gbs ⇒ Integer
The size of the database in GBs, in gigabytes.
82 83 84 |
# File 'lib/oci/recovery/models/protected_database.rb', line 82 def database_size_in_gbs @database_size_in_gbs end |
#db_unique_name ⇒ String
[Required] The dbUniqueName for the protected database in Recovery Service. You cannot change the unique name.
58 59 60 |
# File 'lib/oci/recovery/models/protected_database.rb', line 58 def db_unique_name @db_unique_name end |
#defined_tags ⇒ Hash<String, Hash<String, Object>>
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {\"foo-namespace\": {\"bar-key\": \"value\"}}. For more information, see {Resource Tags}[https://docs.oracle.com/en-us/iaas/Content/General/Concepts/resourcetags.htm]
159 160 161 |
# File 'lib/oci/recovery/models/protected_database.rb', line 159 def @defined_tags end |
#display_name ⇒ String
The protected database name. You can change the displayName. Avoid entering confidential information.
50 51 52 |
# File 'lib/oci/recovery/models/protected_database.rb', line 50 def display_name @display_name end |
#freeform_tags ⇒ Hash<String, String>
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {\"bar-key\": \"value\"}
153 154 155 |
# File 'lib/oci/recovery/models/protected_database.rb', line 153 def @freeform_tags end |
#health ⇒ String
Indicates the protection status of the database. Allowed values are: - HEALTHY - WARNING - ALERT
A 'HEALTHY' status indicates that Recovery Service can ensure database recovery to any point in time within the entire recovery window. The potential data loss exposure since the last backup is: - Less than 10 seconds, if Real-time data protection is enabled - Less than 70 minutes if Real-time data protection is disabled
A 'WARNING' status indicates that Recovery Service can ensure database recovery within the current recovery window - 1 day. The potential data loss exposure since the last backup is: - Greater than 10 seconds, if Real-time data protection is enabled - Greater than 60 minutes, if if Real-time data protection is disabled
An 'ALERT' status indicates that Recovery Service cannot recover the database within the current recovery window.
129 130 131 |
# File 'lib/oci/recovery/models/protected_database.rb', line 129 def health @health end |
#health_details ⇒ String
A message describing the current health of the protected database.
144 145 146 |
# File 'lib/oci/recovery/models/protected_database.rb', line 144 def health_details @health_details end |
#id ⇒ String
[Required] The OCID of the protected database.
46 47 48 |
# File 'lib/oci/recovery/models/protected_database.rb', line 46 def id @id end |
#is_read_only_resource ⇒ BOOLEAN
Indicates whether the protected database is created by Recovery Service or created manually. Set to TRUE for a service-defined protected database. When you enable the OCI-managed automatic backups option for a database and set Recovery Service as the backup destination, then Recovery Service creates the associated protected database resource. Set to FALSE for a user-defined protected database.
136 137 138 |
# File 'lib/oci/recovery/models/protected_database.rb', line 136 def is_read_only_resource @is_read_only_resource end |
#is_redo_logs_shipped ⇒ BOOLEAN
The value TRUE indicates that the protected database is configured to use Real-time data protection, and redo-data is sent from the protected database to Recovery Service. Real-time data protection substantially reduces the window of potential data loss that exists between successive archived redo log backups. For this to be effective, additional configuration is needed on client side.
97 98 99 |
# File 'lib/oci/recovery/models/protected_database.rb', line 97 def is_redo_logs_shipped @is_redo_logs_shipped end |
#lifecycle_details ⇒ String
Detailed description about the current lifecycle state of the protected database. For example, it can be used to provide actionable information for a resource in a Failed state.
140 141 142 |
# File 'lib/oci/recovery/models/protected_database.rb', line 140 def lifecycle_details @lifecycle_details end |
#lifecycle_state ⇒ String
The current state of the Protected Database.
111 112 113 |
# File 'lib/oci/recovery/models/protected_database.rb', line 111 def lifecycle_state @lifecycle_state end |
#metrics ⇒ OCI::Recovery::Models::Metrics
147 148 149 |
# File 'lib/oci/recovery/models/protected_database.rb', line 147 def metrics @metrics end |
#protection_policy_id ⇒ String
[Required] The OCID of the protection policy associated with the protected database.
70 71 72 |
# File 'lib/oci/recovery/models/protected_database.rb', line 70 def protection_policy_id @protection_policy_id end |
#recovery_service_subnets ⇒ Array<OCI::Recovery::Models::RecoveryServiceSubnetDetails>
[Required] List of recovery service subnet resources associated with the protected database.
74 75 76 |
# File 'lib/oci/recovery/models/protected_database.rb', line 74 def recovery_service_subnets @recovery_service_subnets end |
#system_tags ⇒ Hash<String, Hash<String, Object>>
Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}. For more information, see {Resource Tags}[https://docs.oracle.com/en-us/iaas/Content/General/Concepts/resourcetags.htm]
165 166 167 |
# File 'lib/oci/recovery/models/protected_database.rb', line 165 def @system_tags end |
#time_created ⇒ DateTime
An RFC3339 formatted datetime string that indicates the created time for a protected database. For example: '2020-05-22T21:10:29.600Z'
102 103 104 |
# File 'lib/oci/recovery/models/protected_database.rb', line 102 def time_created @time_created end |
#time_updated ⇒ DateTime
An RFC3339 formatted datetime string that indicates the last updated time for a protected database. For example: '2020-05-22T21:10:29.600Z'
107 108 109 |
# File 'lib/oci/recovery/models/protected_database.rb', line 107 def time_updated @time_updated end |
#vpc_user_name ⇒ String
[Required] The virtual private catalog (VPC) user credentials that authenticates the protected database to access Recovery Service.
62 63 64 |
# File 'lib/oci/recovery/models/protected_database.rb', line 62 def vpc_user_name @vpc_user_name end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/oci/recovery/models/protected_database.rb', line 168 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'display_name': :'displayName', 'compartment_id': :'compartmentId', 'db_unique_name': :'dbUniqueName', 'vpc_user_name': :'vpcUserName', 'database_size': :'databaseSize', 'protection_policy_id': :'protectionPolicyId', 'recovery_service_subnets': :'recoveryServiceSubnets', 'database_id': :'databaseId', 'database_size_in_gbs': :'databaseSizeInGBs', 'change_rate': :'changeRate', 'compression_ratio': :'compressionRatio', 'is_redo_logs_shipped': :'isRedoLogsShipped', 'time_created': :'timeCreated', 'time_updated': :'timeUpdated', 'lifecycle_state': :'lifecycleState', 'health': :'health', 'is_read_only_resource': :'isReadOnlyResource', 'lifecycle_details': :'lifecycleDetails', 'health_details': :'healthDetails', 'metrics': :'metrics', 'freeform_tags': :'freeformTags', 'defined_tags': :'definedTags', 'system_tags': :'systemTags' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/oci/recovery/models/protected_database.rb', line 200 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'display_name': :'String', 'compartment_id': :'String', 'db_unique_name': :'String', 'vpc_user_name': :'String', 'database_size': :'String', 'protection_policy_id': :'String', 'recovery_service_subnets': :'Array<OCI::Recovery::Models::RecoveryServiceSubnetDetails>', 'database_id': :'String', 'database_size_in_gbs': :'Integer', 'change_rate': :'Float', 'compression_ratio': :'Float', 'is_redo_logs_shipped': :'BOOLEAN', 'time_created': :'DateTime', 'time_updated': :'DateTime', 'lifecycle_state': :'String', 'health': :'String', 'is_read_only_resource': :'BOOLEAN', 'lifecycle_details': :'String', 'health_details': :'String', 'metrics': :'OCI::Recovery::Models::Metrics', 'freeform_tags': :'Hash<String, String>', 'defined_tags': :'Hash<String, Hash<String, Object>>', 'system_tags': :'Hash<String, Hash<String, Object>>' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 |
# File 'lib/oci/recovery/models/protected_database.rb', line 446 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && display_name == other.display_name && compartment_id == other.compartment_id && db_unique_name == other.db_unique_name && vpc_user_name == other.vpc_user_name && database_size == other.database_size && protection_policy_id == other.protection_policy_id && recovery_service_subnets == other.recovery_service_subnets && database_id == other.database_id && database_size_in_gbs == other.database_size_in_gbs && change_rate == other.change_rate && compression_ratio == other.compression_ratio && is_redo_logs_shipped == other.is_redo_logs_shipped && time_created == other.time_created && time_updated == other.time_updated && lifecycle_state == other.lifecycle_state && health == other.health && is_read_only_resource == other.is_read_only_resource && lifecycle_details == other.lifecycle_details && health_details == other.health_details && metrics == other.metrics && == other. && == other. && == other. end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 |
# File 'lib/oci/recovery/models/protected_database.rb', line 499 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
479 480 481 |
# File 'lib/oci/recovery/models/protected_database.rb', line 479 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
488 489 490 |
# File 'lib/oci/recovery/models/protected_database.rb', line 488 def hash [id, display_name, compartment_id, db_unique_name, vpc_user_name, database_size, protection_policy_id, recovery_service_subnets, database_id, database_size_in_gbs, change_rate, compression_ratio, is_redo_logs_shipped, time_created, time_updated, lifecycle_state, health, is_read_only_resource, lifecycle_details, health_details, metrics, , , ].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
532 533 534 535 536 537 538 539 540 541 |
# File 'lib/oci/recovery/models/protected_database.rb', line 532 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
526 527 528 |
# File 'lib/oci/recovery/models/protected_database.rb', line 526 def to_s to_hash.to_s end |