Class: OCI::Core::Models::VolumeBackupSchedule
- Inherits:
-
Object
- Object
- OCI::Core::Models::VolumeBackupSchedule
- Defined in:
- lib/oci/core/models/volume_backup_schedule.rb
Overview
Defines a chronological recurrence pattern for creating scheduled backups at a particular periodicity.
Constant Summary collapse
- BACKUP_TYPE_ENUM =
[BACKUP_TYPE_FULL = 'FULL', BACKUP_TYPE_INCREMENTAL = 'INCREMENTAL', BACKUP_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
- PERIOD_ENUM =
[PERIOD_ONE_HOUR = 'ONE_HOUR', PERIOD_ONE_DAY = 'ONE_DAY', PERIOD_ONE_WEEK = 'ONE_WEEK', PERIOD_ONE_MONTH = 'ONE_MONTH', PERIOD_ONE_YEAR = 'ONE_YEAR', PERIOD_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
Instance Attribute Summary collapse
-
#backup_type ⇒ String
[Required] The type of backup to create.
-
#offset_seconds ⇒ Integer
[Required] The number of seconds (positive or negative) that the backup time should be shifted from the default interval boundaries specified by the period.
-
#period ⇒ String
[Required] How often the backup should occur.
-
#retention_seconds ⇒ Integer
[Required] How long, in seconds, backups created by this schedule should be kept until being automatically deleted.
Instance Method Summary collapse
-
#==(other_object) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other_object) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ VolumeBackupSchedule
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 = {}) ⇒ VolumeBackupSchedule
Initializes the object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 44 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} if attributes[:'backupType'] self.backup_type = attributes[:'backupType'] end raise 'You cannot provide both :backupType and :backup_type' if attributes.key?(:'backupType') && attributes.key?(:'backup_type') if attributes[:'backup_type'] self.backup_type = attributes[:'backup_type'] end if attributes[:'offsetSeconds'] self.offset_seconds = attributes[:'offsetSeconds'] end raise 'You cannot provide both :offsetSeconds and :offset_seconds' if attributes.key?(:'offsetSeconds') && attributes.key?(:'offset_seconds') if attributes[:'offset_seconds'] self.offset_seconds = attributes[:'offset_seconds'] end if attributes[:'period'] self.period = attributes[:'period'] end if attributes[:'retentionSeconds'] self.retention_seconds = attributes[:'retentionSeconds'] end raise 'You cannot provide both :retentionSeconds and :retention_seconds' if attributes.key?(:'retentionSeconds') && attributes.key?(:'retention_seconds') if attributes[:'retention_seconds'] self.retention_seconds = attributes[:'retention_seconds'] end end |
Instance Attribute Details
#backup_type ⇒ String
[Required] The type of backup to create.
23 24 25 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 23 def backup_type @backup_type end |
#offset_seconds ⇒ Integer
[Required] The number of seconds (positive or negative) that the backup time should be shifted from the default interval boundaries specified by the period.
27 28 29 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 27 def offset_seconds @offset_seconds end |
#period ⇒ String
[Required] How often the backup should occur.
31 32 33 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 31 def period @period end |
#retention_seconds ⇒ Integer
[Required] How long, in seconds, backups created by this schedule should be kept until being automatically deleted.
35 36 37 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 35 def retention_seconds @retention_seconds end |
Instance Method Details
#==(other_object) ⇒ Object
Checks equality by comparing each attribute.
108 109 110 111 112 113 114 115 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 108 def ==(other_object) return true if self.equal?(other_object) self.class == other_object.class && backup_type == other_object.backup_type && offset_seconds == other_object.offset_seconds && period == other_object.period && retention_seconds == other_object.retention_seconds end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 132 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) self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? self.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_object) ⇒ Boolean
119 120 121 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 119 def eql?(other_object) self == other_object end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
125 126 127 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 125 def hash [backup_type, offset_seconds, period, retention_seconds].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
157 158 159 160 161 162 163 164 165 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 157 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
151 152 153 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 151 def to_s to_hash.to_s end |