Class EventService
Class representing a set of event-related functionality.
Inherited Members
Namespace: EasyPost.Services
Assembly: EasyPost.dll
Syntax
public class EventService : EasyPostService, IEasyPostService
  Methods
| Improve this Doc View SourceAll(All, CancellationToken)
List all Events. Related API documentation.
Declaration
public async Task<EventCollection> All(All parameters, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| All | parameters | All parameter set.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<EventCollection> | EventCollection instance.  | 
      
All(Nullable<Dictionary<String, Object>>, CancellationToken)
List all Events. Related API documentation.
Declaration
public async Task<EventCollection> All(Dictionary<string, object>? parameters = null, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Nullable<Dictionary<System.String, System.Object>> | parameters | Dictionary containing parameters to filter the results on. See All for valid keys.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<EventCollection> | EventCollection instance.  | 
      
GetNextPage(EventCollection, Nullable<Int32>, CancellationToken)
Get the next page of a paginated EventCollection. Related API documentation.
Declaration
public async Task<EventCollection> GetNextPage(EventCollection collection, int? pageSize = null, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| EventCollection | collection | The EventCollection to get the next page of.  | 
      
| System.Nullable<System.Int32> | pageSize | The size of the next page.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<EventCollection> | The next page, as a EventCollection instance.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| EndOfPaginationError | Thrown if there is no next page to retrieve.  | 
      
Retrieve(String, CancellationToken)
Retrieve an Event. Related API documentation.
Declaration
public async Task<Event> Retrieve(string id, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | id | The ID of the Event to retrieve.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<Event> | An Event instance.  | 
      
RetrieveAllPayloads(String, CancellationToken)
Retrieve all Payloads for an Event. Related API documentation.
Declaration
public async Task<List<Payload>> RetrieveAllPayloads(string eventId, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | eventId | ID of the Event to retrieve payloads for.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<List<Payload>> | A list of Payload objects.  | 
      
RetrievePayload(String, String, CancellationToken)
Retrieve a specific Payload for an Event. Related API documentation.
Declaration
public async Task<Payload> RetrievePayload(string eventId, string payloadId, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | eventId | ID of the Event to retrieve payload for.  | 
      
| System.String | payloadId | ID of the Payload to retrieve.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<Payload> | A Payload object.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| InvalidRequestError | Thrown if the specified payload ID is malformed.  | 
      
| NotFoundError | Thrown if the specified payload is not found.  |