Class: WorkOS::AuditLogSchema

Inherits:
Types::BaseModel show all
Defined in:
lib/workos/audit_logs/audit_log_schema.rb

Constant Summary collapse

HASH_ATTRS =
{
  actor: :actor,
  targets: :targets,
  metadata: :metadata
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

normalize

Methods included from HashProvider

#inspect, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ AuditLogSchema

Returns a new instance of AuditLogSchema.



18
19
20
21
22
23
# File 'lib/workos/audit_logs/audit_log_schema.rb', line 18

def initialize(json)
  hash = self.class.normalize(json)
  @actor = hash[:actor] ? WorkOS::AuditLogSchemaActor.new(hash[:actor]) : nil
  @targets = (hash[:targets] || []).map { |item| item ? WorkOS::AuditLogSchemaTarget.new(item) : nil }
  @metadata = hash[:metadata] || {}
end

Instance Attribute Details

#actorObject

Returns the value of attribute actor.



13
14
15
# File 'lib/workos/audit_logs/audit_log_schema.rb', line 13

def actor
  @actor
end

#metadataObject

Returns the value of attribute metadata.



13
14
15
# File 'lib/workos/audit_logs/audit_log_schema.rb', line 13

def 
  @metadata
end

#targetsObject

Returns the value of attribute targets.



13
14
15
# File 'lib/workos/audit_logs/audit_log_schema.rb', line 13

def targets
  @targets
end