public class UpdateContentActionRequestExecutor extends RequestExecutor<java.lang.String>
ActionsApi
. Use this class if you want to update
content actions through fluent API in chained fashion, for example:
IKontaktCloud kontaktCloud = KontaktCloud.newInstance();
kontaktCloud.actions().updateContentAction(id)
.withProximity(Proximity.IMMEDIATE)
.withMediaFile(new File(fileName))
.execute();
Modifier and Type | Field and Description |
---|---|
protected ActionsService |
actionsService |
protected java.util.UUID |
id |
protected Proximity |
proximity |
Constructor and Description |
---|
UpdateContentActionRequestExecutor(ActionsService actionsService,
java.util.UUID id)
Constructs request executor initialized with corresponding service class and action's id.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkPreconditions()
Checks if all pre conditions are satisfied before sending the request.
|
java.lang.String |
execute()
Executes created request synchronously.
|
void |
execute(CloudCallback<java.lang.String> callback)
Executes created request asynchronously and invokes callback with the result.
|
protected java.util.Map<java.lang.String,java.lang.String> |
params()
Composes the request's parameters in map.
|
protected retrofit2.Call<java.lang.String> |
prepareCall()
Prepares a request to execute.
|
UpdateContentActionRequestExecutor |
withMediaFile(java.io.File file)
Updates the action's media file.
|
UpdateContentActionRequestExecutor |
withProximity(Proximity proximity)
Updates the action's proximity.
|
protected final ActionsService actionsService
protected final java.util.UUID id
protected Proximity proximity
public UpdateContentActionRequestExecutor(ActionsService actionsService, java.util.UUID id)
actionsService
- teh actions API service.id
- the action's unique identifier.public UpdateContentActionRequestExecutor withMediaFile(java.io.File file) throws java.io.IOException
file
- the media file.java.io.IOException
- instance of IOExceptionpublic UpdateContentActionRequestExecutor withProximity(Proximity proximity)
proximity
- the proximity.protected void checkPreconditions()
protected java.util.Map<java.lang.String,java.lang.String> params()
public java.lang.String execute() throws java.io.IOException, KontaktCloudException
execute
in class RequestExecutor<java.lang.String>
java.io.IOException
- exceptionKontaktCloudException
- exceptionpublic void execute(CloudCallback<java.lang.String> callback)
execute
in class RequestExecutor<java.lang.String>
callback
- the callback object.protected retrofit2.Call<java.lang.String> prepareCall()
prepareCall
in class RequestExecutor<java.lang.String>