com.textmagic.sdk.api.TextMagicApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of textmagic-java-sdk Show documentation
Show all versions of textmagic-java-sdk Show documentation
Java wrapper library for Textmagic services
/*
* TextMagic API
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.textmagic.sdk.api;
import com.textmagic.sdk.ApiCallback;
import com.textmagic.sdk.ApiClient;
import com.textmagic.sdk.ApiException;
import com.textmagic.sdk.ApiResponse;
import com.textmagic.sdk.Configuration;
import com.textmagic.sdk.Pair;
import com.textmagic.sdk.ProgressRequestBody;
import com.textmagic.sdk.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.textmagic.sdk.model.AssignContactsToListInputObject;
import com.textmagic.sdk.model.BadRequestResponse;
import java.math.BigDecimal;
import com.textmagic.sdk.model.BlockContactInputObject;
import com.textmagic.sdk.model.BulkSession;
import com.textmagic.sdk.model.BuyDedicatedNumberInputObject;
import com.textmagic.sdk.model.Chat;
import com.textmagic.sdk.model.CheckPhoneVerificationCodeInputObject;
import com.textmagic.sdk.model.ClearAndAssignContactsToListInputObject;
import com.textmagic.sdk.model.CloseChatsBulkInputObject;
import com.textmagic.sdk.model.Contact;
import com.textmagic.sdk.model.ContactNote;
import com.textmagic.sdk.model.CreateContactInputObject;
import com.textmagic.sdk.model.CreateContactNoteInputObject;
import com.textmagic.sdk.model.CreateCustomFieldInputObject;
import com.textmagic.sdk.model.CreateListInputObject;
import com.textmagic.sdk.model.CreateTemplateInputObject;
import com.textmagic.sdk.model.DeleteChatMessagesBulkInputObject;
import com.textmagic.sdk.model.DeleteChatsBulkInputObject;
import com.textmagic.sdk.model.DeleteContacsFromListObject;
import com.textmagic.sdk.model.DeleteContactNotesBulkInputObject;
import com.textmagic.sdk.model.DeleteContactsByIdsInputObject;
import com.textmagic.sdk.model.DeleteInboundMessagesBulkInputObject;
import com.textmagic.sdk.model.DeleteListContactsBulkInputObject;
import com.textmagic.sdk.model.DeleteListsBulkInputObject;
import com.textmagic.sdk.model.DeleteMessageSessionsBulkInputObject;
import com.textmagic.sdk.model.DeleteOutboundMessagesBulkInputObject;
import com.textmagic.sdk.model.DeleteScheduledMessagesBulkInputObject;
import com.textmagic.sdk.model.DeleteTemplatesBulkInputObject;
import com.textmagic.sdk.model.DoCarrierLookupResponse;
import com.textmagic.sdk.model.DoEmailLookupResponse;
import java.io.File;
import com.textmagic.sdk.model.GetAllBulkSessionsPaginatedResponse;
import com.textmagic.sdk.model.GetAllChatsPaginatedResponse;
import com.textmagic.sdk.model.GetAllInboundMessagesPaginatedResponse;
import com.textmagic.sdk.model.GetAllMessageSessionsPaginatedResponse;
import com.textmagic.sdk.model.GetAllOutboundMessagesPaginatedResponse;
import com.textmagic.sdk.model.GetAllScheduledMessagesPaginatedResponse;
import com.textmagic.sdk.model.GetAllTemplatesPaginatedResponse;
import com.textmagic.sdk.model.GetAvailableDedicatedNumbersResponse;
import com.textmagic.sdk.model.GetAvailableSenderSettingOptionsResponse;
import com.textmagic.sdk.model.GetBalanceNotificationOptionsResponse;
import com.textmagic.sdk.model.GetBalanceNotificationSettingsResponse;
import com.textmagic.sdk.model.GetBlockedContactsPaginatedResponse;
import com.textmagic.sdk.model.GetCallbackSettingsResponse;
import com.textmagic.sdk.model.GetChatMessagesPaginatedResponse;
import com.textmagic.sdk.model.GetContactImportSessionProgressResponse;
import com.textmagic.sdk.model.GetContactNotesPaginatedResponse;
import com.textmagic.sdk.model.GetContactsAutocompleteResponse;
import com.textmagic.sdk.model.GetContactsByListIdPaginatedResponse;
import com.textmagic.sdk.model.GetContactsPaginatedResponse;
import com.textmagic.sdk.model.GetCountriesResponse;
import com.textmagic.sdk.model.GetCustomFieldsPaginatedResponse;
import com.textmagic.sdk.model.GetFavoritesPaginatedResponse;
import com.textmagic.sdk.model.GetInboundMessagesNotificationSettingsResponse;
import com.textmagic.sdk.model.GetInvoicesPaginatedResponse;
import com.textmagic.sdk.model.GetListContactsIdsResponse;
import com.textmagic.sdk.model.GetListsOfContactPaginatedResponse;
import com.textmagic.sdk.model.GetListsPaginatedResponse;
import com.textmagic.sdk.model.GetMessagePreviewResponse;
import com.textmagic.sdk.model.GetMessagePriceResponse;
import com.textmagic.sdk.model.GetMessageSessionStatResponse;
import com.textmagic.sdk.model.GetMessagesBySessionIdPaginatedResponse;
import com.textmagic.sdk.model.GetMessagingCountersResponse;
import com.textmagic.sdk.model.GetMessagingStatResponse;
import com.textmagic.sdk.model.GetOutboundMessagesHistoryPaginatedResponse;
import com.textmagic.sdk.model.GetSenderIdsPaginatedResponse;
import com.textmagic.sdk.model.GetSenderSettingsResponse;
import com.textmagic.sdk.model.GetSpendingStatPaginatedResponse;
import com.textmagic.sdk.model.GetSubaccountsWithTokensInputObject;
import com.textmagic.sdk.model.GetSubaccountsWithTokensResponse;
import com.textmagic.sdk.model.GetTimezonesResponse;
import com.textmagic.sdk.model.GetUnreadMessagesTotalResponse;
import com.textmagic.sdk.model.GetUnsubscribersPaginatedResponse;
import com.textmagic.sdk.model.GetUserDedicatedNumbersPaginatedResponse;
import com.textmagic.sdk.model.InviteSubaccountInputObject;
import com.textmagic.sdk.model.MarkChatsReadBulkInputObject;
import com.textmagic.sdk.model.MarkChatsUnreadBulkInputObject;
import com.textmagic.sdk.model.MessageIn;
import com.textmagic.sdk.model.MessageOut;
import com.textmagic.sdk.model.MessageSession;
import com.textmagic.sdk.model.MessageTemplate;
import com.textmagic.sdk.model.MessagesIcs;
import com.textmagic.sdk.model.MuteChatInputObject;
import com.textmagic.sdk.model.MuteChatsBulkInputObject;
import com.textmagic.sdk.model.NotFoundResponse;
import com.textmagic.sdk.model.PingResponse;
import com.textmagic.sdk.model.ReopenChatsBulkInputObject;
import com.textmagic.sdk.model.RequestNewSubaccountTokenInputObject;
import com.textmagic.sdk.model.RequestSenderIdInputObject;
import com.textmagic.sdk.model.ResourceLinkResponse;
import com.textmagic.sdk.model.SearchChatsByIdsPaginatedResponse;
import com.textmagic.sdk.model.SearchChatsByReceipentPaginatedResponse;
import com.textmagic.sdk.model.SearchChatsPaginatedResponse;
import com.textmagic.sdk.model.SearchContactsPaginatedResponse;
import com.textmagic.sdk.model.SearchInboundMessagesPaginatedResponse;
import com.textmagic.sdk.model.SearchListsPaginatedResponse;
import com.textmagic.sdk.model.SearchOutboundMessagesPaginatedResponse;
import com.textmagic.sdk.model.SearchScheduledMessagesPaginatedResponse;
import com.textmagic.sdk.model.SearchTemplatesPaginatedResponse;
import com.textmagic.sdk.model.SendMessageInputObject;
import com.textmagic.sdk.model.SendMessageResponse;
import com.textmagic.sdk.model.SendPhoneVerificationCodeInputObject;
import com.textmagic.sdk.model.SendPhoneVerificationCodeResponse;
import com.textmagic.sdk.model.SenderId;
import com.textmagic.sdk.model.SetChatStatusInputObject;
import com.textmagic.sdk.model.UnauthorizedResponse;
import com.textmagic.sdk.model.UnblockContactInputObject;
import com.textmagic.sdk.model.UnblockContactsBulkInputObject;
import com.textmagic.sdk.model.UnmuteChatsBulkInputObject;
import com.textmagic.sdk.model.UnsubscribeContactInputObject;
import com.textmagic.sdk.model.UnsubscribedContact;
import com.textmagic.sdk.model.UpdateBalanceNotificationSettingsInputObject;
import com.textmagic.sdk.model.UpdateCallbackSettingsInputObject;
import com.textmagic.sdk.model.UpdateChatDesktopNotificationSettingsInputObject;
import com.textmagic.sdk.model.UpdateContactInputObject;
import com.textmagic.sdk.model.UpdateContactNoteInputObject;
import com.textmagic.sdk.model.UpdateCurrentUserInputObject;
import com.textmagic.sdk.model.UpdateCurrentUserResponse;
import com.textmagic.sdk.model.UpdateCustomFieldInputObject;
import com.textmagic.sdk.model.UpdateCustomFieldValueInputObject;
import com.textmagic.sdk.model.UpdateInboundMessagesNotificationSettingsInputObject;
import com.textmagic.sdk.model.UpdateListObject;
import com.textmagic.sdk.model.UpdateSenderSettingInputObject;
import com.textmagic.sdk.model.UpdateTemplateInputObject;
import com.textmagic.sdk.model.UploadMessageAttachmentResponse;
import com.textmagic.sdk.model.User;
import com.textmagic.sdk.model.UserCustomField;
import com.textmagic.sdk.model.UsersInbound;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class TextMagicApi {
private ApiClient apiClient;
public TextMagicApi() {
this(Configuration.getDefaultApiClient());
}
public TextMagicApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Build call for assignContactsToList
* @param assignContactsToListInputObject (required)
* @param id (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call assignContactsToListCall(AssignContactsToListInputObject assignContactsToListInputObject, Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = assignContactsToListInputObject;
// create path and map variables
String localVarPath = "/api/v2/lists/{id}/contacts"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call assignContactsToListValidateBeforeCall(AssignContactsToListInputObject assignContactsToListInputObject, Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'assignContactsToListInputObject' is set
if (assignContactsToListInputObject == null) {
throw new ApiException("Missing the required parameter 'assignContactsToListInputObject' when calling assignContactsToList(Async)");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling assignContactsToList(Async)");
}
com.squareup.okhttp.Call call = assignContactsToListCall(assignContactsToListInputObject, id, progressListener, progressRequestListener);
return call;
}
/**
* Assign contacts to a list
* > Unlike all other PUT requests, this command does not need old contact IDs to be submitted. For example, if you have a list with contacts 150, 151 and 152 and you want to add contact ID 153, you only need to submit 153 as a parameter of PUT /api/v2/lists/{id}/contacts.
* @param assignContactsToListInputObject (required)
* @param id (required)
* @return ResourceLinkResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ResourceLinkResponse assignContactsToList(AssignContactsToListInputObject assignContactsToListInputObject, Integer id) throws ApiException {
ApiResponse resp = assignContactsToListWithHttpInfo(assignContactsToListInputObject, id);
return resp.getData();
}
/**
* Assign contacts to a list
* > Unlike all other PUT requests, this command does not need old contact IDs to be submitted. For example, if you have a list with contacts 150, 151 and 152 and you want to add contact ID 153, you only need to submit 153 as a parameter of PUT /api/v2/lists/{id}/contacts.
* @param assignContactsToListInputObject (required)
* @param id (required)
* @return ApiResponse<ResourceLinkResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse assignContactsToListWithHttpInfo(AssignContactsToListInputObject assignContactsToListInputObject, Integer id) throws ApiException {
com.squareup.okhttp.Call call = assignContactsToListValidateBeforeCall(assignContactsToListInputObject, id, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Assign contacts to a list (asynchronously)
* > Unlike all other PUT requests, this command does not need old contact IDs to be submitted. For example, if you have a list with contacts 150, 151 and 152 and you want to add contact ID 153, you only need to submit 153 as a parameter of PUT /api/v2/lists/{id}/contacts.
* @param assignContactsToListInputObject (required)
* @param 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 assignContactsToListAsync(AssignContactsToListInputObject assignContactsToListInputObject, Integer id, final ApiCallback 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 = assignContactsToListValidateBeforeCall(assignContactsToListInputObject, id, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for blockContact
* @param blockContactInputObject (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call blockContactCall(BlockContactInputObject blockContactInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = blockContactInputObject;
// create path and map variables
String localVarPath = "/api/v2/contacts/block";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call blockContactValidateBeforeCall(BlockContactInputObject blockContactInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'blockContactInputObject' is set
if (blockContactInputObject == null) {
throw new ApiException("Missing the required parameter 'blockContactInputObject' when calling blockContact(Async)");
}
com.squareup.okhttp.Call call = blockContactCall(blockContactInputObject, progressListener, progressRequestListener);
return call;
}
/**
* Block a contact by phone number
* Block a contact from inbound and outbound communication by phone number.
* @param blockContactInputObject (required)
* @return ResourceLinkResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ResourceLinkResponse blockContact(BlockContactInputObject blockContactInputObject) throws ApiException {
ApiResponse resp = blockContactWithHttpInfo(blockContactInputObject);
return resp.getData();
}
/**
* Block a contact by phone number
* Block a contact from inbound and outbound communication by phone number.
* @param blockContactInputObject (required)
* @return ApiResponse<ResourceLinkResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse blockContactWithHttpInfo(BlockContactInputObject blockContactInputObject) throws ApiException {
com.squareup.okhttp.Call call = blockContactValidateBeforeCall(blockContactInputObject, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Block a contact by phone number (asynchronously)
* Block a contact from inbound and outbound communication by phone number.
* @param blockContactInputObject (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 blockContactAsync(BlockContactInputObject blockContactInputObject, final ApiCallback 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 = blockContactValidateBeforeCall(blockContactInputObject, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for buyDedicatedNumber
* @param buyDedicatedNumberInputObject (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call buyDedicatedNumberCall(BuyDedicatedNumberInputObject buyDedicatedNumberInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = buyDedicatedNumberInputObject;
// create path and map variables
String localVarPath = "/api/v2/numbers";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call buyDedicatedNumberValidateBeforeCall(BuyDedicatedNumberInputObject buyDedicatedNumberInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'buyDedicatedNumberInputObject' is set
if (buyDedicatedNumberInputObject == null) {
throw new ApiException("Missing the required parameter 'buyDedicatedNumberInputObject' when calling buyDedicatedNumber(Async)");
}
com.squareup.okhttp.Call call = buyDedicatedNumberCall(buyDedicatedNumberInputObject, progressListener, progressRequestListener);
return call;
}
/**
* Buy a dedicated number
* To buy a dedicated number, you first need to find an available number matching your criteria using the `/api/v2/numbers/available` command described above.
* @param buyDedicatedNumberInputObject (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void buyDedicatedNumber(BuyDedicatedNumberInputObject buyDedicatedNumberInputObject) throws ApiException {
buyDedicatedNumberWithHttpInfo(buyDedicatedNumberInputObject);
}
/**
* Buy a dedicated number
* To buy a dedicated number, you first need to find an available number matching your criteria using the `/api/v2/numbers/available` command described above.
* @param buyDedicatedNumberInputObject (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse buyDedicatedNumberWithHttpInfo(BuyDedicatedNumberInputObject buyDedicatedNumberInputObject) throws ApiException {
com.squareup.okhttp.Call call = buyDedicatedNumberValidateBeforeCall(buyDedicatedNumberInputObject, null, null);
return apiClient.execute(call);
}
/**
* Buy a dedicated number (asynchronously)
* To buy a dedicated number, you first need to find an available number matching your criteria using the `/api/v2/numbers/available` command described above.
* @param buyDedicatedNumberInputObject (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 buyDedicatedNumberAsync(BuyDedicatedNumberInputObject buyDedicatedNumberInputObject, final ApiCallback 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 = buyDedicatedNumberValidateBeforeCall(buyDedicatedNumberInputObject, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for cancelVerification
* @param verifyId The verifyId that you received in Step 1. (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call cancelVerificationCall(String verifyId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/verify/{verifyId}"
.replaceAll("\\{" + "verifyId" + "\\}", apiClient.escapeString(verifyId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call cancelVerificationValidateBeforeCall(String verifyId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'verifyId' is set
if (verifyId == null) {
throw new ApiException("Missing the required parameter 'verifyId' when calling cancelVerification(Async)");
}
com.squareup.okhttp.Call call = cancelVerificationCall(verifyId, progressListener, progressRequestListener);
return call;
}
/**
* Cancel verification process
* You can cancel the verification not earlier than 30 seconds after the initial request.
* @param verifyId The verifyId that you received in Step 1. (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void cancelVerification(String verifyId) throws ApiException {
cancelVerificationWithHttpInfo(verifyId);
}
/**
* Cancel verification process
* You can cancel the verification not earlier than 30 seconds after the initial request.
* @param verifyId The verifyId that you received in Step 1. (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse cancelVerificationWithHttpInfo(String verifyId) throws ApiException {
com.squareup.okhttp.Call call = cancelVerificationValidateBeforeCall(verifyId, null, null);
return apiClient.execute(call);
}
/**
* Cancel verification process (asynchronously)
* You can cancel the verification not earlier than 30 seconds after the initial request.
* @param verifyId The verifyId that you received in Step 1. (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 cancelVerificationAsync(String verifyId, final ApiCallback 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 = cancelVerificationValidateBeforeCall(verifyId, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for checkPhoneVerificationCodeTFA
* @param checkPhoneVerificationCodeInputObject (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call checkPhoneVerificationCodeTFACall(CheckPhoneVerificationCodeInputObject checkPhoneVerificationCodeInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = checkPhoneVerificationCodeInputObject;
// create path and map variables
String localVarPath = "/api/v2/verify";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call checkPhoneVerificationCodeTFAValidateBeforeCall(CheckPhoneVerificationCodeInputObject checkPhoneVerificationCodeInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'checkPhoneVerificationCodeInputObject' is set
if (checkPhoneVerificationCodeInputObject == null) {
throw new ApiException("Missing the required parameter 'checkPhoneVerificationCodeInputObject' when calling checkPhoneVerificationCodeTFA(Async)");
}
com.squareup.okhttp.Call call = checkPhoneVerificationCodeTFACall(checkPhoneVerificationCodeInputObject, progressListener, progressRequestListener);
return call;
}
/**
* Step 2: Check the verification code
* Check received code from user with the code which was actually sent.
* @param checkPhoneVerificationCodeInputObject (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void checkPhoneVerificationCodeTFA(CheckPhoneVerificationCodeInputObject checkPhoneVerificationCodeInputObject) throws ApiException {
checkPhoneVerificationCodeTFAWithHttpInfo(checkPhoneVerificationCodeInputObject);
}
/**
* Step 2: Check the verification code
* Check received code from user with the code which was actually sent.
* @param checkPhoneVerificationCodeInputObject (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse checkPhoneVerificationCodeTFAWithHttpInfo(CheckPhoneVerificationCodeInputObject checkPhoneVerificationCodeInputObject) throws ApiException {
com.squareup.okhttp.Call call = checkPhoneVerificationCodeTFAValidateBeforeCall(checkPhoneVerificationCodeInputObject, null, null);
return apiClient.execute(call);
}
/**
* Step 2: Check the verification code (asynchronously)
* Check received code from user with the code which was actually sent.
* @param checkPhoneVerificationCodeInputObject (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 checkPhoneVerificationCodeTFAAsync(CheckPhoneVerificationCodeInputObject checkPhoneVerificationCodeInputObject, final ApiCallback 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 = checkPhoneVerificationCodeTFAValidateBeforeCall(checkPhoneVerificationCodeInputObject, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for clearAndAssignContactsToList
* @param clearAndAssignContactsToListInputObject (required)
* @param id (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call clearAndAssignContactsToListCall(ClearAndAssignContactsToListInputObject clearAndAssignContactsToListInputObject, Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = clearAndAssignContactsToListInputObject;
// create path and map variables
String localVarPath = "/api/v2/lists/{id}/contacts"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call clearAndAssignContactsToListValidateBeforeCall(ClearAndAssignContactsToListInputObject clearAndAssignContactsToListInputObject, Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'clearAndAssignContactsToListInputObject' is set
if (clearAndAssignContactsToListInputObject == null) {
throw new ApiException("Missing the required parameter 'clearAndAssignContactsToListInputObject' when calling clearAndAssignContactsToList(Async)");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling clearAndAssignContactsToList(Async)");
}
com.squareup.okhttp.Call call = clearAndAssignContactsToListCall(clearAndAssignContactsToListInputObject, id, progressListener, progressRequestListener);
return call;
}
/**
* Reset list members to the specified contacts
*
* @param clearAndAssignContactsToListInputObject (required)
* @param id (required)
* @return ResourceLinkResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ResourceLinkResponse clearAndAssignContactsToList(ClearAndAssignContactsToListInputObject clearAndAssignContactsToListInputObject, Integer id) throws ApiException {
ApiResponse resp = clearAndAssignContactsToListWithHttpInfo(clearAndAssignContactsToListInputObject, id);
return resp.getData();
}
/**
* Reset list members to the specified contacts
*
* @param clearAndAssignContactsToListInputObject (required)
* @param id (required)
* @return ApiResponse<ResourceLinkResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse clearAndAssignContactsToListWithHttpInfo(ClearAndAssignContactsToListInputObject clearAndAssignContactsToListInputObject, Integer id) throws ApiException {
com.squareup.okhttp.Call call = clearAndAssignContactsToListValidateBeforeCall(clearAndAssignContactsToListInputObject, id, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Reset list members to the specified contacts (asynchronously)
*
* @param clearAndAssignContactsToListInputObject (required)
* @param 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 clearAndAssignContactsToListAsync(ClearAndAssignContactsToListInputObject clearAndAssignContactsToListInputObject, Integer id, final ApiCallback 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 = clearAndAssignContactsToListValidateBeforeCall(clearAndAssignContactsToListInputObject, id, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for closeChatsBulk
* @param closeChatsBulkInputObject (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call closeChatsBulkCall(CloseChatsBulkInputObject closeChatsBulkInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = closeChatsBulkInputObject;
// create path and map variables
String localVarPath = "/api/v2/chats/close/bulk";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call closeChatsBulkValidateBeforeCall(CloseChatsBulkInputObject closeChatsBulkInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'closeChatsBulkInputObject' is set
if (closeChatsBulkInputObject == null) {
throw new ApiException("Missing the required parameter 'closeChatsBulkInputObject' when calling closeChatsBulk(Async)");
}
com.squareup.okhttp.Call call = closeChatsBulkCall(closeChatsBulkInputObject, progressListener, progressRequestListener);
return call;
}
/**
* Close chats (bulk)
* Close chats by chat IDs or close all chats
* @param closeChatsBulkInputObject (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void closeChatsBulk(CloseChatsBulkInputObject closeChatsBulkInputObject) throws ApiException {
closeChatsBulkWithHttpInfo(closeChatsBulkInputObject);
}
/**
* Close chats (bulk)
* Close chats by chat IDs or close all chats
* @param closeChatsBulkInputObject (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse closeChatsBulkWithHttpInfo(CloseChatsBulkInputObject closeChatsBulkInputObject) throws ApiException {
com.squareup.okhttp.Call call = closeChatsBulkValidateBeforeCall(closeChatsBulkInputObject, null, null);
return apiClient.execute(call);
}
/**
* Close chats (bulk) (asynchronously)
* Close chats by chat IDs or close all chats
* @param closeChatsBulkInputObject (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 closeChatsBulkAsync(CloseChatsBulkInputObject closeChatsBulkInputObject, final ApiCallback 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 = closeChatsBulkValidateBeforeCall(closeChatsBulkInputObject, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for closeReadChats
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call closeReadChatsCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/chats/close/read";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call closeReadChatsValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = closeReadChatsCall(progressListener, progressRequestListener);
return call;
}
/**
* Close read chats
* Close all chats that have no unread messages.
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void closeReadChats() throws ApiException {
closeReadChatsWithHttpInfo();
}
/**
* Close read chats
* Close all chats that have no unread messages.
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse closeReadChatsWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = closeReadChatsValidateBeforeCall(null, null);
return apiClient.execute(call);
}
/**
* Close read chats (asynchronously)
* Close all chats that have no unread messages.
* @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 closeReadChatsAsync(final ApiCallback 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 = closeReadChatsValidateBeforeCall(progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for closeSubaccount
* @param id (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call closeSubaccountCall(Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/subaccounts/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call closeSubaccountValidateBeforeCall(Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling closeSubaccount(Async)");
}
com.squareup.okhttp.Call call = closeSubaccountCall(id, progressListener, progressRequestListener);
return call;
}
/**
* Close sub-account
*
* @param id (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void closeSubaccount(Integer id) throws ApiException {
closeSubaccountWithHttpInfo(id);
}
/**
* Close sub-account
*
* @param id (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse closeSubaccountWithHttpInfo(Integer id) throws ApiException {
com.squareup.okhttp.Call call = closeSubaccountValidateBeforeCall(id, null, null);
return apiClient.execute(call);
}
/**
* Close sub-account (asynchronously)
*
* @param 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 closeSubaccountAsync(Integer id, final ApiCallback 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 = closeSubaccountValidateBeforeCall(id, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for createContact
* @param createContactInputObject (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call createContactCall(CreateContactInputObject createContactInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = createContactInputObject;
// create path and map variables
String localVarPath = "/api/v2/contacts/normalized";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call createContactValidateBeforeCall(CreateContactInputObject createContactInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'createContactInputObject' is set
if (createContactInputObject == null) {
throw new ApiException("Missing the required parameter 'createContactInputObject' when calling createContact(Async)");
}
com.squareup.okhttp.Call call = createContactCall(createContactInputObject, progressListener, progressRequestListener);
return call;
}
/**
* Add a new contact
*
* @param createContactInputObject (required)
* @return ResourceLinkResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ResourceLinkResponse createContact(CreateContactInputObject createContactInputObject) throws ApiException {
ApiResponse resp = createContactWithHttpInfo(createContactInputObject);
return resp.getData();
}
/**
* Add a new contact
*
* @param createContactInputObject (required)
* @return ApiResponse<ResourceLinkResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse createContactWithHttpInfo(CreateContactInputObject createContactInputObject) throws ApiException {
com.squareup.okhttp.Call call = createContactValidateBeforeCall(createContactInputObject, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Add a new contact (asynchronously)
*
* @param createContactInputObject (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 createContactAsync(CreateContactInputObject createContactInputObject, final ApiCallback 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 = createContactValidateBeforeCall(createContactInputObject, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for createContactNote
* @param createContactNoteInputObject (required)
* @param id (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call createContactNoteCall(CreateContactNoteInputObject createContactNoteInputObject, Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = createContactNoteInputObject;
// create path and map variables
String localVarPath = "/api/v2/contacts/{id}/notes"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call createContactNoteValidateBeforeCall(CreateContactNoteInputObject createContactNoteInputObject, Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'createContactNoteInputObject' is set
if (createContactNoteInputObject == null) {
throw new ApiException("Missing the required parameter 'createContactNoteInputObject' when calling createContactNote(Async)");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling createContactNote(Async)");
}
com.squareup.okhttp.Call call = createContactNoteCall(createContactNoteInputObject, id, progressListener, progressRequestListener);
return call;
}
/**
* Create a new contact note
*
* @param createContactNoteInputObject (required)
* @param id (required)
* @return ResourceLinkResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ResourceLinkResponse createContactNote(CreateContactNoteInputObject createContactNoteInputObject, Integer id) throws ApiException {
ApiResponse resp = createContactNoteWithHttpInfo(createContactNoteInputObject, id);
return resp.getData();
}
/**
* Create a new contact note
*
* @param createContactNoteInputObject (required)
* @param id (required)
* @return ApiResponse<ResourceLinkResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse createContactNoteWithHttpInfo(CreateContactNoteInputObject createContactNoteInputObject, Integer id) throws ApiException {
com.squareup.okhttp.Call call = createContactNoteValidateBeforeCall(createContactNoteInputObject, id, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Create a new contact note (asynchronously)
*
* @param createContactNoteInputObject (required)
* @param 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 createContactNoteAsync(CreateContactNoteInputObject createContactNoteInputObject, Integer id, final ApiCallback 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 = createContactNoteValidateBeforeCall(createContactNoteInputObject, id, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for createCustomField
* @param createCustomFieldInputObject (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call createCustomFieldCall(CreateCustomFieldInputObject createCustomFieldInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = createCustomFieldInputObject;
// create path and map variables
String localVarPath = "/api/v2/customfields";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call createCustomFieldValidateBeforeCall(CreateCustomFieldInputObject createCustomFieldInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'createCustomFieldInputObject' is set
if (createCustomFieldInputObject == null) {
throw new ApiException("Missing the required parameter 'createCustomFieldInputObject' when calling createCustomField(Async)");
}
com.squareup.okhttp.Call call = createCustomFieldCall(createCustomFieldInputObject, progressListener, progressRequestListener);
return call;
}
/**
* Add a new custom field
*
* @param createCustomFieldInputObject (required)
* @return ResourceLinkResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ResourceLinkResponse createCustomField(CreateCustomFieldInputObject createCustomFieldInputObject) throws ApiException {
ApiResponse resp = createCustomFieldWithHttpInfo(createCustomFieldInputObject);
return resp.getData();
}
/**
* Add a new custom field
*
* @param createCustomFieldInputObject (required)
* @return ApiResponse<ResourceLinkResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse createCustomFieldWithHttpInfo(CreateCustomFieldInputObject createCustomFieldInputObject) throws ApiException {
com.squareup.okhttp.Call call = createCustomFieldValidateBeforeCall(createCustomFieldInputObject, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Add a new custom field (asynchronously)
*
* @param createCustomFieldInputObject (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 createCustomFieldAsync(CreateCustomFieldInputObject createCustomFieldInputObject, final ApiCallback 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 = createCustomFieldValidateBeforeCall(createCustomFieldInputObject, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for createList
* @param createListInputObject (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call createListCall(CreateListInputObject createListInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = createListInputObject;
// create path and map variables
String localVarPath = "/api/v2/lists";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call createListValidateBeforeCall(CreateListInputObject createListInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'createListInputObject' is set
if (createListInputObject == null) {
throw new ApiException("Missing the required parameter 'createListInputObject' when calling createList(Async)");
}
com.squareup.okhttp.Call call = createListCall(createListInputObject, progressListener, progressRequestListener);
return call;
}
/**
* Create a new list
*
* @param createListInputObject (required)
* @return ResourceLinkResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ResourceLinkResponse createList(CreateListInputObject createListInputObject) throws ApiException {
ApiResponse resp = createListWithHttpInfo(createListInputObject);
return resp.getData();
}
/**
* Create a new list
*
* @param createListInputObject (required)
* @return ApiResponse<ResourceLinkResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse createListWithHttpInfo(CreateListInputObject createListInputObject) throws ApiException {
com.squareup.okhttp.Call call = createListValidateBeforeCall(createListInputObject, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Create a new list (asynchronously)
*
* @param createListInputObject (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 createListAsync(CreateListInputObject createListInputObject, final ApiCallback 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 = createListValidateBeforeCall(createListInputObject, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for createTemplate
* @param createTemplateInputObject (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call createTemplateCall(CreateTemplateInputObject createTemplateInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = createTemplateInputObject;
// create path and map variables
String localVarPath = "/api/v2/templates";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call createTemplateValidateBeforeCall(CreateTemplateInputObject createTemplateInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'createTemplateInputObject' is set
if (createTemplateInputObject == null) {
throw new ApiException("Missing the required parameter 'createTemplateInputObject' when calling createTemplate(Async)");
}
com.squareup.okhttp.Call call = createTemplateCall(createTemplateInputObject, progressListener, progressRequestListener);
return call;
}
/**
* Create a template
* There are times when creating a new template makes sense (such as when targeting specific clients or improving your business strategies). You can create new SMS templates for marketing purposes or SMS templates for business campaigns.
* @param createTemplateInputObject (required)
* @return ResourceLinkResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ResourceLinkResponse createTemplate(CreateTemplateInputObject createTemplateInputObject) throws ApiException {
ApiResponse resp = createTemplateWithHttpInfo(createTemplateInputObject);
return resp.getData();
}
/**
* Create a template
* There are times when creating a new template makes sense (such as when targeting specific clients or improving your business strategies). You can create new SMS templates for marketing purposes or SMS templates for business campaigns.
* @param createTemplateInputObject (required)
* @return ApiResponse<ResourceLinkResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse createTemplateWithHttpInfo(CreateTemplateInputObject createTemplateInputObject) throws ApiException {
com.squareup.okhttp.Call call = createTemplateValidateBeforeCall(createTemplateInputObject, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Create a template (asynchronously)
* There are times when creating a new template makes sense (such as when targeting specific clients or improving your business strategies). You can create new SMS templates for marketing purposes or SMS templates for business campaigns.
* @param createTemplateInputObject (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 createTemplateAsync(CreateTemplateInputObject createTemplateInputObject, final ApiCallback 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 = createTemplateValidateBeforeCall(createTemplateInputObject, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for deleteAllContacts
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call deleteAllContactsCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/contact/all";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call deleteAllContactsValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = deleteAllContactsCall(progressListener, progressRequestListener);
return call;
}
/**
* Delete contacts (bulk)
*
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void deleteAllContacts() throws ApiException {
deleteAllContactsWithHttpInfo();
}
/**
* Delete contacts (bulk)
*
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse deleteAllContactsWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = deleteAllContactsValidateBeforeCall(null, null);
return apiClient.execute(call);
}
/**
* Delete contacts (bulk) (asynchronously)
*
* @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 deleteAllContactsAsync(final ApiCallback 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 = deleteAllContactsValidateBeforeCall(progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for deleteAllOutboundMessages
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call deleteAllOutboundMessagesCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/message/all";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call deleteAllOutboundMessagesValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = deleteAllOutboundMessagesCall(progressListener, progressRequestListener);
return call;
}
/**
* Delete all messages
* Delete all messages.
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void deleteAllOutboundMessages() throws ApiException {
deleteAllOutboundMessagesWithHttpInfo();
}
/**
* Delete all messages
* Delete all messages.
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse deleteAllOutboundMessagesWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = deleteAllOutboundMessagesValidateBeforeCall(null, null);
return apiClient.execute(call);
}
/**
* Delete all messages (asynchronously)
* Delete all messages.
* @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 deleteAllOutboundMessagesAsync(final ApiCallback 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 = deleteAllOutboundMessagesValidateBeforeCall(progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for deleteAvatar
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call deleteAvatarCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/user/avatar";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call deleteAvatarValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = deleteAvatarCall(progressListener, progressRequestListener);
return call;
}
/**
* Delete an avatar
*
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void deleteAvatar() throws ApiException {
deleteAvatarWithHttpInfo();
}
/**
* Delete an avatar
*
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse deleteAvatarWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = deleteAvatarValidateBeforeCall(null, null);
return apiClient.execute(call);
}
/**
* Delete an avatar (asynchronously)
*
* @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 deleteAvatarAsync(final ApiCallback 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 = deleteAvatarValidateBeforeCall(progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for deleteChatMessages
* @param deleteChatMessagesBulkInputObject (required)
* @param id (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call deleteChatMessagesCall(DeleteChatMessagesBulkInputObject deleteChatMessagesBulkInputObject, Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = deleteChatMessagesBulkInputObject;
// create path and map variables
String localVarPath = "/api/v2/chats/{id}/messages/delete"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call deleteChatMessagesValidateBeforeCall(DeleteChatMessagesBulkInputObject deleteChatMessagesBulkInputObject, Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'deleteChatMessagesBulkInputObject' is set
if (deleteChatMessagesBulkInputObject == null) {
throw new ApiException("Missing the required parameter 'deleteChatMessagesBulkInputObject' when calling deleteChatMessages(Async)");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling deleteChatMessages(Async)");
}
com.squareup.okhttp.Call call = deleteChatMessagesCall(deleteChatMessagesBulkInputObject, id, progressListener, progressRequestListener);
return call;
}
/**
* Delete chat messages by ID(s)
* Delete messages from chat by given message IDs.
* @param deleteChatMessagesBulkInputObject (required)
* @param id (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void deleteChatMessages(DeleteChatMessagesBulkInputObject deleteChatMessagesBulkInputObject, Integer id) throws ApiException {
deleteChatMessagesWithHttpInfo(deleteChatMessagesBulkInputObject, id);
}
/**
* Delete chat messages by ID(s)
* Delete messages from chat by given message IDs.
* @param deleteChatMessagesBulkInputObject (required)
* @param id (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse deleteChatMessagesWithHttpInfo(DeleteChatMessagesBulkInputObject deleteChatMessagesBulkInputObject, Integer id) throws ApiException {
com.squareup.okhttp.Call call = deleteChatMessagesValidateBeforeCall(deleteChatMessagesBulkInputObject, id, null, null);
return apiClient.execute(call);
}
/**
* Delete chat messages by ID(s) (asynchronously)
* Delete messages from chat by given message IDs.
* @param deleteChatMessagesBulkInputObject (required)
* @param 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 deleteChatMessagesAsync(DeleteChatMessagesBulkInputObject deleteChatMessagesBulkInputObject, Integer id, final ApiCallback 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 = deleteChatMessagesValidateBeforeCall(deleteChatMessagesBulkInputObject, id, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for deleteChatsBulk
* @param deleteChatsBulkInputObject (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call deleteChatsBulkCall(DeleteChatsBulkInputObject deleteChatsBulkInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = deleteChatsBulkInputObject;
// create path and map variables
String localVarPath = "/api/v2/chats/delete";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call deleteChatsBulkValidateBeforeCall(DeleteChatsBulkInputObject deleteChatsBulkInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'deleteChatsBulkInputObject' is set
if (deleteChatsBulkInputObject == null) {
throw new ApiException("Missing the required parameter 'deleteChatsBulkInputObject' when calling deleteChatsBulk(Async)");
}
com.squareup.okhttp.Call call = deleteChatsBulkCall(deleteChatsBulkInputObject, progressListener, progressRequestListener);
return call;
}
/**
* Delete chats (bulk)
* Delete chats by given IDs or delete all chats.
* @param deleteChatsBulkInputObject (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void deleteChatsBulk(DeleteChatsBulkInputObject deleteChatsBulkInputObject) throws ApiException {
deleteChatsBulkWithHttpInfo(deleteChatsBulkInputObject);
}
/**
* Delete chats (bulk)
* Delete chats by given IDs or delete all chats.
* @param deleteChatsBulkInputObject (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse deleteChatsBulkWithHttpInfo(DeleteChatsBulkInputObject deleteChatsBulkInputObject) throws ApiException {
com.squareup.okhttp.Call call = deleteChatsBulkValidateBeforeCall(deleteChatsBulkInputObject, null, null);
return apiClient.execute(call);
}
/**
* Delete chats (bulk) (asynchronously)
* Delete chats by given IDs or delete all chats.
* @param deleteChatsBulkInputObject (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 deleteChatsBulkAsync(DeleteChatsBulkInputObject deleteChatsBulkInputObject, final ApiCallback 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 = deleteChatsBulkValidateBeforeCall(deleteChatsBulkInputObject, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for deleteContact
* @param id (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call deleteContactCall(Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/contacts/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call deleteContactValidateBeforeCall(Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling deleteContact(Async)");
}
com.squareup.okhttp.Call call = deleteContactCall(id, progressListener, progressRequestListener);
return call;
}
/**
* Delete a contact
* > This command removes your contact completely. If it was assigned or saved to a shared list, it will disappear from there too. If you only need to remove a contact from selected lists, use the Contact assignment command in the Lists section instead, rather than deleting the contact.
* @param id (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void deleteContact(Integer id) throws ApiException {
deleteContactWithHttpInfo(id);
}
/**
* Delete a contact
* > This command removes your contact completely. If it was assigned or saved to a shared list, it will disappear from there too. If you only need to remove a contact from selected lists, use the Contact assignment command in the Lists section instead, rather than deleting the contact.
* @param id (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse deleteContactWithHttpInfo(Integer id) throws ApiException {
com.squareup.okhttp.Call call = deleteContactValidateBeforeCall(id, null, null);
return apiClient.execute(call);
}
/**
* Delete a contact (asynchronously)
* > This command removes your contact completely. If it was assigned or saved to a shared list, it will disappear from there too. If you only need to remove a contact from selected lists, use the Contact assignment command in the Lists section instead, rather than deleting the contact.
* @param 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 deleteContactAsync(Integer id, final ApiCallback 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 = deleteContactValidateBeforeCall(id, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for deleteContactAvatar
* @param id (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call deleteContactAvatarCall(Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/contacts/{id}/avatar"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call deleteContactAvatarValidateBeforeCall(Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling deleteContactAvatar(Async)");
}
com.squareup.okhttp.Call call = deleteContactAvatarCall(id, progressListener, progressRequestListener);
return call;
}
/**
* Delete an avatar
*
* @param id (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void deleteContactAvatar(Integer id) throws ApiException {
deleteContactAvatarWithHttpInfo(id);
}
/**
* Delete an avatar
*
* @param id (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse deleteContactAvatarWithHttpInfo(Integer id) throws ApiException {
com.squareup.okhttp.Call call = deleteContactAvatarValidateBeforeCall(id, null, null);
return apiClient.execute(call);
}
/**
* Delete an avatar (asynchronously)
*
* @param 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 deleteContactAvatarAsync(Integer id, final ApiCallback 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 = deleteContactAvatarValidateBeforeCall(id, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for deleteContactNote
* @param id (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call deleteContactNoteCall(Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/notes/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call deleteContactNoteValidateBeforeCall(Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling deleteContactNote(Async)");
}
com.squareup.okhttp.Call call = deleteContactNoteCall(id, progressListener, progressRequestListener);
return call;
}
/**
* Delete a contact note
*
* @param id (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void deleteContactNote(Integer id) throws ApiException {
deleteContactNoteWithHttpInfo(id);
}
/**
* Delete a contact note
*
* @param id (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse deleteContactNoteWithHttpInfo(Integer id) throws ApiException {
com.squareup.okhttp.Call call = deleteContactNoteValidateBeforeCall(id, null, null);
return apiClient.execute(call);
}
/**
* Delete a contact note (asynchronously)
*
* @param 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 deleteContactNoteAsync(Integer id, final ApiCallback 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 = deleteContactNoteValidateBeforeCall(id, progressListener, progressRequestListener);
apiClient.executeAsync(call, callback);
return call;
}
/**
* Build call for deleteContactNotesBulk
* @param id (required)
* @param deleteContactNotesBulkInputObject (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call deleteContactNotesBulkCall(Integer id, DeleteContactNotesBulkInputObject deleteContactNotesBulkInputObject, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = deleteContactNotesBulkInputObject;
// create path and map variables
String localVarPath = "/api/v2/contacts/{id}/notes/delete"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap