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

com.mypurecloud.sdk.api.GreetingsApi 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.DefaultGreetingList;
import com.mypurecloud.sdk.model.Greeting;
import com.mypurecloud.sdk.model.GreetingMediaInfo;
import com.mypurecloud.sdk.model.DomainEntityListing;
import com.mypurecloud.sdk.model.GreetingListing;


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


public class GreetingsApi {
  private ApiClient pcapiClient;

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

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

  public ApiClient getApiClient() {
    return pcapiClient;
  }

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

  /**
   * Deletes a Greeting with the given GreetingId
   * 
   * @param greetingId Greeting ID (required)
   * @throws ApiException if fails to make API call
   */
  public void deleteGreetingId(String greetingId) throws ApiException {
    deleteGreetingIdWithHttpInfo(greetingId);
  }

  /**
   * Deletes a Greeting with the given GreetingId
   * 
   * @param greetingId Greeting ID (required)
   * @throws ApiException if fails to make API call
   */
  public ApiResponse deleteGreetingIdWithHttpInfo(String greetingId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'greetingId' is set
    if (greetingId == null) {
      throw new ApiException(400, "Missing the required parameter 'greetingId' when calling deleteGreetingId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/greetings/{greetingId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "greetingId" + "\\}", pcapiClient.escapeString(greetingId.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 an Organization's DefaultGreetingList
   * 
   * @return DefaultGreetingList
   * @throws ApiException if fails to make API call
   */
  public DefaultGreetingList getDefaults() throws ApiException {
    return getDefaultsWithHttpInfo().getResponseObject();
  }

  /**
   * Get an Organization's DefaultGreetingList
   * 
   * @return DefaultGreetingList
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getDefaultsWithHttpInfo() throws ApiException {
    Object pclocalVarPostBody = null;
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/greetings/defaults".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 a Greeting with the given GreetingId
   * 
   * @param greetingId Greeting ID (required)
   * @return Greeting
   * @throws ApiException if fails to make API call
   */
  public Greeting getGreetingId(String greetingId) throws ApiException {
    return getGreetingIdWithHttpInfo(greetingId).getResponseObject();
  }

  /**
   * Get a Greeting with the given GreetingId
   * 
   * @param greetingId Greeting ID (required)
   * @return Greeting
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getGreetingIdWithHttpInfo(String greetingId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'greetingId' is set
    if (greetingId == null) {
      throw new ApiException(400, "Missing the required parameter 'greetingId' when calling getGreetingId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/greetings/{greetingId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "greetingId" + "\\}", pcapiClient.escapeString(greetingId.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 media playback URI for this greeting
   * 
   * @param greetingId Greeting ID (required)
   * @param formatId The desired media format. (optional, default to WAV)
   * @return GreetingMediaInfo
   * @throws ApiException if fails to make API call
   */
  public GreetingMediaInfo getGreetingIdMedia(String greetingId, String formatId) throws ApiException {
    return getGreetingIdMediaWithHttpInfo(greetingId, formatId).getResponseObject();
  }

  /**
   * Get media playback URI for this greeting
   * 
   * @param greetingId Greeting ID (required)
   * @param formatId The desired media format. (optional, default to WAV)
   * @return GreetingMediaInfo
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getGreetingIdMediaWithHttpInfo(String greetingId, String formatId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'greetingId' is set
    if (greetingId == null) {
      throw new ApiException(400, "Missing the required parameter 'greetingId' when calling getGreetingIdMedia");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/greetings/{greetingId}/media".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "greetingId" + "\\}", pcapiClient.escapeString(greetingId.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() {});
  }
  /**
   * Gets an Organization's Greetings
   * 
   * @param pageSize Page size (optional, default to 25)
   * @param pageNumber Page number (optional, default to 1)
   * @return DomainEntityListing
   * @throws ApiException if fails to make API call
   */
  public DomainEntityListing getGreetings(Integer pageSize, Integer pageNumber) throws ApiException {
    return getGreetingsWithHttpInfo(pageSize, pageNumber).getResponseObject();
  }

  /**
   * Gets an Organization's Greetings
   * 
   * @param pageSize Page size (optional, default to 25)
   * @param pageNumber Page number (optional, default to 1)
   * @return DomainEntityListing
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getGreetingsWithHttpInfo(Integer pageSize, Integer pageNumber) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/greetings".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 a list of the Group's Greetings
   * 
   * @param groupId Group ID (required)
   * @param pageSize Page size (optional, default to 25)
   * @param pageNumber Page number (optional, default to 1)
   * @return GreetingListing
   * @throws ApiException if fails to make API call
   */
  public GreetingListing getGroupIdGreetings(String groupId, Integer pageSize, Integer pageNumber) throws ApiException {
    return getGroupIdGreetingsWithHttpInfo(groupId, pageSize, pageNumber).getResponseObject();
  }

  /**
   * Get a list of the Group's Greetings
   * 
   * @param groupId Group ID (required)
   * @param pageSize Page size (optional, default to 25)
   * @param pageNumber Page number (optional, default to 1)
   * @return GreetingListing
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getGroupIdGreetingsWithHttpInfo(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 getGroupIdGreetings");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/groups/{groupId}/greetings".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() {});
  }
  /**
   * Grabs the list of Default Greetings given a Group's ID
   * 
   * @param groupId Group ID (required)
   * @return DefaultGreetingList
   * @throws ApiException if fails to make API call
   */
  public DefaultGreetingList getGroupIdGreetingsDefaults(String groupId) throws ApiException {
    return getGroupIdGreetingsDefaultsWithHttpInfo(groupId).getResponseObject();
  }

  /**
   * Grabs the list of Default Greetings given a Group's ID
   * 
   * @param groupId Group ID (required)
   * @return DefaultGreetingList
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getGroupIdGreetingsDefaultsWithHttpInfo(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 getGroupIdGreetingsDefaults");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/groups/{groupId}/greetings/defaults".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 a list of the User's Greetings
   * 
   * @param userId User ID (required)
   * @param pageSize Page size (optional, default to 25)
   * @param pageNumber Page number (optional, default to 1)
   * @return DomainEntityListing
   * @throws ApiException if fails to make API call
   */
  public DomainEntityListing getUserIdGreetings(String userId, Integer pageSize, Integer pageNumber) throws ApiException {
    return getUserIdGreetingsWithHttpInfo(userId, pageSize, pageNumber).getResponseObject();
  }

  /**
   * Get a list of the User's Greetings
   * 
   * @param userId User ID (required)
   * @param pageSize Page size (optional, default to 25)
   * @param pageNumber Page number (optional, default to 1)
   * @return DomainEntityListing
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getUserIdGreetingsWithHttpInfo(String userId, Integer pageSize, Integer pageNumber) 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 getUserIdGreetings");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/users/{userId}/greetings".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "userId" + "\\}", pcapiClient.escapeString(userId.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() {});
  }
  /**
   * Grabs the list of Default Greetings given a User's ID
   * 
   * @param userId User ID (required)
   * @return DefaultGreetingList
   * @throws ApiException if fails to make API call
   */
  public DefaultGreetingList getUserIdGreetingsDefaults(String userId) throws ApiException {
    return getUserIdGreetingsDefaultsWithHttpInfo(userId).getResponseObject();
  }

  /**
   * Grabs the list of Default Greetings given a User's ID
   * 
   * @param userId User ID (required)
   * @return DefaultGreetingList
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getUserIdGreetingsDefaultsWithHttpInfo(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 getUserIdGreetingsDefaults");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/users/{userId}/greetings/defaults".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 a Greeting for an Organization
   * 
   * @param body The Greeting to create (required)
   * @return DefaultGreetingList
   * @throws ApiException if fails to make API call
   */
  public DefaultGreetingList postGreetings(Greeting body) throws ApiException {
    return postGreetingsWithHttpInfo(body).getResponseObject();
  }

  /**
   * Create a Greeting for an Organization
   * 
   * @param body The Greeting to create (required)
   * @return DefaultGreetingList
   * @throws ApiException if fails to make API call
   */
  public ApiResponse postGreetingsWithHttpInfo(Greeting 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 postGreetings");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/greetings".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() {});
  }
  /**
   * Creates a Greeting for a Group
   * 
   * @param groupId Group ID (required)
   * @param body The Greeting to create (required)
   * @return Greeting
   * @throws ApiException if fails to make API call
   */
  public Greeting postGroupIdGreetings(String groupId, Greeting body) throws ApiException {
    return postGroupIdGreetingsWithHttpInfo(groupId, body).getResponseObject();
  }

  /**
   * Creates a Greeting for a Group
   * 
   * @param groupId Group ID (required)
   * @param body The Greeting to create (required)
   * @return Greeting
   * @throws ApiException if fails to make API call
   */
  public ApiResponse postGroupIdGreetingsWithHttpInfo(String groupId, Greeting 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 postGroupIdGreetings");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling postGroupIdGreetings");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/groups/{groupId}/greetings".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, "POST", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
  }
  /**
   * Creates a Greeting for a User
   * 
   * @param userId User ID (required)
   * @param body The Greeting to create (required)
   * @return Greeting
   * @throws ApiException if fails to make API call
   */
  public Greeting postUserIdGreetings(String userId, Greeting body) throws ApiException {
    return postUserIdGreetingsWithHttpInfo(userId, body).getResponseObject();
  }

