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_OTHER = 'OTHER'.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_OTHER = 'OTHER'.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



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
133
134
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 97

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)


55
56
57
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 55

def file_location
  @file_location
end

#message_contentString

The contents of the alert log message.

Returns:

  • (String)


43
44
45
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 43

def message_content
  @message_content
end

#message_levelString

[Required] The level of the alert log.

Returns:

  • (String)


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

def message_level
  @message_level
end

#message_typeString

[Required] The type of alert log message.

Returns:

  • (String)


39
40
41
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 39

def message_type
  @message_type
end

#supplemental_detailString

The supplemental details of the alert log.

Returns:

  • (String)


51
52
53
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 51

def supplemental_detail
  @supplemental_detail
end

#timestampDateTime

The date and time the alert log was created.

Returns:

  • (DateTime)


47
48
49
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 47

def timestamp
  @timestamp
end

Class Method Details

.attribute_mapObject

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



58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 58

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.



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

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



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

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



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

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


184
185
186
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 184

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



193
194
195
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 193

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



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

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



231
232
233
# File 'lib/oci/database_management/models/alert_log_summary.rb', line 231

def to_s
  to_hash.to_s
end