com.mypurecloud.sdk.api.LanguagesApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-client Show documentation
Show all versions of platform-client Show documentation
The official Java SDK for the PureCloud Platform API SDK
The newest version!
package com.mypurecloud.sdk.api;
import com.fasterxml.jackson.core.type.TypeReference;
import com.mypurecloud.sdk.ApiException;
import com.mypurecloud.sdk.ApiClient;
import com.mypurecloud.sdk.ApiResponse;
import com.mypurecloud.sdk.Configuration;
import com.mypurecloud.sdk.model.*;
import com.mypurecloud.sdk.Pair;
import com.mypurecloud.sdk.model.ErrorBody;
import com.mypurecloud.sdk.model.Language;
import com.mypurecloud.sdk.model.LanguageEntityListing;
import com.mypurecloud.sdk.model.AvailableTranslations;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class LanguagesApi {
private ApiClient pcapiClient;
public LanguagesApi() {
this(Configuration.getDefaultApiClient());
}
public LanguagesApi(ApiClient apiClient) {
this.pcapiClient = apiClient;
}
public ApiClient getApiClient() {
return pcapiClient;
}
public void setApiClient(ApiClient apiClient) {
this.pcapiClient = apiClient;
}
/**
* Delete Language (Deprecated)
* This endpoint is deprecated. It has been moved to /routing/languages/{languageId}
* @param languageId Language ID (required)
* @throws ApiException if fails to make API call
*/
public void deleteLanguageId(String languageId) throws ApiException {
deleteLanguageIdWithHttpInfo(languageId);
}
/**
* Delete Language (Deprecated)
* This endpoint is deprecated. It has been moved to /routing/languages/{languageId}
* @param languageId Language ID (required)
* @throws ApiException if fails to make API call
*/
public ApiResponse deleteLanguageIdWithHttpInfo(String languageId) throws ApiException {
Object pclocalVarPostBody = null;
// verify the required parameter 'languageId' is set
if (languageId == null) {
throw new ApiException(400, "Missing the required parameter 'languageId' when calling deleteLanguageId");
}
// create path and map variables
String pclocalVarPath = "/api/v2/languages/{languageId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "languageId" + "\\}", pcapiClient.escapeString(languageId.toString()));
// query params
List pclocalVarQueryParams = new ArrayList();
Map pclocalVarHeaderParams = new HashMap();
Map pclocalVarFormParams = new HashMap();
final String[] pclocalVarAccepts = {
"application/json"
};
final String pclocalVarAccept = pcapiClient.selectHeaderAccept(pclocalVarAccepts);
final String[] pclocalVarContentTypes = {
"application/json"
};
final String pclocalVarContentType = pcapiClient.selectHeaderContentType(pclocalVarContentTypes);
String[] pclocalVarAuthNames = new String[] { "PureCloud Auth" };
return pcapiClient.invokeAPIVerbose(pclocalVarPath, "DELETE", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, null);
}
/**
* Delete Language
*
* @param languageId Language ID (required)
* @throws ApiException if fails to make API call
*/
public void deleteLanguagesLanguageId(String languageId) throws ApiException {
deleteLanguagesLanguageIdWithHttpInfo(languageId);
}
/**
* Delete Language
*
* @param languageId Language ID (required)
* @throws ApiException if fails to make API call
*/
public ApiResponse deleteLanguagesLanguageIdWithHttpInfo(String languageId) throws ApiException {
Object pclocalVarPostBody = null;
// verify the required parameter 'languageId' is set
if (languageId == null) {
throw new ApiException(400, "Missing the required parameter 'languageId' when calling deleteLanguagesLanguageId");
}
// create path and map variables
String pclocalVarPath = "/api/v2/routing/languages/{languageId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "languageId" + "\\}", pcapiClient.escapeString(languageId.toString()));
// query params
List pclocalVarQueryParams = new ArrayList();
Map pclocalVarHeaderParams = new HashMap();
Map pclocalVarFormParams = new HashMap();
final String[] pclocalVarAccepts = {
"application/json"
};
final String pclocalVarAccept = pcapiClient.selectHeaderAccept(pclocalVarAccepts);
final String[] pclocalVarContentTypes = {
"application/json"
};
final String pclocalVarContentType = pcapiClient.selectHeaderContentType(pclocalVarContentTypes);
String[] pclocalVarAuthNames = new String[] { "PureCloud Auth" };
return pcapiClient.invokeAPIVerbose(pclocalVarPath, "DELETE", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, null);
}
/**
* Get language (Deprecated)
* This endpoint is deprecated. It has been moved to /routing/languages/{languageId}
* @param languageId Language ID (required)
* @return Language
* @throws ApiException if fails to make API call
*/
public Language getLanguageId(String languageId) throws ApiException {
return getLanguageIdWithHttpInfo(languageId).getResponseObject();
}
/**
* Get language (Deprecated)
* This endpoint is deprecated. It has been moved to /routing/languages/{languageId}
* @param languageId Language ID (required)
* @return Language
* @throws ApiException if fails to make API call
*/
public ApiResponse getLanguageIdWithHttpInfo(String languageId) throws ApiException {
Object pclocalVarPostBody = null;
// verify the required parameter 'languageId' is set
if (languageId == null) {
throw new ApiException(400, "Missing the required parameter 'languageId' when calling getLanguageId");
}
// create path and map variables
String pclocalVarPath = "/api/v2/languages/{languageId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "languageId" + "\\}", pcapiClient.escapeString(languageId.toString()));
// query params
List pclocalVarQueryParams = new ArrayList();
Map pclocalVarHeaderParams = new HashMap();
Map pclocalVarFormParams = new HashMap();
final String[] pclocalVarAccepts = {
"application/json"
};
final String pclocalVarAccept = pcapiClient.selectHeaderAccept(pclocalVarAccepts);
final String[] pclocalVarContentTypes = {
"application/json"
};
final String pclocalVarContentType = pcapiClient.selectHeaderContentType(pclocalVarContentTypes);
String[] pclocalVarAuthNames = new String[] { "PureCloud Auth" };
return pcapiClient.invokeAPIVerbose(pclocalVarPath, "GET", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
}
/**
* Get the list of supported languages. (Deprecated)
* This endpoint is deprecated. It has been moved to /routing/languages
* @param pageSize Page size (optional, default to 25)
* @param pageNumber Page number (optional, default to 1)
* @param sortOrder Ascending or descending sort order (optional, default to ASC)
* @param name Name (optional)
* @return LanguageEntityListing
* @throws ApiException if fails to make API call
*/
public LanguageEntityListing getLanguages(Integer pageSize, Integer pageNumber, String sortOrder, String name) throws ApiException {
return getLanguagesWithHttpInfo(pageSize, pageNumber, sortOrder, name).getResponseObject();
}
/**
* Get the list of supported languages. (Deprecated)
* This endpoint is deprecated. It has been moved to /routing/languages
* @param pageSize Page size (optional, default to 25)
* @param pageNumber Page number (optional, default to 1)
* @param sortOrder Ascending or descending sort order (optional, default to ASC)
* @param name Name (optional)
* @return LanguageEntityListing
* @throws ApiException if fails to make API call
*/
public ApiResponse getLanguagesWithHttpInfo(Integer pageSize, Integer pageNumber, String sortOrder, String name) throws ApiException {
Object pclocalVarPostBody = null;
// create path and map variables
String pclocalVarPath = "/api/v2/languages".replaceAll("\\{format\\}","json");
// query params
List pclocalVarQueryParams = new ArrayList();
Map pclocalVarHeaderParams = new HashMap();
Map pclocalVarFormParams = new HashMap();
pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "pageSize", pageSize));
pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "pageNumber", pageNumber));
pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "sortOrder", sortOrder));
pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "name", name));
final String[] pclocalVarAccepts = {
"application/json"
};
final String pclocalVarAccept = pcapiClient.selectHeaderAccept(pclocalVarAccepts);
final String[] pclocalVarContentTypes = {
"application/json"
};
final String pclocalVarContentType = pcapiClient.selectHeaderContentType(pclocalVarContentTypes);
String[] pclocalVarAuthNames = new String[] { "PureCloud Auth" };
return pcapiClient.invokeAPIVerbose(pclocalVarPath, "GET", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
}
/**
* Get language
*
* @param languageId Language ID (required)
* @return Language
* @throws ApiException if fails to make API call
*/
public Language getLanguagesLanguageId(String languageId) throws ApiException {
return getLanguagesLanguageIdWithHttpInfo(languageId).getResponseObject();
}
/**
* Get language
*
* @param languageId Language ID (required)
* @return Language
* @throws ApiException if fails to make API call
*/
public ApiResponse getLanguagesLanguageIdWithHttpInfo(String languageId) throws ApiException {
Object pclocalVarPostBody = null;
// verify the required parameter 'languageId' is set
if (languageId == null) {
throw new ApiException(400, "Missing the required parameter 'languageId' when calling getLanguagesLanguageId");
}
// create path and map variables
String pclocalVarPath = "/api/v2/routing/languages/{languageId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "languageId" + "\\}", pcapiClient.escapeString(languageId.toString()));
// query params
List pclocalVarQueryParams = new ArrayList();
Map pclocalVarHeaderParams = new HashMap();
Map pclocalVarFormParams = new HashMap();
final String[] pclocalVarAccepts = {
"application/json"
};
final String pclocalVarAccept = pcapiClient.selectHeaderAccept(pclocalVarAccepts);
final String[] pclocalVarContentTypes = {
"application/json"
};
final String pclocalVarContentType = pcapiClient.selectHeaderContentType(pclocalVarContentTypes);
String[] pclocalVarAuthNames = new String[] { "PureCloud Auth" };
return pcapiClient.invokeAPIVerbose(pclocalVarPath, "GET", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
}
/**
* Get all available languages for translation
*
* @return AvailableTranslations
* @throws ApiException if fails to make API call
*/
public AvailableTranslations getTranslations() throws ApiException {
return getTranslationsWithHttpInfo().getResponseObject();
}
/**
* Get all available languages for translation
*
* @return AvailableTranslations
* @throws ApiException if fails to make API call
*/
public ApiResponse getTranslationsWithHttpInfo() throws ApiException {
Object pclocalVarPostBody = null;
// create path and map variables
String pclocalVarPath = "/api/v2/languages/translations".replaceAll("\\{format\\}","json");
// query params
List pclocalVarQueryParams = new ArrayList();
Map pclocalVarHeaderParams = new HashMap();
Map pclocalVarFormParams = new HashMap();
final String[] pclocalVarAccepts = {
"application/json"
};
final String pclocalVarAccept = pcapiClient.selectHeaderAccept(pclocalVarAccepts);
final String[] pclocalVarContentTypes = {
"application/json"
};
final String pclocalVarContentType = pcapiClient.selectHeaderContentType(pclocalVarContentTypes);
String[] pclocalVarAuthNames = new String[] { "PureCloud Auth" };
return pcapiClient.invokeAPIVerbose(pclocalVarPath, "GET", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
}
/**
* Get the builtin translation for a language
*
* @param language The language of the builtin translation to retrieve (required)
* @return Map
* @throws ApiException if fails to make API call
*/
public Map getTranslationsBuiltin(String language) throws ApiException {
return getTranslationsBuiltinWithHttpInfo(language).getResponseObject();
}
/**
* Get the builtin translation for a language
*
* @param language The language of the builtin translation to retrieve (required)
* @return Map
* @throws ApiException if fails to make API call
*/
public ApiResponse