class Trakerr::AppEvent

Attributes

api_key[RW]

API key generated for the application

classification[RW]

(optional) one of 'error' or a custom string for non-errors, defaults to 'error'

context_app_browser[RW]

(optional) browser name if running in a browser (eg. Chrome)

context_app_browser_version[RW]

(optional) browser version if running in a browser

context_app_os[RW]

(optional) OS the application is running on

context_app_os_version[RW]

(optional) OS version the application is running on

context_app_version[RW]

(optional) application version information

context_data_center[RW]

(optional) Data center the application is running on or connected to

context_data_center_region[RW]

(optional) Data center region

context_env_hostname[RW]

(optional) hostname or ID of environment

context_env_language[RW]

(optional) language (like 'python' or 'c#' etc.)

context_env_name[RW]

(optional) environment name (like 'cpython' or 'ironpython' etc.)

context_env_version[RW]

(optional) version of environment

custom_properties[RW]
custom_segments[RW]
deployment_stage[RW]

(optional) deployment stage, one of 'development','staging','production' or a custom string

event_message[RW]

message containing details of the event or error

event_session[RW]

(optional) session identification

event_stacktrace[RW]
event_time[RW]

(optional) event time in ms since epoch

event_type[RW]

type of the event or error (eg. NullPointerException)

event_user[RW]

(optional) event user identifying a user

log_level[RW]

(optional) Logging level, one of 'debug','info','warning','error', 'fatal', defaults to 'error'

Public Class Methods

attribute_map() click to toggle source

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

# File generated/lib/trakerr_client/models/app_event.rb, line 118
def self.attribute_map
  {
    :'api_key' => :'apiKey',
    :'log_level' => :'logLevel',
    :'classification' => :'classification',
    :'event_type' => :'eventType',
    :'event_message' => :'eventMessage',
    :'event_time' => :'eventTime',
    :'event_stacktrace' => :'eventStacktrace',
    :'event_user' => :'eventUser',
    :'event_session' => :'eventSession',
    :'context_app_version' => :'contextAppVersion',
    :'deployment_stage' => :'deploymentStage',
    :'context_env_name' => :'contextEnvName',
    :'context_env_language' => :'contextEnvLanguage',
    :'context_env_version' => :'contextEnvVersion',
    :'context_env_hostname' => :'contextEnvHostname',
    :'context_app_browser' => :'contextAppBrowser',
    :'context_app_browser_version' => :'contextAppBrowserVersion',
    :'context_app_os' => :'contextAppOS',
    :'context_app_os_version' => :'contextAppOSVersion',
    :'context_data_center' => :'contextDataCenter',
    :'context_data_center_region' => :'contextDataCenterRegion',
    :'custom_properties' => :'customProperties',
    :'custom_segments' => :'customSegments'
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File generated/lib/trakerr_client/models/app_event.rb, line 177
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}

  if attributes.has_key?(:'apiKey')
    self.api_key = attributes[:'apiKey']
  end

  if attributes.has_key?(:'logLevel')
    self.log_level = attributes[:'logLevel']
  end

  if attributes.has_key?(:'classification')
    self.classification = attributes[:'classification']
  end

  if attributes.has_key?(:'eventType')
    self.event_type = attributes[:'eventType']
  end

  if attributes.has_key?(:'eventMessage')
    self.event_message = attributes[:'eventMessage']
  end

  if attributes.has_key?(:'eventTime')
    self.event_time = attributes[:'eventTime']
  end

  if attributes.has_key?(:'eventStacktrace')
    self.event_stacktrace = attributes[:'eventStacktrace']
  end

  if attributes.has_key?(:'eventUser')
    self.event_user = attributes[:'eventUser']
  end

  if attributes.has_key?(:'eventSession')
    self.event_session = attributes[:'eventSession']
  end

  if attributes.has_key?(:'contextAppVersion')
    self.context_app_version = attributes[:'contextAppVersion']
  end

  if attributes.has_key?(:'deploymentStage')
    self.deployment_stage = attributes[:'deploymentStage']
  end

  if attributes.has_key?(:'contextEnvName')
    self.context_env_name = attributes[:'contextEnvName']
  end

  if attributes.has_key?(:'contextEnvLanguage')
    self.context_env_language = attributes[:'contextEnvLanguage']
  end

  if attributes.has_key?(:'contextEnvVersion')
    self.context_env_version = attributes[:'contextEnvVersion']
  end

  if attributes.has_key?(:'contextEnvHostname')
    self.context_env_hostname = attributes[:'contextEnvHostname']
  end

  if attributes.has_key?(:'contextAppBrowser')
    self.context_app_browser = attributes[:'contextAppBrowser']
  end

  if attributes.has_key?(:'contextAppBrowserVersion')
    self.context_app_browser_version = attributes[:'contextAppBrowserVersion']
  end

  if attributes.has_key?(:'contextAppOS')
    self.context_app_os = attributes[:'contextAppOS']
  end

  if attributes.has_key?(:'contextAppOSVersion')
    self.context_app_os_version = attributes[:'contextAppOSVersion']
  end

  if attributes.has_key?(:'contextDataCenter')
    self.context_data_center = attributes[:'contextDataCenter']
  end

  if attributes.has_key?(:'contextDataCenterRegion')
    self.context_data_center_region = attributes[:'contextDataCenterRegion']
  end

  if attributes.has_key?(:'customProperties')
    self.custom_properties = attributes[:'customProperties']
  end

  if attributes.has_key?(:'customSegments')
    self.custom_segments = attributes[:'customSegments']
  end

