Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Bandwidth
* Bandwidth's Communication APIs
*
* The version of the OpenAPI document: 1.0.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.bandwidth.sdk.api;
import com.bandwidth.sdk.ApiCallback;
import com.bandwidth.sdk.ApiClient;
import com.bandwidth.sdk.ApiException;
import com.bandwidth.sdk.ApiResponse;
import com.bandwidth.sdk.Configuration;
import com.bandwidth.sdk.Pair;
import com.bandwidth.sdk.ProgressRequestBody;
import com.bandwidth.sdk.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.bandwidth.sdk.model.CallState;
import com.bandwidth.sdk.model.CreateCall;
import com.bandwidth.sdk.model.CreateCallResponse;
import com.bandwidth.sdk.model.UpdateCall;
import com.bandwidth.sdk.model.VoiceApiError;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CallsApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public CallsApi() {
this(Configuration.getDefaultApiClient());
}
public CallsApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for createCall
* @param accountId Your Bandwidth Account ID. (required)
* @param createCall JSON object containing information to create an outbound call (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
201
Created
* Location - The URL for further interactions with this call
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public okhttp3.Call createCallCall(String accountId, CreateCall createCall, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { "https://voice.bandwidth.com/api/v2" };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createCall;
// create path and map variables
String localVarPath = "/accounts/{accountId}/calls"
.replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "Basic" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createCallValidateBeforeCall(String accountId, CreateCall createCall, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException("Missing the required parameter 'accountId' when calling createCall(Async)");
}
// verify the required parameter 'createCall' is set
if (createCall == null) {
throw new ApiException("Missing the required parameter 'createCall' when calling createCall(Async)");
}
return createCallCall(accountId, createCall, _callback);
}
/**
* Create Call
* Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. <b>Please note:</b> Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed.
* @param accountId Your Bandwidth Account ID. (required)
* @param createCall JSON object containing information to create an outbound call (required)
* @return CreateCallResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
201
Created
* Location - The URL for further interactions with this call
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public CreateCallResponse createCall(String accountId, CreateCall createCall) throws ApiException {
ApiResponse localVarResp = createCallWithHttpInfo(accountId, createCall);
return localVarResp.getData();
}
/**
* Create Call
* Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. <b>Please note:</b> Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed.
* @param accountId Your Bandwidth Account ID. (required)
* @param createCall JSON object containing information to create an outbound call (required)
* @return ApiResponse<CreateCallResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
201
Created
* Location - The URL for further interactions with this call
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public ApiResponse createCallWithHttpInfo(String accountId, CreateCall createCall) throws ApiException {
okhttp3.Call localVarCall = createCallValidateBeforeCall(accountId, createCall, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create Call (asynchronously)
* Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. <b>Please note:</b> Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed.
* @param accountId Your Bandwidth Account ID. (required)
* @param createCall JSON object containing information to create an outbound call (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
* @http.response.details
Status Code
Description
Response Headers
201
Created
* Location - The URL for further interactions with this call
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public okhttp3.Call createCallAsync(String accountId, CreateCall createCall, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createCallValidateBeforeCall(accountId, createCall, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getCallState
* @param accountId Your Bandwidth Account ID. (required)
* @param callId Programmable Voice API Call ID. (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public okhttp3.Call getCallStateCall(String accountId, String callId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { "https://voice.bandwidth.com/api/v2" };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/accounts/{accountId}/calls/{callId}"
.replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString()))
.replace("{" + "callId" + "}", localVarApiClient.escapeString(callId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "Basic" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getCallStateValidateBeforeCall(String accountId, String callId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException("Missing the required parameter 'accountId' when calling getCallState(Async)");
}
// verify the required parameter 'callId' is set
if (callId == null) {
throw new ApiException("Missing the required parameter 'callId' when calling getCallState(Async)");
}
return getCallStateCall(accountId, callId, _callback);
}
/**
* Get Call State Information
* Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: Call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an HTTP 404 response.
* @param accountId Your Bandwidth Account ID. (required)
* @param callId Programmable Voice API Call ID. (required)
* @return CallState
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public CallState getCallState(String accountId, String callId) throws ApiException {
ApiResponse localVarResp = getCallStateWithHttpInfo(accountId, callId);
return localVarResp.getData();
}
/**
* Get Call State Information
* Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: Call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an HTTP 404 response.
* @param accountId Your Bandwidth Account ID. (required)
* @param callId Programmable Voice API Call ID. (required)
* @return ApiResponse<CallState>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public ApiResponse getCallStateWithHttpInfo(String accountId, String callId) throws ApiException {
okhttp3.Call localVarCall = getCallStateValidateBeforeCall(accountId, callId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get Call State Information (asynchronously)
* Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: Call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an HTTP 404 response.
* @param accountId Your Bandwidth Account ID. (required)
* @param callId Programmable Voice API Call 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
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public okhttp3.Call getCallStateAsync(String accountId, String callId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getCallStateValidateBeforeCall(accountId, callId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for listCalls
* @param accountId Your Bandwidth Account ID. (required)
* @param to Filter results by the `to` field. (optional)
* @param from Filter results by the `from` field. (optional)
* @param minStartTime Filter results to calls which have a `startTime` after or including `minStartTime` (in ISO8601 format). (optional)
* @param maxStartTime Filter results to calls which have a `startTime` before or including `maxStartTime` (in ISO8601 format). (optional)
* @param disconnectCause Filter results to calls with specified call Disconnect Cause. (optional)
* @param pageSize Specifies the max number of calls that will be returned. (optional, default to 1000)
* @param pageToken Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public okhttp3.Call listCallsCall(String accountId, String to, String from, String minStartTime, String maxStartTime, String disconnectCause, Integer pageSize, String pageToken, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { "https://voice.bandwidth.com/api/v2" };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/accounts/{accountId}/calls"
.replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (to != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to));
}
if (from != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("from", from));
}
if (minStartTime != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("minStartTime", minStartTime));
}
if (maxStartTime != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("maxStartTime", maxStartTime));
}
if (disconnectCause != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("disconnectCause", disconnectCause));
}
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize));
}
if (pageToken != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageToken", pageToken));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "Basic" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call listCallsValidateBeforeCall(String accountId, String to, String from, String minStartTime, String maxStartTime, String disconnectCause, Integer pageSize, String pageToken, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException("Missing the required parameter 'accountId' when calling listCalls(Async)");
}
return listCallsCall(accountId, to, from, minStartTime, maxStartTime, disconnectCause, pageSize, pageToken, _callback);
}
/**
* Get Calls
* Returns a max of 10000 calls, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of calls in the account is bigger than `pageSize`, a `Link` header (with format `<{url}>; rel=\"next\"`) will be returned in the response. The url can be used to retrieve the next page of call records. Also, call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an empty array [] in response.
* @param accountId Your Bandwidth Account ID. (required)
* @param to Filter results by the `to` field. (optional)
* @param from Filter results by the `from` field. (optional)
* @param minStartTime Filter results to calls which have a `startTime` after or including `minStartTime` (in ISO8601 format). (optional)
* @param maxStartTime Filter results to calls which have a `startTime` before or including `maxStartTime` (in ISO8601 format). (optional)
* @param disconnectCause Filter results to calls with specified call Disconnect Cause. (optional)
* @param pageSize Specifies the max number of calls that will be returned. (optional, default to 1000)
* @param pageToken Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. (optional)
* @return List<CallState>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public List listCalls(String accountId, String to, String from, String minStartTime, String maxStartTime, String disconnectCause, Integer pageSize, String pageToken) throws ApiException {
ApiResponse> localVarResp = listCallsWithHttpInfo(accountId, to, from, minStartTime, maxStartTime, disconnectCause, pageSize, pageToken);
return localVarResp.getData();
}
/**
* Get Calls
* Returns a max of 10000 calls, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of calls in the account is bigger than `pageSize`, a `Link` header (with format `<{url}>; rel=\"next\"`) will be returned in the response. The url can be used to retrieve the next page of call records. Also, call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an empty array [] in response.
* @param accountId Your Bandwidth Account ID. (required)
* @param to Filter results by the `to` field. (optional)
* @param from Filter results by the `from` field. (optional)
* @param minStartTime Filter results to calls which have a `startTime` after or including `minStartTime` (in ISO8601 format). (optional)
* @param maxStartTime Filter results to calls which have a `startTime` before or including `maxStartTime` (in ISO8601 format). (optional)
* @param disconnectCause Filter results to calls with specified call Disconnect Cause. (optional)
* @param pageSize Specifies the max number of calls that will be returned. (optional, default to 1000)
* @param pageToken Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. (optional)
* @return ApiResponse<List<CallState>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public ApiResponse> listCallsWithHttpInfo(String accountId, String to, String from, String minStartTime, String maxStartTime, String disconnectCause, Integer pageSize, String pageToken) throws ApiException {
okhttp3.Call localVarCall = listCallsValidateBeforeCall(accountId, to, from, minStartTime, maxStartTime, disconnectCause, pageSize, pageToken, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get Calls (asynchronously)
* Returns a max of 10000 calls, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of calls in the account is bigger than `pageSize`, a `Link` header (with format `<{url}>; rel=\"next\"`) will be returned in the response. The url can be used to retrieve the next page of call records. Also, call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an empty array [] in response.
* @param accountId Your Bandwidth Account ID. (required)
* @param to Filter results by the `to` field. (optional)
* @param from Filter results by the `from` field. (optional)
* @param minStartTime Filter results to calls which have a `startTime` after or including `minStartTime` (in ISO8601 format). (optional)
* @param maxStartTime Filter results to calls which have a `startTime` before or including `maxStartTime` (in ISO8601 format). (optional)
* @param disconnectCause Filter results to calls with specified call Disconnect Cause. (optional)
* @param pageSize Specifies the max number of calls that will be returned. (optional, default to 1000)
* @param pageToken Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public okhttp3.Call listCallsAsync(String accountId, String to, String from, String minStartTime, String maxStartTime, String disconnectCause, Integer pageSize, String pageToken, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = listCallsValidateBeforeCall(accountId, to, from, minStartTime, maxStartTime, disconnectCause, pageSize, pageToken, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for updateCall
* @param accountId Your Bandwidth Account ID. (required)
* @param callId Programmable Voice API Call ID. (required)
* @param updateCall JSON object containing information to redirect an existing call to a new BXML document (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
409
Conflict
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public okhttp3.Call updateCallCall(String accountId, String callId, UpdateCall updateCall, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { "https://voice.bandwidth.com/api/v2" };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = updateCall;
// create path and map variables
String localVarPath = "/accounts/{accountId}/calls/{callId}"
.replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString()))
.replace("{" + "callId" + "}", localVarApiClient.escapeString(callId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "Basic" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateCallValidateBeforeCall(String accountId, String callId, UpdateCall updateCall, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException("Missing the required parameter 'accountId' when calling updateCall(Async)");
}
// verify the required parameter 'callId' is set
if (callId == null) {
throw new ApiException("Missing the required parameter 'callId' when calling updateCall(Async)");
}
// verify the required parameter 'updateCall' is set
if (updateCall == null) {
throw new ApiException("Missing the required parameter 'updateCall' when calling updateCall(Async)");
}
return updateCallCall(accountId, callId, updateCall, _callback);
}
/**
* Update Call
* Interrupts and redirects a call to a different URL that should return a BXML document.
* @param accountId Your Bandwidth Account ID. (required)
* @param callId Programmable Voice API Call ID. (required)
* @param updateCall JSON object containing information to redirect an existing call to a new BXML document (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
409
Conflict
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public void updateCall(String accountId, String callId, UpdateCall updateCall) throws ApiException {
updateCallWithHttpInfo(accountId, callId, updateCall);
}
/**
* Update Call
* Interrupts and redirects a call to a different URL that should return a BXML document.
* @param accountId Your Bandwidth Account ID. (required)
* @param callId Programmable Voice API Call ID. (required)
* @param updateCall JSON object containing information to redirect an existing call to a new BXML document (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
409
Conflict
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public ApiResponse updateCallWithHttpInfo(String accountId, String callId, UpdateCall updateCall) throws ApiException {
okhttp3.Call localVarCall = updateCallValidateBeforeCall(accountId, callId, updateCall, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Update Call (asynchronously)
* Interrupts and redirects a call to a different URL that should return a BXML document.
* @param accountId Your Bandwidth Account ID. (required)
* @param callId Programmable Voice API Call ID. (required)
* @param updateCall JSON object containing information to redirect an existing call to a new BXML document (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
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
409
Conflict
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public okhttp3.Call updateCallAsync(String accountId, String callId, UpdateCall updateCall, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = updateCallValidateBeforeCall(accountId, callId, updateCall, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for updateCallBxml
* @param accountId Your Bandwidth Account ID. (required)
* @param callId Programmable Voice API Call ID. (required)
* @param body (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
204
Call BXML was successfully replaced.
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
409
Conflict
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public okhttp3.Call updateCallBxmlCall(String accountId, String callId, String body, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { "https://voice.bandwidth.com/api/v2" };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/accounts/{accountId}/calls/{callId}/bxml"
.replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString()))
.replace("{" + "callId" + "}", localVarApiClient.escapeString(callId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/xml"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "Basic" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateCallBxmlValidateBeforeCall(String accountId, String callId, String body, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException("Missing the required parameter 'accountId' when calling updateCallBxml(Async)");
}
// verify the required parameter 'callId' is set
if (callId == null) {
throw new ApiException("Missing the required parameter 'callId' when calling updateCallBxml(Async)");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling updateCallBxml(Async)");
}
return updateCallBxmlCall(accountId, callId, body, _callback);
}
/**
* Update Call BXML
* Interrupts and replaces an active call's BXML document.
* @param accountId Your Bandwidth Account ID. (required)
* @param callId Programmable Voice API Call ID. (required)
* @param body (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
204
Call BXML was successfully replaced.
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
409
Conflict
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public void updateCallBxml(String accountId, String callId, String body) throws ApiException {
updateCallBxmlWithHttpInfo(accountId, callId, body);
}
/**
* Update Call BXML
* Interrupts and replaces an active call's BXML document.
* @param accountId Your Bandwidth Account ID. (required)
* @param callId Programmable Voice API Call ID. (required)
* @param body (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
204
Call BXML was successfully replaced.
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
409
Conflict
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.
500
Internal Server Error
-
*/
public ApiResponse updateCallBxmlWithHttpInfo(String accountId, String callId, String body) throws ApiException {
okhttp3.Call localVarCall = updateCallBxmlValidateBeforeCall(accountId, callId, body, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Update Call BXML (asynchronously)
* Interrupts and replaces an active call's BXML document.
* @param accountId Your Bandwidth Account ID. (required)
* @param callId Programmable Voice API Call ID. (required)
* @param body (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
* @http.response.details
Status Code
Description
Response Headers
204
Call BXML was successfully replaced.
-
400
Bad Request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
405
Method Not Allowed
-
409
Conflict
-
415
Unsupported Media Type
-
429
Too Many Requests
* Retry-After - When you should try your request again.