Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
The official DocuSign eSignature JAVA client is based on version 2 of the DocuSign REST API and provides libraries for JAVA application integration. It is recommended that you use this version of the library for new development.
package com.docusign.esign.api;
import com.docusign.esign.client.ApiClient;
import com.docusign.esign.client.ApiException;
import com.docusign.esign.client.ApiResponse;
import com.docusign.esign.client.Configuration;
import com.docusign.esign.client.Pair;
import com.docusign.esign.model.*;
import jakarta.ws.rs.core.GenericType;
/** WorkspacesApi class. */
public class WorkspacesApi {
private ApiClient apiClient;
/** WorkspacesApi. */
public WorkspacesApi() {
this(Configuration.getDefaultApiClient());
}
/** WorkspacesApi. */
public WorkspacesApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* getApiClient Method.
*
* @return ApiClient
*/
public ApiClient getApiClient() {
return apiClient;
}
/** setApiClient Method. */
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Create a Workspace. Creates a new workspace.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param workspace (optional)
* @return Workspace
* @throws ApiException if fails to make API call
*/
public Workspace createWorkspace(String accountId, Workspace workspace) throws ApiException {
ApiResponse localVarResponse = createWorkspaceWithHttpInfo(accountId, workspace);
return localVarResponse.getData();
}
/**
* Create a Workspace Creates a new workspace.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param workspace (optional)
* @return Workspace
* @throws ApiException if fails to make API call
*/
public ApiResponse createWorkspaceWithHttpInfo(String accountId, Workspace workspace)
throws ApiException {
Object localVarPostBody = workspace;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400, "Missing the required parameter 'accountId' when calling createWorkspace");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/workspaces"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType = new GenericType() {};
Workspace localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Creates a workspace file.. This method adds a file to a workspace.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param workspaceId Specifies the workspace ID GUID. (required)
* @param folderId The ID of the folder being accessed. (required)
* @return WorkspaceItem
* @throws ApiException if fails to make API call
*/
public WorkspaceItem createWorkspaceFile(String accountId, String workspaceId, String folderId)
throws ApiException {
ApiResponse localVarResponse =
createWorkspaceFileWithHttpInfo(accountId, workspaceId, folderId);
return localVarResponse.getData();
}
/**
* Creates a workspace file. This method adds a file to a workspace.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param workspaceId Specifies the workspace ID GUID. (required)
* @param folderId The ID of the folder being accessed. (required)
* @return WorkspaceItem
* @throws ApiException if fails to make API call
*/
public ApiResponse createWorkspaceFileWithHttpInfo(
String accountId, String workspaceId, String folderId) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400, "Missing the required parameter 'accountId' when calling createWorkspaceFile");
}
// verify the required parameter 'workspaceId' is set
if (workspaceId == null) {
throw new ApiException(
400, "Missing the required parameter 'workspaceId' when calling createWorkspaceFile");
}
// verify the required parameter 'folderId' is set
if (folderId == null) {
throw new ApiException(
400, "Missing the required parameter 'folderId' when calling createWorkspaceFile");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/workspaces/{workspaceId}/folders/{folderId}/files"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll(
"\\{" + "workspaceId" + "\\}", apiClient.escapeString(workspaceId.toString()))
.replaceAll("\\{" + "folderId" + "\\}", apiClient.escapeString(folderId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType = new GenericType() {};
WorkspaceItem localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Delete Workspace. Deletes an existing workspace (logically).
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param workspaceId Specifies the workspace ID GUID. (required)
* @return Workspace
* @throws ApiException if fails to make API call
*/
public Workspace deleteWorkspace(String accountId, String workspaceId) throws ApiException {
ApiResponse localVarResponse = deleteWorkspaceWithHttpInfo(accountId, workspaceId);
return localVarResponse.getData();
}
/**
* Delete Workspace Deletes an existing workspace (logically).
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param workspaceId Specifies the workspace ID GUID. (required)
* @return Workspace
* @throws ApiException if fails to make API call
*/
public ApiResponse deleteWorkspaceWithHttpInfo(String accountId, String workspaceId)
throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400, "Missing the required parameter 'accountId' when calling deleteWorkspace");
}
// verify the required parameter 'workspaceId' is set
if (workspaceId == null) {
throw new ApiException(
400, "Missing the required parameter 'workspaceId' when calling deleteWorkspace");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/workspaces/{workspaceId}"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll(
"\\{" + "workspaceId" + "\\}", apiClient.escapeString(workspaceId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType = new GenericType() {};
Workspace localVarResponse =
apiClient.invokeAPI(
localVarPath,
"DELETE",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Deletes workspace one or more specific files/folders from the given folder or root.. This
* method deletes one or more files or sub-folders from a workspace folder or root. Note: To
* delete items from a workspace, the `status` of the workspace must be
* `active`.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param workspaceId Specifies the workspace ID GUID. (required)
* @param folderId The ID of the folder being accessed. (required)
* @param workspaceItemList (optional)
* @throws ApiException if fails to make API call
*/
public void deleteWorkspaceFolderItems(
String accountId, String workspaceId, String folderId, WorkspaceItemList workspaceItemList)
throws ApiException {
deleteWorkspaceFolderItemsWithHttpInfo(accountId, workspaceId, folderId, workspaceItemList);
}
/**
* Deletes workspace one or more specific files/folders from the given folder or root. This method
* deletes one or more files or sub-folders from a workspace folder or root. Note: To delete items
* from a workspace, the `status` of the workspace must be `active`.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param workspaceId Specifies the workspace ID GUID. (required)
* @param folderId The ID of the folder being accessed. (required)
* @param workspaceItemList (optional)
* @throws ApiException if fails to make API call
*/
public ApiResponse