use of com.willshex.blogwt.shared.api.notification.call.UpdateNotificationSettingsResponse in project blogwt by billy1380.
the class NotificationService method updateNotificationSettings.
public Request updateNotificationSettings(UpdateNotificationSettingsRequest input, AsyncSuccess<UpdateNotificationSettingsRequest, UpdateNotificationSettingsResponse> onSuccess, AsyncFailure<UpdateNotificationSettingsRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(NotificationMethodUpdateNotificationSettings, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
UpdateNotificationSettingsResponse outputParameter = new UpdateNotificationSettingsResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, exception);
}
});
onCallStart(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, exception);
}
return handle;
}
Aggregations