Class: OCI::DatabaseManagement::Models::IormPlan

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_management/models/iorm_plan.rb

Overview

The IORM plan from an Exadata storage server.

Constant Summary collapse

PLAN_STATUS_ENUM =
[
  PLAN_STATUS_ACTIVE = 'ACTIVE'.freeze,
  PLAN_STATUS_INACTIVE = 'INACTIVE'.freeze,
  PLAN_STATUS_OTHER = 'OTHER'.freeze,
  PLAN_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
PLAN_OBJECTIVE_ENUM =
[
  PLAN_OBJECTIVE_AUTO = 'AUTO'.freeze,
  PLAN_OBJECTIVE_HIGH_THROUGHPUT = 'HIGH_THROUGHPUT'.freeze,
  PLAN_OBJECTIVE_LOW_LATENCY = 'LOW_LATENCY'.freeze,
  PLAN_OBJECTIVE_BALANCED = 'BALANCED'.freeze,
  PLAN_OBJECTIVE_BASIC = 'BASIC'.freeze,
  PLAN_OBJECTIVE_OTHER = 'OTHER'.freeze,
  PLAN_OBJECTIVE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ IormPlan

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/oci/database_management/models/iorm_plan.rb', line 71

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

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

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

  self.plan_objective = attributes[:'planObjective'] if attributes[:'planObjective']

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

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

  self.db_plan = attributes[:'dbPlan'] if attributes[:'dbPlan']

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

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

Instance Attribute Details

#db_planOCI::DatabaseManagement::Models::DatabasePlan



38
39
40
# File 'lib/oci/database_management/models/iorm_plan.rb', line 38

def db_plan
  @db_plan
end

#plan_objectiveString

[Required] The objective of the IORM plan.

Returns:

  • (String)


35
36
37
# File 'lib/oci/database_management/models/iorm_plan.rb', line 35

def plan_objective
  @plan_objective
end

#plan_statusString

[Required] The status of the IORM plan.

Returns:

  • (String)


31
32
33
# File 'lib/oci/database_management/models/iorm_plan.rb', line 31

def plan_status
  @plan_status
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'plan_status': :'planStatus',
    'plan_objective': :'planObjective',
    'db_plan': :'dbPlan'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'plan_status': :'String',
    'plan_objective': :'String',
    'db_plan': :'OCI::DatabaseManagement::Models::DatabasePlan'
    # 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



129
130
131
132
133
134
135
136
# File 'lib/oci/database_management/models/iorm_plan.rb', line 129

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

  self.class == other.class &&
    plan_status == other.plan_status &&
    plan_objective == other.plan_objective &&
    db_plan == other.db_plan
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



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

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


141
142
143
# File 'lib/oci/database_management/models/iorm_plan.rb', line 141

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



150
151
152
# File 'lib/oci/database_management/models/iorm_plan.rb', line 150

def hash
  [plan_status, plan_objective, db_plan].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



194
195
196
197
198
199
200
201
202
203
# File 'lib/oci/database_management/models/iorm_plan.rb', line 194

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



188
189
190
# File 'lib/oci/database_management/models/iorm_plan.rb', line 188

def to_s
  to_hash.to_s
end