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

com.mypurecloud.sdk.api.VoicemailApi 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.VoicemailMailboxInfo;
import com.mypurecloud.sdk.model.VoicemailMessageEntityListing;
import com.mypurecloud.sdk.model.VoicemailGroupPolicy;
import com.mypurecloud.sdk.model.VoicemailUserPolicy;
import com.mypurecloud.sdk.model.VoicemailMessage;
import com.mypurecloud.sdk.model.VoicemailMediaInfo;
import com.mypurecloud.sdk.model.VoicemailOrganizationPolicy;
import com.mypurecloud.sdk.model.VoicemailsSearchResponse;
import com.mypurecloud.sdk.model.CopyVoicemailMessage;
import com.mypurecloud.sdk.model.VoicemailSearchRequest;


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


public class VoicemailApi {
  private ApiClient pcapiClient;

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

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

  public ApiClient getApiClient() {
    return pcapiClient;
  }

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

  /**
   * Delete all voicemail messages
   * 
   * @return String
   * @throws ApiException if fails to make API call
   */
  public String deleteMessages() throws ApiException {
    return deleteMessagesWithHttpInfo().getResponseObject();
  }

  /**
   * Delete all voicemail messages
   * 
   * @return String
   * @throws ApiException if fails to make API call
   */
  public ApiResponse deleteMessagesWithHttpInfo() throws ApiException {
    Object pclocalVarPostBody = null;
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/messages".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, "DELETE", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
  }
  /**
   * Delete a message.
   * 
   * @param messageId Message ID (required)
   * @return String
   * @throws ApiException if fails to make API call
   */
  public String deleteMessagesMessageId(String messageId) throws ApiException {
    return deleteMessagesMessageIdWithHttpInfo(messageId).getResponseObject();
  }

