All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bandwidth.sdk.api.TranscriptionsApi Maven / Gradle / Ivy

Go to download

The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs

The newest version!
/*
 * 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.CallTranscriptionMetadata;
import com.bandwidth.sdk.model.CallTranscriptionResponse;
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 TranscriptionsApi {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;

    public TranscriptionsApi() {
        this(Configuration.getDefaultApiClient());
    }

    public TranscriptionsApi(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 deleteRealTimeTranscription
     * @param accountId Your Bandwidth Account ID. (required)
     * @param callId Programmable Voice API Call ID. (required)
     * @param transcriptionId Programmable Voice API Transcription 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 No Content -
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 deleteRealTimeTranscriptionCall(String accountId, String callId, String transcriptionId, 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}/transcriptions/{transcriptionId}" .replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString())) .replace("{" + "callId" + "}", localVarApiClient.escapeString(callId.toString())) .replace("{" + "transcriptionId" + "}", localVarApiClient.escapeString(transcriptionId.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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteRealTimeTranscriptionValidateBeforeCall(String accountId, String callId, String transcriptionId, 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 deleteRealTimeTranscription(Async)"); } // verify the required parameter 'callId' is set if (callId == null) { throw new ApiException("Missing the required parameter 'callId' when calling deleteRealTimeTranscription(Async)"); } // verify the required parameter 'transcriptionId' is set if (transcriptionId == null) { throw new ApiException("Missing the required parameter 'transcriptionId' when calling deleteRealTimeTranscription(Async)"); } return deleteRealTimeTranscriptionCall(accountId, callId, transcriptionId, _callback); } /** * Delete a specific transcription * Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `200` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param transcriptionId Programmable Voice API Transcription ID. (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 No Content -
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 void deleteRealTimeTranscription(String accountId, String callId, String transcriptionId) throws ApiException { deleteRealTimeTranscriptionWithHttpInfo(accountId, callId, transcriptionId); } /** * Delete a specific transcription * Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `200` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param transcriptionId Programmable Voice API Transcription ID. (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 No Content -
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 deleteRealTimeTranscriptionWithHttpInfo(String accountId, String callId, String transcriptionId) throws ApiException { okhttp3.Call localVarCall = deleteRealTimeTranscriptionValidateBeforeCall(accountId, callId, transcriptionId, null); return localVarApiClient.execute(localVarCall); } /** * Delete a specific transcription (asynchronously) * Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `200` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param transcriptionId Programmable Voice API Transcription 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 No Content -
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 deleteRealTimeTranscriptionAsync(String accountId, String callId, String transcriptionId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteRealTimeTranscriptionValidateBeforeCall(accountId, callId, transcriptionId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** * Build call for getRealTimeTranscription * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param transcriptionId Programmable Voice API Transcription 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 getRealTimeTranscriptionCall(String accountId, String callId, String transcriptionId, 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}/transcriptions/{transcriptionId}" .replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString())) .replace("{" + "callId" + "}", localVarApiClient.escapeString(callId.toString())) .replace("{" + "transcriptionId" + "}", localVarApiClient.escapeString(transcriptionId.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 getRealTimeTranscriptionValidateBeforeCall(String accountId, String callId, String transcriptionId, 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 getRealTimeTranscription(Async)"); } // verify the required parameter 'callId' is set if (callId == null) { throw new ApiException("Missing the required parameter 'callId' when calling getRealTimeTranscription(Async)"); } // verify the required parameter 'transcriptionId' is set if (transcriptionId == null) { throw new ApiException("Missing the required parameter 'transcriptionId' when calling getRealTimeTranscription(Async)"); } return getRealTimeTranscriptionCall(accountId, callId, transcriptionId, _callback); } /** * Retrieve a specific transcription * Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param transcriptionId Programmable Voice API Transcription ID. (required) * @return CallTranscriptionResponse * @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 CallTranscriptionResponse getRealTimeTranscription(String accountId, String callId, String transcriptionId) throws ApiException { ApiResponse localVarResp = getRealTimeTranscriptionWithHttpInfo(accountId, callId, transcriptionId); return localVarResp.getData(); } /** * Retrieve a specific transcription * Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param transcriptionId Programmable Voice API Transcription ID. (required) * @return ApiResponse<CallTranscriptionResponse> * @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 getRealTimeTranscriptionWithHttpInfo(String accountId, String callId, String transcriptionId) throws ApiException { okhttp3.Call localVarCall = getRealTimeTranscriptionValidateBeforeCall(accountId, callId, transcriptionId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Retrieve a specific transcription (asynchronously) * Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param transcriptionId Programmable Voice API Transcription 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 getRealTimeTranscriptionAsync(String accountId, String callId, String transcriptionId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getRealTimeTranscriptionValidateBeforeCall(accountId, callId, transcriptionId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listRealTimeTranscriptions * @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 listRealTimeTranscriptionsCall(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}/transcriptions" .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 listRealTimeTranscriptionsValidateBeforeCall(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 listRealTimeTranscriptions(Async)"); } // verify the required parameter 'callId' is set if (callId == null) { throw new ApiException("Missing the required parameter 'callId' when calling listRealTimeTranscriptions(Async)"); } return listRealTimeTranscriptionsCall(accountId, callId, _callback); } /** * Enumerate transcriptions made with StartTranscription * Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription). * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @return List<CallTranscriptionMetadata> * @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 listRealTimeTranscriptions(String accountId, String callId) throws ApiException { ApiResponse> localVarResp = listRealTimeTranscriptionsWithHttpInfo(accountId, callId); return localVarResp.getData(); } /** * Enumerate transcriptions made with StartTranscription * Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription). * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @return ApiResponse<List<CallTranscriptionMetadata>> * @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> listRealTimeTranscriptionsWithHttpInfo(String accountId, String callId) throws ApiException { okhttp3.Call localVarCall = listRealTimeTranscriptionsValidateBeforeCall(accountId, callId, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Enumerate transcriptions made with StartTranscription (asynchronously) * Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription). * @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 listRealTimeTranscriptionsAsync(String accountId, String callId, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = listRealTimeTranscriptionsValidateBeforeCall(accountId, callId, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy