public class CreateBrowserActionRequestExecutor extends RequestExecutor<Action>
ActionsApi
. Use this class if you want to create
browser actions through fluent API in chained fashion, for example:
IKontaktCloud kontaktCloud = KontaktCloud.newInstance();
Action browserAction = kontaktCloud.actions().createBrowserAction()
.forDevices("AxT7")
.withProximity(Proximity.NEAR)
.withUrl("https://kontakt.io")
.execute();
Modifier and Type | Field and Description |
---|---|
protected ActionsService |
actionsService |
protected Action.Type |
actionType |
protected Proximity |
proximity |
protected java.lang.String[] |
uniqueIds |
Constructor and Description |
---|
CreateBrowserActionRequestExecutor(ActionsService actionsService)
Constructs request executor initialized with corresponding service class.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkPreconditions()
Checks if all pre conditions are satisfied before sending the request.
|
Action |
execute()
Executes created request synchronously.
|
void |
execute(CloudCallback<Action> callback)
Executes created request asynchronously and invokes callback with the result.
|
CreateBrowserActionRequestExecutor |
forDevices(java.util.List<java.lang.String> uniqueIds)
Specifies associated devices.
|
CreateBrowserActionRequestExecutor |
forDevices(java.lang.String... uniqueIds)
Specifies associated devices.
|
protected java.util.Map<java.lang.String,java.lang.String> |
params()
Composes the request's parameters in map.
|
protected retrofit2.Call<Action> |
prepareCall()
Prepares a request to execute.
|
CreateBrowserActionRequestExecutor |
withProximity(Proximity proximity)
Specifies the proximity of newly created action.
|
CreateBrowserActionRequestExecutor |
withUrl(java.lang.String url)
Specifies a URL of newly created action.
|
protected final ActionsService actionsService
protected java.lang.String[] uniqueIds
protected Action.Type actionType
protected Proximity proximity
public CreateBrowserActionRequestExecutor(ActionsService actionsService)
actionsService
- the actions API service.public CreateBrowserActionRequestExecutor withUrl(java.lang.String url)
url
- the URL.public CreateBrowserActionRequestExecutor forDevices(java.lang.String... uniqueIds)
uniqueIds
- the device unique identifiers.public CreateBrowserActionRequestExecutor forDevices(java.util.List<java.lang.String> uniqueIds)
uniqueIds
- the device unique identifiers.public CreateBrowserActionRequestExecutor withProximity(Proximity proximity)
proximity
- the proximity.protected void checkPreconditions()
protected java.util.Map<java.lang.String,java.lang.String> params()
public Action execute() throws java.io.IOException, KontaktCloudException
execute
in class RequestExecutor<Action>
java.io.IOException
- exceptionKontaktCloudException
- exceptionpublic void execute(CloudCallback<Action> callback)
execute
in class RequestExecutor<Action>
callback
- the callback object.protected retrofit2.Call<Action> prepareCall()
prepareCall
in class RequestExecutor<Action>