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

com.mypurecloud.sdk.api.LanguagesApi Maven / Gradle / Ivy

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> getTranslationsBuiltinWithHttpInfo(String language) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'language' is set
    if (language == null) {
      throw new ApiException(400, "Missing the required parameter 'language' when calling getTranslationsBuiltin");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/languages/translations/builtin".replaceAll("\\{format\\}","json");

    // query params
    List pclocalVarQueryParams = new ArrayList();
    Map pclocalVarHeaderParams = new HashMap();
    Map pclocalVarFormParams = new HashMap();

    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "language", language));

    
    
    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 effective translation for an organization by language
   * 
   * @param language The language of the translation to retrieve for the organization (required)
   * @return Map
   * @throws ApiException if fails to make API call
   */
  public Map getTranslationsOrganization(String language) throws ApiException {
    return getTranslationsOrganizationWithHttpInfo(language).getResponseObject();
  }

  /**
   * Get effective translation for an organization by language
   * 
   * @param language The language of the translation to retrieve for the organization (required)
   * @return Map
   * @throws ApiException if fails to make API call
   */
  public ApiResponse> getTranslationsOrganizationWithHttpInfo(String language) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'language' is set
    if (language == null) {
      throw new ApiException(400, "Missing the required parameter 'language' when calling getTranslationsOrganization");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/languages/translations/organization".replaceAll("\\{format\\}","json");

    // query params
    List pclocalVarQueryParams = new ArrayList();
    Map pclocalVarHeaderParams = new HashMap();
    Map pclocalVarFormParams = new HashMap();

    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "language", language));

    
    
    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 effective language translation for a user
   * 
   * @param userId The user id (required)
   * @return Map
   * @throws ApiException if fails to make API call
   */
  public Map getTranslationsUsersUserId(String userId) throws ApiException {
    return getTranslationsUsersUserIdWithHttpInfo(userId).getResponseObject();
  }

  /**
   * Get effective language translation for a user
   * 
   * @param userId The user id (required)
   * @return Map
   * @throws ApiException if fails to make API call
   */
  public ApiResponse> getTranslationsUsersUserIdWithHttpInfo(String userId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'userId' is set
    if (userId == null) {
      throw new ApiException(400, "Missing the required parameter 'userId' when calling getTranslationsUsersUserId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/languages/translations/users/{userId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "userId" + "\\}", pcapiClient.escapeString(userId.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>() {});
  }
  /**
   * Create Language (Deprecated)
   * This endpoint is deprecated. It has been moved to /routing/languages
   * @param body Language (required)
   * @return Language
   * @throws ApiException if fails to make API call
   */
  public Language postLanguages(Language body) throws ApiException {
    return postLanguagesWithHttpInfo(body).getResponseObject();
  }

  /**
   * Create Language (Deprecated)
   * This endpoint is deprecated. It has been moved to /routing/languages
   * @param body Language (required)
   * @return Language
   * @throws ApiException if fails to make API call
   */
  public ApiResponse postLanguagesWithHttpInfo(Language body) throws ApiException {
    Object pclocalVarPostBody = body;
    
    // verify the required parameter 'body' is set
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling postLanguages");
    }
    
    // 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();


    
    
    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, "POST", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy