class SimpleSpark::Endpoints::Events

Provides access to the /message-events endpoint @note See: developers.sparkpost.com/api/events/

Attributes

client[RW]

Public Class Methods

new(client) click to toggle source
# File lib/simple_spark/endpoints/events.rb, line 8
def initialize(client)
  @client = client
end

Public Instance Methods

samples(events = nil) click to toggle source

Returns sample events @param events [String] Event types for which to get a sample payload, use the Webhooks Events endpoint to list the

available event types, defaults to all event types

@return [Array] a list of sample Event hash objects @note See: developers.sparkpost.com/api/events/#events-get-events-samples

# File lib/simple_spark/endpoints/events.rb, line 17
def samples(events = nil)
  query_params = events.nil? ? {} : { events: events }
  @client.call(method: :get, path: 'events/message/samples', query_values: query_params)
end