com.docusign.maestro.api.WorkflowManagementApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docusign-maestro-java Show documentation
Show all versions of docusign-maestro-java Show documentation
The Docusign NuGet package makes integrating Docusign into your apps and websites a super fast and painless process. The library is open sourced on GitHub, look for the docusign-maestro-csharp-client repository.
package com.docusign.maestro.api;
import com.docusign.maestro.client.ApiClient;
import com.docusign.maestro.client.ApiException;
import com.docusign.maestro.client.ApiResponse;
import com.docusign.maestro.client.Configuration;
import com.docusign.maestro.client.Pair;
import com.docusign.maestro.model.*;
import jakarta.ws.rs.core.GenericType;
/** WorkflowManagementApi class. */
public class WorkflowManagementApi {
private ApiClient apiClient;
/** WorkflowManagementApi. */
public WorkflowManagementApi() {
this(Configuration.getDefaultApiClient());
}
/** WorkflowManagementApi. */
public WorkflowManagementApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* getApiClient Method.
*
* @return ApiClient
*/
public ApiClient getApiClient() {
return apiClient;
}
/** setApiClient Method. */
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Creates a new workflow definition.. Creates a new workflow definition.
*
* @param accountId Account ID (required)
* @param body Request Body to create a new workflow definition. (required)
* @return NewOrUpdatedWorkflowDefinitionResponse
* @throws ApiException if fails to make API call
*/
public NewOrUpdatedWorkflowDefinitionResponse createWorkflowDefinition(
String accountId, CreateOrUpdateWorkflowDefinitionRequestBody body) throws ApiException {
ApiResponse localVarResponse =
createWorkflowDefinitionWithHttpInfo(accountId, body);
return localVarResponse.getData();
}
/**
* Creates a new workflow definition. Creates a new workflow definition.
*
* @param accountId Account ID (required)
* @param body Request Body to create a new workflow definition. (required)
* @return NewOrUpdatedWorkflowDefinitionResponse
* @throws ApiException if fails to make API call
*/
public ApiResponse createWorkflowDefinitionWithHttpInfo(
String accountId, CreateOrUpdateWorkflowDefinitionRequestBody body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400, "Missing the required parameter 'accountId' when calling createWorkflowDefinition");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(
400, "Missing the required parameter 'body' when calling createWorkflowDefinition");
}
// create path and map variables
String localVarPath =
"/v1/accounts/{accountId}/management/workflow_definitions"
.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 = {"application/json"};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType =
new GenericType() {};
NewOrUpdatedWorkflowDefinitionResponse localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Deletes a workflow definition.. Deletes a workflow definition.
*
* @param accountId Account ID (required)
* @param workflowDefinitionId Workflow Definition ID (required)
* @return WorkflowDeleteResponse
* @throws ApiException if fails to make API call
*/
public WorkflowDeleteResponse deleteWorkflowDefinition(
String accountId, String workflowDefinitionId) throws ApiException {
ApiResponse localVarResponse =
deleteWorkflowDefinitionWithHttpInfo(accountId, workflowDefinitionId);
return localVarResponse.getData();
}
/**
* Deletes a workflow definition. Deletes a workflow definition.
*
* @param accountId Account ID (required)
* @param workflowDefinitionId Workflow Definition ID (required)
* @return WorkflowDeleteResponse
* @throws ApiException if fails to make API call
*/
public ApiResponse deleteWorkflowDefinitionWithHttpInfo(
String accountId, String workflowDefinitionId) 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 deleteWorkflowDefinition");
}
// verify the required parameter 'workflowDefinitionId' is set
if (workflowDefinitionId == null) {
throw new ApiException(
400,
"Missing the required parameter 'workflowDefinitionId' when calling deleteWorkflowDefinition");
}
// create path and map variables
String localVarPath =
"/v1/accounts/{accountId}/management/workflow_definitions/{workflowDefinitionId}"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll(
"\\{" + "workflowDefinitionId" + "\\}",
apiClient.escapeString(workflowDefinitionId.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 = {"application/json"};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType =
new GenericType() {};
WorkflowDeleteResponse localVarResponse =
apiClient.invokeAPI(
localVarPath,
"DELETE",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
///
/// Get Workflow Definition Returns a workflow definition.
///
/** GetWorkflowDefinitionOptions Class. */
public class GetWorkflowDefinitionOptions {
private String lastDeployedId = null;
/** setLastDeployedId method. */
public void setLastDeployedId(String lastDeployedId) {
this.lastDeployedId = lastDeployedId;
}
/**
* getLastDeployedId method.
*
* @return String
*/
public String getLastDeployedId() {
return this.lastDeployedId;
}
}
/**
* Get Workflow Definition. Returns a workflow definition.
*
* @param accountId Account ID (required)
* @param workflowDefinitionId Workflow Definition ID (required)
* @return WorkflowDefinitionWithId
*/
public WorkflowDefinitionWithId getWorkflowDefinition(
String accountId, String workflowDefinitionId) throws ApiException {
return getWorkflowDefinition(accountId, workflowDefinitionId, null);
}
/**
* Get Workflow Definition. Returns a workflow definition.
*
* @param accountId Account ID (required)
* @param workflowDefinitionId Workflow Definition ID (required)
* @param options for modifying the method behavior.
* @return WorkflowDefinitionWithId
* @throws ApiException if fails to make API call
*/
public WorkflowDefinitionWithId getWorkflowDefinition(
String accountId,
String workflowDefinitionId,
WorkflowManagementApi.GetWorkflowDefinitionOptions options)
throws ApiException {
ApiResponse localVarResponse =
getWorkflowDefinitionWithHttpInfo(accountId, workflowDefinitionId, options);
return localVarResponse.getData();
}
/**
* Get Workflow Definition Returns a workflow definition.
*
* @param accountId Account ID (required)
* @param workflowDefinitionId Workflow Definition ID (required)
* @param options for modifying the method behavior.
* @return WorkflowDefinitionWithId
* @throws ApiException if fails to make API call
*/
public ApiResponse getWorkflowDefinitionWithHttpInfo(
String accountId,
String workflowDefinitionId,
WorkflowManagementApi.GetWorkflowDefinitionOptions options)
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 getWorkflowDefinition");
}
// verify the required parameter 'workflowDefinitionId' is set
if (workflowDefinitionId == null) {
throw new ApiException(
400,
"Missing the required parameter 'workflowDefinitionId' when calling getWorkflowDefinition");
}
// create path and map variables
String localVarPath =
"/v1/accounts/{accountId}/management/workflow_definitions/{workflowDefinitionId}"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll(
"\\{" + "workflowDefinitionId" + "\\}",
apiClient.escapeString(workflowDefinitionId.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();
if (options != null) {
localVarQueryParams.addAll(
apiClient.parameterToPair("lastDeployedId", options.lastDeployedId));
}
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {"application/json"};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType =
new GenericType() {};
WorkflowDefinitionWithId localVarResponse =
apiClient.invokeAPI(
localVarPath,
"GET",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Gets configuration instances. Returns a list of configuration instances for a workflow
* definition
*
* @param accountId Account ID (required)
* @param workflowDefinitionId Workflow Definition ID (required)
* @return GetConfigurationInstancesResponse
* @throws ApiException if fails to make API call
*/
public GetConfigurationInstancesResponse getWorkflowDefinitionConfigInstances(
String accountId, String workflowDefinitionId) throws ApiException {
ApiResponse localVarResponse =
getWorkflowDefinitionConfigInstancesWithHttpInfo(accountId, workflowDefinitionId);
return localVarResponse.getData();
}
/**
* Gets configuration instances Returns a list of configuration instances for a workflow
* definition
*
* @param accountId Account ID (required)
* @param workflowDefinitionId Workflow Definition ID (required)
* @return GetConfigurationInstancesResponse
* @throws ApiException if fails to make API call
*/
public ApiResponse
getWorkflowDefinitionConfigInstancesWithHttpInfo(
String accountId, String workflowDefinitionId) 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 getWorkflowDefinitionConfigInstances");
}
// verify the required parameter 'workflowDefinitionId' is set
if (workflowDefinitionId == null) {
throw new ApiException(
400,
"Missing the required parameter 'workflowDefinitionId' when calling getWorkflowDefinitionConfigInstances");
}
// create path and map variables
String localVarPath =
"/v1/accounts/{accountId}/management/workflow_definitions/{workflowDefinitionId}/config_instances"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll(
"\\{" + "workflowDefinitionId" + "\\}",
apiClient.escapeString(workflowDefinitionId.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 = {"application/json"};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType =
new GenericType() {};
GetConfigurationInstancesResponse localVarResponse =
apiClient.invokeAPI(
localVarPath,
"GET",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
///
/// Get Workflow Definitions metadata Returns a list of workflow definitions' metadata.
///
/** GetWorkflowDefinitionsOptions Class. */
public class GetWorkflowDefinitionsOptions {
private String status = null;
/** setStatus method. */
public void setStatus(String status) {
this.status = status;
}
/**
* getStatus method.
*
* @return String
*/
public String getStatus() {
return this.status;
}
}
/**
* Get Workflow Definitions metadata. Returns a list of workflow definitions' metadata.
*
* @param accountId Account ID (required)
* @return WorkflowDefinitionList
*/
public WorkflowDefinitionList getWorkflowDefinitions(String accountId) throws ApiException {
return getWorkflowDefinitions(accountId, null);
}
/**
* Get Workflow Definitions metadata. Returns a list of workflow definitions' metadata.
*
* @param accountId Account ID (required)
* @param options for modifying the method behavior.
* @return WorkflowDefinitionList
* @throws ApiException if fails to make API call
*/
public WorkflowDefinitionList getWorkflowDefinitions(
String accountId, WorkflowManagementApi.GetWorkflowDefinitionsOptions options)
throws ApiException {
ApiResponse localVarResponse =
getWorkflowDefinitionsWithHttpInfo(accountId, options);
return localVarResponse.getData();
}
/**
* Get Workflow Definitions metadata Returns a list of workflow definitions' metadata.
*
* @param accountId Account ID (required)
* @param options for modifying the method behavior.
* @return WorkflowDefinitionList
* @throws ApiException if fails to make API call
*/
public ApiResponse getWorkflowDefinitionsWithHttpInfo(
String accountId, WorkflowManagementApi.GetWorkflowDefinitionsOptions options)
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 getWorkflowDefinitions");
}
// create path and map variables
String localVarPath =
"/v1/accounts/{accountId}/management/workflow_definitions"
.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();
if (options != null) {
localVarQueryParams.addAll(apiClient.parameterToPair("status", options.status));
}
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {"application/json"};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType =
new GenericType() {};
WorkflowDefinitionList localVarResponse =
apiClient.invokeAPI(
localVarPath,
"GET",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Publishes or unpublishes a workflow definition.. Publishes or unpublishes a workflow
* definition.
*
* @param accountId Account ID (required)
* @param workflowDefinitionId Workflow Definition ID (required)
* @param body Request Body to publish or unpublish a workflow definition. (required)
* @return DeployResponse
* @throws ApiException if fails to make API call
*/
public DeployResponse publishOrUnPublishWorkflowDefinition(
String accountId, String workflowDefinitionId, DeployRequest body) throws ApiException {
ApiResponse localVarResponse =
publishOrUnPublishWorkflowDefinitionWithHttpInfo(accountId, workflowDefinitionId, body);
return localVarResponse.getData();
}
/**
* Publishes or unpublishes a workflow definition. Publishes or unpublishes a workflow definition.
*
* @param accountId Account ID (required)
* @param workflowDefinitionId Workflow Definition ID (required)
* @param body Request Body to publish or unpublish a workflow definition. (required)
* @return DeployResponse
* @throws ApiException if fails to make API call
*/
public ApiResponse publishOrUnPublishWorkflowDefinitionWithHttpInfo(
String accountId, String workflowDefinitionId, DeployRequest body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400,
"Missing the required parameter 'accountId' when calling publishOrUnPublishWorkflowDefinition");
}
// verify the required parameter 'workflowDefinitionId' is set
if (workflowDefinitionId == null) {
throw new ApiException(
400,
"Missing the required parameter 'workflowDefinitionId' when calling publishOrUnPublishWorkflowDefinition");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(
400,
"Missing the required parameter 'body' when calling publishOrUnPublishWorkflowDefinition");
}
// create path and map variables
String localVarPath =
"/v1/accounts/{accountId}/management/workflow_definitions/{workflowDefinitionId}/publish"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll(
"\\{" + "workflowDefinitionId" + "\\}",
apiClient.escapeString(workflowDefinitionId.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 = {"application/json"};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType = new GenericType() {};
DeployResponse localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Updates a workflow definition.. Updates a workflow definition.
*
* @param accountId Account ID (required)
* @param workflowDefinitionId Workflow Definition ID (required)
* @param body Request Body to update a workflow definition. (required)
* @return NewOrUpdatedWorkflowDefinitionResponse
* @throws ApiException if fails to make API call
*/
public NewOrUpdatedWorkflowDefinitionResponse updateWorkflowDefinition(
String accountId,
String workflowDefinitionId,
CreateOrUpdateWorkflowDefinitionRequestBody body)
throws ApiException {
ApiResponse localVarResponse =
updateWorkflowDefinitionWithHttpInfo(accountId, workflowDefinitionId, body);
return localVarResponse.getData();
}
/**
* Updates a workflow definition. Updates a workflow definition.
*
* @param accountId Account ID (required)
* @param workflowDefinitionId Workflow Definition ID (required)
* @param body Request Body to update a workflow definition. (required)
* @return NewOrUpdatedWorkflowDefinitionResponse
* @throws ApiException if fails to make API call
*/
public ApiResponse updateWorkflowDefinitionWithHttpInfo(
String accountId,
String workflowDefinitionId,
CreateOrUpdateWorkflowDefinitionRequestBody body)
throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400, "Missing the required parameter 'accountId' when calling updateWorkflowDefinition");
}
// verify the required parameter 'workflowDefinitionId' is set
if (workflowDefinitionId == null) {
throw new ApiException(
400,
"Missing the required parameter 'workflowDefinitionId' when calling updateWorkflowDefinition");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(
400, "Missing the required parameter 'body' when calling updateWorkflowDefinition");
}
// create path and map variables
String localVarPath =
"/v1/accounts/{accountId}/management/workflow_definitions/{workflowDefinitionId}"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll(
"\\{" + "workflowDefinitionId" + "\\}",
apiClient.escapeString(workflowDefinitionId.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 = {"application/json"};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType =
new GenericType() {};
NewOrUpdatedWorkflowDefinitionResponse localVarResponse =
apiClient.invokeAPI(
localVarPath,
"PUT",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
}