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

com.mypurecloud.sdk.api.StationsApi 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.Station;
import com.mypurecloud.sdk.model.StationEntityListing;


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


public class StationsApi {
  private ApiClient pcapiClient;

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

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

  public ApiClient getApiClient() {
    return pcapiClient;
  }

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

  /**
   * Unassigns the user assigned to this station
   * 
   * @param stationId Station ID (required)
   * @return String
   * @throws ApiException if fails to make API call
   */
  public String deleteStationIdAssociateduser(String stationId) throws ApiException {
    return deleteStationIdAssociateduserWithHttpInfo(stationId).getResponseObject();
  }

  /**
   * Unassigns the user assigned to this station
   * 
   * @param stationId Station ID (required)
   * @return String
   * @throws ApiException if fails to make API call
   */
  public ApiResponse deleteStationIdAssociateduserWithHttpInfo(String stationId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'stationId' is set
    if (stationId == null) {
      throw new ApiException(400, "Missing the required parameter 'stationId' when calling deleteStationIdAssociateduser");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/stations/{stationId}/associateduser".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "stationId" + "\\}", pcapiClient.escapeString(stationId.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 station.
   * 
   * @param stationId Station ID (required)
   * @return Station
   * @throws ApiException if fails to make API call
   */
  public Station getStationId(String stationId) throws ApiException {
    return getStationIdWithHttpInfo(stationId).getResponseObject();
  }

  /**
   * Get station.
   * 
   * @param stationId Station ID (required)
   * @return Station
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getStationIdWithHttpInfo(String stationId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // verify the required parameter 'stationId' is set
    if (stationId == null) {
      throw new ApiException(400, "Missing the required parameter 'stationId' when calling getStationId");
    }
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/stations/{stationId}".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "stationId" + "\\}", pcapiClient.escapeString(stationId.toString()));

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


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

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

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

    return pcapiClient.invokeAPIVerbose(pclocalVarPath, "GET", pclocalVarQueryParams, pclocalVarPostBody, pclocalVarHeaderParams, pclocalVarFormParams, pclocalVarAccept, pclocalVarContentType, pclocalVarAuthNames, new TypeReference() {});
  }
  /**
   * Get the list of available stations.
   * 
   * @param pageSize Page size (optional, default to 25)
   * @param pageNumber Page number (optional, default to 1)
   * @param sortBy Sort by (optional, default to name)
   * @param name Name (optional)
   * @param id Comma separated list of stationIds (optional)
   * @param lineAppearanceId lineAppearanceId (optional)
   * @return StationEntityListing
   * @throws ApiException if fails to make API call
   */
  public StationEntityListing getStations(Integer pageSize, Integer pageNumber, String sortBy, String name, String id, String lineAppearanceId) throws ApiException {
    return getStationsWithHttpInfo(pageSize, pageNumber, sortBy, name, id, lineAppearanceId).getResponseObject();
  }

  /**
   * Get the list of available stations.
   * 
   * @param pageSize Page size (optional, default to 25)
   * @param pageNumber Page number (optional, default to 1)
   * @param sortBy Sort by (optional, default to name)
   * @param name Name (optional)
   * @param id Comma separated list of stationIds (optional)
   * @param lineAppearanceId lineAppearanceId (optional)
   * @return StationEntityListing
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getStationsWithHttpInfo(Integer pageSize, Integer pageNumber, String sortBy, String name, String id, String lineAppearanceId) throws ApiException {
    Object pclocalVarPostBody = null;
    
    // create path and map variables
    String pclocalVarPath = "/api/v2/stations".replaceAll("\\{format\\}","json");

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

    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "pageSize", pageSize));
    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "pageNumber", pageNumber));
    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "sortBy", sortBy));
    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "name", name));
    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "id", id));
    pclocalVarQueryParams.addAll(pcapiClient.parameterToPairs("", "lineAppearanceId", lineAppearanceId));

    
    
    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() {});
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy