class SimpleSpark::Endpoints::MessageEvents

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

Attributes

client[RW]

Public Class Methods

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

Public Instance Methods

samples(events = nil) click to toggle source

Returns sample message_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 MessageEvent hash objects @note See: developers.sparkpost.com/api/#/reference/message-events/events-samples

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