class EasyPost::Services::Event
Public Instance Methods
Source
# File lib/easypost/services/event.rb, line 16 def all(params = {}) filters = { key: 'events' } get_all_helper('events', MODEL_CLASS, params, filters) end
Retrieve all Event
objects
Source
# File lib/easypost/services/event.rb, line 37 def get_next_page(collection, page_size = nil) raise EasyPost::Errors::EndOfPaginationError.new unless more_pages?(collection) params = { before_id: collection.events.last.id } params[:page_size] = page_size unless page_size.nil? all(params) end
Get the next page of events.
Source
# File lib/easypost/services/event.rb, line 9 def retrieve(id) response = @client.make_request(:get, "events/#{id}") EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end
Retrieve an Event
object
Source
# File lib/easypost/services/event.rb, line 23 def retrieve_all_payloads(event_id) response = @client.make_request(:get, "events/#{event_id}/payloads") EasyPost::InternalUtilities::Json.convert_json_to_object(response, EasyPost::Models::Payload) end
Retrieve all payloads for an event.
Source
# File lib/easypost/services/event.rb, line 30 def retrieve_payload(event_id, payload_id) response = @client.make_request(:get, "events/#{event_id}/payloads/#{payload_id}") EasyPost::InternalUtilities::Json.convert_json_to_object(response, EasyPost::Models::Payload) end
Retrieve a specific payload for an event.