Class: Trycourier::Resources::AuditEvents

Inherits:
Object
  • Object
show all
Defined in:
lib/trycourier/resources/audit_events.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AuditEvents

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of AuditEvents.

Parameters:



51
52
53
# File 'lib/trycourier/resources/audit_events.rb', line 51

def initialize(client:)
  @client = client
end

Instance Method Details

#list(cursor: nil, request_options: {}) ⇒ Trycourier::Models::AuditEventListResponse

Fetch the list of audit events

Parameters:

  • cursor (String, nil)

    A unique identifier that allows for fetching the next set of audit events.

  • request_options (Trycourier::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



37
38
39
40
41
42
43
44
45
46
# File 'lib/trycourier/resources/audit_events.rb', line 37

def list(params = {})
  parsed, options = Trycourier::AuditEventListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "audit-events",
    query: parsed,
    model: Trycourier::Models::AuditEventListResponse,
    options: options
  )
end

#retrieve(audit_event_id, request_options: {}) ⇒ Trycourier::Models::AuditEvent

Fetch a specific audit event by ID.

Parameters:

  • audit_event_id (String)

    A unique identifier associated with the audit event you wish to retrieve

  • request_options (Trycourier::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



17
18
19
20
21
22
23
24
# File 'lib/trycourier/resources/audit_events.rb', line 17

def retrieve(audit_event_id, params = {})
  @client.request(
    method: :get,
    path: ["audit-events/%1$s", audit_event_id],
    model: Trycourier::AuditEvent,
    options: params[:request_options]
  )
end