  /**
   * Creates a Greeting for a User
   * 
   * @param userId User ID (required)
   * @param body The Greeting to create (required)
   * @return Greeting
   * @throws ApiException if fails to make API call
   */
  public ApiResponse postUserIdGreetingsWithHttpInfo(String userId, Greeting 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 postUserIdGreetings");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling postUserIdGreetings");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/users/{userId}/greetings".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, "POST", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
  }
  /**
   * Update an Organization's DefaultGreetingList
   * 
   * @param body The updated defaultGreetingList (required)
   * @return DefaultGreetingList
   * @throws ApiException if fails to make API call
   */
  public DefaultGreetingList putDefaults(DefaultGreetingList body) throws ApiException {
    return putDefaultsWithHttpInfo(body).getResponseObject();
  }

  /**
   * Update an Organization's DefaultGreetingList
   * 
   * @param body The updated defaultGreetingList (required)
   * @return DefaultGreetingList
   * @throws ApiException if fails to make API call
   */
  public ApiResponse putDefaultsWithHttpInfo(DefaultGreetingList 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 putDefaults");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/greetings/defaults".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() {});
  }
  /**
   * Updates the Greeting with the given GreetingId
   * 
   * @param greetingId Greeting ID (required)
   * @param body The updated Greeting (required)
   * @return Greeting
   * @throws ApiException if fails to make API call
   */
  public Greeting putGreetingId(String greetingId, Greeting body) throws ApiException {
    return putGreetingIdWithHttpInfo(greetingId, body).getResponseObject();
  }

  /**
   * Updates the Greeting with the given GreetingId
   * 
   * @param greetingId Greeting ID (required)
   * @param body The updated Greeting (required)
   * @return Greeting
   * @throws ApiException if fails to make API call
   */
  public ApiResponse putGreetingIdWithHttpInfo(String greetingId, Greeting body) throws ApiException {
    Object pclocalVarPostBody = body;
    
    // verify the required parameter 'greetingId' is set
    if (greetingId == null) {
      throw new ApiException(400, "Missing the required parameter 'greetingId' when calling putGreetingId");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling putGreetingId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/greetings/{greetingId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "greetingId" + "\\}", pcapiClient.escapeString(greetingId.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() {});
  }
  /**
   * Updates the DefaultGreetingList of the specified Group
   * 
   * @param groupId Group ID (required)
   * @param body The updated defaultGreetingList (required)
   * @return DefaultGreetingList
   * @throws ApiException if fails to make API call
   */
  public DefaultGreetingList putGroupIdGreetingsDefaults(String groupId, DefaultGreetingList body) throws ApiException {
    return putGroupIdGreetingsDefaultsWithHttpInfo(groupId, body).getResponseObject();
  }

  /**
   * Updates the DefaultGreetingList of the specified Group
   * 
   * @param groupId Group ID (required)
   * @param body The updated defaultGreetingList (required)
   * @return DefaultGreetingList
   * @throws ApiException if fails to make API call
   */
  public ApiResponse putGroupIdGreetingsDefaultsWithHttpInfo(String groupId, DefaultGreetingList 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 putGroupIdGreetingsDefaults");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling putGroupIdGreetingsDefaults");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/groups/{groupId}/greetings/defaults".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, "PUT", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
  }
  /**
   * Updates the DefaultGreetingList of the specified User
   * 
   * @param userId User ID (required)
   * @param body The updated defaultGreetingList (required)
   * @return DefaultGreetingList
   * @throws ApiException if fails to make API call
   */
  public DefaultGreetingList putUserIdGreetingsDefaults(String userId, DefaultGreetingList body) throws ApiException {
    return putUserIdGreetingsDefaultsWithHttpInfo(userId, body).getResponseObject();
  }

  /**
   * Updates the DefaultGreetingList of the specified User
   * 
   * @param userId User ID (required)
   * @param body The updated defaultGreetingList (required)
   * @return DefaultGreetingList
   * @throws ApiException if fails to make API call
   */
  public ApiResponse putUserIdGreetingsDefaultsWithHttpInfo(String userId, DefaultGreetingList 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 putUserIdGreetingsDefaults");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling putUserIdGreetingsDefaults");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/users/{userId}/greetings/defaults".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, "PUT", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy