Class: WorkOS::AuditLogSchemaJson
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- WorkOS::AuditLogSchemaJson
- Defined in:
- lib/workos/audit_logs/audit_log_schema_json.rb
Constant Summary collapse
- HASH_ATTRS =
{ object: :object, version: :version, actor: :actor, targets: :targets, metadata: :metadata, created_at: :created_at }.freeze
Instance Attribute Summary collapse
-
#actor ⇒ Object
Returns the value of attribute actor.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#object ⇒ Object
Returns the value of attribute object.
-
#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) ⇒ AuditLogSchemaJson
constructor
A new instance of AuditLogSchemaJson.
Methods inherited from Types::BaseModel
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ AuditLogSchemaJson
Returns a new instance of AuditLogSchemaJson.
24 25 26 27 28 29 30 31 32 |
# File 'lib/workos/audit_logs/audit_log_schema_json.rb', line 24 def initialize(json) hash = self.class.normalize(json) @object = hash[:object] @version = hash[:version] @actor = hash[:actor] ? WorkOS::AuditLogSchemaJsonActor.new(hash[:actor]) : nil @targets = (hash[:targets] || []).map { |item| item ? WorkOS::AuditLogSchemaJsonTarget.new(item) : nil } @metadata = hash[:metadata] || {} @created_at = hash[:created_at] end |
Instance Attribute Details
#actor ⇒ Object
Returns the value of attribute actor.
16 17 18 |
# File 'lib/workos/audit_logs/audit_log_schema_json.rb', line 16 def actor @actor end |
#created_at ⇒ Object
Returns the value of attribute created_at.
16 17 18 |
# File 'lib/workos/audit_logs/audit_log_schema_json.rb', line 16 def created_at @created_at end |
#metadata ⇒ Object
Returns the value of attribute metadata.
16 17 18 |
# File 'lib/workos/audit_logs/audit_log_schema_json.rb', line 16 def @metadata end |
#object ⇒ Object
Returns the value of attribute object.
16 17 18 |
# File 'lib/workos/audit_logs/audit_log_schema_json.rb', line 16 def object @object end |
#targets ⇒ Object
Returns the value of attribute targets.
16 17 18 |
# File 'lib/workos/audit_logs/audit_log_schema_json.rb', line 16 def targets @targets end |
#version ⇒ Object
Returns the value of attribute version.
16 17 18 |
# File 'lib/workos/audit_logs/audit_log_schema_json.rb', line 16 def version @version end |