Class: OCI::ApmTraces::Models::Log

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/apm_traces/models/log.rb

Overview

Definition of a log object.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Log

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/oci/apm_traces/models/log.rb', line 148

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

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

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

  self.event_name = attributes[:'eventName'] if attributes[:'eventName']

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

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

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

  self.trace_key = attributes[:'traceKey'] if attributes[:'traceKey']

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

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

  self.span_key = attributes[:'spanKey'] if attributes[:'spanKey']

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

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

  self.trace_flags = attributes[:'traceFlags'] if attributes[:'traceFlags']

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.time_observed = attributes[:'timeObserved'] if attributes[:'timeObserved']

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

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

  self.severity_text = attributes[:'severityText'] if attributes[:'severityText']

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

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

  self.severity_number = attributes[:'severityNumber'] if attributes[:'severityNumber']

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

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

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

  self.overflow_attributes = attributes[:'overflowAttributes'] if attributes[:'overflowAttributes']

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

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

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

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

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

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

Instance Attribute Details

#attribute_metadataHash<String, OCI::ApmTraces::Models::AttributeMetadata>

Metadata about the attributes in the logs.



82
83
84
# File 'lib/oci/apm_traces/models/log.rb', line 82

def 
  @attribute_metadata
end

#attributesArray<OCI::ApmTraces::Models::Attribute>

List of attributes associated with the logs.



77
78
79
# File 'lib/oci/apm_traces/models/log.rb', line 77

def attributes
  @attributes
end

#bodyString

Log body (Body).

Returns:

  • (String)


67
68
69
# File 'lib/oci/apm_traces/models/log.rb', line 67

def body
  @body
end

#event_nameString

Name of the event.

Returns:

  • (String)


22
23
24
# File 'lib/oci/apm_traces/models/log.rb', line 22

def event_name
  @event_name
end

#log_keyString

[Required] Unique identifier (logId) for the logKey. Note that this field is defined as logKey in the API and it maps to the logId in Application Performance Monitoring.

Returns:

  • (String)


17
18
19
# File 'lib/oci/apm_traces/models/log.rb', line 17

def log_key
  @log_key
end

#overflow_attributesString

Full values for attributes that are too long to be stored as a log attribute (Overflow).

Returns:

  • (String)


72
73
74
# File 'lib/oci/apm_traces/models/log.rb', line 72

def overflow_attributes
  @overflow_attributes
end

#severity_numberInteger

Log Severity number (SeverityNumber).

Returns:

  • (Integer)


62
63
64
# File 'lib/oci/apm_traces/models/log.rb', line 62

def severity_number
  @severity_number
end

#severity_textString

Log Severity text (SeverityText). Also known as Log level.

Returns:

  • (String)


57
58
59
# File 'lib/oci/apm_traces/models/log.rb', line 57

def severity_text
  @severity_text
end

#span_keyString

Unique identifier for the span (spanId) associated with this log.

Returns:

  • (String)


37
38
39
# File 'lib/oci/apm_traces/models/log.rb', line 37

def span_key
  @span_key
end

#time_createdDateTime

Time that the log event occurred (CreatedTime).

Returns:

  • (DateTime)


47
48
49
# File 'lib/oci/apm_traces/models/log.rb', line 47

def time_created
  @time_created
end

#time_observedDateTime

Time that the log was received by apm (ObservedTime).

Returns:

  • (DateTime)


52
53
54
# File 'lib/oci/apm_traces/models/log.rb', line 52

def time_observed
  @time_observed
end

#timestampDateTime

[Required] Time used by the time picker (RecordedTime). Either the timeCreated if present or the timeObserved.

Returns:

  • (DateTime)


27
28
29
# File 'lib/oci/apm_traces/models/log.rb', line 27

def timestamp
  @timestamp
end

#trace_flagsInteger

Trace flags.

Returns:

  • (Integer)


42
43
44
# File 'lib/oci/apm_traces/models/log.rb', line 42

def trace_flags
  @trace_flags
end

#trace_keyString

Unique identifier for the trace (traceId) associated with this log.

Returns:

  • (String)


32
33
34
# File 'lib/oci/apm_traces/models/log.rb', line 32

def trace_key
  @trace_key
end

Class Method Details

.attribute_mapObject

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



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/oci/apm_traces/models/log.rb', line 85

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'log_key': :'logKey',
    'event_name': :'eventName',
    'timestamp': :'timestamp',
    'trace_key': :'traceKey',
    'span_key': :'spanKey',
    'trace_flags': :'traceFlags',
    'time_created': :'timeCreated',
    'time_observed': :'timeObserved',
    'severity_text': :'severityText',
    'severity_number': :'severityNumber',
    'body': :'body',
    'overflow_attributes': :'overflowAttributes',
    'attributes': :'attributes',
    'attribute_metadata': :'attributeMetadata'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/oci/apm_traces/models/log.rb', line 107

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'log_key': :'String',
    'event_name': :'String',
    'timestamp': :'DateTime',
    'trace_key': :'String',
    'span_key': :'String',
    'trace_flags': :'Integer',
    'time_created': :'DateTime',
    'time_observed': :'DateTime',
    'severity_text': :'String',
    'severity_number': :'Integer',
    'body': :'String',
    'overflow_attributes': :'String',
    'attributes': :'Array<OCI::ApmTraces::Models::Attribute>',
    'attribute_metadata': :'Hash<String, OCI::ApmTraces::Models::AttributeMetadata>'
    # 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



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/oci/apm_traces/models/log.rb', line 234

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

  self.class == other.class &&
    log_key == other.log_key &&
    event_name == other.event_name &&
    timestamp == other.timestamp &&
    trace_key == other.trace_key &&
    span_key == other.span_key &&
    trace_flags == other.trace_flags &&
    time_created == other.time_created &&
    time_observed == other.time_observed &&
    severity_text == other.severity_text &&
    severity_number == other.severity_number &&
    body == other.body &&
    overflow_attributes == other.overflow_attributes &&
    attributes == other.attributes &&
     == other.
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



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/oci/apm_traces/models/log.rb', line 277

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


257
258
259
# File 'lib/oci/apm_traces/models/log.rb', line 257

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



266
267
268
# File 'lib/oci/apm_traces/models/log.rb', line 266

def hash
  [log_key, event_name, timestamp, trace_key, span_key, trace_flags, time_created, time_observed, severity_text, severity_number, body, overflow_attributes, attributes, ].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



310
311
312
313
314
315
316
317
318
319
# File 'lib/oci/apm_traces/models/log.rb', line 310

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



304
305
306
# File 'lib/oci/apm_traces/models/log.rb', line 304

def to_s
  to_hash.to_s
end