Class: OCI::Opsi::Models::AddmDbRecommendationAggregation

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/opsi/models/addm_db_recommendation_aggregation.rb

Overview

Summarizes a specific ADDM recommendation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AddmDbRecommendationAggregation

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



113
114
115
116
117
118
119
120
121
122
123
124
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
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 113

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

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

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

  self.requires_db_restart = attributes[:'requiresDbRestart'] if attributes[:'requiresDbRestart']

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

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

  self.implement_actions = attributes[:'implementActions'] if attributes[:'implementActions']

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

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

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

  self.max_benefit_percent = attributes[:'maxBenefitPercent'] if attributes[:'maxBenefitPercent']

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

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

  self.overall_benefit_percent = attributes[:'overallBenefitPercent'] if attributes[:'overallBenefitPercent']

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

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

  self.max_benefit_avg_active_sessions = attributes[:'maxBenefitAvgActiveSessions'] if attributes[:'maxBenefitAvgActiveSessions']

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

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

  self.frequency_count = attributes[:'frequencyCount'] if attributes[:'frequencyCount']

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

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

  self.related_object = attributes[:'relatedObject'] if attributes[:'relatedObject']

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

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

Instance Attribute Details

#frequency_countInteger

Number of occurrences for this recommendation

Returns:

  • (Integer)


53
54
55
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 53

def frequency_count
  @frequency_count
end

#idString

[Required] The OCID of the Database insight.

Returns:

  • (String)


13
14
15
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 13

def id
  @id
end

#implement_actionsArray<String>

Actions that can be performed to implement the recommendation (such as 'ALTER PARAMETER', 'RUN SQL TUNING ADVISOR')

Returns:

  • (Array<String>)


33
34
35
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 33

def implement_actions
  @implement_actions
end

#max_benefit_avg_active_sessionsFloat

Maximum estimated benefit in terms of average active sessions

Returns:

  • (Float)


49
50
51
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 49

def max_benefit_avg_active_sessions
  @max_benefit_avg_active_sessions
end

#max_benefit_percentFloat

Maximum estimated benefit in terms of percentage of total activity

Returns:

  • (Float)


41
42
43
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 41

def max_benefit_percent
  @max_benefit_percent
end

#messageString

[Required] Recommendation message

Returns:

  • (String)


21
22
23
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 21

def message
  @message
end

#overall_benefit_percentFloat

Overall estimated benefit in terms of percentage of total activity

Returns:

  • (Float)


45
46
47
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 45

def overall_benefit_percent
  @overall_benefit_percent
end

#rationaleString

Recommendation message

Returns:

  • (String)


37
38
39
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 37

def rationale
  @rationale
end


56
57
58
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 56

def related_object
  @related_object
end

#requires_db_restartString

Indicates implementation of the recommended action requires a database restart in order for it to take effect. Possible values "Y", "N" and null.

Returns:

  • (String)


27
28
29
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 27

def requires_db_restart
  @requires_db_restart
end

#typeString

Type of recommendation

Returns:

  • (String)


17
18
19
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 17

def type
  @type
end

Class Method Details

.attribute_mapObject

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



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 59

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'type': :'type',
    'message': :'message',
    'requires_db_restart': :'requiresDbRestart',
    'implement_actions': :'implementActions',
    'rationale': :'rationale',
    'max_benefit_percent': :'maxBenefitPercent',
    'overall_benefit_percent': :'overallBenefitPercent',
    'max_benefit_avg_active_sessions': :'maxBenefitAvgActiveSessions',
    'frequency_count': :'frequencyCount',
    'related_object': :'relatedObject'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 78

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'type': :'String',
    'message': :'String',
    'requires_db_restart': :'String',
    'implement_actions': :'Array<String>',
    'rationale': :'String',
    'max_benefit_percent': :'Float',
    'overall_benefit_percent': :'Float',
    'max_benefit_avg_active_sessions': :'Float',
    'frequency_count': :'Integer',
    'related_object': :'OCI::Opsi::Models::RelatedObjectTypeDetails'
    # 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



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 177

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

  self.class == other.class &&
    id == other.id &&
    type == other.type &&
    message == other.message &&
    requires_db_restart == other.requires_db_restart &&
    implement_actions == other.implement_actions &&
    rationale == other.rationale &&
    max_benefit_percent == other.max_benefit_percent &&
    overall_benefit_percent == other.overall_benefit_percent &&
    max_benefit_avg_active_sessions == other.max_benefit_avg_active_sessions &&
    frequency_count == other.frequency_count &&
    related_object == other.related_object
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



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 217

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


197
198
199
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 197

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



206
207
208
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 206

def hash
  [id, type, message, requires_db_restart, implement_actions, rationale, max_benefit_percent, overall_benefit_percent, max_benefit_avg_active_sessions, frequency_count, related_object].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



250
251
252
253
254
255
256
257
258
259
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 250

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



244
245
246
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 244

def to_s
  to_hash.to_s
end