Package com.easypost.service
Class EventService
java.lang.Object
com.easypost.service.EventService
-
Method Summary
Modifier and TypeMethodDescriptionGet a list of Events.getNextPage(EventCollection collection) Get the next page of an EventCollection.getNextPage(EventCollection collection, Integer pageSize) Get the next page of an EventCollection.Retrieve a Event from the API.retrieveAllPayloads(String eventId) Retrieve all payloads.retrievePayload(String eventId, String payloadId) Retrieve a payload.
-
Method Details
-
retrieve
Retrieve a Event from the API.- Parameters:
id- ID of the Event to retrieve- Returns:
- Event object
- Throws:
EasyPostException- when the request fails.
-
all
Get a list of Events.- Parameters:
params- A map of parameters to pass to the API.- Returns:
- EventCollection object
- Throws:
EasyPostException- when the request fails.
-
getNextPage
Get the next page of an EventCollection.- Parameters:
collection- EventCollection to get next page of.- Returns:
- EventCollection object.
- Throws:
EndOfPaginationError- when there are no more pages to retrieve.
-
getNextPage
public EventCollection getNextPage(EventCollection collection, Integer pageSize) throws EndOfPaginationError Get the next page of an EventCollection.- Parameters:
collection- EventCollection to get next page of.pageSize- The number of results to return on the next page.- Returns:
- EventCollection object.
- Throws:
EndOfPaginationError- when there are no more pages to retrieve.
-
retrieveAllPayloads
Retrieve all payloads.- Parameters:
eventId- The ID of event.- Returns:
- List of Payload objects.
- Throws:
EasyPostException- when the request fails.
-
retrievePayload
Retrieve a payload.- Parameters:
eventId- The ID of event.payloadId- The ID of payload.- Returns:
- PayloadCollection object
- Throws:
EasyPostException- when the request fails.
-