Class: OCI::DatabaseManagement::Models::AttentionLogSummary

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

Overview

The details for one attention log entry.

Constant Summary collapse

MESSAGE_URGENCY_ENUM =
[
  MESSAGE_URGENCY_IMMEDIATE = 'IMMEDIATE'.freeze,
  MESSAGE_URGENCY_SOON = 'SOON'.freeze,
  MESSAGE_URGENCY_DEFERRABLE = 'DEFERRABLE'.freeze,
  MESSAGE_URGENCY_INFO = 'INFO'.freeze,
  MESSAGE_URGENCY_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 = {}) ⇒ AttentionLogSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :message_urgency (String)

    The value to assign to the #message_urgency 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

  • :scope (String)

    The value to assign to the #scope property

  • :target_user (String)

    The value to assign to the #target_user property

  • :cause (String)

    The value to assign to the #cause property

  • :action (String)

    The value to assign to the #action 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



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
170
171
172
# File 'lib/oci/database_management/models/attention_log_summary.rb', line 123

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_urgency = attributes[:'messageUrgency'] if attributes[:'messageUrgency']

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

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

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

  self.target_user = attributes[:'targetUser'] if attributes[:'targetUser']

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

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

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

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

  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

#actionString

The recommended action to handle the attention log.

Returns:

  • (String)


61
62
63
# File 'lib/oci/database_management/models/attention_log_summary.rb', line 61

def action
  @action
end

#causeString

The cause of the attention log.

Returns:

  • (String)


57
58
59
# File 'lib/oci/database_management/models/attention_log_summary.rb', line 57

def cause
  @cause
end

#file_locationString

The attention log file location.

Returns:

  • (String)


69
70
71
# File 'lib/oci/database_management/models/attention_log_summary.rb', line 69

def file_location
  @file_location
end

#message_contentString

The contents of the attention log message.

Returns:

  • (String)


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

def message_content
  @message_content
end

#message_typeString

[Required] The type of attention log message.

Returns:

  • (String)


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

def message_type
  @message_type
end

#message_urgencyString

[Required] The urgency of the attention log.

Returns:

  • (String)


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

def message_urgency
  @message_urgency
end

#scopeString

The database scope for the attention log.

Returns:

  • (String)


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

def scope
  @scope
end

#supplemental_detailString

The supplemental details of the attention log.

Returns:

  • (String)


65
66
67
# File 'lib/oci/database_management/models/attention_log_summary.rb', line 65

def supplemental_detail
  @supplemental_detail
end

#target_userString

The user who must act on the attention log message.

Returns:

  • (String)


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

def target_user
  @target_user
end

#timestampDateTime

The date and time the attention log was created.

Returns:

  • (DateTime)


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

def timestamp
  @timestamp
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'message_urgency': :'messageUrgency',
    'message_type': :'messageType',
    'message_content': :'messageContent',
    'timestamp': :'timestamp',
    'scope': :'scope',
    'target_user': :'targetUser',
    'cause': :'cause',
    'action': :'action',
    'supplemental_detail': :'supplementalDetail',
    'file_location': :'fileLocation'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/oci/database_management/models/attention_log_summary.rb', line 90

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'message_urgency': :'String',
    'message_type': :'String',
    'message_content': :'String',
    'timestamp': :'DateTime',
    'scope': :'String',
    'target_user': :'String',
    'cause': :'String',
    'action': :'String',
    '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



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/oci/database_management/models/attention_log_summary.rb', line 207

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

  self.class == other.class &&
    message_urgency == other.message_urgency &&
    message_type == other.message_type &&
    message_content == other.message_content &&
    timestamp == other.timestamp &&
    scope == other.scope &&
    target_user == other.target_user &&
    cause == other.cause &&
    action == other.action &&
    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



246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/oci/database_management/models/attention_log_summary.rb', line 246

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


226
227
228
# File 'lib/oci/database_management/models/attention_log_summary.rb', line 226

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



235
236
237
# File 'lib/oci/database_management/models/attention_log_summary.rb', line 235

def hash
  [message_urgency, message_type, message_content, timestamp, scope, target_user, cause, action, 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



279
280
281
282
283
284
285
286
287
288
# File 'lib/oci/database_management/models/attention_log_summary.rb', line 279

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



273
274
275
# File 'lib/oci/database_management/models/attention_log_summary.rb', line 273

def to_s
  to_hash.to_s
end