Class InsuranceService
java.lang.Object
com.easypost.service.InsuranceService
-
Method Summary
Modifier and TypeMethodDescriptionGet a list of Insurances.Create a new Insurance object from a map of parameters.getNextPage
(InsuranceCollection collection) Get the next page of an InsuranceCollection.getNextPage
(InsuranceCollection collection, Integer pageSize) Get the next page of an InsuranceCollection.Refund an Insurance from the API.Retrieve an Insurance from the API.
-
Method Details
-
create
Create a new Insurance object from a map of parameters.- Parameters:
params
- Map of parameters.- Returns:
- Insurance object
- Throws:
EasyPostException
- when the request fails.
-
retrieve
Retrieve an Insurance from the API.- Parameters:
id
- The ID of the Insurance to retrieve.- Returns:
- Insurance object
- Throws:
EasyPostException
- when the request fails.
-
all
Get a list of Insurances.- Parameters:
params
- a map of parameters- Returns:
- InsuranceCollection object
- Throws:
EasyPostException
- when the request fails.
-
refund
Refund an Insurance from the API.- Parameters:
id
- The ID of the Insurance to refund.- Returns:
- Insurance object
- Throws:
EasyPostException
- when the request fails.
-
getNextPage
Get the next page of an InsuranceCollection.- Parameters:
collection
- InsuranceCollection to get next page of.- Returns:
- InsuranceCollection object.
- Throws:
EndOfPaginationError
- when there are no more pages to retrieve.
-
getNextPage
public InsuranceCollection getNextPage(InsuranceCollection collection, Integer pageSize) throws EndOfPaginationError Get the next page of an InsuranceCollection.- Parameters:
collection
- InsuranceCollection to get next page of.pageSize
- The number of results to return on the next page.- Returns:
- InsuranceCollection object.
- Throws:
EndOfPaginationError
- when there are no more pages to retrieve.
-