Class: OCI::Opsi::Models::AddmDbFindingAggregation

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

Overview

Summarizes a specific ADDM finding

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AddmDbFindingAggregation

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :finding_id (String)

    The value to assign to the #finding_id property

  • :category_name (String)

    The value to assign to the #category_name property

  • :category_display_name (String)

    The value to assign to the #category_display_name property

  • :name (String)

    The value to assign to the #name property

  • :message (String)

    The value to assign to the #message property

  • :impact_overall_percent (Float)

    The value to assign to the #impact_overall_percent property

  • :impact_max_percent (Float)

    The value to assign to the #impact_max_percent property

  • :impact_avg_active_sessions (Float)

    The value to assign to the #impact_avg_active_sessions property

  • :frequency_count (Integer)

    The value to assign to the #frequency_count property

  • :recommendation_count (Integer)

    The value to assign to the #recommendation_count property



110
111
112
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
169
# File 'lib/oci/opsi/models/addm_db_finding_aggregation.rb', line 110

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

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

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

  self.category_name = attributes[:'categoryName'] if attributes[:'categoryName']

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

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

  self.category_display_name = attributes[:'categoryDisplayName'] if attributes[:'categoryDisplayName']

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

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

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

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

  self.impact_overall_percent = attributes[:'impactOverallPercent'] if attributes[:'impactOverallPercent']

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

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

  self.impact_max_percent = attributes[:'impactMaxPercent'] if attributes[:'impactMaxPercent']

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

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

  self.impact_avg_active_sessions = attributes[:'impactAvgActiveSessions'] if attributes[:'impactAvgActiveSessions']

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

  self.impact_avg_active_sessions = attributes[:'impact_avg_active_sessions'] if attributes[:'impact_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.recommendation_count = attributes[:'recommendationCount'] if attributes[:'recommendationCount']

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

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

Instance Attribute Details

#category_display_nameString

[Required] Category display name

Returns:

  • (String)


25
26
27
# File 'lib/oci/opsi/models/addm_db_finding_aggregation.rb', line 25

def category_display_name
  @category_display_name
end

#category_nameString

[Required] Category name

Returns:

  • (String)


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

def category_name
  @category_name
end

#finding_idString

[Required] Unique finding id

Returns:

  • (String)


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

def finding_id
  @finding_id
end

#frequency_countInteger

[Required] Number of occurrences for this finding

Returns:

  • (Integer)


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

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_finding_aggregation.rb', line 13

def id
  @id
end

#impact_avg_active_sessionsFloat

Impact in terms of average active sessions

Returns:

  • (Float)


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

def impact_avg_active_sessions
  @impact_avg_active_sessions
end

#impact_max_percentFloat

[Required] Maximum impact in terms of percentage of total activity

Returns:

  • (Float)


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

def impact_max_percent
  @impact_max_percent
end

#impact_overall_percentFloat

[Required] Overall impact in terms of percentage of total activity

Returns:

  • (Float)


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

def impact_overall_percent
  @impact_overall_percent
end

#messageString

[Required] Finding message

Returns:

  • (String)


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

def message
  @message
end

#nameString

[Required] Finding name

Returns:

  • (String)


29
30
31
# File 'lib/oci/opsi/models/addm_db_finding_aggregation.rb', line 29

def name
  @name
end

#recommendation_countInteger

[Required] Number of recommendations for this finding

Returns:

  • (Integer)


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

def recommendation_count
  @recommendation_count
end

Class Method Details

.attribute_mapObject

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



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/oci/opsi/models/addm_db_finding_aggregation.rb', line 56

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'finding_id': :'findingId',
    'category_name': :'categoryName',
    'category_display_name': :'categoryDisplayName',
    'name': :'name',
    'message': :'message',
    'impact_overall_percent': :'impactOverallPercent',
    'impact_max_percent': :'impactMaxPercent',
    'impact_avg_active_sessions': :'impactAvgActiveSessions',
    'frequency_count': :'frequencyCount',
    'recommendation_count': :'recommendationCount'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/oci/opsi/models/addm_db_finding_aggregation.rb', line 75

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'finding_id': :'String',
    'category_name': :'String',
    'category_display_name': :'String',
    'name': :'String',
    'message': :'String',
    'impact_overall_percent': :'Float',
    'impact_max_percent': :'Float',
    'impact_avg_active_sessions': :'Float',
    'frequency_count': :'Integer',
    'recommendation_count': :'Integer'
    # 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



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

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

  self.class == other.class &&
    id == other.id &&
    finding_id == other.finding_id &&
    category_name == other.category_name &&
    category_display_name == other.category_display_name &&
    name == other.name &&
    message == other.message &&
    impact_overall_percent == other.impact_overall_percent &&
    impact_max_percent == other.impact_max_percent &&
    impact_avg_active_sessions == other.impact_avg_active_sessions &&
    frequency_count == other.frequency_count &&
    recommendation_count == other.recommendation_count
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



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

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


198
199
200
# File 'lib/oci/opsi/models/addm_db_finding_aggregation.rb', line 198

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



207
208
209
# File 'lib/oci/opsi/models/addm_db_finding_aggregation.rb', line 207

def hash
  [id, finding_id, category_name, category_display_name, name, message, impact_overall_percent, impact_max_percent, impact_avg_active_sessions, frequency_count, recommendation_count].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



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

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



245
246
247
# File 'lib/oci/opsi/models/addm_db_finding_aggregation.rb', line 245

def to_s
  to_hash.to_s
end