Method: WorkOS::AuditLogs.create_export
- Defined in:
- lib/workos/audit_logs.rb
.create_export(organization:, range_start:, range_end:, actions: nil, actors: nil, targets: nil, actor_names: nil, actor_ids: nil) ⇒ WorkOS::AuditLogExport
Create an Export of Audit Log Events.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/workos/audit_logs.rb', line 46 def create_export(organization:, range_start:, range_end:, actions: nil, # rubocop:disable Metrics/ParameterLists actors: nil, targets: nil, actor_names: nil, actor_ids: nil) body = { organization_id: organization, range_start: range_start, range_end: range_end, } body['actions'] = actions unless actions.nil? body['actors'] = actors unless actors.nil? body['actor_names'] = actor_names unless actor_names.nil? body['actor_ids'] = actor_ids unless actor_ids.nil? body['targets'] = targets unless targets.nil? request = post_request( path: '/audit_logs/exports', auth: true, body: body, ) response = execute_request(request: request) WorkOS::AuditLogExport.new(response.body) end |