public class OffersRequestBuilder extends RequestBuilder
RequestBuilder.Order
Constructor and Description |
---|
OffersRequestBuilder(OkHttpClient httpClient,
HttpUrl serverURI) |
Modifier and Type | Method and Description |
---|---|
OffersRequestBuilder |
cursor(java.lang.String token)
Sets
cursor parameter on the request. |
Page<OfferResponse> |
execute()
Build and execute request.
|
static Page<OfferResponse> |
execute(OkHttpClient httpClient,
HttpUrl uri)
|
OffersRequestBuilder |
forAccount(KeyPair account)
Builds request to
GET /accounts/{account}/offers |
OffersRequestBuilder |
limit(int number)
Sets
limit parameter on the request. |
OffersRequestBuilder |
order(RequestBuilder.Order direction)
Sets
order parameter on the request. |
public OffersRequestBuilder(OkHttpClient httpClient, HttpUrl serverURI)
public OffersRequestBuilder forAccount(KeyPair account)
GET /accounts/{account}/offers
account
- Account for which to get offerspublic static Page<OfferResponse> execute(OkHttpClient httpClient, HttpUrl uri) throws java.io.IOException, TooManyRequestsException
uri
and returns Page
of OfferResponse
.
This method is helpful for getting the next set of results.Page
of OfferResponse
TooManyRequestsException
- when too many requests were sent to the Horizon server.java.io.IOException
public Page<OfferResponse> execute() throws java.io.IOException, TooManyRequestsException
Page
of OfferResponse
TooManyRequestsException
- when too many requests were sent to the Horizon server.java.io.IOException
public OffersRequestBuilder cursor(java.lang.String token)
RequestBuilder
cursor
parameter on the request.
A cursor is a value that points to a specific location in a collection of resources.
The cursor attribute itself is an opaque value meaning that users should not try to parse it.cursor
in class RequestBuilder
public OffersRequestBuilder limit(int number)
RequestBuilder
limit
parameter on the request.
It defines maximum number of records to return.
For range and default values check documentation of the endpoint requested.limit
in class RequestBuilder
number
- maxium number of records to returnpublic OffersRequestBuilder order(RequestBuilder.Order direction)
RequestBuilder
order
parameter on the request.order
in class RequestBuilder
direction
- RequestBuilder.Order