  /**
   * Delete a message.
   * 
   * @param messageId Message ID (required)
   * @return String
   * @throws ApiException if fails to make API call
   */
  public ApiResponse deleteMessagesMessageIdWithHttpInfo(String messageId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'messageId' is set
    if (messageId == null) {
      throw new ApiException(400, "Missing the required parameter 'messageId' when calling deleteMessagesMessageId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/messages/{messageId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "messageId" + "\\}", pcapiClient.escapeString(messageId.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, new TypeReference() {});
  }
  /**
   * Get the group's mailbox information
   * 
   * @param groupId groupId (required)
   * @return VoicemailMailboxInfo
   * @throws ApiException if fails to make API call
   */
  public VoicemailMailboxInfo getGroupsGroupIdMailbox(String groupId) throws ApiException {
    return getGroupsGroupIdMailboxWithHttpInfo(groupId).getResponseObject();
  }

  /**
   * Get the group's mailbox information
   * 
   * @param groupId groupId (required)
   * @return VoicemailMailboxInfo
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getGroupsGroupIdMailboxWithHttpInfo(String groupId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'groupId' is set
    if (groupId == null) {
      throw new ApiException(400, "Missing the required parameter 'groupId' when calling getGroupsGroupIdMailbox");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/groups/{groupId}/mailbox".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "groupId" + "\\}", pcapiClient.escapeString(groupId.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() {});
  }
  /**
   * List voicemail messages
   * 
   * @param groupId Group ID (required)
   * @param pageSize Page size (optional, default to 25)
   * @param pageNumber Page number (optional, default to 1)
   * @return VoicemailMessageEntityListing
   * @throws ApiException if fails to make API call
   */
  public VoicemailMessageEntityListing getGroupsGroupIdMessages(String groupId, Integer pageSize, Integer pageNumber) throws ApiException {
    return getGroupsGroupIdMessagesWithHttpInfo(groupId, pageSize, pageNumber).getResponseObject();
  }

  /**
   * List voicemail messages
   * 
   * @param groupId Group ID (required)
   * @param pageSize Page size (optional, default to 25)
   * @param pageNumber Page number (optional, default to 1)
   * @return VoicemailMessageEntityListing
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getGroupsGroupIdMessagesWithHttpInfo(String groupId, Integer pageSize, Integer pageNumber) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'groupId' is set
    if (groupId == null) {
      throw new ApiException(400, "Missing the required parameter 'groupId' when calling getGroupsGroupIdMessages");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/groups/{groupId}/messages".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "groupId" + "\\}", pcapiClient.escapeString(groupId.toString()));

    // 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));

    
    
    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 a group's voicemail policy
   * 
   * @param groupId Group ID (required)
   * @return VoicemailGroupPolicy
   * @throws ApiException if fails to make API call
   */
  public VoicemailGroupPolicy getGroupsGroupIdPolicy(String groupId) throws ApiException {
    return getGroupsGroupIdPolicyWithHttpInfo(groupId).getResponseObject();
  }

  /**
   * Get a group's voicemail policy
   * 
   * @param groupId Group ID (required)
   * @return VoicemailGroupPolicy
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getGroupsGroupIdPolicyWithHttpInfo(String groupId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'groupId' is set
    if (groupId == null) {
      throw new ApiException(400, "Missing the required parameter 'groupId' when calling getGroupsGroupIdPolicy");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/groups/{groupId}/policy".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "groupId" + "\\}", pcapiClient.escapeString(groupId.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 current user's mailbox information
   * 
   * @return VoicemailMailboxInfo
   * @throws ApiException if fails to make API call
   */
  public VoicemailMailboxInfo getMailbox() throws ApiException {
    return getMailboxWithHttpInfo().getResponseObject();
  }

  /**
   * Get the current user's mailbox information
   * 
   * @return VoicemailMailboxInfo
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getMailboxWithHttpInfo() throws ApiException {
    Object pclocalVarPostBody = null;
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/mailbox".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 current user's mailbox information
   * 
   * @return VoicemailMailboxInfo
   * @throws ApiException if fails to make API call
   */
  public VoicemailMailboxInfo getMeMailbox() throws ApiException {
    return getMeMailboxWithHttpInfo().getResponseObject();
  }

  /**
   * Get the current user's mailbox information
   * 
   * @return VoicemailMailboxInfo
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getMeMailboxWithHttpInfo() throws ApiException {
    Object pclocalVarPostBody = null;
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/me/mailbox".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() {});
  }
  /**
   * List voicemail messages
   * 
   * @param pageSize Page size (optional, default to 25)
   * @param pageNumber Page number (optional, default to 1)
   * @return VoicemailMessageEntityListing
   * @throws ApiException if fails to make API call
   */
  public VoicemailMessageEntityListing getMeMessages(Integer pageSize, Integer pageNumber) throws ApiException {
    return getMeMessagesWithHttpInfo(pageSize, pageNumber).getResponseObject();
  }

  /**
   * List voicemail messages
   * 
   * @param pageSize Page size (optional, default to 25)
   * @param pageNumber Page number (optional, default to 1)
   * @return VoicemailMessageEntityListing
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getMeMessagesWithHttpInfo(Integer pageSize, Integer pageNumber) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/me/messages".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));

    
    
    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 current user's voicemail policy
   * 
   * @return VoicemailUserPolicy
   * @throws ApiException if fails to make API call
   */
  public VoicemailUserPolicy getMePolicy() throws ApiException {
    return getMePolicyWithHttpInfo().getResponseObject();
  }

  /**
   * Get the current user's voicemail policy
   * 
   * @return VoicemailUserPolicy
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getMePolicyWithHttpInfo() throws ApiException {
    Object pclocalVarPostBody = null;
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/me/policy".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() {});
  }
  /**
   * List voicemail messages
   * 
   * @param ids An optional comma separated list of VoicemailMessage ids (optional)
   * @param expand If the caller is a known user, which fields, if any, to expand (optional)
   * @return VoicemailMessageEntityListing
   * @throws ApiException if fails to make API call
   */
  public VoicemailMessageEntityListing getMessages(String ids, List expand) throws ApiException {
    return getMessagesWithHttpInfo(ids, expand).getResponseObject();
  }

  /**
   * List voicemail messages
   * 
   * @param ids An optional comma separated list of VoicemailMessage ids (optional)
   * @param expand If the caller is a known user, which fields, if any, to expand (optional)
   * @return VoicemailMessageEntityListing
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getMessagesWithHttpInfo(String ids, List expand) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/messages".replaceAll("\\{format\\}","json");

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

    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "ids", ids));
    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("multi", "expand", expand));

    
    
    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 message.
   * 
   * @param messageId Message ID (required)
   * @param expand If the caller is a known user, which fields, if any, to expand (optional)
   * @return VoicemailMessage
   * @throws ApiException if fails to make API call
   */
  public VoicemailMessage getMessagesMessageId(String messageId, List expand) throws ApiException {
    return getMessagesMessageIdWithHttpInfo(messageId, expand).getResponseObject();
  }

  /**
   * Get message.
   * 
   * @param messageId Message ID (required)
   * @param expand If the caller is a known user, which fields, if any, to expand (optional)
   * @return VoicemailMessage
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getMessagesMessageIdWithHttpInfo(String messageId, List expand) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'messageId' is set
    if (messageId == null) {
      throw new ApiException(400, "Missing the required parameter 'messageId' when calling getMessagesMessageId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/messages/{messageId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "messageId" + "\\}", pcapiClient.escapeString(messageId.toString()));

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

    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("multi", "expand", expand));

    
    
    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 media playback URI for this message
   * 
   * @param messageId Message ID (required)
   * @param formatId The desired media format. (optional, default to WEBM)
   * @return VoicemailMediaInfo
   * @throws ApiException if fails to make API call
   */
  public VoicemailMediaInfo getMessagesMessageIdMedia(String messageId, String formatId) throws ApiException {
    return getMessagesMessageIdMediaWithHttpInfo(messageId, formatId).getResponseObject();
  }

  /**
   * Get media playback URI for this message
   * 
   * @param messageId Message ID (required)
   * @param formatId The desired media format. (optional, default to WEBM)
   * @return VoicemailMediaInfo
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getMessagesMessageIdMediaWithHttpInfo(String messageId, String formatId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'messageId' is set
    if (messageId == null) {
      throw new ApiException(400, "Missing the required parameter 'messageId' when calling getMessagesMessageIdMedia");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/messages/{messageId}/media".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "messageId" + "\\}", pcapiClient.escapeString(messageId.toString()));

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

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

    
    
    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 a policy
   * 
   * @return VoicemailOrganizationPolicy
   * @throws ApiException if fails to make API call
   */
  public VoicemailOrganizationPolicy getPolicy() throws ApiException {
    return getPolicyWithHttpInfo().getResponseObject();
  }

  /**
   * Get a policy
   * 
   * @return VoicemailOrganizationPolicy
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getPolicyWithHttpInfo() throws ApiException {
    Object pclocalVarPostBody = null;
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/policy".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() {});
  }
  /**
   * Search voicemails using the q64 value returned from a previous search
   * 
   * @param q64 q64 (required)
   * @param expand expand (optional)
   * @return VoicemailsSearchResponse
   * @throws ApiException if fails to make API call
   */
  public VoicemailsSearchResponse getSearch(String q64, List expand) throws ApiException {
    return getSearchWithHttpInfo(q64, expand).getResponseObject();
  }

  /**
   * Search voicemails using the q64 value returned from a previous search
   * 
   * @param q64 q64 (required)
   * @param expand expand (optional)
   * @return VoicemailsSearchResponse
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getSearchWithHttpInfo(String q64, List expand) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'q64' is set
    if (q64 == null) {
      throw new ApiException(400, "Missing the required parameter 'q64' when calling getSearch");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/search".replaceAll("\\{format\\}","json");

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

    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "q64", q64));
    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("multi", "expand", expand));

    
    
    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 a user's voicemail policy
   * 
   * @param userId User ID (required)
   * @return VoicemailUserPolicy
   * @throws ApiException if fails to make API call
   */
  public VoicemailUserPolicy getUserpoliciesUserId(String userId) throws ApiException {
    return getUserpoliciesUserIdWithHttpInfo(userId).getResponseObject();
  }

  /**
   * Get a user's voicemail policy
   * 
   * @param userId User ID (required)
   * @return VoicemailUserPolicy
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getUserpoliciesUserIdWithHttpInfo(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 getUserpoliciesUserId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/userpolicies/{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() {});
  }
  /**
   * Update a group's voicemail policy
   * 
   * @param groupId Group ID (required)
   * @param body The group's voicemail policy (required)
   * @return VoicemailGroupPolicy
   * @throws ApiException if fails to make API call
   */
  public VoicemailGroupPolicy patchGroupsGroupIdPolicy(String groupId, VoicemailGroupPolicy body) throws ApiException {
    return patchGroupsGroupIdPolicyWithHttpInfo(groupId, body).getResponseObject();
  }

  /**
   * Update a group's voicemail policy
   * 
   * @param groupId Group ID (required)
   * @param body The group's voicemail policy (required)
   * @return VoicemailGroupPolicy
   * @throws ApiException if fails to make API call
   */
  public ApiResponse patchGroupsGroupIdPolicyWithHttpInfo(String groupId, VoicemailGroupPolicy body) throws ApiException {
    Object pclocalVarPostBody = body;
    
    // verify the required parameter 'groupId' is set
    if (groupId == null) {
      throw new ApiException(400, "Missing the required parameter 'groupId' when calling patchGroupsGroupIdPolicy");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling patchGroupsGroupIdPolicy");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/groups/{groupId}/policy".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "groupId" + "\\}", pcapiClient.escapeString(groupId.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, "PATCH", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
  }
  /**
   * Update the current user's voicemail policy
   * 
   * @param body The user's voicemail policy (required)
   * @return VoicemailUserPolicy
   * @throws ApiException if fails to make API call
   */
  public VoicemailUserPolicy patchMePolicy(VoicemailUserPolicy body) throws ApiException {
    return patchMePolicyWithHttpInfo(body).getResponseObject();
  }

  /**
   * Update the current user's voicemail policy
   * 
   * @param body The user's voicemail policy (required)
   * @return VoicemailUserPolicy
   * @throws ApiException if fails to make API call
   */
  public ApiResponse patchMePolicyWithHttpInfo(VoicemailUserPolicy 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 patchMePolicy");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/me/policy".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, "PATCH", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
  }
  /**
   * Update a user's voicemail policy
   * 
   * @param userId User ID (required)
   * @param body The user's voicemail policy (required)
   * @return VoicemailUserPolicy
   * @throws ApiException if fails to make API call
   */
  public VoicemailUserPolicy patchUserpoliciesUserId(String userId, VoicemailUserPolicy body) throws ApiException {
    return patchUserpoliciesUserIdWithHttpInfo(userId, body).getResponseObject();
  }

  /**
   * Update a user's voicemail policy
   * 
   * @param userId User ID (required)
   * @param body The user's voicemail policy (required)
   * @return VoicemailUserPolicy
   * @throws ApiException if fails to make API call
   */
  public ApiResponse patchUserpoliciesUserIdWithHttpInfo(String userId, VoicemailUserPolicy body) throws ApiException {
    Object pclocalVarPostBody = body;
    
    // verify the required parameter 'userId' is set
    if (userId == null) {
      throw new ApiException(400, "Missing the required parameter 'userId' when calling patchUserpoliciesUserId");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling patchUserpoliciesUserId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/userpolicies/{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, "PATCH", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
  }
  /**
   * Copy a voicemail message to a user or group
   * 
   * @param body  (optional)
   * @return VoicemailMessage
   * @throws ApiException if fails to make API call
   */
  public VoicemailMessage postMessages(CopyVoicemailMessage body) throws ApiException {
    return postMessagesWithHttpInfo(body).getResponseObject();
  }

  /**
   * Copy a voicemail message to a user or group
   * 
   * @param body  (optional)
   * @return VoicemailMessage
   * @throws ApiException if fails to make API call
   */
  public ApiResponse postMessagesWithHttpInfo(CopyVoicemailMessage body) throws ApiException {
    Object pclocalVarPostBody = body;
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/messages".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() {});
  }
  /**
   * Search voicemails
   * 
   * @param body Search request options (required)
   * @return VoicemailsSearchResponse
   * @throws ApiException if fails to make API call
   */
  public VoicemailsSearchResponse postSearch(VoicemailSearchRequest body) throws ApiException {
    return postSearchWithHttpInfo(body).getResponseObject();
  }

  /**
   * Search voicemails
   * 
   * @param body Search request options (required)
   * @return VoicemailsSearchResponse
   * @throws ApiException if fails to make API call
   */
  public ApiResponse postSearchWithHttpInfo(VoicemailSearchRequest 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 postSearch");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/search".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 a message.
   * 
   * @param messageId Message ID (required)
   * @param body VoicemailMessage (required)
   * @return VoicemailMessage
   * @throws ApiException if fails to make API call
   */
  public VoicemailMessage putMessagesMessageId(String messageId, VoicemailMessage body) throws ApiException {
    return putMessagesMessageIdWithHttpInfo(messageId, body).getResponseObject();
  }

  /**
   * Update a message.
   * 
   * @param messageId Message ID (required)
   * @param body VoicemailMessage (required)
   * @return VoicemailMessage
   * @throws ApiException if fails to make API call
   */
  public ApiResponse putMessagesMessageIdWithHttpInfo(String messageId, VoicemailMessage body) throws ApiException {
    Object pclocalVarPostBody = body;
    
    // verify the required parameter 'messageId' is set
    if (messageId == null) {
      throw new ApiException(400, "Missing the required parameter 'messageId' when calling putMessagesMessageId");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling putMessagesMessageId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/messages/{messageId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "messageId" + "\\}", pcapiClient.escapeString(messageId.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 a policy
   * 
   * @param body Policy (required)
   * @return VoicemailOrganizationPolicy
   * @throws ApiException if fails to make API call
   */
  public VoicemailOrganizationPolicy putPolicy(VoicemailOrganizationPolicy body) throws ApiException {
    return putPolicyWithHttpInfo(body).getResponseObject();
  }

  /**
   * Update a policy
   * 
   * @param body Policy (required)
   * @return VoicemailOrganizationPolicy
   * @throws ApiException if fails to make API call
   */
  public ApiResponse putPolicyWithHttpInfo(VoicemailOrganizationPolicy 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 putPolicy");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/voicemail/policy".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, "PUT", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy