Class: OCI::Dif::Models::ObjectStorageUpdateDetail

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/dif/models/object_storage_update_detail.rb

Overview

Details of Object Storage instance to be updated.

Constant Summary collapse

OBJECT_VERSIONING_ENUM =
[
  OBJECT_VERSIONING_ENABLED = 'ENABLED'.freeze,
  OBJECT_VERSIONING_SUSPENDED = 'SUSPENDED'.freeze,
  OBJECT_VERSIONING_DISABLED = 'DISABLED'.freeze
].freeze
AUTO_TIERING_ENUM =
[
  AUTO_TIERING_DISABLED = 'DISABLED'.freeze,
  AUTO_TIERING_INFREQUENTACCESS = 'INFREQUENTACCESS'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ObjectStorageUpdateDetail

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :instance_id (String)

    The value to assign to the #instance_id property

  • :object_versioning (String)

    The value to assign to the #object_versioning property

  • :auto_tiering (String)

    The value to assign to the #auto_tiering property



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/oci/dif/models/object_storage_update_detail.rb', line 65

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.instance_id = attributes[:'instanceId'] if attributes[:'instanceId']

  raise 'You cannot provide both :instanceId and :instance_id' if attributes.key?(:'instanceId') && attributes.key?(:'instance_id')

  self.instance_id = attributes[:'instance_id'] if attributes[:'instance_id']

  self.object_versioning = attributes[:'objectVersioning'] if attributes[:'objectVersioning']

  raise 'You cannot provide both :objectVersioning and :object_versioning' if attributes.key?(:'objectVersioning') && attributes.key?(:'object_versioning')

  self.object_versioning = attributes[:'object_versioning'] if attributes[:'object_versioning']

  self.auto_tiering = attributes[:'autoTiering'] if attributes[:'autoTiering']

  raise 'You cannot provide both :autoTiering and :auto_tiering' if attributes.key?(:'autoTiering') && attributes.key?(:'auto_tiering')

  self.auto_tiering = attributes[:'auto_tiering'] if attributes[:'auto_tiering']
end

Instance Attribute Details

#auto_tieringString

It sets the auto-tiering status on the bucket.Allowed values are "DISABLED" / "INFREQUENTACCESS"

Returns:

  • (String)


32
33
34
# File 'lib/oci/dif/models/object_storage_update_detail.rb', line 32

def auto_tiering
  @auto_tiering
end

#instance_idString

[Required] Instance id of the existing Object Storage instance to be updated.

Returns:

  • (String)


24
25
26
# File 'lib/oci/dif/models/object_storage_update_detail.rb', line 24

def instance_id
  @instance_id
end

#object_versioningString

Mentions which storage tier to use for the bucket,Allowed values are "STANDARD" / "ARCHIVE"

Returns:

  • (String)


28
29
30
# File 'lib/oci/dif/models/object_storage_update_detail.rb', line 28

def object_versioning
  @object_versioning
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



35
36
37
38
39
40
41
42
43
# File 'lib/oci/dif/models/object_storage_update_detail.rb', line 35

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'instance_id': :'instanceId',
    'object_versioning': :'objectVersioning',
    'auto_tiering': :'autoTiering'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



46
47
48
49
50
51
52
53
54
# File 'lib/oci/dif/models/object_storage_update_detail.rb', line 46

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'instance_id': :'String',
    'object_versioning': :'String',
    'auto_tiering': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



113
114
115
116
117
118
119
120
# File 'lib/oci/dif/models/object_storage_update_detail.rb', line 113

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    instance_id == other.instance_id &&
    object_versioning == other.object_versioning &&
    auto_tiering == other.auto_tiering
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/oci/dif/models/object_storage_update_detail.rb', line 145

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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


125
126
127
# File 'lib/oci/dif/models/object_storage_update_detail.rb', line 125

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



134
135
136
# File 'lib/oci/dif/models/object_storage_update_detail.rb', line 134

def hash
  [instance_id, object_versioning, auto_tiering].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



178
179
180
181
182
183
184
185
186
187
# File 'lib/oci/dif/models/object_storage_update_detail.rb', line 178

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



172
173
174
# File 'lib/oci/dif/models/object_storage_update_detail.rb', line 172

def to_s
  to_hash.to_s
end