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

com.mypurecloud.sdk.api.WorkforceManagementApi 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.UserScheduleAdherence;
import com.mypurecloud.sdk.model.ManagementUnit;
import com.mypurecloud.sdk.model.ActivityCodeContainer;
import com.mypurecloud.sdk.model.WfmUserEntityListing;
import com.mypurecloud.sdk.model.TimeOffRequestList;
import com.mypurecloud.sdk.model.TimeOffRequest;
import com.mypurecloud.sdk.model.TimeOffRequestPatch;
import com.mypurecloud.sdk.model.UserScheduleContainer;
import com.mypurecloud.sdk.model.UserListScheduleRequestBody;
import com.mypurecloud.sdk.model.CurrentUserScheduleRequestBody;


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


public class WorkforceManagementApi {
  private ApiClient pcapiClient;

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

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

  public ApiClient getApiClient() {
    return pcapiClient;
  }

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

  /**
   * Get a list of UserScheduleAdherence records for the requested users
   * 
   * @param userId User Id(s) for which to fetch current schedule adherence information.  Min 1, Max of 100 userIds per request (required)
   * @return List
   * @throws ApiException if fails to make API call
   */
  public List getAdherence(List userId) throws ApiException {
    return getAdherenceWithHttpInfo(userId).getResponseObject();
  }

