Class: OCI::CloudBridge::Models::OlvmDataCenter

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/cloud_bridge/models/olvm_data_center.rb

Overview

An OLVM Data Center.

Constant Summary collapse

QUOTA_MODE_TYPE_ENUM =
[
  QUOTA_MODE_TYPE_AUDIT = 'AUDIT'.freeze,
  QUOTA_MODE_TYPE_DISABLED = 'DISABLED'.freeze,
  QUOTA_MODE_TYPE_ENABLED = 'ENABLED'.freeze
].freeze
DATA_CENTER_STATUS_ENUM =
[
  DATA_CENTER_STATUS_CONTEND = 'CONTEND'.freeze,
  DATA_CENTER_STATUS_MAINTENANCE = 'MAINTENANCE'.freeze,
  DATA_CENTER_STATUS_NOT_OPERATIONAL = 'NOT_OPERATIONAL'.freeze,
  DATA_CENTER_STATUS_PROBLEMATIC = 'PROBLEMATIC'.freeze,
  DATA_CENTER_STATUS_UNINITIALIZED = 'UNINITIALIZED'.freeze,
  DATA_CENTER_STATUS_UP = 'UP'.freeze
].freeze
STORAGE_FORMAT_ENUM =
[
  STORAGE_FORMAT_V1 = 'V1'.freeze,
  STORAGE_FORMAT_V2 = 'V2'.freeze,
  STORAGE_FORMAT_V3 = 'V3'.freeze,
  STORAGE_FORMAT_V4 = 'V4'.freeze,
  STORAGE_FORMAT_V5 = 'V5'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ OlvmDataCenter

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 125

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

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

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

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

  self.is_local = attributes[:'isLocal'] unless attributes[:'isLocal'].nil?

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

  self.is_local = attributes[:'is_local'] unless attributes[:'is_local'].nil?

  self.quota_mode_type = attributes[:'quotaModeType'] if attributes[:'quotaModeType']

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

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

  self.data_center_status = attributes[:'dataCenterStatus'] if attributes[:'dataCenterStatus']

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

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

  self.storage_format = attributes[:'storageFormat'] if attributes[:'storageFormat']

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

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

  self.supported_versions = attributes[:'supportedVersions'] if attributes[:'supportedVersions']

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

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

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

Instance Attribute Details

#commentString

Free text containing comments about this object.

Returns:

  • (String)


36
37
38
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 36

def comment
  @comment
end

#data_center_statusString

The status of data center

Returns:

  • (String)


60
61
62
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 60

def data_center_status
  @data_center_status
end

#descriptionString

A human-readable description in plain text.

Returns:

  • (String)


40
41
42
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 40

def description
  @description
end

#idString

A unique identifier.

Returns:

  • (String)


44
45
46
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 44

def id
  @id
end

#is_localBOOLEAN

Whether the data center is local.

Returns:

  • (BOOLEAN)


52
53
54
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 52

def is_local
  @is_local
end

#nameString

A human-readable name in plain text.

Returns:

  • (String)


48
49
50
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 48

def name
  @name
end

#quota_mode_typeString

The type of quota mode

Returns:

  • (String)


56
57
58
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 56

def quota_mode_type
  @quota_mode_type
end

#storage_formatString

Type which represents a format of storage domain

Returns:

  • (String)


64
65
66
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 64

def storage_format
  @storage_format
end

#supported_versionsArray<OCI::CloudBridge::Models::OlvmVersion>

List of supported versions.



68
69
70
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 68

def supported_versions
  @supported_versions
end

#versionOCI::CloudBridge::Models::OlvmVersion



71
72
73
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 71

def version
  @version
end

Class Method Details

.attribute_mapObject

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



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 74

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'comment': :'comment',
    'description': :'description',
    'id': :'id',
    'name': :'name',
    'is_local': :'isLocal',
    'quota_mode_type': :'quotaModeType',
    'data_center_status': :'dataCenterStatus',
    'storage_format': :'storageFormat',
    'supported_versions': :'supportedVersions',
    'version': :'version'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 92

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'comment': :'String',
    'description': :'String',
    'id': :'String',
    'name': :'String',
    'is_local': :'BOOLEAN',
    'quota_mode_type': :'String',
    'data_center_status': :'String',
    'storage_format': :'String',
    'supported_versions': :'Array<OCI::CloudBridge::Models::OlvmVersion>',
    'version': :'OCI::CloudBridge::Models::OlvmVersion'
    # 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



203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 203

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

  self.class == other.class &&
    comment == other.comment &&
    description == other.description &&
    id == other.id &&
    name == other.name &&
    is_local == other.is_local &&
    quota_mode_type == other.quota_mode_type &&
    data_center_status == other.data_center_status &&
    storage_format == other.storage_format &&
    supported_versions == other.supported_versions &&
    version == other.version
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



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 242

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


222
223
224
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 222

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



231
232
233
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 231

def hash
  [comment, description, id, name, is_local, quota_mode_type, data_center_status, storage_format, supported_versions, version].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



275
276
277
278
279
280
281
282
283
284
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 275

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



269
270
271
# File 'lib/oci/cloud_bridge/models/olvm_data_center.rb', line 269

def to_s
  to_hash.to_s
end