Class: OCI::Mysql::Models::ShapeSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/mysql/models/shape_summary.rb

Overview

The shape of the DB System. The shape determines resources to allocate to the DB System - CPU cores and memory for VM shapes; CPU cores, memory and storage for non-VM (or bare metal) shapes. For a description of shapes, see DB System Shape Options.

Constant Summary collapse

IS_SUPPORTED_FOR_ENUM =
[
  IS_SUPPORTED_FOR_DBSYSTEM = 'DBSYSTEM'.freeze,
  IS_SUPPORTED_FOR_HEATWAVECLUSTER = 'HEATWAVECLUSTER'.freeze,
  IS_SUPPORTED_FOR_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ShapeSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :name (String)

    The value to assign to the #name property

  • :cpu_core_count (Integer)

    The value to assign to the #cpu_core_count property

  • :memory_size_in_gbs (Integer)

    The value to assign to the #memory_size_in_gbs property

  • :is_supported_for (Array<String>)

    The value to assign to the #is_supported_for property



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/oci/mysql/models/shape_summary.rb', line 73

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

  self.cpu_core_count = attributes[:'cpuCoreCount'] if attributes[:'cpuCoreCount']

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

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

  self.memory_size_in_gbs = attributes[:'memorySizeInGBs'] if attributes[:'memorySizeInGBs']

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

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

  self.is_supported_for = attributes[:'isSupportedFor'] if attributes[:'isSupportedFor']

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

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

Instance Attribute Details

#cpu_core_countInteger

[Required] The number of CPU Cores the Instance provides. These are "OCPU"s.

Returns:

  • (Integer)


28
29
30
# File 'lib/oci/mysql/models/shape_summary.rb', line 28

def cpu_core_count
  @cpu_core_count
end

#is_supported_forArray<String>

What service features the shape is supported for.

Returns:

  • (Array<String>)


37
38
39
# File 'lib/oci/mysql/models/shape_summary.rb', line 37

def is_supported_for
  @is_supported_for
end

#memory_size_in_gbsInteger

[Required] The amount of RAM the Instance provides. This is an IEC base-2 number.

Returns:

  • (Integer)


32
33
34
# File 'lib/oci/mysql/models/shape_summary.rb', line 32

def memory_size_in_gbs
  @memory_size_in_gbs
end

#nameString

[Required] The name of the shape used for the DB System.

Returns:

  • (String)


24
25
26
# File 'lib/oci/mysql/models/shape_summary.rb', line 24

def name
  @name
end

Class Method Details

.attribute_mapObject

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



40
41
42
43
44
45
46
47
48
49
# File 'lib/oci/mysql/models/shape_summary.rb', line 40

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'cpu_core_count': :'cpuCoreCount',
    'memory_size_in_gbs': :'memorySizeInGBs',
    'is_supported_for': :'isSupportedFor'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



52
53
54
55
56
57
58
59
60
61
# File 'lib/oci/mysql/models/shape_summary.rb', line 52

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'cpu_core_count': :'Integer',
    'memory_size_in_gbs': :'Integer',
    'is_supported_for': :'Array<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



127
128
129
130
131
132
133
134
135
# File 'lib/oci/mysql/models/shape_summary.rb', line 127

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

  self.class == other.class &&
    name == other.name &&
    cpu_core_count == other.cpu_core_count &&
    memory_size_in_gbs == other.memory_size_in_gbs &&
    is_supported_for == other.is_supported_for
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



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/oci/mysql/models/shape_summary.rb', line 160

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


140
141
142
# File 'lib/oci/mysql/models/shape_summary.rb', line 140

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



149
150
151
# File 'lib/oci/mysql/models/shape_summary.rb', line 149

def hash
  [name, cpu_core_count, memory_size_in_gbs, is_supported_for].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



193
194
195
196
197
198
199
200
201
202
# File 'lib/oci/mysql/models/shape_summary.rb', line 193

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



187
188
189
# File 'lib/oci/mysql/models/shape_summary.rb', line 187

def to_s
  to_hash.to_s
end