  /**
   * Get a list of UserScheduleAdherence records for the requested users
   * 
   * @param userId User Id(s) for which to fetch current schedule adherence information.  Min 1, Max of 100 userIds per request (required)
   * @return List
   * @throws ApiException if fails to make API call
   */
  public ApiResponse> getAdherenceWithHttpInfo(List 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 getAdherence");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/workforcemanagement/adherence".replaceAll("\\{format\\}","json");

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

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

    
    
    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 management units
   * 
   * @param selector Selector (optional)
   * @param pageSize  (optional, default to 25)
   * @param pageNumber  (optional, default to 1)
   * @return List
   * @throws ApiException if fails to make API call
   */
  public List getManagementunits(String selector, Integer pageSize, Integer pageNumber) throws ApiException {
    return getManagementunitsWithHttpInfo(selector, pageSize, pageNumber).getResponseObject();
  }

  /**
   * Get management units
   * 
   * @param selector Selector (optional)
   * @param pageSize  (optional, default to 25)
   * @param pageNumber  (optional, default to 1)
   * @return List
   * @throws ApiException if fails to make API call
   */
  public ApiResponse> getManagementunitsWithHttpInfo(String selector, Integer pageSize, Integer pageNumber) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/workforcemanagement/managementunits".replaceAll("\\{format\\}","json");

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

    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "selector", selector));
    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 activity codes corresponding to a management unit
   * 
   * @param muId The muId of the management unit. (required)
   * @return ActivityCodeContainer
   * @throws ApiException if fails to make API call
   */
  public ActivityCodeContainer getManagementunitsMuIdActivitycodes(String muId) throws ApiException {
    return getManagementunitsMuIdActivitycodesWithHttpInfo(muId).getResponseObject();
  }

  /**
   * Get activity codes corresponding to a management unit
   * 
   * @param muId The muId of the management unit. (required)
   * @return ActivityCodeContainer
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getManagementunitsMuIdActivitycodesWithHttpInfo(String muId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'muId' is set
    if (muId == null) {
      throw new ApiException(400, "Missing the required parameter 'muId' when calling getManagementunitsMuIdActivitycodes");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/workforcemanagement/managementunits/{muId}/activitycodes".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "muId" + "\\}", pcapiClient.escapeString(muId.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 agents in the management unit
   * 
   * @param muId The muId of the management unit. (required)
   * @return WfmUserEntityListing
   * @throws ApiException if fails to make API call
   */
  public WfmUserEntityListing getManagementunitsMuIdUsers(String muId) throws ApiException {
    return getManagementunitsMuIdUsersWithHttpInfo(muId).getResponseObject();
  }

  /**
   * Get agents in the management unit
   * 
   * @param muId The muId of the management unit. (required)
   * @return WfmUserEntityListing
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getManagementunitsMuIdUsersWithHttpInfo(String muId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'muId' is set
    if (muId == null) {
      throw new ApiException(400, "Missing the required parameter 'muId' when calling getManagementunitsMuIdUsers");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/workforcemanagement/managementunits/{muId}/users".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "muId" + "\\}", pcapiClient.escapeString(muId.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 time off requests for any user
   * 
   * @param muId The muId of the management unit. (required)
   * @param userId The userId to whom the Time Off Request applies. (required)
   * @param recentlyReviewed Limit results to requests that have been reviewed within the preceding 30 days (optional, default to false)
   * @return TimeOffRequestList
   * @throws ApiException if fails to make API call
   */
  public TimeOffRequestList getManagementunitsMuIdUsersUserIdTimeoffrequests(String muId, String userId, Boolean recentlyReviewed) throws ApiException {
    return getManagementunitsMuIdUsersUserIdTimeoffrequestsWithHttpInfo(muId, userId, recentlyReviewed).getResponseObject();
  }

  /**
   * Get a list of time off requests for any user
   * 
   * @param muId The muId of the management unit. (required)
   * @param userId The userId to whom the Time Off Request applies. (required)
   * @param recentlyReviewed Limit results to requests that have been reviewed within the preceding 30 days (optional, default to false)
   * @return TimeOffRequestList
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getManagementunitsMuIdUsersUserIdTimeoffrequestsWithHttpInfo(String muId, String userId, Boolean recentlyReviewed) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'muId' is set
    if (muId == null) {
      throw new ApiException(400, "Missing the required parameter 'muId' when calling getManagementunitsMuIdUsersUserIdTimeoffrequests");
    }
    
    // verify the required parameter 'userId' is set
    if (userId == null) {
      throw new ApiException(400, "Missing the required parameter 'userId' when calling getManagementunitsMuIdUsersUserIdTimeoffrequests");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/workforcemanagement/managementunits/{muId}/users/{userId}/timeoffrequests".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "muId" + "\\}", pcapiClient.escapeString(muId.toString()))
      .replaceAll("\\{" + "userId" + "\\}", pcapiClient.escapeString(userId.toString()));

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

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

    
    
    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 time off request by id
   * 
   * @param muId The muId of the management unit. (required)
   * @param userId The userId to whom the Time Off Request applies. (required)
   * @param timeOffRequestId Time Off Request Id (required)
   * @return TimeOffRequest
   * @throws ApiException if fails to make API call
   */
  public TimeOffRequest getManagementunitsMuIdUsersUserIdTimeoffrequestsTimeoffrequestId(String muId, String userId, String timeOffRequestId) throws ApiException {
    return getManagementunitsMuIdUsersUserIdTimeoffrequestsTimeoffrequestIdWithHttpInfo(muId, userId, timeOffRequestId).getResponseObject();
  }

  /**
   * Get a time off request by id
   * 
   * @param muId The muId of the management unit. (required)
   * @param userId The userId to whom the Time Off Request applies. (required)
   * @param timeOffRequestId Time Off Request Id (required)
   * @return TimeOffRequest
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getManagementunitsMuIdUsersUserIdTimeoffrequestsTimeoffrequestIdWithHttpInfo(String muId, String userId, String timeOffRequestId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'muId' is set
    if (muId == null) {
      throw new ApiException(400, "Missing the required parameter 'muId' when calling getManagementunitsMuIdUsersUserIdTimeoffrequestsTimeoffrequestId");
    }
    
    // verify the required parameter 'userId' is set
    if (userId == null) {
      throw new ApiException(400, "Missing the required parameter 'userId' when calling getManagementunitsMuIdUsersUserIdTimeoffrequestsTimeoffrequestId");
    }
    
    // verify the required parameter 'timeOffRequestId' is set
    if (timeOffRequestId == null) {
      throw new ApiException(400, "Missing the required parameter 'timeOffRequestId' when calling getManagementunitsMuIdUsersUserIdTimeoffrequestsTimeoffrequestId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/workforcemanagement/managementunits/{muId}/users/{userId}/timeoffrequests/{timeOffRequestId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "muId" + "\\}", pcapiClient.escapeString(muId.toString()))
      .replaceAll("\\{" + "userId" + "\\}", pcapiClient.escapeString(userId.toString()))
      .replaceAll("\\{" + "timeOffRequestId" + "\\}", pcapiClient.escapeString(timeOffRequestId.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 time off requests for the current user
   * 
   * @param recentlyReviewed Limit results to requests that have been reviewed within the preceding 30 days (optional, default to false)
   * @return TimeOffRequestList
   * @throws ApiException if fails to make API call
   */
  public TimeOffRequestList getTimeoffrequests(Boolean recentlyReviewed) throws ApiException {
    return getTimeoffrequestsWithHttpInfo(recentlyReviewed).getResponseObject();
  }

  /**
   * Get a list of time off requests for the current user
   * 
   * @param recentlyReviewed Limit results to requests that have been reviewed within the preceding 30 days (optional, default to false)
   * @return TimeOffRequestList
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getTimeoffrequestsWithHttpInfo(Boolean recentlyReviewed) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/workforcemanagement/timeoffrequests".replaceAll("\\{format\\}","json");

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

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

    
    
    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 time off request for the current user by id
   * 
   * @param timeOffRequestId Time Off Request Id (required)
   * @return TimeOffRequest
   * @throws ApiException if fails to make API call
   */
  public TimeOffRequest getTimeoffrequestsTimeoffrequestId(String timeOffRequestId) throws ApiException {
    return getTimeoffrequestsTimeoffrequestIdWithHttpInfo(timeOffRequestId).getResponseObject();
  }

  /**
   * Get a time off request for the current user by id
   * 
   * @param timeOffRequestId Time Off Request Id (required)
   * @return TimeOffRequest
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getTimeoffrequestsTimeoffrequestIdWithHttpInfo(String timeOffRequestId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'timeOffRequestId' is set
    if (timeOffRequestId == null) {
      throw new ApiException(400, "Missing the required parameter 'timeOffRequestId' when calling getTimeoffrequestsTimeoffrequestId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/workforcemanagement/timeoffrequests/{timeOffRequestId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "timeOffRequestId" + "\\}", pcapiClient.escapeString(timeOffRequestId.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() {});
  }
  /**
   * Mark a time off request for the current user as read or unread
   * 
   * @param timeOffRequestId Time Off Request Id (required)
   * @param body  (optional)
   * @throws ApiException if fails to make API call
   */
  public void patchTimeoffrequestsTimeoffrequestId(String timeOffRequestId, TimeOffRequestPatch body) throws ApiException {
    patchTimeoffrequestsTimeoffrequestIdWithHttpInfo(timeOffRequestId, body);
  }

  /**
   * Mark a time off request for the current user as read or unread
   * 
   * @param timeOffRequestId Time Off Request Id (required)
   * @param body  (optional)
   * @throws ApiException if fails to make API call
   */
  public ApiResponse patchTimeoffrequestsTimeoffrequestIdWithHttpInfo(String timeOffRequestId, TimeOffRequestPatch body) throws ApiException {
    Object pclocalVarPostBody = body;
    
    // verify the required parameter 'timeOffRequestId' is set
    if (timeOffRequestId == null) {
      throw new ApiException(400, "Missing the required parameter 'timeOffRequestId' when calling patchTimeoffrequestsTimeoffrequestId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/workforcemanagement/timeoffrequests/{timeOffRequestId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "timeOffRequestId" + "\\}", pcapiClient.escapeString(timeOffRequestId.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, null);
  }
  /**
   * Get user schedules within the given time range
   * 
   * @param muId The muId of the management unit. (required)
   * @param body body (optional)
   * @return UserScheduleContainer
   * @throws ApiException if fails to make API call
   */
  public UserScheduleContainer postManagementunitsMuIdSchedulesSearch(String muId, UserListScheduleRequestBody body) throws ApiException {
    return postManagementunitsMuIdSchedulesSearchWithHttpInfo(muId, body).getResponseObject();
  }

  /**
   * Get user schedules within the given time range
   * 
   * @param muId The muId of the management unit. (required)
   * @param body body (optional)
   * @return UserScheduleContainer
   * @throws ApiException if fails to make API call
   */
  public ApiResponse postManagementunitsMuIdSchedulesSearchWithHttpInfo(String muId, UserListScheduleRequestBody body) throws ApiException {
    Object pclocalVarPostBody = body;
    
    // verify the required parameter 'muId' is set
    if (muId == null) {
      throw new ApiException(400, "Missing the required parameter 'muId' when calling postManagementunitsMuIdSchedulesSearch");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/workforcemanagement/managementunits/{muId}/schedules/search".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "muId" + "\\}", pcapiClient.escapeString(muId.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() {});
  }
  /**
   * Get a schedule for the current user
   * 
   * @param body body (optional)
   * @return UserScheduleContainer
   * @throws ApiException if fails to make API call
   */
  public UserScheduleContainer postSchedules(CurrentUserScheduleRequestBody body) throws ApiException {
    return postSchedulesWithHttpInfo(body).getResponseObject();
  }

  /**
   * Get a schedule for the current user
   * 
   * @param body body (optional)
   * @return UserScheduleContainer
   * @throws ApiException if fails to make API call
   */
  public ApiResponse postSchedulesWithHttpInfo(CurrentUserScheduleRequestBody body) throws ApiException {
    Object pclocalVarPostBody = body;
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/workforcemanagement/schedules".replaceAll("\\{format\\}","json");

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


    
    
    final String[] pclocalVarAccepts = {
      "application/json"
    };
    final String pclocalVarAccept = pcapiClient.selectHeaderAccept(pclocalVarAccepts);

    final String[] pclocalVarContentTypes = {
      "application/json"
    };
    final String pclocalVarContentType = pcapiClient.selectHeaderContentType(pclocalVarContentTypes);

    String[] pclocalVarAuthNames = new String[] { "PureCloud Auth" };

    return pcapiClient.invokeAPIVerbose(pclocalVarPath, "POST", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy