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

com.mypurecloud.sdk.api.ResponseManagementApi 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.LibraryEntityListing;
import com.mypurecloud.sdk.model.Library;
import com.mypurecloud.sdk.model.ResponseEntityListing;
import com.mypurecloud.sdk.model.Response;
import com.mypurecloud.sdk.model.ResponseQueryResults;
import com.mypurecloud.sdk.model.ResponseQueryRequest;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class ResponseManagementApi {
  private ApiClient pcapiClient;

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

  public ResponseManagementApi(ApiClient apiClient) {
    this.pcapiClient = apiClient;
  }

  public ApiClient getApiClient() {
    return pcapiClient;
  }

  public void setApiClient(ApiClient apiClient) {
    this.pcapiClient = apiClient;
  }

  /**
   * Delete an existing response library.
   * This will remove any responses associated with the library.
   * @param libraryId Library ID (required)
   * @throws ApiException if fails to make API call
   */
  public void deleteLibrariesLibraryId(String libraryId) throws ApiException {
    deleteLibrariesLibraryIdWithHttpInfo(libraryId);
  }

  /**
   * Delete an existing response library.
   * This will remove any responses associated with the library.
   * @param libraryId Library ID (required)
   * @throws ApiException if fails to make API call
   */
  public ApiResponse deleteLibrariesLibraryIdWithHttpInfo(String libraryId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'libraryId' is set
    if (libraryId == null) {
      throw new ApiException(400, "Missing the required parameter 'libraryId' when calling deleteLibrariesLibraryId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/responsemanagement/libraries/{libraryId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "libraryId" + "\\}", pcapiClient.escapeString(libraryId.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 an existing response.
   * This will remove the response from any libraries associated with it.
   * @param responseId Response ID (required)
   * @throws ApiException if fails to make API call
   */
  public void deleteResponsesResponseId(String responseId) throws ApiException {
    deleteResponsesResponseIdWithHttpInfo(responseId);
  }

  /**
   * Delete an existing response.
   * This will remove the response from any libraries associated with it.
   * @param responseId Response ID (required)
   * @throws ApiException if fails to make API call
   */
  public ApiResponse deleteResponsesResponseIdWithHttpInfo(String responseId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'responseId' is set
    if (responseId == null) {
      throw new ApiException(400, "Missing the required parameter 'responseId' when calling deleteResponsesResponseId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/responsemanagement/responses/{responseId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "responseId" + "\\}", pcapiClient.escapeString(responseId.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);
  }
  /**
   * Gets a list of existing response libraries.
   * 
   * @param pageNumber Page number (optional, default to 1)
   * @param pageSize Page size (optional, default to 25)
   * @return LibraryEntityListing
   * @throws ApiException if fails to make API call
   */
  public LibraryEntityListing getLibraries(Integer pageNumber, Integer pageSize) throws ApiException {
    return getLibrariesWithHttpInfo(pageNumber, pageSize).getResponseObject();
  }

  /**
   * Gets a list of existing response libraries.
   * 
   * @param pageNumber Page number (optional, default to 1)
   * @param pageSize Page size (optional, default to 25)
   * @return LibraryEntityListing
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getLibrariesWithHttpInfo(Integer pageNumber, Integer pageSize) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/responsemanagement/libraries".replaceAll("\\{format\\}","json");

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

    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "pageNumber", pageNumber));
    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "pageSize", pageSize));

    
    
    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 details about an existing response library.
   * 
   * @param libraryId Library ID (required)
   * @return Library
   * @throws ApiException if fails to make API call
   */
  public Library getLibrariesLibraryId(String libraryId) throws ApiException {
    return getLibrariesLibraryIdWithHttpInfo(libraryId).getResponseObject();
  }

  /**
   * Get details about an existing response library.
   * 
   * @param libraryId Library ID (required)
   * @return Library
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getLibrariesLibraryIdWithHttpInfo(String libraryId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'libraryId' is set
    if (libraryId == null) {
      throw new ApiException(400, "Missing the required parameter 'libraryId' when calling getLibrariesLibraryId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/responsemanagement/libraries/{libraryId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "libraryId" + "\\}", pcapiClient.escapeString(libraryId.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() {});
  }
  /**
   * Gets a list of existing responses.
   * 
   * @param libraryId Library ID (required)
   * @param pageNumber Page number (optional, default to 1)
   * @param pageSize Page size (optional, default to 25)
   * @return ResponseEntityListing
   * @throws ApiException if fails to make API call
   */
  public ResponseEntityListing getResponses(String libraryId, Integer pageNumber, Integer pageSize) throws ApiException {
    return getResponsesWithHttpInfo(libraryId, pageNumber, pageSize).getResponseObject();
  }

  /**
   * Gets a list of existing responses.
   * 
   * @param libraryId Library ID (required)
   * @param pageNumber Page number (optional, default to 1)
   * @param pageSize Page size (optional, default to 25)
   * @return ResponseEntityListing
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getResponsesWithHttpInfo(String libraryId, Integer pageNumber, Integer pageSize) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'libraryId' is set
    if (libraryId == null) {
      throw new ApiException(400, "Missing the required parameter 'libraryId' when calling getResponses");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/responsemanagement/responses".replaceAll("\\{format\\}","json");

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

    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "libraryId", libraryId));
    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "pageNumber", pageNumber));
    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "pageSize", pageSize));

    
    
    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 details about an existing response.
   * 
   * @param responseId Response ID (required)
   * @return Response
   * @throws ApiException if fails to make API call
   */
  public Response getResponsesResponseId(String responseId) throws ApiException {
    return getResponsesResponseIdWithHttpInfo(responseId).getResponseObject();
  }

  /**
   * Get details about an existing response.
   * 
   * @param responseId Response ID (required)
   * @return Response
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getResponsesResponseIdWithHttpInfo(String responseId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'responseId' is set
    if (responseId == null) {
      throw new ApiException(400, "Missing the required parameter 'responseId' when calling getResponsesResponseId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/responsemanagement/responses/{responseId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "responseId" + "\\}", pcapiClient.escapeString(responseId.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 a response library.
   * 
   * @param body Library (required)
   * @return Library
   * @throws ApiException if fails to make API call
   */
  public Library postLibraries(Library body) throws ApiException {
    return postLibrariesWithHttpInfo(body).getResponseObject();
  }

  /**
   * Create a response library.
   * 
   * @param body Library (required)
   * @return Library
   * @throws ApiException if fails to make API call
   */
  public ApiResponse postLibrariesWithHttpInfo(Library 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 postLibraries");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/responsemanagement/libraries".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() {});
  }
  /**
   * Create a response.
   * 
   * @param body Response (required)
   * @return Response
   * @throws ApiException if fails to make API call
   */
  public Response postResponses(Response body) throws ApiException {
    return postResponsesWithHttpInfo(body).getResponseObject();
  }

  /**
   * Create a response.
   * 
   * @param body Response (required)
   * @return Response
   * @throws ApiException if fails to make API call
   */
  public ApiResponse postResponsesWithHttpInfo(Response 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 postResponses");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/responsemanagement/responses".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() {});
  }
  /**
   * Query responses
   * 
   * @param body Response (required)
   * @return ResponseQueryResults
   * @throws ApiException if fails to make API call
   */
  public ResponseQueryResults postResponsesQuery(ResponseQueryRequest body) throws ApiException {
    return postResponsesQueryWithHttpInfo(body).getResponseObject();
  }

  /**
   * Query responses
   * 
   * @param body Response (required)
   * @return ResponseQueryResults
   * @throws ApiException if fails to make API call
   */
  public ApiResponse postResponsesQueryWithHttpInfo(ResponseQueryRequest 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 postResponsesQuery");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/responsemanagement/responses/query".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() {});
  }
  /**
   * Update an existing response library.
   * Fields that can be updated: name. The most recent version is required for updates.
   * @param libraryId Library ID (required)
   * @param body Library (required)
   * @return Library
   * @throws ApiException if fails to make API call
   */
  public Library putLibrariesLibraryId(String libraryId, Library body) throws ApiException {
    return putLibrariesLibraryIdWithHttpInfo(libraryId, body).getResponseObject();
  }

  /**
   * Update an existing response library.
   * Fields that can be updated: name. The most recent version is required for updates.
   * @param libraryId Library ID (required)
   * @param body Library (required)
   * @return Library
   * @throws ApiException if fails to make API call
   */
  public ApiResponse putLibrariesLibraryIdWithHttpInfo(String libraryId, Library body) throws ApiException {
    Object pclocalVarPostBody = body;
    
    // verify the required parameter 'libraryId' is set
    if (libraryId == null) {
      throw new ApiException(400, "Missing the required parameter 'libraryId' when calling putLibrariesLibraryId");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling putLibrariesLibraryId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/responsemanagement/libraries/{libraryId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "libraryId" + "\\}", pcapiClient.escapeString(libraryId.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, "PUT", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
  }
  /**
   * Update an existing response.
   * Fields that can be updated: name, libraries, and texts. The most recent version is required for updates.
   * @param responseId Response ID (required)
   * @param body Response (required)
   * @return Response
   * @throws ApiException if fails to make API call
   */
  public Response putResponsesResponseId(String responseId, Response body) throws ApiException {
    return putResponsesResponseIdWithHttpInfo(responseId, body).getResponseObject();
  }

  /**
   * Update an existing response.
   * Fields that can be updated: name, libraries, and texts. The most recent version is required for updates.
   * @param responseId Response ID (required)
   * @param body Response (required)
   * @return Response
   * @throws ApiException if fails to make API call
   */
  public ApiResponse putResponsesResponseIdWithHttpInfo(String responseId, Response body) throws ApiException {
    Object pclocalVarPostBody = body;
    
    // verify the required parameter 'responseId' is set
    if (responseId == null) {
      throw new ApiException(400, "Missing the required parameter 'responseId' when calling putResponsesResponseId");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling putResponsesResponseId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/responsemanagement/responses/{responseId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "responseId" + "\\}", pcapiClient.escapeString(responseId.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, "PUT", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy