Class: OCI::Opsi::Models::AddmDbSummary

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

Overview

ADDM summary for a database

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AddmDbSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



103
104
105
106
107
108
109
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
# File 'lib/oci/opsi/models/addm_db_summary.rb', line 103

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

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

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

  self.number_of_findings = attributes[:'numberOfFindings'] if attributes[:'numberOfFindings']

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

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

  self.number_of_addm_tasks = attributes[:'numberOfAddmTasks'] if attributes[:'numberOfAddmTasks']

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

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

  self.time_first_snapshot_begin = attributes[:'timeFirstSnapshotBegin'] if attributes[:'timeFirstSnapshotBegin']

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

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

  self.time_latest_snapshot_end = attributes[:'timeLatestSnapshotEnd'] if attributes[:'timeLatestSnapshotEnd']

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

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

  self.snapshot_interval_start = attributes[:'snapshotIntervalStart'] if attributes[:'snapshotIntervalStart']

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

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

  self.snapshot_interval_end = attributes[:'snapshotIntervalEnd'] if attributes[:'snapshotIntervalEnd']

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

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

  self.max_overall_impact = attributes[:'maxOverallImpact'] if attributes[:'maxOverallImpact']

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

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

  self.most_frequent_category_name = attributes[:'mostFrequentCategoryName'] if attributes[:'mostFrequentCategoryName']

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

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

  self.most_frequent_category_display_name = attributes[:'mostFrequentCategoryDisplayName'] if attributes[:'mostFrequentCategoryDisplayName']

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

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

Instance Attribute Details

#database_detailsOCI::Opsi::Models::DatabaseDetails

This attribute is required.



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

def database_details
  @database_details
end

#max_overall_impactFloat

Maximum overall impact in terms of percentage of total activity

Returns:

  • (Float)


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

def max_overall_impact
  @max_overall_impact
end

#most_frequent_category_display_nameString

Category display name

Returns:

  • (String)


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

def most_frequent_category_display_name
  @most_frequent_category_display_name
end

#most_frequent_category_nameString

Category name

Returns:

  • (String)


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

def most_frequent_category_name
  @most_frequent_category_name
end

#number_of_addm_tasksInteger

Number of ADDM tasks

Returns:

  • (Integer)


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

def number_of_addm_tasks
  @number_of_addm_tasks
end

#number_of_findingsInteger

Number of ADDM findings

Returns:

  • (Integer)


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

def number_of_findings
  @number_of_findings
end

#snapshot_interval_endString

AWR snapshot id.

Returns:

  • (String)


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

def snapshot_interval_end
  @snapshot_interval_end
end

#snapshot_interval_startString

AWR snapshot id.

Returns:

  • (String)


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

def snapshot_interval_start
  @snapshot_interval_start
end

#time_first_snapshot_beginDateTime

The start timestamp that was passed into the request.

Returns:

  • (DateTime)


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

def time_first_snapshot_begin
  @time_first_snapshot_begin
end

#time_latest_snapshot_endDateTime

The end timestamp that was passed into the request.

Returns:

  • (DateTime)


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

def time_latest_snapshot_end
  @time_latest_snapshot_end
end

Class Method Details

.attribute_mapObject

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



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/oci/opsi/models/addm_db_summary.rb', line 52

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'database_details': :'databaseDetails',
    'number_of_findings': :'numberOfFindings',
    'number_of_addm_tasks': :'numberOfAddmTasks',
    'time_first_snapshot_begin': :'timeFirstSnapshotBegin',
    'time_latest_snapshot_end': :'timeLatestSnapshotEnd',
    'snapshot_interval_start': :'snapshotIntervalStart',
    'snapshot_interval_end': :'snapshotIntervalEnd',
    'max_overall_impact': :'maxOverallImpact',
    'most_frequent_category_name': :'mostFrequentCategoryName',
    'most_frequent_category_display_name': :'mostFrequentCategoryDisplayName'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/oci/opsi/models/addm_db_summary.rb', line 70

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'database_details': :'OCI::Opsi::Models::DatabaseDetails',
    'number_of_findings': :'Integer',
    'number_of_addm_tasks': :'Integer',
    'time_first_snapshot_begin': :'DateTime',
    'time_latest_snapshot_end': :'DateTime',
    'snapshot_interval_start': :'String',
    'snapshot_interval_end': :'String',
    'max_overall_impact': :'Float',
    'most_frequent_category_name': :'String',
    'most_frequent_category_display_name': :'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



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

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

  self.class == other.class &&
    database_details == other.database_details &&
    number_of_findings == other.number_of_findings &&
    number_of_addm_tasks == other.number_of_addm_tasks &&
    time_first_snapshot_begin == other.time_first_snapshot_begin &&
    time_latest_snapshot_end == other.time_latest_snapshot_end &&
    snapshot_interval_start == other.snapshot_interval_start &&
    snapshot_interval_end == other.snapshot_interval_end &&
    max_overall_impact == other.max_overall_impact &&
    most_frequent_category_name == other.most_frequent_category_name &&
    most_frequent_category_display_name == other.most_frequent_category_display_name
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



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

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


196
197
198
# File 'lib/oci/opsi/models/addm_db_summary.rb', line 196

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



205
206
207
# File 'lib/oci/opsi/models/addm_db_summary.rb', line 205

def hash
  [database_details, number_of_findings, number_of_addm_tasks, time_first_snapshot_begin, time_latest_snapshot_end, snapshot_interval_start, snapshot_interval_end, max_overall_impact, most_frequent_category_name, most_frequent_category_display_name].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



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

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



243
244
245
# File 'lib/oci/opsi/models/addm_db_summary.rb', line 243

def to_s
  to_hash.to_s
end