Class: WorkOS::AuditLogEvent
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- WorkOS::AuditLogEvent
- Defined in:
- lib/workos/audit_logs/audit_log_event.rb
Constant Summary collapse
- HASH_ATTRS =
{ action: :action, occurred_at: :occurred_at, actor: :actor, targets: :targets, context: :context, metadata: :metadata, version: :version }.freeze
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#actor ⇒ Object
Returns the value of attribute actor.
-
#context ⇒ Object
Returns the value of attribute context.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#occurred_at ⇒ Object
Returns the value of attribute occurred_at.
-
#targets ⇒ Object
Returns the value of attribute targets.
-
#version ⇒ Object
Returns the value of attribute version.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ AuditLogEvent
constructor
A new instance of AuditLogEvent.
Methods inherited from Types::BaseModel
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ AuditLogEvent
Returns a new instance of AuditLogEvent.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/workos/audit_logs/audit_log_event.rb', line 26 def initialize(json) hash = self.class.normalize(json) @action = hash[:action] @occurred_at = hash[:occurred_at] @actor = hash[:actor] ? WorkOS::AuditLogEventActor.new(hash[:actor]) : nil @targets = (hash[:targets] || []).map { |item| item ? WorkOS::AuditLogEventTarget.new(item) : nil } @context = hash[:context] ? WorkOS::AuditLogEventContext.new(hash[:context]) : nil @metadata = hash[:metadata] || {} @version = hash[:version] end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
17 18 19 |
# File 'lib/workos/audit_logs/audit_log_event.rb', line 17 def action @action end |
#actor ⇒ Object
Returns the value of attribute actor.
17 18 19 |
# File 'lib/workos/audit_logs/audit_log_event.rb', line 17 def actor @actor end |
#context ⇒ Object
Returns the value of attribute context.
17 18 19 |
# File 'lib/workos/audit_logs/audit_log_event.rb', line 17 def context @context end |
#metadata ⇒ Object
Returns the value of attribute metadata.
17 18 19 |
# File 'lib/workos/audit_logs/audit_log_event.rb', line 17 def @metadata end |
#occurred_at ⇒ Object
Returns the value of attribute occurred_at.
17 18 19 |
# File 'lib/workos/audit_logs/audit_log_event.rb', line 17 def occurred_at @occurred_at end |
#targets ⇒ Object
Returns the value of attribute targets.
17 18 19 |
# File 'lib/workos/audit_logs/audit_log_event.rb', line 17 def targets @targets end |
#version ⇒ Object
Returns the value of attribute version.
17 18 19 |
# File 'lib/workos/audit_logs/audit_log_event.rb', line 17 def version @version end |