end
swagger_types() click to toggle source

Attribute type mapping.

# File generated/lib/trakerr_client/models/app_event.rb, line 147
def self.swagger_types
  {
    :'api_key' => :'String',
    :'log_level' => :'String',
    :'classification' => :'String',
    :'event_type' => :'String',
    :'event_message' => :'String',
    :'event_time' => :'Integer',
    :'event_stacktrace' => :'Stacktrace',
    :'event_user' => :'String',
    :'event_session' => :'String',
    :'context_app_version' => :'String',
    :'deployment_stage' => :'String',
    :'context_env_name' => :'String',
    :'context_env_language' => :'String',
    :'context_env_version' => :'String',
    :'context_env_hostname' => :'String',
    :'context_app_browser' => :'String',
    :'context_app_browser_version' => :'String',
    :'context_app_os' => :'String',
    :'context_app_os_version' => :'String',
    :'context_data_center' => :'String',
    :'context_data_center_region' => :'String',
    :'custom_properties' => :'CustomData',
    :'custom_segments' => :'CustomData'
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File generated/lib/trakerr_client/models/app_event.rb, line 308
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      api_key == o.api_key &&
      log_level == o.log_level &&
      classification == o.classification &&
      event_type == o.event_type &&
      event_message == o.event_message &&
      event_time == o.event_time &&
      event_stacktrace == o.event_stacktrace &&
      event_user == o.event_user &&
      event_session == o.event_session &&
      context_app_version == o.context_app_version &&
      deployment_stage == o.deployment_stage &&
      context_env_name == o.context_env_name &&
      context_env_language == o.context_env_language &&
      context_env_version == o.context_env_version &&
      context_env_hostname == o.context_env_hostname &&
      context_app_browser == o.context_app_browser &&
      context_app_browser_version == o.context_app_browser_version &&
      context_app_os == o.context_app_os &&
      context_app_os_version == o.context_app_os_version &&
      context_data_center == o.context_data_center &&
      context_data_center_region == o.context_data_center_region &&
      custom_properties == o.custom_properties &&
      custom_segments == o.custom_segments
end
_deserialize(type, value) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# File generated/lib/trakerr_client/models/app_event.rb, line 372
def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /^(true|t|yes|y|1)$/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = Trakerr.const_get(type).new
    temp_model.build_from_hash(value)
  end
end
_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File generated/lib/trakerr_client/models/app_event.rb, line 438
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map{ |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File generated/lib/trakerr_client/models/app_event.rb, line 351
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)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(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?(o) click to toggle source

@see the `==` method @param [Object] Object to be compared

# File generated/lib/trakerr_client/models/app_event.rb, line 338
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File generated/lib/trakerr_client/models/app_event.rb, line 344
def hash
  [api_key, log_level, classification, event_type, event_message, event_time, event_stacktrace, event_user, event_session, context_app_version, deployment_stage, context_env_name, context_env_language, context_env_version, context_env_hostname, context_app_browser, context_app_browser_version, context_app_os, context_app_os_version, context_data_center, context_data_center_region, custom_properties, custom_segments].hash
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properies with the reasons

# File generated/lib/trakerr_client/models/app_event.rb, line 279
def list_invalid_properties
  invalid_properties = Array.new
  return invalid_properties
end
log_level=(log_level) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] log_level Object to be assigned

# File generated/lib/trakerr_client/models/app_event.rb, line 298
def log_level=(log_level)
  validator = EnumAttributeValidator.new('String', ["debug", "info", "warning", "error", "fatal"])
  unless validator.valid?(log_level)
    fail ArgumentError, "invalid value for 'log_level', must be one of #{validator.allowable_values}."
  end
  @log_level = log_level
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File generated/lib/trakerr_client/models/app_event.rb, line 418
def to_body
  to_hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File generated/lib/trakerr_client/models/app_event.rb, line 424
def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end
to_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File generated/lib/trakerr_client/models/app_event.rb, line 412
def to_s
  to_hash.to_s
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File generated/lib/trakerr_client/models/app_event.rb, line 286
def valid?
  return false if @api_key.nil?
  log_level_validator = EnumAttributeValidator.new('String', ["debug", "info", "warning", "error", "fatal"])
  return false unless log_level_validator.valid?(@log_level)
  return false if @classification.nil?
  return false if @event_type.nil?
  return false if @event_message.nil?
  return true
end