Class: WorkOS::AuditLogExport

Inherits:
Object
  • Object
show all
Includes:
HashProvider
Defined in:
lib/workos/audit_log_export.rb

Overview

The AuditLogExport class represents the WorkOS entity created when exporting Audit Log Events.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashProvider

#to_h

Constructor Details

#initialize(json) ⇒ AuditLogExport

Returns a new instance of AuditLogExport.



10
11
12
13
14
15
16
17
18
19
# File 'lib/workos/audit_log_export.rb', line 10

def initialize(json)
  hash = JSON.parse(json, symbolize_names: true)

  @object = hash[:object]
  @id = hash[:id]
  @state = hash[:state]
  @url = hash[:url]
  @created_at = hash[:created_at]
  @updated_at = hash[:updated_at]
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



8
9
10
# File 'lib/workos/audit_log_export.rb', line 8

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



8
9
10
# File 'lib/workos/audit_log_export.rb', line 8

def id
  @id
end

#objectObject

Returns the value of attribute object.



8
9
10
# File 'lib/workos/audit_log_export.rb', line 8

def object
  @object
end

#stateObject

Returns the value of attribute state.



8
9
10
# File 'lib/workos/audit_log_export.rb', line 8

def state
  @state
end

#updated_atObject

Returns the value of attribute updated_at.



8
9
10
# File 'lib/workos/audit_log_export.rb', line 8

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url.



8
9
10
# File 'lib/workos/audit_log_export.rb', line 8

def url
  @url
end

Instance Method Details

#to_jsonObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/workos/audit_log_export.rb', line 21

def to_json(*)
  {
    object: object,
    id: id,
    state: state,
    url: url,
    created_at: created_at,
    updated_at: updated_at,
  }
end