com.mypurecloud.sdk.api.FaxApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-client Show documentation
Show all versions of platform-client Show documentation
The official Java SDK for the PureCloud Platform API SDK
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.FaxDocumentEntityListing;
import com.mypurecloud.sdk.model.FaxDocument;
import com.mypurecloud.sdk.model.DownloadResponse;
import com.mypurecloud.sdk.model.FaxSummary;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class FaxApi {
private ApiClient pcapiClient;
public FaxApi() {
this(Configuration.getDefaultApiClient());
}
public FaxApi(ApiClient apiClient) {
this.pcapiClient = apiClient;
}
public ApiClient getApiClient() {
return pcapiClient;
}
public void setApiClient(ApiClient apiClient) {
this.pcapiClient = apiClient;
}
/**
* Delete a fax document.
*
* @param documentId Document ID (required)
* @throws ApiException if fails to make API call
*/
public void deleteDocumentsDocumentId(String documentId) throws ApiException {
deleteDocumentsDocumentIdWithHttpInfo(documentId);
}
/**
* Delete a fax document.
*
* @param documentId Document ID (required)
* @throws ApiException if fails to make API call
*/
public ApiResponse deleteDocumentsDocumentIdWithHttpInfo(String documentId) throws ApiException {
Object pclocalVarPostBody = null;
// verify the required parameter 'documentId' is set
if (documentId == null) {
throw new ApiException(400, "Missing the required parameter 'documentId' when calling deleteDocumentsDocumentId");
}
// create path and map variables
String pclocalVarPath = "/api/v2/fax/documents/{documentId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "documentId" + "\\}", pcapiClient.escapeString(documentId.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 a list of fax documents.
*
* @param pageSize Page size (optional, default to 25)
* @param pageNumber Page number (optional, default to 1)
* @return FaxDocumentEntityListing
* @throws ApiException if fails to make API call
*/
public FaxDocumentEntityListing getDocuments(Integer pageSize, Integer pageNumber) throws ApiException {
return getDocumentsWithHttpInfo(pageSize, pageNumber).getResponseObject();
}
/**
* Get a list of fax documents.
*
* @param pageSize Page size (optional, default to 25)
* @param pageNumber Page number (optional, default to 1)
* @return FaxDocumentEntityListing
* @throws ApiException if fails to make API call
*/
public ApiResponse getDocumentsWithHttpInfo(Integer pageSize, Integer pageNumber) throws ApiException {
Object pclocalVarPostBody = null;
// create path and map variables
String pclocalVarPath = "/api/v2/fax/documents".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 document.
*
* @param documentId Document ID (required)
* @return FaxDocument
* @throws ApiException if fails to make API call
*/
public FaxDocument getDocumentsDocumentId(String documentId) throws ApiException {
return getDocumentsDocumentIdWithHttpInfo(documentId).getResponseObject();
}
/**
* Get a document.
*
* @param documentId Document ID (required)
* @return FaxDocument
* @throws ApiException if fails to make API call
*/
public ApiResponse getDocumentsDocumentIdWithHttpInfo(String documentId) throws ApiException {
Object pclocalVarPostBody = null;
// verify the required parameter 'documentId' is set
if (documentId == null) {
throw new ApiException(400, "Missing the required parameter 'documentId' when calling getDocumentsDocumentId");
}
// create path and map variables
String pclocalVarPath = "/api/v2/fax/documents/{documentId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "documentId" + "\\}", pcapiClient.escapeString(documentId.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() {});
}
/**
* Download a fax document.
*
* @param documentId Document ID (required)
* @return DownloadResponse
* @throws ApiException if fails to make API call
*/
public DownloadResponse getDocumentsDocumentIdContent(String documentId) throws ApiException {
return getDocumentsDocumentIdContentWithHttpInfo(documentId).getResponseObject();
}
/**
* Download a fax document.
*
* @param documentId Document ID (required)
* @return DownloadResponse
* @throws ApiException if fails to make API call
*/
public ApiResponse getDocumentsDocumentIdContentWithHttpInfo(String documentId) throws ApiException {
Object pclocalVarPostBody = null;
// verify the required parameter 'documentId' is set
if (documentId == null) {
throw new ApiException(400, "Missing the required parameter 'documentId' when calling getDocumentsDocumentIdContent");
}
// create path and map variables
String pclocalVarPath = "/api/v2/fax/documents/{documentId}/content".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "documentId" + "\\}", pcapiClient.escapeString(documentId.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 fax summary
*
* @return FaxSummary
* @throws ApiException if fails to make API call
*/
public FaxSummary getSummary() throws ApiException {
return getSummaryWithHttpInfo().getResponseObject();
}
/**
* Get fax summary
*
* @return FaxSummary
* @throws ApiException if fails to make API call
*/
public ApiResponse getSummaryWithHttpInfo() throws ApiException {
Object pclocalVarPostBody = null;
// create path and map variables
String pclocalVarPath = "/api/v2/fax/summary".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() {});
}
/**
* Update a fax document.
*
* @param documentId Document ID (required)
* @param body Document (required)
* @return FaxDocument
* @throws ApiException if fails to make API call
*/
public FaxDocument putDocumentsDocumentId(String documentId, FaxDocument body) throws ApiException {
return putDocumentsDocumentIdWithHttpInfo(documentId, body).getResponseObject();
}
/**
* Update a fax document.
*
* @param documentId Document ID (required)
* @param body Document (required)
* @return FaxDocument
* @throws ApiException if fails to make API call
*/
public ApiResponse putDocumentsDocumentIdWithHttpInfo(String documentId, FaxDocument body) throws ApiException {
Object pclocalVarPostBody = body;
// verify the required parameter 'documentId' is set
if (documentId == null) {
throw new ApiException(400, "Missing the required parameter 'documentId' when calling putDocumentsDocumentId");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling putDocumentsDocumentId");
}
// create path and map variables
String pclocalVarPath = "/api/v2/fax/documents/{documentId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "documentId" + "\\}", pcapiClient.escapeString(documentId.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() {});
}
}