本文整理汇总了Java中cloud.artik.client.ApiCallback类的典型用法代码示例。如果您正苦于以下问题:Java ApiCallback类的具体用法?Java ApiCallback怎么用?Java ApiCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApiCallback类属于cloud.artik.client包,在下文中一共展示了ApiCallback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addDeviceAsync
import cloud.artik.client.ApiCallback; //导入依赖的package包/类
/**
* Add Device (asynchronously)
* Create a device
* @param device Device to be added to the user (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call addDeviceAsync(Device device, final ApiCallback<DeviceEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = addDeviceValidateBeforeCall(device, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<DeviceEnvelope>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
示例2: deleteDeviceAsync
import cloud.artik.client.ApiCallback; //导入依赖的package包/类
/**
* Delete Device (asynchronously)
* Deletes a device
* @param deviceId deviceId (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call deleteDeviceAsync(String deviceId, final ApiCallback<DeviceEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = deleteDeviceValidateBeforeCall(deviceId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<DeviceEnvelope>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
示例3: deleteDeviceTokenAsync
import cloud.artik.client.ApiCallback; //导入依赖的package包/类
/**
* Delete Device Token (asynchronously)
* Deletes a device's token
* @param deviceId deviceId (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call deleteDeviceTokenAsync(String deviceId, final ApiCallback<DeviceTokenEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = deleteDeviceTokenValidateBeforeCall(deviceId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<DeviceTokenEnvelope>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
示例4: getDeviceAsync
import cloud.artik.client.ApiCallback; //导入依赖的package包/类
/**
* Get Device (asynchronously)
* Retrieves a device
* @param deviceId deviceId (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call getDeviceAsync(String deviceId, final ApiCallback<DeviceEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = getDeviceValidateBeforeCall(deviceId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<DeviceEnvelope>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
示例5: getDevicePresenceAsync
import cloud.artik.client.ApiCallback; //导入依赖的package包/类
/**
* Get device presence information (asynchronously)
* Return the presence status of the given device along with the time it was last seen
* @param deviceId Device ID. (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call getDevicePresenceAsync(String deviceId, final ApiCallback<PresenceEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = getDevicePresenceValidateBeforeCall(deviceId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<PresenceEnvelope>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
示例6: getDeviceTokenAsync
import cloud.artik.client.ApiCallback; //导入依赖的package包/类
/**
* Get Device Token (asynchronously)
* Retrieves a device's token
* @param deviceId deviceId (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call getDeviceTokenAsync(String deviceId, final ApiCallback<DeviceTokenEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = getDeviceTokenValidateBeforeCall(deviceId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<DeviceTokenEnvelope>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
示例7: updateDeviceAsync
import cloud.artik.client.ApiCallback; //导入依赖的package包/类
/**
* Update Device (asynchronously)
* Updates a device
* @param deviceId deviceId (required)
* @param device Device to be updated (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call updateDeviceAsync(String deviceId, Device device, final ApiCallback<DeviceEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = updateDeviceValidateBeforeCall(deviceId, device, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<DeviceEnvelope>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
示例8: updateDeviceTokenAsync
import cloud.artik.client.ApiCallback; //导入依赖的package包/类
/**
* Update Device Token (asynchronously)
* Updates a device's token
* @param deviceId deviceId (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call updateDeviceTokenAsync(String deviceId, final ApiCallback<DeviceTokenEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = updateDeviceTokenValidateBeforeCall(deviceId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<DeviceTokenEnvelope>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
示例9: createSubscriptionAsync
import cloud.artik.client.ApiCallback; //导入依赖的package包/类
/**
* Create Subscription (asynchronously)
* Create Subscription
* @param subscriptionInfo Subscription details (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call createSubscriptionAsync(SubscriptionInfo subscriptionInfo, final ApiCallback<SubscriptionEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = createSubscriptionValidateBeforeCall(subscriptionInfo, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<SubscriptionEnvelope>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
示例10: deleteSubscriptionAsync
import cloud.artik.client.ApiCallback; //导入依赖的package包/类
/**
* Delete Subscription (asynchronously)
* Delete Subscription
* @param subId Subscription ID. (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call deleteSubscriptionAsync(String subId, final ApiCallback<SubscriptionEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = deleteSubscriptionValidateBeforeCall(subId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<SubscriptionEnvelope>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
示例11: getAllSubscriptionsAsync
import cloud.artik.client.ApiCallback; //导入依赖的package包/类
/**
* Get All Subscriptions (asynchronously)
* Get All Subscriptions
* @param uid User ID (optional)
* @param offset Offset for pagination. (optional)
* @param count Desired count of items in the result set. (optional)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call getAllSubscriptionsAsync(String uid, Integer offset, Integer count, final ApiCallback<SubscriptionsEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = getAllSubscriptionsValidateBeforeCall(uid, offset, count, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<SubscriptionsEnvelope>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
示例12: getMessagesAsync
import cloud.artik.client.ApiCallback; //导入依赖的package包/类
/**
* Get Messages (asynchronously)
* Get Messages
* @param notifId Notification ID. (required)
* @param offset Offset for pagination. (optional)
* @param count Desired count of items in the result set. (optional)
* @param order Sort order of results by ts. Either 'asc' or 'desc'. (optional)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call getMessagesAsync(String notifId, Integer offset, Integer count, String order, final ApiCallback<NotifMessagesResponse> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = getMessagesValidateBeforeCall(notifId, offset, count, order, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<NotifMessagesResponse>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
示例13: getSubscriptionAsync
import cloud.artik.client.ApiCallback; //导入依赖的package包/类
/**
* Get Subscription (asynchronously)
* Get Subscription
* @param subId Subscription ID. (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call getSubscriptionAsync(String subId, final ApiCallback<SubscriptionEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = getSubscriptionValidateBeforeCall(subId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<SubscriptionEnvelope>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
示例14: validateSubscriptionAsync
import cloud.artik.client.ApiCallback; //导入依赖的package包/类
/**
* Validate Subscription (asynchronously)
* Validate Subscription
* @param subId Subscription ID. (required)
* @param validationCallbackRequest Subscription validation callback request (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call validateSubscriptionAsync(String subId, ValidationCallbackInfo validationCallbackRequest, final ApiCallback<SubscriptionEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = validateSubscriptionValidateBeforeCall(subId, validationCallbackRequest, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<SubscriptionEnvelope>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
示例15: checkTokenAsync
import cloud.artik.client.ApiCallback; //导入依赖的package包/类
/**
* Check Token (asynchronously)
* (Deprecated) Check Token. See tokenInfo
* @param tokenInfo Token object to be checked (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call checkTokenAsync(TokenRequest tokenInfo, final ApiCallback<CheckTokenResponse> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = checkTokenValidateBeforeCall(tokenInfo, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<CheckTokenResponse>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}