Class: Rafflesia::AuditLogRecord

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/audit/audit_log_record.rb

Constant Summary collapse

HASH_ATTRS =
{
  actor: :actor,
  audit_log_id: :audit_log_id,
  created_at: :created_at,
  duration_ms: :duration_ms,
  error_code: :error_code,
  evidence: :evidence,
  finished_at: :finished_at,
  input_hash: :input_hash,
  is_ok: :is_ok,
  metadata: :metadata,
  method: :method,
  operation: :operation,
  parameters_hash: :parameters_hash,
  path: :path,
  query_string: :query_string,
  request_body: :request_body,
  request_id: :request_id,
  request_size_bytes: :request_size_bytes,
  response_size_bytes: :response_size_bytes,
  route_path: :route_path,
  started_at: :started_at,
  status_code: :status_code,
  warning_count: :warning_count
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ AuditLogRecord

Returns a new instance of AuditLogRecord.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/rafflesia/audit/audit_log_record.rb', line 59

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @actor = hash[:actor] ? Rafflesia::AuditLogActor.new(hash[:actor]) : nil
  @audit_log_id = hash[:audit_log_id]
  @created_at = hash[:created_at]
  @duration_ms = hash[:duration_ms]
  @error_code = hash[:error_code]
  @evidence = hash[:evidence] ? Rafflesia::EvidenceSummary.new(hash[:evidence]) : nil
  @finished_at = hash[:finished_at]
  @input_hash = hash[:input_hash]
  @is_ok = hash[:is_ok]
  @metadata = hash[:metadata] || {}
  @method = hash[:method]
  @operation = hash[:operation]
  @parameters_hash = hash[:parameters_hash]
  @path = hash[:path]
  @query_string = hash[:query_string]
  @request_body = hash[:request_body]
  @request_id = hash[:request_id]
  @request_size_bytes = hash[:request_size_bytes]
  @response_size_bytes = hash[:response_size_bytes]
  @route_path = hash[:route_path]
  @started_at = hash[:started_at]
  @status_code = hash[:status_code]
  @warning_count = hash[:warning_count]
end

Instance Attribute Details

#actorObject

Returns the value of attribute actor.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def actor
  @actor
end

#audit_log_idObject

Returns the value of attribute audit_log_id.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def audit_log_id
  @audit_log_id
end

#created_atObject

Returns the value of attribute created_at.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def created_at
  @created_at
end

#duration_msObject

Returns the value of attribute duration_ms.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def duration_ms
  @duration_ms
end

#error_codeObject

Returns the value of attribute error_code.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def error_code
  @error_code
end

#evidenceObject

Returns the value of attribute evidence.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def evidence
  @evidence
end

#finished_atObject

Returns the value of attribute finished_at.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def finished_at
  @finished_at
end

#input_hashObject

Returns the value of attribute input_hash.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def input_hash
  @input_hash
end

#is_okObject

Returns the value of attribute is_ok.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def is_ok
  @is_ok
end

#metadataObject

Returns the value of attribute metadata.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def 
  @metadata
end

#methodObject

Returns the value of attribute method.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def method
  @method
end

#operationObject

Returns the value of attribute operation.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def operation
  @operation
end

#parameters_hashObject

Returns the value of attribute parameters_hash.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def parameters_hash
  @parameters_hash
end

#pathObject

Returns the value of attribute path.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def path
  @path
end

#query_stringObject

Returns the value of attribute query_string.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def query_string
  @query_string
end

#request_bodyObject

Returns the value of attribute request_body.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def request_body
  @request_body
end

#request_idObject

Returns the value of attribute request_id.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def request_id
  @request_id
end

#request_size_bytesObject

Returns the value of attribute request_size_bytes.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def request_size_bytes
  @request_size_bytes
end

#response_size_bytesObject

Returns the value of attribute response_size_bytes.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def response_size_bytes
  @response_size_bytes
end

#route_pathObject

Returns the value of attribute route_path.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def route_path
  @route_path
end

#started_atObject

Returns the value of attribute started_at.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def started_at
  @started_at
end

#status_codeObject

Returns the value of attribute status_code.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def status_code
  @status_code
end

#warning_countObject

Returns the value of attribute warning_count.



34
35
36
# File 'lib/rafflesia/audit/audit_log_record.rb', line 34

def warning_count
  @warning_count
end