public class AssignDeviceRequestExecutor extends RequestExecutor<java.lang.String>
DevicesApi
. Use this class if you want to assign
devices either to manager or to venue through fluent API in chained fashion. Example of use:
IKontaktCloud kontaktCloud = KontaktCloud.newInstance();
kontaktCloud.devices().assign(IDs)
.toManager(managerId)
.execute();
Keep in mind that toManager
cannot be used with toVenue
and so on.
In such a situation an exception will be thrown at runtime.Constructor and Description |
---|
AssignDeviceRequestExecutor(DevicesService devicesService,
java.lang.String... uniqueIds)
Constructs request executor initialized with corresponding service class and device unique IDs.
|
AssignDeviceRequestExecutor(DevicesService devicesService,
java.util.UUID... deviceIds)
Constructs request executor initialized with corresponding service class and device unique IDs.
|
Modifier and Type | Method and Description |
---|---|
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.
|
AssignDeviceRequestExecutor |
toManager(java.util.UUID managerId)
Specifies the manager.
|
AssignDeviceRequestExecutor |
toVenue(java.util.UUID venueId)
Specifies the venue.
|
public AssignDeviceRequestExecutor(DevicesService devicesService, java.util.UUID... deviceIds)
devicesService
- the devices API service.deviceIds
- device unique identifiers.public AssignDeviceRequestExecutor(DevicesService devicesService, java.lang.String... uniqueIds)
devicesService
- the devices API service.uniqueIds
- device unique identifiers.public AssignDeviceRequestExecutor toVenue(java.util.UUID venueId)
toManager
simultaneously.venueId
- venue unique identifier.public AssignDeviceRequestExecutor toManager(java.util.UUID managerId)
toVenue
simultaneously.managerId
- manager unique identifier.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>
protected java.util.Map<java.lang.String,java.lang.String> params()
params
in class RequestExecutor<java.lang.String>