public class ActionsRequestExecutor extends PaginatedRequestExecutor<Actions>
ActionsApi
. Use this class if you want to obtain actions
through fluent API in chained fashion. Here is an example of how to use this executor:
IKontaktCloud kontaktCloud = KontaktCloud.newInstance();
Actions actions = kontaktCloud.actions().fetch()
.forDevices("AxT7")
.startIndex(4)
.maxResult(10)
.filter("")
.execute();
Keep in mind that devices must be specified so invocation of forDevices
method is mandatory.
Otherwise an exception will be thrown.eTag, maxResult, order, orderBy, query, startIndex
Constructor and Description |
---|
ActionsRequestExecutor(ActionsService actionsService)
Constructs request executor initialized with corresponding service class.
|
Modifier and Type | Method and Description |
---|---|
ActionsRequestExecutor |
eTag(java.lang.String eTag)
Specifies HTTP entity tag purposed for caching REST API calls.
|
Actions |
execute()
Executes created request synchronously.
|
void |
execute(CloudCallback<Actions> callback)
Executes created request asynchronously and invokes callback with the result.
|
ActionsRequestExecutor |
filter(java.lang.String query)
Specifies the filter for requested data.
|
ActionsRequestExecutor |
forDevices(java.util.List<java.lang.String> uniqueIds)
Specifies associated devices.
|
ActionsRequestExecutor |
forDevices(java.lang.String... uniqueIds)
Specifies associated devices.
|
ActionsRequestExecutor |
maxResult(int maxResult)
Specifies the maximum size of response data collection.
|
ActionsRequestExecutor |
orderBy(OrderBy orderBy,
Order order)
Specifies the ordering of response data elements.
|
protected java.util.Map<java.lang.String,java.lang.String> |
params()
Composes the request's query parameters in map.
|
protected retrofit2.Call<Actions> |
prepareCall()
Prepares a request to execute.
|
ActionsRequestExecutor |
startIndex(int startIndex)
Specifies the start index of requested data.
|
public ActionsRequestExecutor(ActionsService actionsService)
actionsService
- the actions API service.public ActionsRequestExecutor forDevices(java.lang.String... uniqueIds)
uniqueIds
- the device unique identifiers.public ActionsRequestExecutor forDevices(java.util.List<java.lang.String> uniqueIds)
uniqueIds
- the device unique identifiers.public ActionsRequestExecutor startIndex(int startIndex)
startIndex
in class PaginatedRequestExecutor<Actions>
startIndex
- the start index.public ActionsRequestExecutor maxResult(int maxResult)
maxResult
in class PaginatedRequestExecutor<Actions>
maxResult
- the maximum response size value.public ActionsRequestExecutor filter(java.lang.String query)
filter
in class PaginatedRequestExecutor<Actions>
query
- the query filter.public ActionsRequestExecutor orderBy(OrderBy orderBy, Order order)
orderBy
in class PaginatedRequestExecutor<Actions>
orderBy
- the field type that specifies the order by column.order
- ascending or descending.public ActionsRequestExecutor eTag(java.lang.String eTag)
eTag
in class PaginatedRequestExecutor<Actions>
eTag
- the entity tag value.public Actions execute() throws java.io.IOException, KontaktCloudException
execute
in class RequestExecutor<Actions>
java.io.IOException
- exceptionKontaktCloudException
- exceptionpublic void execute(CloudCallback<Actions> callback)
execute
in class RequestExecutor<Actions>
callback
- the callback object.protected retrofit2.Call<Actions> prepareCall()
prepareCall
in class RequestExecutor<Actions>
protected java.util.Map<java.lang.String,java.lang.String> params()
params
in class PaginatedRequestExecutor<Actions>