Class AddressService
Class representing a set of address-related functionality.
Inherited Members
Namespace: EasyPost.Services
Assembly: EasyPost.dll
Syntax
public class AddressService : EasyPostService, IEasyPostService
  Methods
| Improve this Doc View SourceAll(All, CancellationToken)
List all Address objects.
Declaration
public async Task<AddressCollection> All(All parameters, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| All | parameters | All parameter set.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<AddressCollection> | AddressCollection instance.  | 
      
All(Nullable<Dictionary<String, Object>>, CancellationToken)
List all Address objects. Related API documentation.
Declaration
public async Task<AddressCollection> 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 result list with.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<AddressCollection> | A AddressCollection instance.  | 
      
Create(Dictionary<String, Object>, CancellationToken)
Create an Address. Related API documentation.
Declaration
public async Task<Address> Create(Dictionary<string, object> parameters, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Dictionary<System.String, System.Object> | parameters | Data to use to create the Address.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<Address> | An Address object.  | 
      
Create(Create, CancellationToken)
Create an Address. Related API documentation.
Declaration
public async Task<Address> Create(Create parameters, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Create | parameters | Data to use to create the Address.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<Address> | An Address object.  | 
      
CreateAndVerify(Dictionary<String, Object>, CancellationToken)
Create and verify an Address in one API call. Related API documentation.
Declaration
public async Task<Address> CreateAndVerify(Dictionary<string, object> parameters, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Dictionary<System.String, System.Object> | parameters | Data to use to create the Address.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<Address> | An Address object.  | 
      
CreateAndVerify(Create, CancellationToken)
Create and verify an Address in one API call. Related API documentation.
Declaration
public async Task<Address> CreateAndVerify(Create parameters, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Create | parameters | Data to use to create the Address.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<Address> | An Address object.  | 
      
GetNextPage(AddressCollection, Nullable<Int32>, CancellationToken)
Get the next page of a paginated AddressCollection.
Declaration
public async Task<AddressCollection> GetNextPage(AddressCollection collection, int? pageSize = null, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| AddressCollection | collection | The AddressCollection to get the next page of.  | 
      
| System.Nullable<System.Int32> | pageSize | The size of the next page.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<AddressCollection> | The next page, as a AddressCollection instance.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| EndOfPaginationError | Thrown if there is no next page to retrieve.  | 
      
Retrieve(String, CancellationToken)
Retrieve an Address from its id.
Declaration
public async Task<Address> Retrieve(string id, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | id | String representing an Address. Starts with "adr_".  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<Address> | EasyPost.Address instance.  | 
      
Verify(String, CancellationToken)
Verify an Address.
Declaration
public async Task<Address> Verify(string id, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | id | ID of the address to verify.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<Address> | EasyPost.Address instance. Check message for verification failures.  |