Class: Courier::Resources::AuditEvents
- Inherits:
-
Object
- Object
- Courier::Resources::AuditEvents
- Defined in:
- lib/courier/resources/audit_events.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ AuditEvents
constructor
private
A new instance of AuditEvents.
-
#list(cursor: nil, request_options: {}) ⇒ Courier::Models::AuditEventListResponse
Fetch the list of audit events.
-
#retrieve(audit_event_id, request_options: {}) ⇒ Courier::Models::AuditEvent
Fetch a specific audit event by ID.
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.
52 53 54 |
# File 'lib/courier/resources/audit_events.rb', line 52 def initialize(client:) @client = client end |
Instance Method Details
#list(cursor: nil, request_options: {}) ⇒ Courier::Models::AuditEventListResponse
Fetch the list of audit events
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/courier/resources/audit_events.rb', line 37 def list(params = {}) parsed, = Courier::AuditEventListParams.dump_request(params) query = Courier::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "audit-events", query: query, model: Courier::Models::AuditEventListResponse, options: ) end |
#retrieve(audit_event_id, request_options: {}) ⇒ Courier::Models::AuditEvent
Fetch a specific audit event by ID.
17 18 19 20 21 22 23 24 |
# File 'lib/courier/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: Courier::AuditEvent, options: params[:request_options] ) end |