Class: OCI::DatabaseManagement::Models::AlertLogSummary

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

Overview

The detail for one alert log entry.

Constant Summary collapse

MESSAGE_LEVEL_ENUM =
[
  MESSAGE_LEVEL_CRITICAL = 'CRITICAL'.freeze,
  MESSAGE_LEVEL_SEVERE = 'SEVERE'.freeze,
  MESSAGE_LEVEL_IMPORTANT = 'IMPORTANT'.freeze,
  MESSAGE_LEVEL_NORMAL = 'NORMAL'.freeze,
  MESSAGE_LEVEL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
MESSAGE_TYPE_ENUM =
[
  MESSAGE_TYPE_UNKNOWN = 'UNKNOWN'.freeze,
  MESSAGE_TYPE_INCIDENT_ERROR = 'INCIDENT_ERROR'.freeze,
  MESSAGE_TYPE_ERROR = 'ERROR'.freeze,
  MESSAGE_TYPE_WARNING = 'WARNING'.freeze,
  MESSAGE_TYPE_NOTIFICATION = 'NOTIFICATION'.freeze,
  MESSAGE_TYPE_TRACE = 'TRACE'.freeze,
  MESSAGE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AlertLogSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :message_level (String)

    The value to assign to the #message_level property

  • :message_type (String)

    The value to assign to the #message_type property

  • :message_content (String)

    The value to assign to the #message_content property

  • :timestamp (DateTime)

    The value to assign to the #timestamp property

  • :supplemental_detail (String)

    The value to assign to the #supplemental_detail property

  • :file_location (String)

    The value to assign to the #file_location property



95
96
97
98
99
100
101
102
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
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 95

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

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

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

  self.message_type = attributes[:'messageType'] if attributes[:'messageType']

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

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

  self.message_content = attributes[:'messageContent'] if attributes[:'messageContent']

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

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

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

  self.supplemental_detail = attributes[:'supplementalDetail'] if attributes[:'supplementalDetail']

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

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

  self.file_location = attributes[:'fileLocation'] if attributes[:'fileLocation']

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

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

Instance Attribute Details

#file_locationString

The alert log file location.

Returns:

  • (String)


53
54
55
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 53

def file_location
  @file_location
end

#message_contentString

The contents of the alert log message.

Returns:

  • (String)


41
42
43
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 41

def message_content
  @message_content
end

#message_levelString

[Required] The level of the alert log.

Returns:

  • (String)


33
34
35
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 33

def message_level
  @message_level
end

#message_typeString

[Required] The type of alert log message.

Returns:

  • (String)


37
38
39
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 37

def message_type
  @message_type
end

#supplemental_detailString

The supplemental details of the alert log.

Returns:

  • (String)


49
50
51
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 49

def supplemental_detail
  @supplemental_detail
end

#timestampDateTime

The date and time the alert log was created.

Returns:

  • (DateTime)


45
46
47
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 45

def timestamp
  @timestamp
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
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 56

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'message_level': :'messageLevel',
    'message_type': :'messageType',
    'message_content': :'messageContent',
    'timestamp': :'timestamp',
    'supplemental_detail': :'supplementalDetail',
    'file_location': :'fileLocation'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 70

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'message_level': :'String',
    'message_type': :'String',
    'message_content': :'String',
    'timestamp': :'DateTime',
    'supplemental_detail': :'String',
    'file_location': :'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



167
168
169
170
171
172
173
174
175
176
177
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 167

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

  self.class == other.class &&
    message_level == other.message_level &&
    message_type == other.message_type &&
    message_content == other.message_content &&
    timestamp == other.timestamp &&
    supplemental_detail == other.supplemental_detail &&
    file_location == other.file_location
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



202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 202

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


182
183
184
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 182

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



191
192
193
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 191

def hash
  [message_level, message_type, message_content, timestamp, supplemental_detail, file_location].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



235
236
237
238
239
240
241
242
243
244
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 235

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



229
230
231
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 229

def to_s
  to_hash.to_s
end