Class: Courier::AuditEvents

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

Constant Summary collapse

KEY =
"/audit-events"

Instance Method Summary collapse

Constructor Details

#initialize(session) ⇒ AuditEvents

Returns a new instance of AuditEvents.



5
6
7
# File 'lib/trycourier/audit_events.rb', line 5

def initialize(session)
  @session = session
end

Instance Method Details

#get(audit_event_id:) ⇒ Object



9
10
11
12
13
# File 'lib/trycourier/audit_events.rb', line 9

def get(audit_event_id:)
  path = "#{KEY}/#{audit_event_id}"
  res = @session.send(path, "GET")
  ErrorHandler.check_err(res)
end

#list(cursor: nil) ⇒ Object



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

def list(cursor: nil)
  path = "#{KEY}"

  params = {}
  if cursor
    params["cursor"] = cursor
  end

  res = @session.send(path, "GET", params: params)
  ErrorHandler.check_err(res)
end